Package se.kb.oai.pmh

Examples of se.kb.oai.pmh.OaiPmhServer


    public List<URI> list(URI pdURI, Query q) throws QueryValidationException {
      if (pdURI == null) {
        // OAI hierarchy is flat (no sub-directories) - only allow 'null' as pdURI!
        ArrayList<URI> resultList = new ArrayList<URI>();
       
        OaiPmhServer server = new OaiPmhServer(baseURL);
        try {
          IdentifiersList list;
          if (q == null) {
            list = server.listIdentifiers(metaDataPrefix);           
          } else {
            if (!(q instanceof QueryDateRange))
              throw new QueryValidationException("Unsupported query type");
           
            list = server.listIdentifiers(metaDataPrefix, dateFormat.format(((QueryDateRange) q).getStartDate().getTime()), dateFormat.format(((QueryDateRange) q).getEndDate().getTime()), set)
          }
         
          for (Header header : list.asList()) {
            try {
              resultList.add(new URI(header.getIdentifier()));
View Full Code Here


    /**
     * {@inheritDoc}
     * @see eu.planets_project.ifr.core.storage.api.DigitalObjectManager#retrieve(java.net.URI)
     */
    public DigitalObject retrieve(URI pdURI) throws DigitalObjectNotFoundException {
        OaiPmhServer server = new OaiPmhServer(baseURL);
        try {
            Record rec = server.getRecord(pdURI.toString(), metaDataPrefix);
            Element recEle = rec.getMetadata();
            if (recEle != null) {

                Document doc = recEle.getDocument();
                HashMap<String, String> map = new HashMap<String, String>();
View Full Code Here

        } else {
          // OAI hierarchy is flat (no sub-directories)
          List<URI> resultList = new ArrayList<URI>();
         
        log.info("OAIDigitalObjectManagerDCImpl pdURI: " + pdURI + ", baseURL: "+ baseURL);
          OaiPmhServer server = new OaiPmhServer(baseURL);
          try {
            if (q == null) {
              log.info("OAIDigitalObjectManagerDCImpl pdURI: " + pdURI + ", metaDataPrefix: "+ metaDataPrefix);
             
              // read titles and metadata
View Full Code Here

    public List<URI> list(URI pdURI, Query q) throws QueryValidationException {
      if ((pdURI == null) || pdURI.equals(root)) {
        // 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/")
View Full Code Here

TOP

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

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.