Package evolaris.framework.sys.business.exception

Examples of evolaris.framework.sys.business.exception.InputException


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


   
   
    SmsServiceDbManager smsServiceDbManager = new SmsServiceDbManager(locale,session);
    TimerEvent timerEvent = smsServiceDbManager.getTimerEvent(teForm.getId());
    if (timerEvent == null){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"));
    }
   
    MessageResources resources = getResources(req);
   
    TimerEventExecutionAction.processEvent(req, timerEvent,locale,session,resources);
View Full Code Here

        for (CommandEntry entry : commandEntries) {
          if (entry instanceof SmsCommandEntry){
            SmsCommandEntry smsCommandEntry = (SmsCommandEntry)entry;
            if (smsCommandEntry.getDestinationUserSet() != null || smsCommandEntry.getDestinationGroup() != null){
              ResourceBundle messages = ResourceBundle.getBundle("SmsServices", locale);
              throw new InputException(messages.getString("smssvc.SendingToMoreThanOneUserNotAllowedInTimerEventAppliedToMoreThanOneRequestingUser"));
            }
          }
        }
      }
     
View Full Code Here

   */
  public ActionForward createIncludingInteractions(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    FragmentEnterOrEditForm f = (FragmentEnterOrEditForm)form;
    Fragment oldFragment = entryFromDatabase(f.getId());
    if (oldFragment == null){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"));
    }
    checkAccessRights(req,oldFragment.getGroup(),null);
    req.getSession().setAttribute("oldInteractionListId", oldFragment.getId());
    Set<CommandEntry> commandEntries = oldFragment.getCommandEntries();
    Fragment editedFragment = f.toEntry(new Fragment(), locale, session, getResources(req));
   
    // check for fragment with the same name already here to avoid error messages after selecting the mapping
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    Fragment existingFragment = smsDbManager.getFragment(f.getName(),editedFragment.getGroup());
    if (existingFragment != null){
      throw new InputException(MessageFormat.format(ResourceBundle.getBundle("SmsServices", locale).getString("FragmentP0AlreadyExists"),f.getName()));
    }

    req.getSession().setAttribute("newInteractionList", editedFragment)// needed when we duplicate or come back
   
    // mapping from command entries of the duplication source fragment
View Full Code Here

    MappingSet mappingSet = (MappingSet) mappingSetFromSession;
    mappingSet.reload(locale, session);
   
    Object oldInteractionListId = req.getSession().getAttribute("oldInteractionListId");
    if (oldInteractionListId == null || !(oldInteractionListId instanceof Long)){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"old fragment entry not found in session",null,null);
    }
    Fragment oldFragment = new SmsDbManager(locale,session).getFragment((Long)oldInteractionListId);
    if (oldFragment == null){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"old fragment entry #" + oldInteractionListId + " not found",null,null);
    }
    checkAccessRights(req,oldFragment.getGroup(),null);

    Object newEntry = req.getSession().getAttribute("newInteractionList");
    if (newEntry == null || !(newEntry instanceof Fragment)){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"new fragment entry not found in session",null,null);
    }
   
    // reload references in current session
    Fragment newFragment = (Fragment)newEntry;
    f.initialize(newFragment,locale,session,getResources(req));
View Full Code Here

   */
  protected ActionForward inline(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp){
    FragmentEnterOrEditForm f = (FragmentEnterOrEditForm)form;
    Fragment fragment = entryFromDatabase(f.getId());
    if (fragment == null){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"));
    }
    checkAccessRights(req,fragment.getGroup(),fragment);
    // TODO
    return mapping.findForward("deleted");
  }
View Full Code Here

    req.getSession().setAttribute("applicationId", applicationId);
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    InteractionList interactionList = smsDbManager.getInteractionList(interactionListId);
    if (interactionList == null){  // may happen if the interactionList was deleted in the meantime
      String interactionListDeletedString = getResources(req).getMessage(locale,"smssvc.interactionDefinitionNotPossible");
      throw new InputException(interactionListDeletedString);
    }
    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();
View Full Code Here

    // check access rights
    if (!req.isUserInRole(SmsDbManager.INTERACTION_ADMINISTRATOR)
          || !req.isUserInRole(UserManagerBase.ADMINISTRATOR) && interactionList.getGroup() != webUser.getGroup()
          || interactionList.getGroup() != commandEntry.getGroup()) {
      throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
    }

    // associate the new command entry with the interactionList/service
    Set<InteractionList> interactionLists = new HashSet<InteractionList>(1);
    interactionLists.add(interactionList);
View Full Code Here

    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
   
    InteractionList interactionList = smsDbManager.getInteractionList(interactionListId);
   
    if (interactionList == null){
      throw new InputException(getResources(req).getMessage(locale, "sys.entryNotAvailable"),"id = " + f.getInteractionListId(),null,null);
    }
   
    req.getSession().setAttribute("interactionList", interactionList);
   
    Long msisdn = webUser.getMsisdn();
View Full Code Here

  protected ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {
    IterateInteractionEnterOrEditForm iterateForm = (IterateInteractionEnterOrEditForm)form;
    MessageResources resources = getResources(req);
    IterateCommandEntry commandEntry = (IterateCommandEntry)commandEntryFromRequest(req);
    if(commandEntry == null){
      throw new InputException(resources.getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"));
    }
    checkAccessRights(req, commandEntry.getGroup());
    iterateForm.initialize(commandEntry, locale, session, getResources(req));
    UserSetManager userSetManager = new UserSetManager(locale,session);
    req.getSession().setAttribute("userSets", userSetManager.getUserSets(commandEntry.getGroup()));
View Full Code Here

TOP

Related Classes of evolaris.framework.sys.business.exception.InputException

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.