Package evolaris.framework.smsservices.datamodel

Examples of evolaris.framework.smsservices.datamodel.CommandEntry


        }
        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 HttpCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
   
    HttpCommandEntry httpCommandEntry = (HttpCommandEntry)commandEntry;
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 BlogCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
   
    BlogCommandEntry blogCommandEntry = (BlogCommandEntry)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 SimpleCommandEntry){
      return mapping.findForward("editSimpleInteraction");
    } else if (commandEntry instanceof SmsCommandEntry){
      return mapping.findForward("editSmsInteraction");
    } else if (commandEntry instanceof EmailCommandEntry){
      return mapping.findForward("editEmailInteraction");
    } else if (commandEntry instanceof UserSetCommandEntry){
      return mapping.findForward("editUserSetInteraction");
    } else if (commandEntry instanceof AccessCheckCommandEntry){
      return mapping.findForward("editAccessCheckInteraction");
    } else if (commandEntry instanceof FragmentCommandEntry){
      return mapping.findForward("editFragmentInteraction");
    } else if (commandEntry instanceof IterateCommandEntry){
      return mapping.findForward("editIterateInteraction");
    } else if (commandEntry instanceof InteractionLogCommandEntry){
      return mapping.findForward("editInteractionLogInteraction");
    } else if (commandEntry instanceof BreakCommandEntry){
      return mapping.findForward("editBreakInteraction");
    } else if (commandEntry instanceof ContentParseCommandEntry){
      return mapping.findForward("editContentParserInteraction");
    } else if (commandEntry instanceof Send2DCodeCommandEntry) {
      return mapping.findForward("editSend2DCodeInteraction");     
    } else if(commandEntry instanceof UpcallCommandEntry){
      return mapping.findForward("editUpcallInteraction")
    } else if(commandEntry instanceof BlogCommandEntry){
      return mapping.findForward("editBlogInteraction")
    } else if(commandEntry instanceof HttpCommandEntry){
      return mapping.findForward("editHttpInteraction")
    } else if(commandEntry instanceof CommentCommandEntry){
      return mapping.findForward("editCommentInteraction")
    } else if(commandEntry instanceof ImageRecognitionCommandEntry){
      return mapping.findForward("editImageRecognitionInteraction")
    } else {
      throw new BugException("unknown command entry type: " + commandEntry.getClass().getName());
    }
  }
View Full Code Here

    Set<CommandEntry> oldCommandEntries = oldFragment.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(newFragment.getGroup(),mappingSet);
      Set<InteractionList> fragments = new TreeSet<InteractionList>();
      fragments.add(newFragment);
      duplicatedCommandEntry.setInteractionLists(fragments);
      commandEntryManager.create(duplicatedCommandEntry)// also sets the ID for sorting
      newCommandEntries.add(duplicatedCommandEntry);
    }
    newFragment.setCommandEntries(newCommandEntries);
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
View Full Code Here

  public ActionForward modify(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    IterateInteractionEnterOrEditForm f = (IterateInteractionEnterOrEditForm)form;
    MessageResources resources = getResources(req);
    long commandEntryId = f.getCommandEntryId();
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof IterateCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
    IterateCommandEntry iterateCommandEntry = (IterateCommandEntry)commandEntry;
    checkAccessRights(req, iterateCommandEntry.getGroup());
View Full Code Here

    Object commandEntryIdParameter = req.getAttribute("commandEntryId");
    if (commandEntryIdParameter == null || !(commandEntryIdParameter instanceof Long)){
      throw new BugException("no command entry id passed to the edit action");
    }
    long commandEntryId = ((Long)commandEntryIdParameter).longValue();
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if(commandEntry == null){
      throw new ConfigurationException("There is no command entry with id: " + commandEntryId + " -> cannot edit the interaction");
    }
    return commandEntry;
  }
View Full Code Here

    InteractionEnterOrEditBaseForm interactionForm = (InteractionEnterOrEditBaseForm)form;

    long commandEntryId = interactionForm.getCommandEntryId();
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.InteractionToBeDeletedDoesNotExistAnymore."),"command entry id = " + commandEntryId,null,null)// may have been deleted
    }
    checkAccessRights(req, commandEntry.getGroup());
    commandEntryManager.delete(commandEntry);
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Command Entry #" + commandEntryId + " has been deleted");

    return mapping.findForward("deleted");
  }
View Full Code Here

  public ActionForward modify(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    FragmentInteractionEnterOrEditForm f = (FragmentInteractionEnterOrEditForm)form;
    MessageResources resources = getResources(req);
    long commandEntryId = f.getCommandEntryId();
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof FragmentCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
    FragmentCommandEntry fragmentCommandEntry = (FragmentCommandEntry)commandEntry;
    checkAccessRights(req, fragmentCommandEntry.getGroup());
View Full Code Here

    }
    if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && (!req.isUserInRole(SmsDbManager.INTERACTION_ADMINISTRATOR) || webUser.getGroup() != interactionList.getGroup())){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
    }
    SortedSet<CommandEntry> sortedCommandEntries = sortedCommandEntries(interactionList);
    CommandEntry insertCommandEntry = null;
    Long insertId = interactionListForm.getInsertCommandEntryId();
    int insertionType = interactionListForm.getInsertionType();
    if (insertId != null && insertId >= 1 && insertionType >= 1){
      CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
      insertCommandEntry = commandEntryManager.getCommandEntry(insertId);
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.