{
Request request = ObjectModelHelper.getRequest(objectModel);
Context context = ContextUtil.obtainContext(objectModel);
String token = (String) request.getAttribute("token");
RequestItem requestItem = RequestItem.findByToken(context, token);
Item item = Item.find(context, requestItem.getItemID());
RequestItemAuthor requestItemAuthor = new DSpace()
.getServiceManager()
.getServiceByName(RequestItemAuthorExtractor.class.getName(),
RequestItemAuthorExtractor.class)
.getRequestItemAuthor(context, item);
Object[] args = new String[]{
requestItem.getReqName(),
requestItemAuthor.getFullName(),
requestItemAuthor.getEmail()
};
String subject = I18nUtil.getMessage("itemRequest.response.subject.contactRequester");
String messageTemplate = MessageFormat.format(I18nUtil.getMessage("itemRequest.response.body.contactRequester", context), args);
Division itemRequest = body.addInteractiveDivision("itemRequest-form",
request.getRequestURI(),Division.METHOD_POST,"primary");
itemRequest.setHead(T_head);
itemRequest.addPara(T_para1);
List form = itemRequest.addList("form",List.TYPE_FORM);
Text toEmail = form.addItem().addText("to");
toEmail.setLabel(T_toEmail);
toEmail.setValue(requestItem.getReqEmail());
toEmail.setDisabled(true);
Text subj = form.addItem().addText("subject");
subj.setLabel(T_subject);
subj.setValue(subject);