Package org.dspace.app.requestitem
Class RequestItemServiceImpl
java.lang.Object
org.dspace.app.requestitem.RequestItemServiceImpl
- All Implemented Interfaces:
RequestItemService
Service implementation for the RequestItem object.
This class is responsible for all business logic calls for the RequestItem
object and is autowired by Spring.
This class should never be accessed directly.
- Author:
- kevinvandevelde at atmire.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuthorizeServiceprotected RequestItemDAOprotected ResourcePolicyService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRequest(Context context, Bitstream bitstream, Item item, boolean allFiles, String reqEmail, String reqName, String reqMessage) Generate a request item representing the request and put it into the DBvoiddelete(Context context, RequestItem requestItem) Remove the record from the database.Fetch all item requests.findByItem(Context context, Item item) Retrieve a request based on the item.findByToken(Context context, String token) Retrieve a request by its token.booleanisRestricted(Context context, DSpaceObject o) Is there at least one valid READ resource policy for this object?voidupdate(Context context, RequestItem requestItem) Save updates to the record.
-
Field Details
-
requestItemDAO
-
authorizeService
-
resourcePolicyService
-
-
Constructor Details
-
RequestItemServiceImpl
protected RequestItemServiceImpl()
-
-
Method Details
-
createRequest
public String createRequest(Context context, Bitstream bitstream, Item item, boolean allFiles, String reqEmail, String reqName, String reqMessage) throws SQLException Description copied from interface:RequestItemServiceGenerate a request item representing the request and put it into the DB- Specified by:
createRequestin interfaceRequestItemService- Parameters:
context- The relevant DSpace Context.bitstream- The requested bitstreamitem- The requested itemallFiles- true indicates that all bitstreams of this item are requestedreqEmail- email Requester emailreqName- Requester namereqMessage- Request message text- Returns:
- the token of the request item
- Throws:
SQLException- if database error
-
findAll
Description copied from interface:RequestItemServiceFetch all item requests.- Specified by:
findAllin interfaceRequestItemService- Parameters:
context- current DSpace session.- Returns:
- all item requests.
- Throws:
SQLException- passed through.
-
findByToken
Description copied from interface:RequestItemServiceRetrieve a request by its token.- Specified by:
findByTokenin interfaceRequestItemService- Parameters:
context- current DSpace session.token- the token identifying the request.- Returns:
- the matching request, or null if not found.
-
findByItem
Description copied from interface:RequestItemServiceRetrieve a request based on the item.- Specified by:
findByItemin interfaceRequestItemService- Parameters:
context- current DSpace session.item- the item to find requests for.- Returns:
- the matching requests, or null if not found.
- Throws:
SQLException
-
update
Description copied from interface:RequestItemServiceSave updates to the record. Only accept_request, and decision_date are set-able.- Specified by:
updatein interfaceRequestItemService- Parameters:
context- The relevant DSpace Context.requestItem- requested item
-
delete
Description copied from interface:RequestItemServiceRemove the record from the database.- Specified by:
deletein interfaceRequestItemService- Parameters:
context- current DSpace context.requestItem- record to be removed.
-
isRestricted
Description copied from interface:RequestItemServiceIs there at least one valid READ resource policy for this object?- Specified by:
isRestrictedin interfaceRequestItemService- Parameters:
context- current DSpace session.o- the object.- Returns:
- true if a READ policy applies.
- Throws:
SQLException- passed through.
-