Exemplo n.º 1
0
  // initialize - get plugins and MD field settings from config
  @Override
  public void afterPropertiesSet() throws Exception {
    if (terms_schema == null) {
      String terms = ConfigurationManager.getProperty("embargo.field.terms");
      String lift = ConfigurationManager.getProperty("embargo.field.lift");
      if (terms == null || lift == null) {
        throw new IllegalStateException(
            "Missing one or more of the required DSpace configuration properties for EmbargoManager, check your configuration file.");
      }
      terms_schema = getSchemaOf(terms);
      terms_element = getElementOf(terms);
      terms_qualifier = getQualifierOf(terms);
      lift_schema = getSchemaOf(lift);
      lift_element = getElementOf(lift);
      lift_qualifier = getQualifierOf(lift);

      setter = (EmbargoSetter) PluginManager.getSinglePlugin(EmbargoSetter.class);
      if (setter == null) {
        throw new IllegalStateException(
            "The EmbargoSetter plugin was not defined in DSpace configuration.");
      }
      lifter = (EmbargoLifter) PluginManager.getSinglePlugin(EmbargoLifter.class);
      if (lifter == null) {
        throw new IllegalStateException(
            "The EmbargoLifter plugin was not defined in DSpace configuration.");
      }
    }
  }
 public static SwordEntryIngester getEntryInstance(
     Context context, Deposit deposit, DSpaceObject dso) throws DSpaceSwordException, SwordError {
   SwordEntryIngester ingester =
       (SwordEntryIngester)
           PluginManager.getSinglePlugin("swordv2-server", SwordEntryIngester.class);
   if (ingester == null) {
     throw new SwordError(
         UriRegistry.ERROR_CONTENT, "No ingester configured for handling sword entry documents");
   }
   return ingester;
 }