Package org.dspace.access.status
Class DefaultAccessStatusHelper
- java.lang.Object
-
- org.dspace.access.status.DefaultAccessStatusHelper
-
- All Implemented Interfaces:
AccessStatusHelper
public class DefaultAccessStatusHelper extends Object implements 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.
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthorizeServiceauthorizeServicestatic StringEMBARGOprotected ItemServiceitemServicestatic StringMETADATA_ONLYstatic StringOPEN_ACCESSprotected ResourcePolicyServiceresourcePolicyServicestatic StringRESTRICTEDstatic StringUNKNOWN
-
Constructor Summary
Constructors Constructor Description DefaultAccessStatusHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessStatusFromItem(Context context, Item item, Date threshold)Look at the item's policies to determine an access status value.
-
-
-
Field Detail
-
EMBARGO
public static final String EMBARGO
- See Also:
- Constant Field Values
-
METADATA_ONLY
public static final String METADATA_ONLY
- See Also:
- Constant Field Values
-
OPEN_ACCESS
public static final String OPEN_ACCESS
- See Also:
- Constant Field Values
-
RESTRICTED
public static final String RESTRICTED
- See Also:
- Constant Field Values
-
UNKNOWN
public static final String UNKNOWN
- See Also:
- Constant Field Values
-
itemService
protected ItemService itemService
-
resourcePolicyService
protected ResourcePolicyService resourcePolicyService
-
authorizeService
protected AuthorizeService authorizeService
-
-
Method Detail
-
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 embargos and restrictions. If the item is null, simply returns the "unknown" value.- Specified by:
getAccessStatusFromItemin 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.
-
-