Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. 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 [[V4_Designing_Forms#From_Schema|Adding Controls from Schema]] for  for further details.
  2. Drag/drop, change labels etc. directly in the browser
  3. Specify URI template .../customers/{customer}, choose Read Method GET and Write Method PUT
  4. Specify a Form Action URI if desired (we'll get to this later).

That's it. As usual, you [[V4_Using_Forms#Sharing_Forms |access the form using its URI]]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. Live Forms will resolve the URI template above to: .../customers/02, GET the customer, and display the initialized form. When the form is submitted, Live Forms will automatically PUT the customer document to the same URI thereby updating the customer. The diagram below shows the interactions.

Here's [http://www.frevvo.com/frevvo/web/user/gallery/app/_73zHwep_EduZgK0BUzi1Ug/formtype/__AKE4PgqEdusGKt5_HoCDw?_method=POST&embed=true&customer=02 an example form] that  that uses the Customer entity described above. In the example:

  1. We instantiate the form with a parameter customer=02. This causes the form to resolve the URI template and GET the customer data from: http://[server]/customers/02. The resulting XML document provides the initial state of the Customer and is used to initialize the form.
  2. Modify a value and click Submit. The form will automatically PUT to the correct resource and update the customer information.
  3. Finally, Live Forms will store the generated document set and assign it a unique URI. The document set and the documents therein can be [[V4_Using_Forms#Documents|accessed at this URI]]URl.

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 [[V4_Using_Forms#Sharing_Forms | access the form using its URI]]URl . When the form is used (instantiated), Live Forms will  will perform the POST and create the customer. It will then follow the server redirect (to the URI of the newly customer) and display the form. When the user enters customer information and submits the form, Live Forms will  will automatically PUT the resulting XML document to the URI of the newly created customer resource thereby updating it. The diagram below shows the interactions:

Here is [http://www.frevvo.com/frevvo/web/user/gallery/app/_73zHwep_EduZgK0BUzi1Ug/formtype/_1zmI4PsCEduLxOM9M8PJlQ?_method=POST&embed=true an an example form an example form] that creates a new customer using this method.

...