示例#1
0
    /**
     * @param mdl
     * @param linkType
     */
    private void handleMetadataLink(MetadataLinkInfo mdl, String linkType) {
      if (mdl != null) {
        AttributesImpl attributes = new AttributesImpl();

        if ((mdl.getAbout() != null) && (mdl.getAbout() != "")) {
          attributes.addAttribute("", "about", "about", "", mdl.getAbout());
        }

        if ((mdl.getMetadataType() != null) && (mdl.getMetadataType() != "")) {
          attributes.addAttribute("", "xlink:type", "xlink:type", "", linkType);
        }

        if (attributes.getLength() > 0) {
          element("ows:Metadata", null, attributes);
        }
      }
    }
示例#2
0
    /**
     * DOCUMENT ME!
     *
     * @param metadataLink DOCUMENT ME!
     * @throws SAXException DOCUMENT ME!
     */
    private void handleMetadataLink(MetadataLinkInfo mdl) {
      if (mdl != null) {
        AttributesImpl attributes = new AttributesImpl();

        if ((mdl.getAbout() != null) && (mdl.getAbout() != "")) {
          attributes.addAttribute("", "about", "about", "", mdl.getAbout());
        }

        // if( mdl.getType() != null && mdl.getType() != "" ) {
        // attributes.addAttribute("", "type", "type", "",
        // mdl.getType());
        // }
        if ((mdl.getMetadataType() != null) && (mdl.getMetadataType() != "")) {
          attributes.addAttribute("", "metadataType", "metadataType", "", mdl.getMetadataType());
        }

        if (attributes.getLength() > 0) {
          start("wcs:metadataLink", attributes);
          // characters(mdl.getContent());
          end("wcs:metadataLink");
        }
      }
    }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (!(obj instanceof MetadataLinkInfo)) {
      return false;
    }

    final MetadataLinkInfo other = (MetadataLinkInfo) obj;
    if (about == null) {
      if (other.getAbout() != null) return false;
    } else if (!about.equals(other.getAbout())) return false;
    if (content == null) {
      if (other.getContent() != null) return false;
    } else if (!content.equals(other.getContent())) return false;
    if (metadataType == null) {
      if (other.getMetadataType() != null) return false;
    } else if (!metadataType.equals(other.getMetadataType())) return false;
    if (type == null) {
      if (other.getType() != null) return false;
    } else if (!type.equals(other.getType())) return false;
    return true;
  }
    /**
     * Turns the metadata URL list to XML
     *
     * @param keywords
     */
    private void handleMetadataList(Collection<MetadataLinkInfo> metadataURLs) {
      if (metadataURLs == null) {
        return;
      }

      for (MetadataLinkInfo link : metadataURLs) {

        AttributesImpl lnkAtts = new AttributesImpl();
        lnkAtts.addAttribute("", "type", "type", "", link.getMetadataType());
        start("MetadataURL", lnkAtts);

        element("Format", link.getType());

        AttributesImpl orAtts = new AttributesImpl();
        orAtts.addAttribute("", "xmlns:xlink", "xmlns:xlink", "", XLINK_NS);
        orAtts.addAttribute(XLINK_NS, "xlink:type", "xlink:type", "", "simple");
        orAtts.addAttribute("", "xlink:href", "xlink:href", "", link.getContent());
        element("OnlineResource", null, orAtts);

        end("MetadataURL");
      }
    }