Publish form definition API
Since Orbeon Forms 2017.2.
This is an Orbeon Forms PE feature.
The API is also used internally by Form Builder and by the Form Runner Home page.
The purpose of the
publishAPI is to publish a form definition.
The form definition is:
- either provided as XHTML+XForms in the Orbeon Forms form definition format
- or stored in the database under the
It is important to note that you cannot simply take a form definition and
PUTit via the persistence REST API. The reason for this is that publishing requires adding some information to the form definition, such as:
- data migration information for repeated grids
- section templates must be included
Only Form Builder and Form Runner are able to provide this information consistently. So in order to publish a form definition, this API must be used.
If the form definition is provided in the request:
- Optional URL parameter:
- Value: Form Builder document id for retrieval of attachments
- Request body: XHTML+XForms
If the form definition is NOT provided in the request:
$document-id: Form Builder document id for retrieval of attachments
- Request body: empty
The following URL parameters apply in both cases:
- missing: indicates the latest published version, or
1if there is no published version
next: to indicate that the form definition must be published under the next available version
- or a specific version number: to indicate that the form definition must replace the given version
false: make or keep the form definition unavailable
trueor missing: make or keep the form definition available
trueor missing: upgrade the form definition
false: do not upgrade the form definition
- This should usually be
trueor missing, in order to allow:
- form definition update to the latest format
- inclusion of data migration information
- embedding of section templates
- app/form name used
Example response body:
<?xml version="1.0" encoding="UTF-8"?>
NOTE: When the form definition is
POSTed as XML, form definition attachments such as PDF, XML Schema, or image attachments will not be published reliably if a
document-idis not passed.
The following publishes the form definition saved with Form Builder under the
The following publishes the form definition provided in the file
-H "Content-Type: application/xml"
-X POST http://localhost:9090/orbeon/fr/service/publish