Package org.dspace.embargo
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:730That 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
-
-
Field Summary
-
Fields inherited from class org.dspace.embargo.DefaultEmbargoSetter
authorizeService, resourcePolicyService
-
-
Constructor Summary
Constructors Constructor Description DayTableEmbargoSetter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DCDateparseTerms(Context context, Item item, String terms)Parse the terms into a definite date.-
Methods inherited from class org.dspace.embargo.DefaultEmbargoSetter
checkEmbargo, generatePolicies, setEmbargo
-
-
-
-
Method Detail
-
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:
parseTermsin interfaceEmbargoSetter- Overrides:
parseTermsin classDefaultEmbargoSetter- Parameters:
context- the DSpace contextitem- the item to embargoterms- 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.
-
-