Class DayTableEmbargoSetter

java.lang.Object
org.dspace.embargo.DefaultEmbargoSetter
org.dspace.embargo.DayTableEmbargoSetter
All Implemented Interfaces:
EmbargoSetter

public class DayTableEmbargoSetter extends DefaultEmbargoSetter
Plugin implementation of the embargo setting function. The parseTerms() method performs a look-up to a table that relates a terms expression to a fixed number of days. Table constructed from a dspace.cfg property with syntax: embargo.terms.days = 90 days:90,1 year:365,2 years:730 That is, an arbitrary, comma separated, list of <terms>:<days> where <terms> can be any string and <days> must be a positive integer. All the <terms> fields should be defined in a 'value-pairs' element, and the field configured as the embargo terms should employ a drop-down using that element in input_forms.xml, if user submission is desired.
Author:
Richard Rodgers
  • Constructor Details

    • DayTableEmbargoSetter

      public DayTableEmbargoSetter()
  • Method Details

    • parseTerms

      public DCDate parseTerms(Context context, Item item, String terms) throws SQLException, AuthorizeException
      Parse the terms into a definite date. Only terms expressions processed are those defined in 'embargo.terms.days' configuration property.
      Specified by:
      parseTerms in interface EmbargoSetter
      Overrides:
      parseTerms in class DefaultEmbargoSetter
      Parameters:
      context - the DSpace context
      item - the item to embargo
      terms - the embargo terms
      Returns:
      parsed date in DCDate format
      Throws:
      SQLException - An exception that provides information on a database access error or other errors.
      AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.