Package evolaris.framework.async.datamodel

Examples of evolaris.framework.async.datamodel.InteractionList


    long interactionListId = ((Long)interactionListIdParam).longValue();
    if (interactionListId == -1) {
      throw new BugException("interactionList id -1 in session");
    }
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    InteractionList interactionList = smsDbManager.getInteractionList(interactionListId);
    if(interactionList == null) {
      throw new ConfigurationException("There is no interactionList with id: " + interactionListId + " -> cannot add a new interaction");
    }
    if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && (!req.isUserInRole(SmsDbManager.INTERACTION_ADMINISTRATOR) || webUser.getGroup() != interactionList.getGroup())){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
    }   
    LOGGER.debug("interaction list from session: id="+ interactionList.getId() + "; group=`" + interactionList.getGroup().getGroupname() + "`; class=" + interactionList.getClass().getName());
    return interactionList;
  }
View Full Code Here


    InteractionListForm interactionListForm = (InteractionListForm) form;
    String idParam = req.getParameter("id");
    if (idParam != null) {
      req.getSession().setAttribute("interactionListId", new Long(idParam)); // required for command entries
    }
    InteractionList interactionList = interactionListFromSession(req);

    // page title and information according to actual type; must be extended for additional types!
    MessageResources resources = getResources(req);
    if (interactionList instanceof Invocation) {
      Invocation invocation = (Invocation) interactionList;
      req.setAttribute("title",resources.getMessage(locale,"smssvc.EditServiceInteractions"));
      req.setAttribute("information1Title",resources.getMessage(locale,"smssvc.MSISDN") + " / " + resources.getMessage(locale,"smssvc.Keywords"));
      req.setAttribute("information1Value",invocation.getMsisdn() == null ? "" : (invocation.getMsisdn() + (invocation.getKeywords() == null ? "" : (" / " + invocation.getKeywords()))));
      req.setAttribute("information2Title",resources.getMessage(locale,"smssvc.ServiceId") + " / " + resources.getMessage(locale,"smssvc.Authentication"));
      req.setAttribute("information2Value",invocation.getServiceId() == null ? "" : (invocation.getServiceId() + (invocation.getAuthenticationKey() == null ? "" : (" / " + invocation.getAuthenticationKey()))));
      req.getSession().setAttribute("interactionListType", "invocation")// required for cancelling
    } else if (interactionList instanceof Fragment){
      Fragment fragment = (Fragment)interactionList;
      req.setAttribute("title",resources.getMessage(locale,"smssvc.EditFragmentInteractions"));
      req.setAttribute("information1Title", resources.getMessage(locale,"smssvc.FragmentName"));
      req.setAttribute("information1Value",fragment.getFragmentName());
      req.setAttribute("information2Title", null)// second line not used
      req.getSession().setAttribute("interactionListType", "fragment")// required for cancelling
    } else {
      throw new BugException("can't do anything with list of type: " + interactionList.getClass().getName());
    }
   
    req.setAttribute("interactionList", interactionList);
    interactionListForm.setGroupId(interactionList.getGroup().getId());   
    req.getSession().setAttribute("groupId", interactionList.getGroup().getId());
   
    interactionListForm.setInteractionListId(interactionList.getId());
    SortedSet<CommandEntry> sortedCommandEntries = sortedCommandEntries(interactionList);
    List<DisplayableInteractionContent> displayableInteractions = buildInteractionList(req, interactionList.getGroup(), sortedCommandEntries,interactionList instanceof Fragment, Boolean.TRUE.equals(interactionListForm.getExpandFragments()));
    req.setAttribute("interactions",displayableInteractions);
    long defaultInsertionPointId = sortedCommandEntries.size() == 0 ? 0L :  insertionPointFromRequest(req, sortedCommandEntries.last()).getId();
    interactionListForm.setInsertCommandEntryId(defaultInsertionPointId);
    interactionListForm.setInsertionType(2);
    req.setAttribute("commandEntries", sortedCommandEntries);
View Full Code Here

    }
    req.getSession().setAttribute("interactionListId", interactionListId);
    req.getSession().setAttribute("groupId", groupId);
    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();
View Full Code Here

    }
    long interactionListId = ((Long)interactionListIdParameter).longValue();
    if (interactionListId == -1){
      throw new BugException("interactionList id -1 in session");
    }
    InteractionList interactionList = smsDbManager.getInteractionList(interactionListId);
    if(interactionList == null){
      throw new ConfigurationException("There is no interactionList with id: " + interactionListId + " -> cannot add a new interaction");
    }

    // 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);
    commandEntry.setInteractionLists(interactionLists);
    commandEntryManager.modify(commandEntry);
    Set<CommandEntry> commandEntries = interactionList.getCommandEntries();
    commandEntries.add(commandEntry);
    interactionList.setCommandEntries(commandEntries)// necessary to receive complete list already within this session
    LOGGER.info("associated command entry #" + commandEntry.getId() + " with interactionList entry " + interactionListId);
  }
View Full Code Here

    InteractionListForm f = (InteractionListForm) form;
   
    Long interactionListId = f.getInteractionListId();
    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);
    }
   
View Full Code Here

   * @req  HTTP servlet request
   * @return an object extending the EventParameters class; null => list will never be executed directly (fragment)
   */
  @Override
  public EventParameters dummyEventParametersForList(HttpServletRequest req){
    InteractionList interactionList = interactionListFromSession(req);
    if (interactionList instanceof Invocation){  // used for services, SMS- and Email
      Invocation invocation = (Invocation)interactionList;
      if (invocation.getMsisdn() != null){
        return new SmsEventParameters(locale,session,null,null,null);
      }
View Full Code Here

    long interactionListId = ((Long)interactionListIdParam).longValue();
    if (interactionListId == -1) {
      throw new BugException("interactionList id -1 in session");
    }
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    InteractionList interactionList = smsDbManager.getInteractionList(interactionListId);
    if(interactionList == null) {
      throw new ConfigurationException("There is no interactionList with id: " + interactionListId + " -> cannot add a new interaction");
    }
    if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && (!req.isUserInRole(SmsDbManager.INTERACTION_ADMINISTRATOR) || webUser.getGroup() != interactionList.getGroup())){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
    }   
    return interactionList;
  }
View Full Code Here

   */
  @Override
  protected ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    ActionForward actionForward = super.edit(mapping, form, req, resp);
    EnterEditDuplicateForm f = (EnterEditDuplicateForm)form;
    InteractionList entry = entryFromDatabase(f.getId());
    if (entry == null){
      throw new InputException(getLocalizedMessage("SystemWeb", "sys.entryNotAvailable"),"id = " + f.getId(),null,null);
    }
    req.getSession().setAttribute("deleteMode", entry.getCommandEntries().size() == 0 ? "delete" : "deleteIncludingInteractions");   
    return actionForward;
  }
View Full Code Here

TOP

Related Classes of evolaris.framework.async.datamodel.InteractionList

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.