org.dspace.embargo
Class DayTableEmbargoSetter

java.lang.Object
  extended by org.dspace.embargo.DefaultEmbargoSetter
      extended by 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 : where can be any string and must be a positive integer. All the 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

Field Summary
 
Fields inherited from class org.dspace.embargo.DefaultEmbargoSetter
termsOpen
 
Constructor Summary
DayTableEmbargoSetter()
           
 
Method Summary
 DCDate parseTerms(Context context, Item item, String terms)
          Parse the terms into a definite date.
 
Methods inherited from class org.dspace.embargo.DefaultEmbargoSetter
checkEmbargo, generatePolicies, setEmbargo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DayTableEmbargoSetter

public DayTableEmbargoSetter()
Method Detail

parseTerms

public DCDate parseTerms(Context context,
                         Item item,
                         String terms)
                  throws SQLException,
                         AuthorizeException,
                         IOException
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
AuthorizeException
IOException


Copyright © 2012 DuraSpace. All Rights Reserved.