Open ebruchez opened 6 years ago
What we do when the user presses the "Publish" button in the dialog:
fb-publish-form
save
processsend
s fb-publish-submission
(/fr/service/publish
)xxf:instance('fb-form-instance')
from the dialogSo the question now is: how can we modify the document to publish in a process? Processes cannot yet have parameters. So we would need to store the document in a temporary instance?
Specifically, for a current use case, we would need to insert a new instance in the published form, based on running the simple data migration functions.
One imperfect solution would be to just have a custom process that is allowed to modify the form about to be sent to the publish API. For example oxf.fr.detail.process.publish-amend.orbeon.builder
or oxf.fr.detail.process.before-publish.orbeon.builder
.
The process would access either directly xxf:instance('fb-form-instance')
or event('doc')
and make changes in that mutable document.
One issue is that we have no function to insert XML data right now. Should we add:
xf:insert(
into = "...xpath..." | before = "...xpath..." | after = "...xpath...",
origin = "...xpath..."
)
publish.xhtml
Q: Should this run from Form Builder's publish only, or inside the publish API? Ideally the latter.
+1 from customer to have a process for publish, not just before-publish
.
Right now, the publish process is interactive, as it asks the user for a form definition version to use. A process must take as input this information, which could be next
, latest
, or a specific version.
Currently, there is no real process you can use for publish. The
oxf.fr.detail.process.publish.orbeon.builder
is only about opening the publish dialog in Form Builder. When the user confirms publishing in the dialog, this calls the Publish form definition API. So right now there is no hook available.+1 from customer