With the Designer you can create Capture OnTheGo templates. COTG templates are used to generate forms for the Capture OnTheGo mobile application. For more information about the application refer to these websites: Capture OnTheGo and Capture OnTheGo in the Resource Center.
A Capture OnTheGo Form is actually just a Web Form that has a number of characteristic features:
Before starting to create a COTG Form, take some time to structure the design process and to get familiar with the principles of form design, as explained in the topic Designing a COTG Template.
Capture OnTheGo forms can be single-use or reusable. This doesn't depend on the design (although, of course, this should be reflected in the design). What makes a form reusable is a setting in the Output to Capture OnTheGo plugin in Workflow; see Output to CaptureOnTheGo. In the Capture OnTheGo app a reusable form is called a 'template'.
Forms for offline use
The action of the Capture OnTheGo Form element should specify a Workflow HTTP Server Input task (see Workflow Help: HTTP Server Input) that receives and handles the submitted data. The action will look similiar to this: http://192.168.175.1:8080/actionname (where actionname is the HTTP action of the HTTP Server Input task).
For testing purposes, it is possible to use another URL for the Form's action or not to specify an action at all; see Testing a Capture OnTheGo Template.
Filling a COTG template
Before inserting elements in a COTG Form, have the design ready; see Designing a COTG Template.
Foundation, the framework added by the COTG template wizards, comes with a series of features that can be very useful in COTG forms; see Using Foundation.
If you have started creating your Capture OnTheGo template using a COTG Template Wizard, you can find more ready-made elements in the Snippets folder on the Resources pane.
Use the Outline pane at the left to see which elements are present in the template and to select an element.
Use the Attributes pane at the right to see the current element's ID, class and some other properties.
Use the Styles pane next to the Attributes pane to see which styles are applied to the currently selected element.
Click the Edges button on the toolbar to highlight borders of elements on the Design tab. The borders will not be visible on the Preview tab.
For COTG templates created with a COTG Template wizard, lots of features are already available through the Foundation framework; see Using Foundation.
Custom save and restore functions
It is possible to save custom information when the COTG app saves the Form, and to influence what the Form looks like when it is reopened. To do this, register for the olcotgsavestate and the olcotgrestorestate event, respectively, in the usual way (see the addEventListener documentation by Mozilla and w3schools, and the below example). The first event gets fired when all the COTG widgets have saved their state. The second event gets fired when the COTG widgets have restored their state.
With jQuery you must use event.originalEvent in the handler functions, for example:
Testing the template
A Capture OnTheGo (COTG) template will be used to create a form that can be downloaded, filled out and submitted using the COTG app. Before starting to actually use the template, you will want to make sure that it produces a form that looks good and functions as expected. How to preview the form, how to submit data and how to preview the submitted data is described in another topic: Testing a Capture OnTheGo Template.
Sending the template to the Workflow tool
After testing the template (see Testing a Capture OnTheGo Template) the template must be sent to the Workflow module. Templates sent to the Workflow module can be used in any process within it.
How to send the template and the corresponding Data Mapping Configuration to the Workflow tool is explained in another topic: Sending files to Workflow.
Next, you can start building a Workflow configuration that receives and handles the submitted data. The configuration should start with a HTTP Server Input task (see Workflow Help: HTTP Server Input) of which the HTTP action is the one specified in the COTG Form's action.
When a user submits a COTG Form, a Workflow configuration may store the information in a database and/or push it into other Workflows, for example to send a letter or an email receipt. To be able to use the submitted data in a template for that letter or email receipt, follow these steps:
The Camera widget submits a base64-encoded string, which can be put in a data field using the DataMapper. When this data field is dragged into a template, the string will show up in the content, instead of the image.