1. Java Rosa
  2. javarosa

Wiki

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.

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

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' ?>
<xforms>
  <xform>
    <id>1</id>
    <name>Form 1</name>
  </xform>
  <xform>
    <id>2</id>
    <name>Form 2</name>
  </xform>
</xforms>

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.

Updated