Search in sources :

Example 1 with OdkSymbolHandler

use of org.activityinfo.server.endpoint.odk.OdkSymbolHandler in project activityinfo by bedatadriven.

the class XFormBuilder method build.

public XForm build(FormClass formClass) {
    this.formClass = formClass;
    startDateFieldId = field(formClass.getId(), START_DATE_FIELD);
    endDateFieldId = field(formClass.getId(), END_DATE_FIELD);
    dateFields = Sets.newHashSet(startDateFieldId, endDateFieldId);
    locationNameFieldId = field(formClass.getId(), LOCATION_NAME_FIELD);
    gpsFieldId = field(formClass.getId(), GPS_FIELD);
    fields = createFieldBuilders(formClass);
    odkSymbolHandler = new OdkSymbolHandler(fields);
    xPathBuilder = new XPathBuilder(odkSymbolHandler);
    xform = new XForm();
    xform.getHead().setTitle(formClass.getLabel());
    xform.getHead().setModel(createModel());
    xform.setBody(createBody());
    return xform;
}
Also used : OdkSymbolHandler(org.activityinfo.server.endpoint.odk.OdkSymbolHandler) XPathBuilder(org.activityinfo.io.xform.xpath.XPathBuilder)

Aggregations

XPathBuilder (org.activityinfo.io.xform.xpath.XPathBuilder)1 OdkSymbolHandler (org.activityinfo.server.endpoint.odk.OdkSymbolHandler)1