* javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
public ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {
EmailInteractionEnterOrEditForm emailInteractionEnterOrEditForm = (EmailInteractionEnterOrEditForm) form;
EmailCommandEntry emailCommandEntry = (EmailCommandEntry)commandEntryFromRequest(req);
Group group = emailCommandEntry.getGroup();
checkAccessRights(req, group);
if (emailCommandEntry.getUseAsTemplate() == 1){
req.getSession().setAttribute("attributeId", null); // application-independent selection lists in case of template editing
}
emailInteractionEnterOrEditForm.initialize(emailCommandEntry,false);
prepareUserSets(req, emailInteractionEnterOrEditForm, group);
// destination users (no users selectable because refresh does not work; already selected user may be inserted below)
Set<User> users = new HashSet<User>();
if (emailInteractionEnterOrEditForm.getUserId() != null && emailInteractionEnterOrEditForm.getUserId() >= 1){
users.add(emailCommandEntry.getDestinationUser());
}
SortedSet<EmailAddress> userAddresses = EmailAddress.availableAddresses(users);
prepareUser(req, emailInteractionEnterOrEditForm, userAddresses);
CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
Set<EmailCommandEntry> commandEntries = commandEntryManager.getTemplateCommandEntries(group, new EmailCommandEntry());
req.getSession().setAttribute("templates",commandEntries);
req.getSession().setAttribute("interactionGroupName",group.getGroupname());
req.getSession().setAttribute("enterOrEdit", "edit");
req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));