Package evolaris.framework.smsservices.datamodel

Examples of evolaris.framework.smsservices.datamodel.CommandEntry


  // checks the label of a newly created command entry, associates it with the current keyword/service, then forwards to list
  @Override
  protected ActionForward adaptCreated(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryFromRequest(req, commandEntryManager);
    checkSortLabel(req, commandEntry,interactionListFromSession(req).getCommandEntries());
    associate(req,commandEntryManager, commandEntry);
    return list(mapping,form,req,resp);
  }
View Full Code Here


  // checks the label of a modified command entry, then forwards to list
  @Override
  protected ActionForward adaptModified(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryFromRequest(req, commandEntryManager);
    checkSortLabel(req, commandEntry,interactionListFromSession(req).getCommandEntries());
    return list(mapping,form,req,resp);
  }
View Full Code Here

    }


    long commandEntryId = breakInteractionEnterOrEditForm.getCommandEntryId();
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof BreakCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }

    BreakCommandEntry breakCommandEntry = (BreakCommandEntry)commandEntry;
View Full Code Here

      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;
View Full Code Here

        }
        return result;
      }
    });
    sortedCommandEntries.addAll(commandEntries);
    CommandEntry noTemplate = new CommandEntry();
    noTemplate.setId(-1);
    noTemplate.setSortLabel("("+getResources(req).getMessage(locale,"smssvc.noTemplate")+")");
    sortedCommandEntries.add(noTemplate);
   
    return sortedCommandEntries;
  }
View Full Code Here

      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }
       
    long commandEntryId = f.getCommandEntryId();
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof ContentParseCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }

    ContentParseCommandEntry contentCommandEntry = (ContentParseCommandEntry)commandEntry;
View Full Code Here

    String commandEntryIdParam = req.getParameter("commandEntryId");
    if (commandEntryIdParam == null){
      throw new BugException("missing command entry id parameter");
    }
    long commandEntryId = Long.parseLong(commandEntryIdParam);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null){  // command may have been deleted
      throw new InputException(getResources(req).getMessage(locale,"smssvc.commandEntryNotAvailable"));
    }
    LOGGER.info("distributing edit action according to command entry type: " + commandEntry.getClass().getSimpleName());
    req.setAttribute("commandEntryId",commandEntryId);
   
    if (commandEntry instanceof SmsCommandEntry){
      return mapping.findForward("editSmsTemplate");
    } else if (commandEntry instanceof EmailCommandEntry){
        return mapping.findForward("editEmailTemplate");
    } else if (commandEntry instanceof UpcallCommandEntry) {
      return mapping.findForward("editUpcallTemplate");
    } else if (commandEntry instanceof HttpCommandEntry) {
      return mapping.findForward("editHttpTemplate");
    } else {
      throw new BugException("unsupported command entry type for template: " + commandEntry.getClass().getName());
    }
  }
View Full Code Here

    Set<CommandEntry> oldCommandEntries = oldInvocation.getCommandEntries();
    SortedSet<CommandEntry> sortedOldCommandEntries = new TreeSet<CommandEntry>(new CommandEntryManager.CommandEntryComparator());
    sortedOldCommandEntries.addAll(oldCommandEntries);
    for (CommandEntry oldCommandEntry : sortedOldCommandEntries) {
      CommandEntryExtender extender = commandEntryManager.createCommandEntryExtender(oldCommandEntry);
      CommandEntry duplicatedCommandEntry = extender.duplicateCommandEntry(newInvocation.getGroup(),mappingSet);
      Set<InteractionList> invocations = new TreeSet<InteractionList>();
      invocations.add(newInvocation);
      duplicatedCommandEntry.setInteractionLists(invocations);
      commandEntryManager.create(duplicatedCommandEntry)// also sets the ID for sorting
      newCommandEntries.add(duplicatedCommandEntry);
    }
    newInvocation.setCommandEntries(newCommandEntries);
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
View Full Code Here

    }
    if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && (!req.isUserInRole(SmsDbManager.INTERACTION_ADMINISTRATOR) || webUser.getGroup() != event.getGroup())){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
    }
    SortedSet<CommandEntry> sortedCommandEntries = sortedCommandEntries(event);
    CommandEntry insertCommandEntry = null;
    Long insertId = f.getInsertCommandEntryId();
    int insertionType = f.getInsertionType();
    if (insertId != null && insertId >= 1 && insertionType >= 1){
      CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
      insertCommandEntry = commandEntryManager.getCommandEntry(insertId);
View Full Code Here

   * Check the label of a newly created command entry and associate it with the current timer event, then forward to list
   */
  @Override
  protected ActionForward adaptCreated(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale, session);
    CommandEntry commandEntry = commandEntryFromRequest(req, commandEntryManager);
    checkSortLabel(req, commandEntry,eventFromSession(req).getCommandEntries());
    associate(req, commandEntryManager, commandEntry);
    return list(mapping,form,req,resp);
  }
View Full Code Here

TOP

Related Classes of evolaris.framework.smsservices.datamodel.CommandEntry

Copyright © 2018 www.massapicom. 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.