Clone wiki

javarosa / HistoricalFormlistImplementations

Below is a description of how existing servers support discovery and download of forms.

Downloading a list of forms from ODK Aggregate

Download and parse the XML file you get from http://server/formList. Then download each form from the URL. Format is documented below.

    <form url="http://server/url1">Form 1</form>
    <form url="http://server/url2">Form 2</form>  

Downloading a form list from OpenMRS

Download and parse the XML file you get from http://server:8080/openmrs/moduleServlet/xforms/xformDownload?target=xformslist&uname=username&pw=passwd. Authentication is performed inline, and if not present will return the HTML OpenMRS login form. Each entry provides the Form-id and Form-name. Use the Form-id to create a new URL to use to download the form. Format is documented below.

<?xml version='1.0' encoding='UTF-8' ?>
    <name>Form 1</name>
    <name>Form 2</name>

The URL for downloading a form in it's original OpenMRS format (XML) is: http://server:8080/openmrs/moduleServlet/xforms/xformDownload?target=xform&uname=username&pw=passwd&formId=2&contentType=xml&excludeLayout=true -- where 2 is the id of the form.

Use contentType=xhtml to download a form in xhtml format: http://server:8080/openmrs/moduleServlet/xforms/xformDownload?target=xform&uname=username&pw=passwd&formId=2&contentType=xhtml&excludeLayout=true -- where 2 is the id of the form.