Examples of UpcallCommandEntry


Examples of evolaris.framework.smsservices.datamodel.UpcallCommandEntry

      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.framework.smsservices.datamodel.UpcallCommandEntry

   * @see evolaris.platform.smssvc.web.action.InteractionEnterOrEditBaseAction#edit(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
   
    UpcallCommandEntry commandEntry = (UpcallCommandEntry)commandEntryFromRequest(req);
    if(commandEntry == null){
      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();
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.UpcallCommandEntry

    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.framework.smsservices.datamodel.UpcallCommandEntry

 
  private TreeSet<CommandEntry> getSortedCommandEntries(HttpServletRequest req){
    // template selector: first set content from the template, if selected; content will be changed later if not allowed (except destination group, which  has to be checked explicitly)

    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    Set<UpcallCommandEntry> commandEntries = commandEntryManager.getTemplateCommandEntries(groupFromSession(req), new UpcallCommandEntry());
    TreeSet<CommandEntry> sortedCommandEntries = new TreeSet<CommandEntry>(new Comparator<CommandEntry>(){
      public int compare(CommandEntry o1, CommandEntry o2) {
        String leftName = o1.getSortLabel();
        String rightName = o2.getSortLabel();
        if (leftName.startsWith("(") && !rightName.startsWith("(")) {  // "(no template)" first in list
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.UpcallCommandEntry

    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    Set<CommandEntry> templates = commandEntryManager.getTemplateCommandEntries(groupToDisplay, null);
    DisplayableInteractionContent[] interactions = null;
    SortedSet<CommandEntry> sortedCommandEntries = new TreeSet<CommandEntry>(new CommandEntryManager.TemplateCommandEntryComparator());
    for (CommandEntry entry : templates) {
      if(!req.isUserInRole(SmsDbManager.INTERACTION_ADMINISTRATOR) && entry.getClass().isInstance(new UpcallCommandEntry())
          || !req.isUserInRole(SmsDbManager.SMS_SENDER) && entry.getClass().isInstance(new SmsCommandEntry())
          || !req.isUserInRole(SmsDbManager.EMAIL_SENDER) && entry.getClass().isInstance(new EmailCommandEntry())){
        // only users in role interaction_administrator are allowed to view upcall command templates,
        // users in roles sms_sender / email_sender are allowed to see sms / email templates
      } else {
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.