Package org.dspace.access.status
Class DefaultAccessStatusHelper
java.lang.Object
org.dspace.access.status.DefaultAccessStatusHelper
- All Implemented Interfaces:
AccessStatusHelper
Default plugin implementation of the access status helper.
The getAccessStatusFromItem method provides a simple logic to
calculate the access status of an item based on the policies of
the primary or the first bitstream in the original bundle.
Users can override this method for enhanced functionality.
The getEmbargoInformationFromItem method provides a simple logic to
* retrieve embargo information of bitstreams from an item based on the policies of
* the primary or the first bitstream in the original bundle.
* Users can override this method for enhanced functionality.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuthorizeServicestatic final Stringprotected ItemServicestatic final Stringstatic final Stringprotected ResourcePolicyServicestatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAccessStatusFromItem(Context context, Item item, Date threshold) Look at the item's policies to determine an access status value.getEmbargoFromItem(Context context, Item item, Date threshold) Look at the policies of the primary (or first) bitstream of the item to retrieve its embargo.
-
Field Details
-
EMBARGO
- See Also:
-
METADATA_ONLY
- See Also:
-
OPEN_ACCESS
- See Also:
-
RESTRICTED
- See Also:
-
UNKNOWN
- See Also:
-
itemService
-
resourcePolicyService
-
authorizeService
-
-
Constructor Details
-
DefaultAccessStatusHelper
public DefaultAccessStatusHelper()
-
-
Method Details
-
getAccessStatusFromItem
public String getAccessStatusFromItem(Context context, Item item, Date threshold) throws SQLException Look at the item's policies to determine an access status value. It is also considering a date threshold for embargoes and restrictions. If the item is null, simply returns the "unknown" value.- Specified by:
getAccessStatusFromItemin interfaceAccessStatusHelper- Parameters:
context- the DSpace contextitem- the item to check for embargoesthreshold- the embargo threshold date- Returns:
- an access status value
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
getEmbargoFromItem
Look at the policies of the primary (or first) bitstream of the item to retrieve its embargo. If the item is null, simply returns an empty map with no embargo information.- Specified by:
getEmbargoFromItemin interfaceAccessStatusHelper- Parameters:
context- the DSpace contextitem- the item to embargothreshold- the embargo threshold date- Returns:
- an access status value
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-