Package evolaris.platform.smssvc.web.form

Examples of evolaris.platform.smssvc.web.form.FragmentEnterOrEditForm


   *      org.apache.struts.action.ActionForm,
   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  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


  /**
   * 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){
    FragmentEnterOrEditForm f = (FragmentEnterOrEditForm)form;
    Object newEntry = req.getSession().getAttribute("newInteractionList");
    if (newEntry == null || !(newEntry instanceof InteractionList)){
      return mapping.findForward("cancelled");
    }
    f.initialize((Fragment)newEntry,locale,session,getResources(req));
    return mapping.findForward("continue");
  }
View Full Code Here

   * Creates fragment 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){
    FragmentEnterOrEditForm f = (FragmentEnterOrEditForm)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 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));
    newFragment = new Fragment();
    f.toEntry(newFragment, locale, session, getResources(req));
    checkAccessRights(req, newFragment.getGroup(),null);
   
    // group assignment is not editable => perform source to destination automatically
    mappingSet.add(new Entry(oldFragment.getGroup()), new Entry(newFragment.getGroup()));
   
View Full Code Here

  /**
   * Inlines fragment interactions and delete the fragment
   * @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 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
View Full Code Here

TOP

Related Classes of evolaris.platform.smssvc.web.form.FragmentEnterOrEditForm

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.