* org.apache.struts.action.ActionForm,
* javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
public ActionForward modify(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {
EmailInteractionEnterOrEditForm f = (EmailInteractionEnterOrEditForm) form;
long commandEntryId = f.getCommandEntryId();
CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
if (commandEntry == null || !(commandEntry instanceof EmailCommandEntry)){
throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore")); // may have been deleted
}
EmailCommandEntry emailCommandEntry = (EmailCommandEntry)commandEntry;
Group group = emailCommandEntry.getGroup();
checkAccessRights(req, group);
commandEntryManager.evict(emailCommandEntry); // do not modify in this session yet (might be erroneous)
f.toEntry(emailCommandEntry, locale, session, getResources(req));
LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase()
+ ": Modified message command entry #" + emailCommandEntry.getId()
+ "; label: " + emailCommandEntry.getSortLabel() + "; subject: " + emailCommandEntry.getSubject());
setCommandEntryInRequest(req, emailCommandEntry);
return mapping.findForward("modified");