Package evolaris.platform.smssvc.web.form

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


   *      org.apache.struts.action.ActionForm,
   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward enter(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    InteractionLogInteractionEnterOrEditForm interactionLogForm = (InteractionLogInteractionEnterOrEditForm)form;
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    interactionLogForm.setSortLabel(sortLabelProposalFromSession(req));
    interactionLogForm.setCommandType(0)// default create entry
    interactionLogForm.setParameterSelection(0)// default (empty) constant
    interactionLogForm.setUserSetId(-1)// no user set preselected
    interactionLogForm.setLogContact(false)// logging the contact not required
    req.getSession().setAttribute("enterOrEdit", "enter");
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
    req.getSession().setAttribute("userSets", new UserSetManager(locale,session).getUserSets(group));
    return mapping.findForward("enter");
  }
View Full Code Here


   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {

    InteractionLogInteractionEnterOrEditForm interactionLogForm = (InteractionLogInteractionEnterOrEditForm)form;

    MessageResources resources = getResources(req);
    if (interactionLogForm.getSortLabel() == null ||  interactionLogForm.getSortLabel().equals("")){
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }

    InteractionLogCommandEntry commandEntry = new InteractionLogCommandEntry();
    Group group = groupFromSession(req);
View Full Code Here

    return mapping.findForward("created");
  }

  public ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {

    InteractionLogInteractionEnterOrEditForm interactionLogForm = (InteractionLogInteractionEnterOrEditForm)form;

    InteractionLogCommandEntry commandEntry = (InteractionLogCommandEntry)commandEntryFromRequest(req);
    if(commandEntry == null){
      MessageResources resources = getResources(req);
      throw new InputException(resources.getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"));
    }
    checkAccessRights(req, commandEntry.getGroup());

    interactionLogForm.setCommandEntryId(commandEntry.getId());
    interactionLogForm.setCommandType(commandEntry.getInteractionLogCommandEntryType());
    interactionLogForm.setOperation(commandEntry.getOperation());
    interactionLogForm.setParameterSelection(commandEntry.getInteractionLogCommandEntryType() == 0 ? commandEntry.getParameterFromContent() : null);
    interactionLogForm.setParameter(commandEntry.getParameter());
    interactionLogForm.setUserSetId(commandEntry.getLogUserSet() == null ? -1 : commandEntry.getLogUserSet().getId() );
    if (commandEntry.getLogCurrentUserSet() == 1) {
      interactionLogForm.setUserSetId(-2)
    }
    interactionLogForm.setLogContact(commandEntry.getLogContact() != 0);
    interactionLogForm.setSortLabel(commandEntry.getSortLabel());

    req.getSession().setAttribute("enterOrEdit", "edit");
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
    req.getSession().setAttribute("userSets", new UserSetManager(locale,session).getUserSets(commandEntry.getGroup()));
    return mapping.findForward("edit");
View Full Code Here

   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward modify(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {

    InteractionLogInteractionEnterOrEditForm interactionLogForm = (InteractionLogInteractionEnterOrEditForm)form;

    MessageResources resources = getResources(req);
    if (interactionLogForm.getSortLabel() == null ||  interactionLogForm.getSortLabel().equals("")){
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }


    long commandEntryId = interactionLogForm.getCommandEntryId();
    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof InteractionLogCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
View Full Code Here

TOP

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

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.