public void displayStructure(QueryControl q_cntl, int index, HttpUtils h, XView xv, String cntl)
            throws MetadataValidationException, MetadataException {
        System.out.println("Related QueryContents");
        this.displayStructureHeader(index, xv);
        Metadata m = getMetadata();
        boolean object_refs = m.isObjectRefsOnly();
        if (m.getWrapper() == null) {
            return;
        }
        xv.getMetadata().addMetadata(m);
        if (object_refs) {
            // no idea what to do here
        } else {
            String ref_id = this.getReferenceId();
            h.indent1(xv.build_details_link(ref_id, cntl) + " (" + xv.build_xml_link(ref_id, cntl) + " "
                    + ((m.isRetrievable_a(ref_id)) ? xv.build_ret_a_link(ref_id) + " " : "")
                    + ((m.isRetrievable_b(ref_id)) ? xv.build_ret_b_link(ref_id) + " " : "")
                    + ")");
            // AMS 04/24/2009 - FIXME - Refactor this - 'else-if' and 'else' are pretty similar
            for (OMElement a_ele : m.getAssociations()) {
                String src_id = m.getAssocSource(a_ele);
                String a_type = m.getAssocType(a_ele);
                String a_id = m.getId(a_ele);
                String tgt_id = m.getAssocTarget(a_ele);
                if (src_id == null) {
                } else if (src_id != null && !src_id.equals(this.getReferenceId())) {
                    if (MetadataSupport.xdsB_ihe_assoc_type_rplc.equals(a_type)) {
                        a_type = "replaced by";
                    } else if (MetadataSupport.xdsB_ihe_assoc_type_apnd.equals(a_type)) {
                        a_type = "has appended";
                    } else if (MetadataSupport.xdsB_ihe_assoc_type_xfrm.equals(a_type)) {
                        a_type = "transformed to";
                    } else if (MetadataSupport.xdsB_ihe_assoc_type_issnapshotof.equals(a_type)) {
                        a_type = "is snapshot of";
                    } else {
                        a_type = a_type + " by";
                    }
                    h.indent2(xv.build_assoc_link(a_id, a_type, cntl) + " "
                            + xv.build_details_link(src_id, cntl)
                            + " (" + xv.build_xml_link(src_id, cntl) + " "
                            + ((m.isRetrievable_a(tgt_id)) ? xv.build_ret_a_link(tgt_id) + " " : "")
                            + ((m.isRetrievable_b(tgt_id)) ? xv.build_ret_b_link(tgt_id) + " " : "")
                            + ") "
                            + " [" + ((q_cntl.hasEndpoint()) ? xv.build_related_link(src_id) : "")
                            + "]");
                } else {
                    if (MetadataSupport.xdsB_ihe_assoc_type_rplc.equals(a_type)) {
                        a_type = "replaces";
                    } else if (MetadataSupport.xdsB_ihe_assoc_type_apnd.equals(a_type)) {
                        a_type = "appended to";
                    } else if (MetadataSupport.xdsB_ihe_assoc_type_xfrm.equals(a_type)) {
                        a_type = "transform of";
                    }
                    h.indent2(xv.build_assoc_link(a_id, a_type, cntl) + " "
                            + xv.build_details_link(tgt_id, cntl)
                            + " (" + xv.build_xml_link(tgt_id, cntl) + " "
                            + ((m.isRetrievable_a(tgt_id)) ? xv.build_ret_a_link(tgt_id) + " " : "")
                            + ((m.isRetrievable_b(tgt_id)) ? xv.build_ret_b_link(tgt_id) + " " : "")
                            + ") "
                            + " [" + ((q_cntl.hasEndpoint()) ? xv.build_related_link(tgt_id) : "")
                            + "]");
                }
            }
        }
    }
public void displayStructure(QueryControl q_cntl, int index, HttpUtils h, XView xv, String cntl)
            throws MetadataValidationException, MetadataException {
        System.out.println("Related QueryContents");
        this.displayStructureHeader(index, xv);
        Metadata m = getMetadata();
        boolean object_refs = m.isObjectRefsOnly();
        if (m.getWrapper() == null) {
            return;
        }
        xv.getMetadata().addMetadata(m);
        if (object_refs) {
           
        } else {
            String ref_id = this.getReferenceId();
            h.indent1(xv.build_details_link(ref_id, cntl) + " (" + xv.build_xml_link(ref_id, cntl) + " "
                    + ((m.isRetrievable_a(ref_id)) ? xv.build_ret_a_link(ref_id) + " " : "")
                    + ((m.isRetrievable_b(ref_id)) ? xv.build_ret_b_link(ref_id) + " " : "")
                    + ")");
           
            for (OMElement a_ele : m.getAssociations()) {
                String src_id = m.getAssocSource(a_ele);
                String a_type = m.getAssocType(a_ele);
                String a_id = m.getId(a_ele);
                String tgt_id = m.getAssocTarget(a_ele);
                if (src_id == null) {
                } else if (src_id != null && !src_id.equals(this.getReferenceId())) {
                    if (MetadataSupport.xdsB_ihe_assoc_type_rplc.equals(a_type)) {
                        a_type = "replaced by";
                    } else if (MetadataSupport.xdsB_ihe_assoc_type_apnd.equals(a_type)) {
                        a_type = "has appended";
                    } else if (MetadataSupport.xdsB_ihe_assoc_type_xfrm.equals(a_type)) {
                        a_type = "transformed to";
                    } else if (MetadataSupport.xdsB_ihe_assoc_type_issnapshotof.equals(a_type)) {
                        a_type = "is snapshot of";
                    } else {
                        a_type = a_type + " by";
                    }
                    h.indent2(xv.build_assoc_link(a_id, a_type, cntl) + " "
                            + xv.build_details_link(src_id, cntl)
                            + " (" + xv.build_xml_link(src_id, cntl) + " "
                            + ((m.isRetrievable_a(tgt_id)) ? xv.build_ret_a_link(tgt_id) + " " : "")
                            + ((m.isRetrievable_b(tgt_id)) ? xv.build_ret_b_link(tgt_id) + " " : "")
                            + ") "
                            + " [" + ((q_cntl.hasEndpoint()) ? xv.build_related_link(src_id) : "")
                            + "]");
                } else {
                    if (MetadataSupport.xdsB_ihe_assoc_type_rplc.equals(a_type)) {
                        a_type = "replaces";
                    } else if (MetadataSupport.xdsB_ihe_assoc_type_apnd.equals(a_type)) {
                        a_type = "appended to";
                    } else if (MetadataSupport.xdsB_ihe_assoc_type_xfrm.equals(a_type)) {
                        a_type = "transform of";
                    }
                    h.indent2(xv.build_assoc_link(a_id, a_type, cntl) + " "
                            + xv.build_details_link(tgt_id, cntl)
                            + " (" + xv.build_xml_link(tgt_id, cntl) + " "
                            + ((m.isRetrievable_a(tgt_id)) ? xv.build_ret_a_link(tgt_id) + " " : "")
                            + ((m.isRetrievable_b(tgt_id)) ? xv.build_ret_b_link(tgt_id) + " " : "")
                            + ") "
                            + " [" + ((q_cntl.hasEndpoint()) ? xv.build_related_link(tgt_id) : "")
                            + "]");
                }
            }
        }
    }
public void displaystructure(querycontrol q_cntl, int index, httputils h, xview xv, string cntl) throws metadatavalidationexception, metadataexception { system.out.println("related querycontents"); this.displaystructureheader(index, xv); metadata m = getmetadata(); boolean object_refs = m.isobjectrefsonly(); if (m.getwrapper() == null) { return; } xv.getmetadata().addmetadata(m); if (object_refs) { } else { string ref_id = this.getreferenceid(); h.indent1(xv.build_details_link(ref_id, cntl) + " (" + xv.build_xml_link(ref_id, cntl) + " " + ((m.isretrievable_a(ref_id)) ? xv.build_ret_a_link(ref_id) + " " : "") + ((m.isretrievable_b(ref_id)) ? xv.build_ret_b_link(ref_id) + " " : "") + ")"); for (omelement a_ele : m.getassociations()) { string src_id = m.getassocsource(a_ele); string a_type = m.getassoctype(a_ele); string a_id = m.getid(a_ele); string tgt_id = m.getassoctarget(a_ele); if (src_id == null) { } else if (src_id != null && !src_id.equals(this.getreferenceid())) { if (metadatasupport.xdsb_ihe_assoc_type_rplc.equals(a_type)) { a_type = "replaced by"; } else if (metadatasupport.xdsb_ihe_assoc_type_apnd.equals(a_type)) { a_type = "has appended"; } else if (metadatasupport.xdsb_ihe_assoc_type_xfrm.equals(a_type)) { a_type = "transformed to"; } else if (metadatasupport.xdsb_ihe_assoc_type_issnapshotof.equals(a_type)) { a_type = "is snapshot of"; } else { a_type = a_type + " by"; } h.indent2(xv.build_assoc_link(a_id, a_type, cntl) + " " + xv.build_details_link(src_id, cntl) + " (" + xv.build_xml_link(src_id, cntl) + " " + ((m.isretrievable_a(tgt_id)) ? xv.build_ret_a_link(tgt_id) + " " : "") + ((m.isretrievable_b(tgt_id)) ? xv.build_ret_b_link(tgt_id) + " " : "") + ") " + " [" + ((q_cntl.hasendpoint()) ? xv.build_related_link(src_id) : "") + "]"); } else { if (metadatasupport.xdsb_ihe_assoc_type_rplc.equals(a_type)) { a_type = "replaces"; } else if (metadatasupport.xdsb_ihe_assoc_type_apnd.equals(a_type)) { a_type = "appended to"; } else if (metadatasupport.xdsb_ihe_assoc_type_xfrm.equals(a_type)) { a_type = "transform of"; } h.indent2(xv.build_assoc_link(a_id, a_type, cntl) + " " + xv.build_details_link(tgt_id, cntl) + " (" + xv.build_xml_link(tgt_id, cntl) + " " + ((m.isretrievable_a(tgt_id)) ? xv.build_ret_a_link(tgt_id) + " " : "") + ((m.isretrievable_b(tgt_id)) ? xv.build_ret_b_link(tgt_id) + " " : "") + ") " + " [" + ((q_cntl.hasendpoint()) ? xv.build_related_link(tgt_id) : "") + "]"); } } } }