Package evolaris.platform.smssvc.web.form

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


   * @see evolaris.framework.sys.web.action.EnterEditDuplicateAction#enter(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected ActionForward enter(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    ActionForward actionForward = super.enter(mapping, form, req, resp)// initializes also group ID in form
    TimerEventEnterOrEditForm f = (TimerEventEnterOrEditForm)form;
    requestingUserAndUserSetPreparation(f, groupPreparation(req, f.getGroupId()), req);
    f.setOwningUserId(webUser.getId());
    if (f.getGroupId() == webUser.getGroup().getId()){
      f.setRequestingUserId(webUser.getId());
    }
    return actionForward;
  }
View Full Code Here


   * @see EnterEditDuplicateAction#create(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
   */
  @SuppressWarnings("unchecked")
  public ActionForward create(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    if ("duplicate".equals(req.getSession().getAttribute("task"))) {
      TimerEventEnterOrEditForm f = (TimerEventEnterOrEditForm)form;
      f.setOwningUserId(webUser.getId());
    }
    return super.create(mapping, form, req, resp);
  }
View Full Code Here

   *      org.apache.struts.action.ActionForm,
   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward createIncludingInteractions(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    TimerEventEnterOrEditForm f = (TimerEventEnterOrEditForm)form;
   
    TimerEvent oldTimerEvent = entryFromDatabase(f.getId());
    if (oldTimerEvent == null){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"));
    }
    checkAccessRights(req,oldTimerEvent.getGroup(),null);
    req.getSession().setAttribute("oldInteractionListId", oldTimerEvent.getId());
    Set<CommandEntry> commandEntries = oldTimerEvent.getCommandEntries();
    f.setOwningUserId(webUser.getId());
    TimerEvent editedTimerEvent = f.toEntry(new TimerEvent(), locale, session, getResources(req));
    req.getSession().setAttribute("newTimerEvent", editedTimerEvent)// needed when we duplicate or come back
   
    // mapping from command entries of the duplication source
    MappingSet mappingSet = new MappingSet(commandEntries,editedTimerEvent.getGroup(), locale, session);
   
View Full Code Here

   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  protected ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    ActionForward actionForward = super.edit(mapping, form, req, resp);
    TimerEventEnterOrEditForm f = (TimerEventEnterOrEditForm)form;
    requestingUserAndUserSetPreparation(f, groupPreparation(req, f.getGroupId()), req);
    TimerEvent 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

  /**
   * 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)
   */
  public ActionForward reeditContinue(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp){
    TimerEventEnterOrEditForm f = (TimerEventEnterOrEditForm)form;
    Object newEntry = req.getSession().getAttribute("newTimerEvent");
    if (newEntry == null || !(newEntry instanceof TimerEvent)){
      return mapping.findForward("cancelled");
    }
    f.initialize((TimerEvent)newEntry,locale,session,getResources(req));
    return mapping.findForward("continue");
  }
View Full Code Here

  /**
   * Creates timer event 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)
   */
  protected ActionForward duplicateBasedOnMappingSet(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp){
    TimerEventEnterOrEditForm f = (TimerEventEnterOrEditForm)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 oldTimerEventId = req.getSession().getAttribute("oldInteractionListId");
    if (oldTimerEventId == null || !(oldTimerEventId instanceof Long)){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"old timer event entry not found in session",null,null);
    }
    TimerEvent oldTimerEvent = new SmsServiceDbManager(locale,session).getTimerEvent((Long)oldTimerEventId);
    if (oldTimerEvent == null){
      throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"),"old timer event entry #" + oldTimerEventId + " not found",null,null);
    }
    checkAccessRights(req,oldTimerEvent.getGroup(),null);

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

   * default method refreshes
   */
  @Override
  protected ActionForward defaultMethod(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    super.defaultMethod(mapping, form, req, resp);
    TimerEventEnterOrEditForm f = (TimerEventEnterOrEditForm)form;
    requestingUserAndUserSetPreparation(f, groupPreparation(req, f.getGroupId()), req);
    return mapping.findForward("continue");
  }
View Full Code Here

TOP

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

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.