示例#1
0
  /**
   * It parses the online resources
   *
   * @return Resource
   * @param label Label that contains the resource root
   */
  private Resource[] getResources(String label) {
    XMLNode[] nodes = XMLTree.searchMultipleNode(getNode(), label);

    if (nodes == null) {
      return null;
    }
    Resource[] resources = new Resource[nodes.length];

    for (int i = 0; i < resources.length; i++) {

      String sProtocol = XMLTree.searchNodeValue(nodes[i], "protocol");
      String sName = XMLTree.searchNodeValue(nodes[i], "orName");

      if (sProtocol == null) {
        sProtocol = Resource.WEBSITE;
        sName = "orName";
      }

      resources[i] =
          new Resource(
              XMLTree.searchNodeValue(nodes[i], "linkage"),
              sProtocol,
              sName,
              "orDesc",
              "",
              "",
              null);
    }
    return resources;
  }
示例#2
0
 /** @param node */
 public DublinCoreRecord(URI uri, XMLNode node) {
   super(uri, node);
   setTitle(XMLTree.searchNodeValue(node, "dc:title"));
   setAbstract_(XMLTree.searchNodeValue(node, "dc:subject"));
   setPurpose(XMLTree.searchNodeValue(node, "dc:description"));
   setResources(getResources(node));
 }
示例#3
0
 /** @param node */
 public IdecISO19115Record(URI uri, XMLNode node) {
   super(uri, node);
   setTitle(
       XMLTree.searchNodeValue(
           node, "identificationInfo->MD_DataIdentification->citation->title"));
   setAbstract_(
       XMLTree.searchNodeValue(node, "identificationInfo->MD_DataIdentification->abstract"));
   setPurpose(XMLTree.searchNodeValue(node, "identificationInfo->MD_DataIdentification->purpose"));
   setKeyWords(
       XMLTree.searchMultipleNodeValue(
           node, "identificationInfo->MD_DataIdentification->descriptiveKeywords->keyword"));
   setResources(getResources("distributionInfo->distributor->distributorTransferOptions->onLine"));
   // setImage(getImageUrl("identificationInfo->MD_DataIdentification->graphicOverview->fileName"));
 }
示例#4
0
  /**
   * It parses the resource tags
   *
   * @return
   * @param node
   */
  public Resource[] getResources(XMLNode node) {
    String format = XMLTree.searchNodeValue(node, "dc:format");
    String source = XMLTree.searchNodeValue(node, "dc:source");
    Coordinates coordinates =
        new Coordinates(
            XMLTree.searchNodeValue(getNode(), "dc:spatial->dcmiBox:Box->dcmiBox:westlimit"),
            XMLTree.searchNodeValue(getNode(), "dc:spatial->dcmiBox:Box->dcmiBox:northlimit"),
            XMLTree.searchNodeValue(getNode(), "dc:spatial->dcmiBox:Box->dcmiBox:eastlimit"),
            XMLTree.searchNodeValue(getNode(), "dc:spatial->dcmiBox:Box->dcmiBox:southlimit"));

    if ((source == null) || (format == null)) {
      return null;
    }

    if (format.toLowerCase().equals("shapefile")) format = Resource.DOWNLOAD;

    if (format.toLowerCase().trim().equals("web page")) format = Resource.WEBSITE;

    Resource[] resources = new Resource[1];
    resources[0] = new Resource(source, format, "", "", "", "", coordinates);

    return resources;
  }