Package evolaris.platform.smssvc.web.form

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


   *      org.apache.struts.action.ActionForm,
   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward enter(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    ImageRecognitionInteractionEnterOrEditForm f = (ImageRecognitionInteractionEnterOrEditForm)form;
    f.setSortLabel(sortLabelProposalFromSession(req));
    req.getSession().setAttribute("enterOrEdit", "enter");
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
    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) {

    ImageRecognitionInteractionEnterOrEditForm f = (ImageRecognitionInteractionEnterOrEditForm)form;

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

   
    ImageRecognitionCommandEntry commandEntry = new ImageRecognitionCommandEntry();
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    commandEntry.setGroup(group);
    commandEntry.setSortLabel(f.getSortLabel());
    commandEntry.setFolderSuffix(Integer.parseInt(f.getFolderSuffix()));
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Created image recognition entry ");
    setCommandEntryInRequest(req, commandEntry);
    return mapping.findForward("created");
  }
View Full Code Here

    return mapping.findForward("created");
  }

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

    ImageRecognitionInteractionEnterOrEditForm f = (ImageRecognitionInteractionEnterOrEditForm)form;

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

    f.setCommandEntryId(commandEntry.getId());
    f.setSortLabel(commandEntry.getSortLabel());
    f.setFolderSuffix(Integer.toString(commandEntry.getFolderSuffix()));

    req.getSession().setAttribute("enterOrEdit", "edit");
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
    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)  {

    ImageRecognitionInteractionEnterOrEditForm f = (ImageRecognitionInteractionEnterOrEditForm)form;

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


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

    ImageRecognitionCommandEntry commentCommandEntry = (ImageRecognitionCommandEntry)commandEntry;
    checkAccessRights(req, commentCommandEntry.getGroup());
    commandEntryManager.evict(commentCommandEntry)// do not modify in this session yet (might be erroneous)

    commentCommandEntry.setSortLabel(f.getSortLabel());
    commentCommandEntry.setFolderSuffix(Integer.parseInt(f.getFolderSuffix()));
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": comment entry #" + commandEntryId + " has been modified;");
    setCommandEntryInRequest(req, commentCommandEntry);
    return mapping.findForward("modified");
  }
View Full Code Here

TOP

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

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.