Examples of UpcallInteractionEnterOrEditForm


Examples of evolaris.platform.smssvc.web.form.UpcallInteractionEnterOrEditForm

   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward enter(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
   
    UpcallInteractionEnterOrEditForm upcallForm = (UpcallInteractionEnterOrEditForm)form;
   
    upcallForm.setSortLabel(sortLabelProposalFromSession(req));
   
    req.getSession().setAttribute("enterOrEdit", "enter");
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
    req.getSession().setAttribute("templates",getSortedCommandEntries(req));
   
View Full Code Here

Examples of evolaris.platform.smssvc.web.form.UpcallInteractionEnterOrEditForm

   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward create(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"));
    }
   
    if (upcallForm.getJndiName() == null || upcallForm.getJndiName().equals("")) {
      throw new InputException(resources.getMessage(locale, "smssvc.NameMustBeProvided"));
    }
   
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    UpcallCommandEntry upcallCommandEntry = new UpcallCommandEntry();
    upcallCommandEntry.setGroup(group);
    upcallCommandEntry.setJndiName(upcallForm.getJndiName());
    upcallCommandEntry.setSortLabel(upcallForm.getSortLabel());
    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() + ": Created 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("created");
View Full Code Here

Examples of evolaris.platform.smssvc.web.form.UpcallInteractionEnterOrEditForm

      MessageResources resources = getResources(req);
      throw new InputException(resources.getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"));
    }
    checkAccessRights(req, commandEntry.getGroup());
   
    UpcallInteractionEnterOrEditForm upcallForm = (UpcallInteractionEnterOrEditForm)form;
    upcallForm.setCommandEntryId(commandEntry.getId());
    upcallForm.setSortLabel(commandEntry.getSortLabel());
    upcallForm.setJndiName(commandEntry.getJndiName());
    upcallForm.setParameter1(commandEntry.getParameter1());
    upcallForm.setParameter2(commandEntry.getParameter2());
    upcallForm.setParameter3(commandEntry.getParameter3());
    upcallForm.setParameter4(commandEntry.getParameter4());
    upcallForm.setParameter5(commandEntry.getParameter5());
   
    req.getSession().setAttribute("enterOrEdit", "edit");
    req.getSession().setAttribute("groupId", commandEntry.getGroup().getId()); // the groupId is used by the method getSortedCommandEntries
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
    TreeSet<CommandEntry> sortedCommandEntries = getSortedCommandEntries(req);
    req.getSession().setAttribute("templates",sortedCommandEntries);
   
    Long selectedTemplateId = upcallForm.getTemplateId();
    upcallForm.setTemplateId(-1L)// none selected
    if (selectedTemplateId != null && selectedTemplateId != -1){
      // only use the selected template if it is assigned to the selected group
      for (CommandEntry entry : sortedCommandEntries) {
        if (entry.getId() == selectedTemplateId) {
          applyTemplate((UpcallCommandEntry)entry, upcallForm);
View Full Code Here

Examples of evolaris.platform.smssvc.web.form.UpcallInteractionEnterOrEditForm

   *      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");
  }
View Full Code Here

Examples of evolaris.platform.smssvc.web.form.UpcallInteractionEnterOrEditForm

    form.setParameter4(entry.getParameter4());
    form.setParameter5(entry.getParameter5());
  }
 
  protected ActionForward defaultMethod(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    UpcallInteractionEnterOrEditForm upcallForm = (UpcallInteractionEnterOrEditForm)form;
   
    if(upcallForm.getCommandEntryId() == 0){ // 0 means that the command entry doesn't exist in the database
      Long selectedTemplateId = upcallForm.getTemplateId();
      upcallForm.setTemplateId(-1L)// none selected
      if (selectedTemplateId != null && selectedTemplateId != -1){
        // only use the selected template if it is assigned to the selected group
        TreeSet<CommandEntry> sortedCommandEntries = getSortedCommandEntries(req);
        for (CommandEntry entry : sortedCommandEntries) {
          if (entry.getId() == selectedTemplateId) {
            applyTemplate((UpcallCommandEntry)entry, upcallForm);
            break;
          }
        }
      }
      return enter(mapping, form, req, resp);
     
    } else {
      req.setAttribute("commandEntryId",upcallForm.getCommandEntryId());
      return mapping.findForward("updated");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.