Search in sources :

Example 6 with FormDefBean

use of org.akaza.openclinica.bean.odmbeans.FormDefBean in project OpenClinica by OpenClinica.

the class MetaDataReportBean method addFormDef.

public void addFormDef(boolean isStudy, String currentIndent) {
    StringBuffer xml = this.getXmlOutput();
    String indent = this.getIndent();
    ArrayList<FormDefBean> forms = (ArrayList<FormDefBean>) odmstudy.getMetaDataVersion().getFormDefs();
    for (FormDefBean form : forms) {
        xml.append(currentIndent + "<FormDef OID=\"" + StringEscapeUtils.escapeXml(form.getOid()) + "\" Name=\"" + StringEscapeUtils.escapeXml(form.getName()) + "\" Repeating=\"" + form.getRepeating() + "\">");
        xml.append(nls);
        ArrayList<ElementRefBean> igs = (ArrayList<ElementRefBean>) form.getItemGroupRefs();
        for (ElementRefBean ig : igs) {
            xml.append(currentIndent + indent + "<ItemGroupRef ItemGroupOID=\"" + StringEscapeUtils.escapeXml(ig.getElementDefOID()) + "\" Mandatory=\"" + ig.getMandatory() + "\"/>");
            xml.append(nls);
        }
        ArrayList<ElementRefBean> formLayoutRefs = (ArrayList<ElementRefBean>) form.getFormLayoutRefs();
        for (ElementRefBean formLayoutRef : formLayoutRefs) {
            xml.append(currentIndent + indent + "<OpenClinica:FormLayoutDef OID=\"" + StringEscapeUtils.escapeXml(formLayoutRef.getName()) + "\">");
            xml.append(nls);
            xml.append(currentIndent + indent + "<OpenClinica:URL>" + StringEscapeUtils.escapeXml(formLayoutRef.getUrl()) + "</OpenClinica:URL>");
            xml.append(nls);
            xml.append(currentIndent + indent + "</OpenClinica:FormLayoutDef>");
            xml.append(nls);
        }
        // add FormDetails for oc1.3
        if ("oc1.3".equals(this.getODMVersion())) {
            this.addFormDetails(form.getFormDetails(), currentIndent + indent);
        }
        xml.append(currentIndent + "</FormDef>");
        xml.append(nls);
    }
}
Also used : ElementRefBean(org.akaza.openclinica.bean.odmbeans.ElementRefBean) ArrayList(java.util.ArrayList) FormDefBean(org.akaza.openclinica.bean.odmbeans.FormDefBean)

Aggregations

ArrayList (java.util.ArrayList)6 FormDefBean (org.akaza.openclinica.bean.odmbeans.FormDefBean)6 HashMap (java.util.HashMap)5 Iterator (java.util.Iterator)5 LinkedHashMap (java.util.LinkedHashMap)5 ElementRefBean (org.akaza.openclinica.bean.odmbeans.ElementRefBean)5 ItemDefBean (org.akaza.openclinica.bean.odmbeans.ItemDefBean)3 ItemGroupDefBean (org.akaza.openclinica.bean.odmbeans.ItemGroupDefBean)3 StudyEventDefBean (org.akaza.openclinica.bean.odmbeans.StudyEventDefBean)3 HashSet (java.util.HashSet)2 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)2 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)2 CodeListBean (org.akaza.openclinica.bean.odmbeans.CodeListBean)2 CodeListItemBean (org.akaza.openclinica.bean.odmbeans.CodeListItemBean)2 MetaDataVersionProtocolBean (org.akaza.openclinica.bean.odmbeans.MetaDataVersionProtocolBean)2 MultiSelectListBean (org.akaza.openclinica.bean.odmbeans.MultiSelectListBean)2 MultiSelectListItemBean (org.akaza.openclinica.bean.odmbeans.MultiSelectListItemBean)2 TranslatedTextBean (org.akaza.openclinica.bean.odmbeans.TranslatedTextBean)2 List (java.util.List)1 ConfigurationParameters (org.akaza.openclinica.bean.odmbeans.ConfigurationParameters)1