Package evolaris.framework.smsservices.datamodel

Examples of evolaris.framework.smsservices.datamodel.CommandEntry


  protected CommandEntry commandEntryFromRequest(HttpServletRequest req, CommandEntryManager commandEntryManager) {
    Object commandEntryParameter = req.getAttribute("commandEntry");
    if (commandEntryParameter == null || !(commandEntryParameter instanceof CommandEntry)){
      throw new BugException("no command entry returned by the interaction enter action");
    }
    CommandEntry commandEntry = (CommandEntry)commandEntryParameter;
    CommandEntryExtender commandEntryExtender = commandEntryManager.createCommandEntryExtender(commandEntry);
    commandEntryExtender.reloadReferences()// reload outdated references
    // check access rights
    if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && commandEntry.getGroup() != webUser.getGroup()) {
      throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
    }
    commandEntryManager.createOrModify(commandEntry);
    req.setAttribute("insertionPointId", commandEntry.getId());
    return commandEntry;
  }
View Full Code Here


  public CommandEntry insertionPointFromRequest(HttpServletRequest req,CommandEntry defaultInsertionPoint){
    Object insertionPointIdParameter = req.getAttribute("insertionPointId");
    if (insertionPointIdParameter != null && insertionPointIdParameter instanceof Long){
      long insertionPointId = (Long)insertionPointIdParameter;
      CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
      CommandEntry commandEntry = commandEntryManager.getCommandEntry(insertionPointId);
      if (commandEntry != null){
        return commandEntry;
      }
    }
    return defaultInsertionPoint;
View Full Code Here

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

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

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

    Set<CommandEntry> oldCommandEntries = oldTimerEvent.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(newTimerEvent.getGroup(),mappingSet);
      Set<TimerEvent> timerEvents = new TreeSet<TimerEvent>();
      timerEvents.add(newTimerEvent);
      duplicatedCommandEntry.setTimerEvents(timerEvents);
      commandEntryManager.create(duplicatedCommandEntry)// also sets the ID for sorting
      newCommandEntries.add(duplicatedCommandEntry);
    }
    newTimerEvent.setCommandEntries(newCommandEntries);
    new SmsServiceDbManager(locale,session).createTimerEvent(newTimerEvent);
View Full Code Here

   */
  public ActionForward modify(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    EmailInteractionEnterOrEditForm f = (EmailInteractionEnterOrEditForm) form;
    long commandEntryId = f.getCommandEntryId();
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof EmailCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
    EmailCommandEntry emailCommandEntry = (EmailCommandEntry)commandEntry;
    Group group = emailCommandEntry.getGroup();
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.