Package se.kb.oai.pmh

Examples of se.kb.oai.pmh.RecordsList


      ArrayList<URI> resultList = new ArrayList<URI>();

      long starttime = System.currentTimeMillis();
      log.info("OAIDigitalObjectManagerDCImpl retrieveAll() starttime: " + starttime + ", pdURI: " + pdURI);
      try {
        RecordsList recordsList;
        recordsList = server.listRecords(metaDataPrefix)
        for (Record record : recordsList.asList()) {
          Element metadata = record.getMetadata();
        if (metadata != null) {
          // Namespace URI
          URI namespaceURI = null;
          try {
View Full Code Here


        // OAI hierarchy is flat (no sub-directories) - only allow 'null' as pdURI!
        ArrayList<URI> resultList = new ArrayList<URI>();
       
        OaiPmhServer server = new OaiPmhServer(baseURL);
        try {
          RecordsList list;
          if (q == null) {
            list = server.listRecords(metaDataPrefix, "2009-07-12T10:50:20Z", "2009-07-14T16:38:20Z", set);           
          } else {
            if (!(q instanceof QueryDateRange))
              throw new QueryValidationException("Unsupported query type");
           
            list = server.listRecords(metaDataPrefix, dateFormat.format(((QueryDateRange) q).getStartDate().getTime()), dateFormat.format(((QueryDateRange) q).getEndDate().getTime()), set)
          }
         
          // Prepare XPath expression
                HashMap<String, String> map = new HashMap<String, String>();
                map.put("pmh", "http://www.openarchives.org/OAI/2.0/")
                map.put("xb", "http://com/exlibris/digitool/repository/api/xmlbeans");
               
                try {
                  XPath xpathURL = new Dom4jXPath("/pmh:OAI-PMH/pmh:ListRecords/pmh:record/pmh:metadata/xb:digital_entity/pmh:urls/pmh:url[@type='stream']");
                  xpathURL.setNamespaceContext(new SimpleNamespaceContext(map));
           
            List urlList = xpathURL.selectNodes(list.getResponse());
            for (Object aNode : urlList) {
              try {
                if (aNode instanceof Node) {
                  resultList.add(new URI(((Node) aNode).getText()));
                }
View Full Code Here

TOP

Related Classes of se.kb.oai.pmh.RecordsList

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.