Package evolaris.platform.smssvc.web.form

Examples of evolaris.platform.smssvc.web.form.InvocationEnterOrEditForm$SelectableEmail


   *      org.apache.struts.action.ActionForm,
   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward createIncludingInteractions(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    InvocationEnterOrEditForm f = (InvocationEnterOrEditForm)form;
    Invocation oldInvocation = entryFromDatabase(f.getId());
    if (oldInvocation == null){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"));
    }
    checkAccessRights(req,oldInvocation.getGroup(),null);
    req.getSession().setAttribute("oldInteractionListId", oldInvocation.getId());
    Set<CommandEntry> commandEntries = oldInvocation.getCommandEntries();
    Invocation editedInvocation = f.toEntry(new Invocation(), locale, session, getResources(req));
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    req.getSession().setAttribute("newInteractionList", editedInvocation)// needed when we duplicate or come back
    smsDbManager.checkInvocationUniqueness(editedInvocation,false);
    smsDbManager.checkIfInvocationAllowed(editedInvocation,false);
   
View Full Code Here


  /**
   * Method executed for "method" parameter "continue"
   * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  protected ActionForward reeditContinue(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp){
    InvocationEnterOrEditForm f = (InvocationEnterOrEditForm)form;
    Object newEntry = req.getSession().getAttribute("newInteractionList");
    if (newEntry == null || !(newEntry instanceof Invocation)){
      return mapping.findForward("cancelled");
    }
    Invocation invocation = (Invocation)newEntry;
    f.initialize(invocation,locale,session,getResources(req));
    prepareSelectionLists(form,req,invocation.getMsisdn(),invocation.getEmail());
    return mapping.findForward("continue");
  }
View Full Code Here

   * Creates invocation entry with interactions based on mapping set in session
   * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected ActionForward duplicateBasedOnMappingSet(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp){
    InvocationEnterOrEditForm f = (InvocationEnterOrEditForm)form;
    // get mappings from session
    Object mappingSetFromSession = req.getSession().getAttribute("mappingSet");
    if (!(mappingSetFromSession instanceof MappingSet)) {
      throw new BugException("invalid mappingSet parameter: " + mappingSetFromSession);
    }
    MappingSet mappingSet = (MappingSet) mappingSetFromSession;
    mappingSet.reload(locale, session);
   
    Object oldInvocationId = req.getSession().getAttribute("oldInteractionListId");
    if (oldInvocationId == null || !(oldInvocationId instanceof Long)){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"old invocation entry not found in session",null,null);
    }
    Invocation oldInvocation = new SmsDbManager(locale,session).getInvocation((Long)oldInvocationId);
    if (oldInvocation == null){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"old invocation entry #" + oldInvocationId + " not found",null,null);
    }
    checkAccessRights(req,oldInvocation.getGroup(),null);

    Object newEntry = req.getSession().getAttribute("newInteractionList");
    if (newEntry == null || !(newEntry instanceof Invocation)){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"new invocation entry not found in session",null,null);
    }
   
    // reload references in current session
    Invocation newInvocation = (Invocation)newEntry;
    f.initialize(newInvocation,locale,session,getResources(req));
    newInvocation = new Invocation();
    f.toEntry(newInvocation, locale, session, getResources(req));
    checkAccessRights(req, newInvocation.getGroup(),null);
   
    // group assignment is not editable => perform source to destination automatically
    mappingSet.add(new Entry(oldInvocation.getGroup()), new Entry(newInvocation.getGroup()));
   
View Full Code Here

   * @see evolaris.framework.sys.web.action.EnterEditDuplicateAction#edit(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    ActionForward actionForward = super.edit(mapping, form, req, resp);
    InvocationEnterOrEditForm f = (InvocationEnterOrEditForm)form;
    Invocation entry = entryFromDatabase(f.getId());
    prepareSelectionLists(form,req,entry.getMsisdn(),entry.getEmail());
    return actionForward;
  }
View Full Code Here

    return actionForward;
  }

  // prepares selection lists in session; optional storedMsisdn and storedEmail can be provided to always be included in the lists
  private void prepareSelectionLists(ActionForm form,HttpServletRequest req,Long storedMsisdn,String storedEmail) {
    InvocationEnterOrEditForm f = (InvocationEnterOrEditForm)form;
    Group group = groupPreparation(req, f.getGroupId());
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    SortedSet<InvocationEnterOrEditForm.SelectableMsisdn> selectableMsisdns = new TreeSet<InvocationEnterOrEditForm.SelectableMsisdn>();
    SortedSet<InvocationEnterOrEditForm.SelectableEmail> selectableEmails = new TreeSet<InvocationEnterOrEditForm.SelectableEmail>();
    String storedMsisdnLabel = null;
    String storedEmailLabel = null;
View Full Code Here

   * @see evolaris.framework.sys.web.action.EnterEditDuplicateAction#defaultMethod(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected ActionForward defaultMethod(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    ActionForward actionForward = super.defaultMethod(mapping, form, req, resp);
    InvocationEnterOrEditForm f = (InvocationEnterOrEditForm)form;
    Invocation entry = entryFromDatabase(f.getId());
    prepareSelectionLists(form, req, entry != null ? entry.getMsisdn() : null,entry != null ? entry.getEmail() : null);
    return actionForward;
  }
View Full Code Here

TOP

Related Classes of evolaris.platform.smssvc.web.form.InvocationEnterOrEditForm$SelectableEmail

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.