Package org.dspace.embargo
Class DayTableEmbargoSetter
java.lang.Object
org.dspace.embargo.DefaultEmbargoSetter
org.dspace.embargo.DayTableEmbargoSetter
- All Implemented Interfaces:
EmbargoSetter
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
-
Field Summary
Fields inherited from class org.dspace.embargo.DefaultEmbargoSetter
authorizeService, resourcePolicyService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparseTerms(Context context, Item item, String terms) Parse the terms into a definite date.Methods inherited from class org.dspace.embargo.DefaultEmbargoSetter
checkEmbargo, generatePolicies, setEmbargo
-
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:
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.
-