public class EmbargoServiceImpl extends Object implements EmbargoService
Configuration properties: (with examples)
# DC metadata field to hold the user-supplied embargo terms
embargo.field.terms = dc.embargo.terms
# DC metadata field to hold computed "lift date" of embargo
embargo.field.lift = dc.date.available
# String to indicate indefinite (forever) embargo in terms
embargo.terms.open = Indefinite
# implementation of embargo setter plugin
plugin.single.org.dspace.embargo.EmbargoSetter = edu.my.Setter
# implementation of embargo lifter plugin
plugin.single.org.dspace.embargo.EmbargoLifter = edu.my.Lifter
| Modifier and Type | Field and Description |
|---|---|
protected ConfigurationService |
configurationService |
protected ItemService |
itemService |
protected String |
lift_element |
protected String |
lift_qualifier |
protected String |
lift_schema |
protected EmbargoLifter |
lifter |
protected PluginService |
pluginService |
protected EmbargoSetter |
setter |
protected String |
terms_element |
protected String |
terms_qualifier |
protected String |
terms_schema |
FOREVER| Modifier | Constructor and Description |
|---|---|
protected |
EmbargoServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkEmbargo(Context context,
Item item) |
Iterator<Item> |
findItemsByLiftMetadata(Context context) |
protected String |
getElementOf(String field) |
DCDate |
getEmbargoTermsAsDate(Context context,
Item item)
Get the embargo lift date for an Item, if any.
|
List<MetadataValue> |
getLiftMetadata(Context context,
Item item) |
protected String |
getQualifierOf(String field) |
protected String |
getSchemaOf(String field) |
void |
init()
Initialize the bean (after dependency injection has already taken place).
|
void |
liftEmbargo(Context context,
Item item)
Lift the embargo on an item which is assumed to be under embargo.
|
protected DCDate |
recoverEmbargoDate(Item item) |
void |
setEmbargo(Context context,
Item item)
Put an Item under embargo until the specified lift date.
|
protected String terms_schema
protected String terms_element
protected String terms_qualifier
protected String lift_schema
protected String lift_element
protected String lift_qualifier
protected EmbargoSetter setter
protected EmbargoLifter lifter
@Autowired(required=true) protected ItemService itemService
@Autowired(required=true) protected ConfigurationService configurationService
@Autowired(required=true) protected PluginService pluginService
public void setEmbargo(Context context, Item item) throws SQLException, AuthorizeException
EmbargoServicesetEmbargo in interface EmbargoServicecontext - the DSpace contextitem - the item to embargoSQLExceptionAuthorizeExceptionpublic DCDate getEmbargoTermsAsDate(Context context, Item item) throws SQLException, AuthorizeException
EmbargoServiceNote that the plugin is *always* called, in case it gets its cue for the embargo date from sources other than, or in addition to, the specified field.
getEmbargoTermsAsDate in interface EmbargoServicecontext - the DSpace contextitem - the item to embargoSQLExceptionAuthorizeExceptionpublic void liftEmbargo(Context context, Item item) throws SQLException, AuthorizeException, IOException
EmbargoServiceliftEmbargo in interface EmbargoServicecontext - the DSpace contextitem - the item on which to lift the embargoSQLExceptionAuthorizeExceptionIOExceptionpublic void init()
throws Exception
Exceptionpublic void checkEmbargo(Context context, Item item) throws SQLException, IOException, AuthorizeException
checkEmbargo in interface EmbargoServiceSQLExceptionIOExceptionAuthorizeExceptionpublic List<MetadataValue> getLiftMetadata(Context context, Item item)
getLiftMetadata in interface EmbargoServicepublic Iterator<Item> findItemsByLiftMetadata(Context context) throws SQLException, IOException, AuthorizeException
findItemsByLiftMetadata in interface EmbargoServiceSQLExceptionIOExceptionAuthorizeExceptionCopyright © 2017 DuraSpace. All rights reserved.