|
Capture OnTheGoWith 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. COTG FormsA Capture OnTheGo Form is actually just a Web Form that has a number of characteristic features:
Creating a COTG FormA Capture OnTheGo Form is actually just a Web Form, so you could add a Form element to a Web page in the Web context without the use of a Template Wizard. It is strongly recommended however, to start the COTG Template using one of the COTG Template Wizards. They all include the appropriate JavaScript files and style sheets to create user-friendly, responsive forms; see Capture OnTheGo template wizards. 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. Specifying an actionThe 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 templateBefore inserting elements in a COTG Form, have the design ready; see Designing a COTG Template. In a Capture OnTheGo form, you can use special Capture OnTheGo Form elements, such as a Signature and a Barcode Scanner element; see COTG Elements and Using COTG Elements. 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. Naturally, Web Form elements can also be used on COTG Forms (see Forms and Form Elements) as well as text, images and other elements (see Content elements). Capture OnTheGo templates can be personalized just like any other type of template; see Variable Data and Personalizing content. 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 make borders of elements visible on the Design tab. The borders will not be visible on the Preview tab. Using JavaScriptJavaScript files, libraries and frameworks can be added to a template, to add widgets and other functionality to your Capture OnTheGo Forms; see Using JavaScript. For COTG templates created with a COTG Template wizard, lots of features are already available through the Foundation framework; see Using Foundation. When you add a COTG element to a template that you didn't start with a COTG template wizard, the Designer will automatically add the jQuery library and the JavaScript file cotg.js, so that the element works well. The Foundation JavaScript files and style sheets will not be added. You only get those automatically when you start creating a COTG template with a template wizard.
Custom save and restore functionsIt 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. ExampleThe following JavaScript code saves the value "test: " when the Form is saved. On reopening the Form, the code gets the restored URL of the COTG Image element, appends it to the saved "test: " string and puts the result in a <p> element at the top of the form.
With jQuery you must use event.originalEvent in the handler functions, for example:
Note that you should register for the event directly in the JavaScript file (a separate JavaScript file, preferably, not cotg-1.2.1.js). You should not do this on the document ready event. The order of JavaScript file includes in the template does not matter. Testing the templateA 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 toolAfter 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. Using COTG data in a templateWhen 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:
Adding Camera data to the templateThe 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.
|
|