Page History
Section | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Document URIs
For each Document Type that you add to your form,
Frevvoproduct |
---|
- a document URI Template resolved either using query parameters or form fields.
- a Read method and
- a Write method.
This is best described using several examples. Consider the example above. Here are the interactions a Customer Resource supports:
Resource | Method | Description | Returns |
---|---|---|---|
Customer List | GET | List of customers (may be criteria based | XML list of customers |
Customer List | POST | Create new customer | URI of newly created customer |
Customer | GET | Get customer data | XML representation of customer |
Customer | PUT | Update customer | |
Customer | DELETE | Remove customer |
Updating a document
Consider the case where a form is used to update a particular customer. To create the form:
- Upload your customer schema to the designer, add the customer element to the document types for the form and add the customer to the form (which automatically generates controls). See the section on Adding Controls from Schema for further details.
- Drag/drop, change labels etc. directly in the browser
- Specify URI template .../customers/{customer}, choose Read Method GET and Write Method PUT
- Specify a Form Action URI if desired (we'll get to this later).
That's it. As usual, you access the form using its URl. When the form is used (instantiated), you may specify one or more query parameters along with the URI. For this example, we might use a URI and query parameter: .../form/1234?customer=02.
Frevvoproduct |
---|
Frevvoproduct |
---|
Creating a new document
Consider the case where a form is used to create a new customer. Follow the same steps above, except use the appropriate URI template .../customers and change the Read method to POST. That's it. As usual, you access the form using its URl . When the form is used (instantiated),
Frevvoproduct |
---|
Frevvoproduct |
---|
Dynamic documents
A document URI template can also be linked to a form control. To do this, use the Control Name. Consider the Updating a document example above.
The form has a Customer document and we have specified URI template .../customers/{customer} and Read method GET. In this form, there is a control which has Type ID 'customer' as shown in the figure below.
If you enter a value in this control,
Frevvoproduct |
---|
If you enter an ID that does not exist, the GET will fail (return an empty document or a 404 HTTP status code). In this case,
Frevvoproduct |
---|
In either case, if you modify/fill in fields and submit the form, it will PUT (since we chose PUT as the Write Method, the form will send an HTTP PUT) the resulting XML document to the resolved URI.
For example, if you enter ID 03,
Frevvoproduct |
---|
If you enter ID 99 (which does not exist),
Frevvoproduct |
---|
Example
The
Frevvoproduct |
---|