- Example using curl
- URL parameters
- Publishing from Form Builder
- Deleting all data for an existing form
PUT to deal with resources, the body of HTTP requests contains the resource to handle.
- The request body is empty and response body contains resource.
- [SINCE Orbeon Forms 4.5] The
Orbeon-Operationsresponse header lists the operations that the user can perform on the data (see Supporting permissions in your persistence API implementation).
- [SINCE Orbeon Forms 4.5] If the implementation of the persistence API supports form versioning, and the request is for a form definition, the
Orbeon-Form-Definition-Versionrequest header tells which version of the form definition is requested.
- The request body contains the resource to store.
Content-Typemust contain the content-type of the resource to store. For XML in particular, pass
- The request response is empty.
- If your implementation of the persistence API supports form versioning, then when storing a new document, you need to tell the persistence what version of the form definition was used to create this data, so the same version can then be used to subsequently edit the data. This is done by specifying the version in the
- Both request and response bodies are empty.
When the resource is an XML file (e.g. form.xhtml, data.xml), the persistence layer must return an appropriate XML content-type:
Example using curl
The following uses the curl command-line utility to
PUT a form definition so that it's available to Form Builder (indented for clarity):
curl -v -k -d @form.xhtml -H "Content-Type: application/xml" -H "Orbeon-Form-Definition-Version: 1" -X PUT http://localhost:8080/orbeon/fr/service/persistence/crud/orbeon/builder/data/7b55c9d6f9b058376293e61d9f0d4442e379f717/data.xml
The following retrieves the data (the
GET method is used implicitly):
curl -v -k -H "Orbeon-Form-Definition-Version: 1" http://localhost:8080/orbeon/fr/service/persistence/crud/orbeon/builder/data/7b55c9d6f9b058376293e61d9f0d4442e379f717/data.xml
[SINCE: Orbeon Forms 4.2]
When data is stored using PUT, the following URL parameter is set:
valid: whether the data sent satisfies validation rules
http://example.org/orbeon/fr/service/persistence/crud/ orbeon/ bookshelf/ data/891ce63e59c17348f6fda273afe28c2b/data.xml? valid=true
Publishing from Form Builder
When you create, edit, or read form definition with Form Builder, form definitions are stored as Form Builder data. That is, they are stored under:
On the other hand, when Form Builder publishes a form definition, it stores it where Form Runner will find it, that is under:
For example, this is what happens when saving and publishing a form definition acme/demo with a single attachment:
- PUT /crud/orbeon/builder/data/7b55c9d6f9b058376293e61d9f0d4442e379f717/a29fd47011b2957ef44a62d92995adfdbae03fa9.bin
- PUT /crud/orbeon/builder/data/7b55c9d6f9b058376293e61d9f0d4442e379f717/data.xml
- PUT /crud/acme/demo/form/a29fd47011b2957ef44a62d92995adfdbae03fa9.bin
- PUT /crud/acme/demo/form/form.xhtml?document=7b55c9d6f9b058376293e61d9f0d4442e379f717
[SINCE Orbeon Forms 4.6]
When Form Builder publishes a form definition, if versioning is supported by the target persistence layer, it passes a
Orbeon-Form-Definition-Version header with values:
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
Deleting all data for an existing form
To remove all instances of form data, issue a DELETE to: