...
Code Block | ||||
---|---|---|---|---|
| ||||
curl -X POST -d "server_url=https://api.ona.io/api/v1/<username>&form_id=<form_id>" https://enketo.org/transform/get_html_form |
Please Note the username is the Ona account username while form_id is the id of the form as viewed from the form settings see screenshot below
- This generates a xml document which contains two nodes, model and form, rest of the nodes can be ignored. model is the XForm Model instance, this is used by Enketo to do all the validations and calculations in the forms. form is the HTML DOM which Enketo uses to render the form
- model and form are saved as model.xml and form.xml. These files are then copied to the location <dristhi_app_root>/dristhi-app/assets/www/form/<form_name>/model.xml and <dristhi_app_root>/dristhi-app/assets/www/form/<form_name>/form.xml. When a form is launched, form_name is passed in the query parameter. Using this Enketo renders the form
- Another important part of form is form_definition.json file. This is a mapping file that is written for every form which maps the fields within the form to Dristhi database. More about form_definition.json later
- So model.xml, form.xml and form_definition.json comprise a Enketo Form
...