Package org.dspace.app.requestitem
Class RequestItemServiceImpl
- java.lang.Object
-
- org.dspace.app.requestitem.RequestItemServiceImpl
-
- All Implemented Interfaces:
RequestItemService
public class RequestItemServiceImpl extends Object implements 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
Fields Modifier and Type Field Description protected AuthorizeServiceauthorizeServiceprotected RequestItemDAOrequestItemDAOprotected ResourcePolicyServiceresourcePolicyService
-
Constructor Summary
Constructors Modifier Constructor Description protectedRequestItemServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateRequest(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.List<RequestItem>findAll(Context context)Fetch all item requests.RequestItemfindByToken(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 Detail
-
requestItemDAO
@Autowired(required=true) protected RequestItemDAO requestItemDAO
-
authorizeService
@Autowired(required=true) protected AuthorizeService authorizeService
-
resourcePolicyService
@Autowired(required=true) protected ResourcePolicyService resourcePolicyService
-
-
Method Detail
-
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
public List<RequestItem> findAll(Context context) throws SQLException
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
public RequestItem findByToken(Context context, String token)
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.
-
update
public void update(Context context, RequestItem requestItem)
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
public void delete(Context context, RequestItem requestItem)
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
public boolean isRestricted(Context context, DSpaceObject o) throws SQLException
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.
-
-