orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
518 stars 220 forks source link

Publish should be a process so that you can hook into it #3814

Open ebruchez opened 6 years ago

ebruchez commented 6 years ago

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

ebruchez commented 4 years ago

+1 from customer

ebruchez commented 4 years ago

What we do when the user presses the "Publish" button in the dialog:

So 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.

ebruchez commented 4 years ago

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.

ebruchez commented 4 years ago

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..."
)
ebruchez commented 4 years ago
ebruchez commented 4 years ago

Q: Should this run from Form Builder's publish only, or inside the publish API? Ideally the latter.

ebruchez commented 2 years ago

+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.