Package org.dspace.app.requestitem
Class RequestItemEmailNotifier
- java.lang.Object
-
- org.dspace.app.requestitem.RequestItemEmailNotifier
-
@Singleton public class RequestItemEmailNotifier extends Object
Send item requests and responses by email.The "strategy" by which approvers are chosen is in an implementation of
RequestItemAuthorExtractorwhich is injected by the namerequestItemAuthorExtractor. See the DI configuration documents.- Author:
- Mark H. Wood
-
-
Field Summary
Fields Modifier and Type Field Description protected BitstreamServicebitstreamServiceprotected ConfigurationServiceconfigurationServiceprotected HandleServicehandleServiceprotected RequestItemAuthorExtractorrequestItemAuthorExtractorprotected RequestItemServicerequestItemService
-
Constructor Summary
Constructors Constructor Description RequestItemEmailNotifier(RequestItemAuthorExtractor requestItemAuthorExtractor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrequestOpenAccess(Context context, RequestItem ri)Send, to a repository administrator, a request to open access to a requested object.voidsendRequest(Context context, RequestItem ri, String responseLink)Send the request to the approver(s).voidsendResponse(Context context, RequestItem ri, String subject, String message)Send the approver's response back to the requester, with files attached if approved.
-
-
-
Field Detail
-
bitstreamService
@Inject protected BitstreamService bitstreamService
-
configurationService
@Inject protected ConfigurationService configurationService
-
handleService
@Inject protected HandleService handleService
-
requestItemService
@Inject protected RequestItemService requestItemService
-
requestItemAuthorExtractor
protected final RequestItemAuthorExtractor requestItemAuthorExtractor
-
-
Constructor Detail
-
RequestItemEmailNotifier
@Inject public RequestItemEmailNotifier(RequestItemAuthorExtractor requestItemAuthorExtractor)
-
-
Method Detail
-
sendRequest
public void sendRequest(Context context, RequestItem ri, String responseLink) throws IOException, SQLException
Send the request to the approver(s).- Parameters:
context- current DSpace session.ri- the request.responseLink- link back to DSpace to send the response.- Throws:
IOException- passed through.SQLException- if the message was not sent.
-
sendResponse
public void sendResponse(Context context, RequestItem ri, String subject, String message) throws IOException
Send the approver's response back to the requester, with files attached if approved.- Parameters:
context- current DSpace session.ri- the request.subject- email subject header value.message- email body (may be empty).- Throws:
IOException- if sending failed.
-
requestOpenAccess
public void requestOpenAccess(Context context, RequestItem ri) throws IOException
Send, to a repository administrator, a request to open access to a requested object.- Parameters:
context- current DSpace sessionri- the item request that the approver is handling- Throws:
IOException- if the message body cannot be loaded or the message cannot be sent.
-
-