Esempio n. 1
0
 /**
  * Retrieve the list of supported Sets. This should probably be initialized by the constructor
  * from the properties object that is passed to it.
  *
  * @return a Map object containing <setSpec> values as the Map keys and <setName> values for the
  *     corresponding the Map values.
  * @exception NoSetHierarchyException No sets are defined for this repository
  * @exception OAIInternalServerError An error occurred
  * @throws CannotDisseminateFormatException
  * @throws IdDoesNotExistException
  */
 public static List listSets(Properties properties)
     throws NoSetHierarchyException, OAIInternalServerError {
   String repository = properties.getProperty("oai.repositoryName", "undefined");
   if (repository.equalsIgnoreCase("imeji")) {
     return FetchImeji.listSets(properties);
   }
   if (repository.equalsIgnoreCase("escidoc")) {
     return null;
     // TODO
     // return fetcheSciDoc.listSets(Properties properties);
   }
   return null;
 }
Esempio n. 2
0
  /**
   * Retrieve the specified metadata for the specified identifier
   *
   * @param identifier the OAI identifier
   * @return the String containing the result record.
   * @exception IdDoesNotExistException The specified identifier doesn't exist.
   * @exception CannotDisseminateFormatException The identifier exists, but doesn't support the
   *     specified metadataPrefix.
   * @exception OAIInternalServerError signals an http status code 500 problem
   */
  public static String getRecord(String identifier, String metadataPrefix, Properties properties)
      throws IdDoesNotExistException, CannotDisseminateFormatException, OAIInternalServerError {
    String repository = properties.getProperty("oai.repositoryName", "undefined");
    if (repository.equalsIgnoreCase("imeji")) {

      return FetchImeji.getRecord(identifier, metadataPrefix, properties);
    }
    if (repository.equalsIgnoreCase("escidoc")) {
      return null;
      // TODO
      // return fetcheSciDoc.getRecord(identifier, metadataPrefix, properties);
    }
    return null;
  }
Esempio n. 3
0
  /**
   * Retrieve a list of records that satisfy the specified criteria
   *
   * @param from beginning date in the form of YYYY-MM-DD or null if earliest date is desired
   * @param until ending date in the form of YYYY-MM-DD or null if latest date is desired
   * @param set set name or null if no set is desired
   * @return a Map object containing an optional "resumptionToken" key/value pair and a "records"
   *     Iterator object. The "records" Iterator contains a set of Records objects.
   * @exception BadArgumentException one or more of the arguments are bad.
   * @exception CannotDisseminateFormatException the requested metadataPrefix isn't supported
   * @exception NoItemsMatchException no items fit the criteria
   * @exception NoSetHierarchyException sets aren't defined for this repository
   * @exception OAIInternalServerError signals an http status code 500 problem
   */
  public static String listRecords(
      String metadataPrefix, Properties properties, String from, String until, String set)
      throws NoItemsMatchException, CannotDisseminateFormatException, OAIInternalServerError {
    String repository = properties.getProperty("oai.repositoryName", "undefined");
    if (repository.equalsIgnoreCase("imeji")) {

      return FetchImeji.listRecords(metadataPrefix, properties, from, until, set);
    }
    if (repository.equalsIgnoreCase("escidoc")) {
      return null;
      // TODO
      // return fetcheSciDoc.listRecords(metadataPrefix, properties, from ,until, set);
    }
    return null;
  }
Esempio n. 4
0
 /**
  * TODO
  *
  * @param from
  * @param until
  * @param set
  * @param properties
  * @return
  * @throws BadArgumentException
  * @throws CannotDisseminateFormatException
  * @throws NoItemsMatchException
  * @throws NoSetHierarchyException
  * @throws OAIInternalServerError
  */
 public String listIdentifiers(String from, String until, String set, Properties properties)
     throws BadArgumentException, CannotDisseminateFormatException, NoItemsMatchException,
         NoSetHierarchyException, OAIInternalServerError {
   String repository = properties.getProperty("oai.repositoryName", "undefined");
   if (repository.equalsIgnoreCase("imeji")) {
     return FetchImeji.listIdentifiers(from, until, set, properties);
   }
   if (repository.equalsIgnoreCase("escidoc")) {
     return null;
     // TODO
     // return fetcheSciDoc.listIdentifiers(String from, String until, String set, String
     // metadataPrefix);
   }
   return null;
 }