* org.apache.struts.action.ActionForm,
* javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
public ActionForward modify(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {
UpcallInteractionEnterOrEditForm upcallForm = (UpcallInteractionEnterOrEditForm)form;
MessageResources resources = getResources(req);
if (upcallForm.getSortLabel() == null || upcallForm.getSortLabel().equals("")){
throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
}
long commandEntryId = upcallForm.getCommandEntryId();
CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
if (commandEntry == null || !(commandEntry instanceof UpcallCommandEntry)){
throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore")); // may have been deleted
}
UpcallCommandEntry upcallCommandEntry = (UpcallCommandEntry)commandEntry;
checkAccessRights(req, upcallCommandEntry.getGroup());
commandEntryManager.evict(upcallCommandEntry); // do not modify in this session yet (might be erroneous)
upcallCommandEntry.setSortLabel(upcallForm.getSortLabel());
upcallCommandEntry.setJndiName(upcallForm.getJndiName());
upcallCommandEntry.setParameter1(upcallForm.getParameter1());
upcallCommandEntry.setParameter2(upcallForm.getParameter2());
upcallCommandEntry.setParameter3(upcallForm.getParameter3());
upcallCommandEntry.setParameter4(upcallForm.getParameter4());
upcallCommandEntry.setParameter5(upcallForm.getParameter5());
LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Modified upcall entry. id: " + upcallCommandEntry.getId() + " JNDI: " + upcallCommandEntry.getJndiName() + " interaction log message: " + " Parameter 1: " + upcallCommandEntry.getParameter1() + " Parameter 2: "
+ upcallCommandEntry.getParameter2() + " Parameter 3: "+ upcallCommandEntry.getParameter3() + " Parameter 4: "+ upcallCommandEntry.getParameter4() + " Parameter 5: "+ upcallCommandEntry.getParameter5());
setCommandEntryInRequest(req, upcallCommandEntry);
return mapping.findForward("modified");
}