Examples of BreakCommandEntry


Examples of evolaris.framework.smsservices.datamodel.BreakCommandEntry

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

    BreakCommandEntry commandEntry = new BreakCommandEntry();
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    commandEntry.setGroup(group);
    commandEntry.setResultString(breakInteractionEnterOrEditForm.getResultString().length() == 0 ? null : breakInteractionEnterOrEditForm.getResultString())// empty input => null
    commandEntry.setSortLabel(breakInteractionEnterOrEditForm.getSortLabel());
    commandEntry.setTypeOfBreak(breakInteractionEnterOrEditForm.getTypeOfBreak());
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Created break entry with result value: `" + breakInteractionEnterOrEditForm.getResultString() + "`");
    setCommandEntryInRequest(req, commandEntry);
    return mapping.findForward("created");
  }
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.BreakCommandEntry

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

    BreakInteractionEnterOrEditForm breakInteractionEnterOrEditForm = (BreakInteractionEnterOrEditForm)form;

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

    breakInteractionEnterOrEditForm.setCommandEntryId(commandEntry.getId());
    breakInteractionEnterOrEditForm.setResultString(commandEntry.getResultString()==null?"":commandEntry.getResultString());
    breakInteractionEnterOrEditForm.setSortLabel(commandEntry.getSortLabel());
    breakInteractionEnterOrEditForm.setTypeOfBreak(commandEntry.getTypeOfBreak());

    req.getSession().setAttribute("enterOrEdit", "edit");
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
    return mapping.findForward("edit");
  }
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.BreakCommandEntry

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

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

    breakCommandEntry.setSortLabel(breakInteractionEnterOrEditForm.getSortLabel());
    breakCommandEntry.setResultString(breakInteractionEnterOrEditForm.getResultString().length() == 0?null:breakInteractionEnterOrEditForm.getResultString());
    breakCommandEntry.setTypeOfBreak(breakInteractionEnterOrEditForm.getTypeOfBreak());
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Break  entry #" + commandEntryId + " has been modified to result value: " + breakCommandEntry.getResultString());
    setCommandEntryInRequest(req, breakCommandEntry);
    return mapping.findForward("modified");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.