Package com.esri.gpt.framework.xml

Examples of com.esri.gpt.framework.xml.NodeListAdapter


   */
  protected Map<String, List<String>> extractEsriItemAttributes(Node esriItemInfo) {
    AttrMap attributes = new AttrMap();
    ItemDesc itemDesc = null;
    // go through each child of ESRI item info
    for (Node nd : new NodeListAdapter(esriItemInfo.getChildNodes())) {
      // get name and value of the attribute
      String name = Val.chkStr(nd.getNodeName());
      String value = Val.chkStr(nd.getTextContent());
     
      if (!name.isEmpty() && !value.isEmpty()) {
View Full Code Here


    XPath xPath = XPathFactory.newInstance().newXPath();
    Node node = (Node) xPath.evaluate(
        "/feed/entry",
        doc, XPathConstants.NODE);
    Node elementNode = null;
    for (Node nd : new NodeListAdapter(node.getChildNodes())) {
      if (nd.getNodeType()==Node.ELEMENT_NODE) {
        elementNode = nd;
        break;
      }
    }
View Full Code Here

    entries = (NodeList) xPath.evaluate("/atom:feed/atom:entry", fDom, XPathConstants.NODESET);   
  } catch (XPathExpressionException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
    for (Node entry : new NodeListAdapter(entries)) {
      feedNd.removeChild(entry);
    }
    try {
      String xml = Val.chkStr(XmlIoUtil.domToString(fDom));
      if(xml.length() > 0){
View Full Code Here

      XPath xPath = XPathFactory.newInstance().newXPath();
      Node node = (Node) xPath.evaluate(
          "/feed/entry",
          doc, XPathConstants.NODE);
      Node elementNode = null;
      for (Node nd : new NodeListAdapter(node.getChildNodes())) {
        if (nd.getNodeType()==Node.ELEMENT_NODE) {
          elementNode = nd;
          break;
        }
      }
View Full Code Here

    XPath xPath = XPathFactory.newInstance().newXPath();
    NodeList nodeList = (NodeList) xPath.evaluate("/OAI-PMH/ListIdentifiers/header", doc, XPathConstants.NODESET);

    boolean maxReached = false;
    ArrayList<Resource> resources = new ArrayList<Resource>();
    for (Node nd : new NodeListAdapter(nodeList)) {
      recs++;
      maxReached = criteria!=null && criteria.getMaxRecords()!=null && recs>criteria.getMaxRecords();
      if (maxReached) break;
      final String id = (String) xPath.evaluate("identifier/text()", nd, XPathConstants.STRING);
      Publishable publishable = new CommonPublishable() {
View Full Code Here

      // creating TFiles only if iso exist
      URL baseUrl = new URL(infoUrl.toExternalForm());
      baseUrl = new URL(baseUrl, iso);
   
      NodeList ndDatasets = (NodeList)xPath.evaluate("//dataset[string-length(normalize-space(@urlPath))>0]", ndCatalog, XPathConstants.NODESET);
      for (Node ndDataset: new NodeListAdapter(ndDatasets)) {
        String url = (String)xPath.evaluate("@urlPath",ndDataset,XPathConstants.STRING);
        String ID = (String)xPath.evaluate("@ID",ndDataset,XPathConstants.STRING);
        if (!url.isEmpty()) {
          URL datasetUrl = new URL(baseUrl, url);
          TFile datasetFile = new TFile(proxy, datasetUrl.toExternalForm()+"?catalog="+encodeUrl(info.getUrl())+"&dataset="+ID);
          resources.add(datasetFile);
        }
      }
    }

    NodeList ndCatalogRefs = (NodeList)xPath.evaluate("//catalogRef/@href", ndCatalog, XPathConstants.NODESET);
    for (Node ndCatalogRef: new NodeListAdapter(ndCatalogRefs)) {
      String url = Val.chkStr(ndCatalogRef.getNodeValue());
      URL catalogUrl = new URL(infoUrl, url);
      String catalogUrlExternal = catalogUrl.toExternalForm();
      if (!processedFolders.contains(catalogUrlExternal)) {
        processedFolders.add(catalogUrlExternal);
View Full Code Here

    Node node = (Node) xPath.evaluate(
        "/OAI-PMH/GetRecord/record/metadata",
        doc, XPathConstants.NODE);
    Node elementNode = null;
    if (node!=null) {
      for (Node nd : new NodeListAdapter(node.getChildNodes())) {
        if (nd.getNodeType()==Node.ELEMENT_NODE) {
          elementNode = nd;
          break;
        }
      }
View Full Code Here

        }

        if (xPath.evaluate("dataCategory", doc, XPathConstants.NODE) != null) {
          ArrayList<String> aCodes = new ArrayList<String>();
          NodeList codes = (NodeList) xPath.evaluate("dataCategory/code/#text()", root, XPathConstants.NODESET);
          for (Node code : new NodeListAdapter(codes)) {
            aCodes.add(code.getNodeValue());
          }
          crt.setDataCategory(aCodes.toArray(new String[aCodes.size()]));
        }
View Full Code Here

    }

    cfg.getLuceneConfig().setParserProxies(infos.createParserProxies());
   
    NodeList ndObservers = (NodeList) xpath.evaluate("observer", ndLucene, XPathConstants.NODESET);
    for (Node ndObserver: new NodeListAdapter(ndObservers)) {
      LuceneIndexObserverInfo info = new LuceneIndexObserverInfo();
      info.setClassName(Val.chkStr(xpath.evaluate("@className", ndObserver)));
      NodeList ndListProps = (NodeList) xpath.evaluate("attribute", ndObserver, XPathConstants.NODESET);
      for (Node ndAttribute: new NodeListAdapter(ndListProps)) {
        String key = xpath.evaluate("@key", ndAttribute);
        String value = xpath.evaluate("@value", ndAttribute);
        info.getAttributes().set(key, value);
      }
      LuceneIndexObserver observer = info.createObserver();
View Full Code Here

  // get root of webharvester configuration
  Node ndWebHarvester = (Node) xpath.evaluate("webharvester", root, XPathConstants.NODE);
  if (ndWebHarvester!=null) {
    // create and initialize data processor for each netry in configuration
    NodeList ndDataProcessorFactories = (NodeList) xpath.evaluate("dataProcessorFactory", ndWebHarvester, XPathConstants.NODESET);
    for (Node ndDataProcessorFactory : new NodeListAdapter(ndDataProcessorFactories)) {
      String className = Val.chkStr((String) xpath.evaluate("@className", ndDataProcessorFactory, XPathConstants.STRING));
      String name = Val.chkStr((String) xpath.evaluate("@name", ndDataProcessorFactory, XPathConstants.STRING));
      boolean enabled = Val.chkBool(Val.chkStr((String) xpath.evaluate("@enabled", ndDataProcessorFactory, XPathConstants.STRING)), true);
      if (enabled) {
        try {
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.xml.NodeListAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.