Package evolaris.framework.smsservices.datamodel

Examples of evolaris.framework.smsservices.datamodel.HttpCommandEntry


    MessageResources resources = getResources(req);
    if (f.getSortLabel() == null ||  f.getSortLabel().equals("")) {
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }
   
    HttpCommandEntry commandEntry = new HttpCommandEntry();
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    commandEntry.setGroup(group);
    commandEntry.setSortLabel(f.getSortLabel());
    commandEntry.setUrl(f.getUrl());
    commandEntry.setNofEvaluatedResponseLetters(Integer.parseInt(f.getNofEvaluatedResponseLetters()));
    LOGGER.info("User " + UserManagerBase.toString(webUser) + ": Created new http interaction");
    setCommandEntryInRequest(req, commandEntry);
    return mapping.findForward("created");
  }
View Full Code Here


  }

  public ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {
    HttpInteractionEnterOrEditForm f = (HttpInteractionEnterOrEditForm)form;
   
    HttpCommandEntry commandEntry = (HttpCommandEntry)commandEntryFromRequest(req);
    if(commandEntry == null){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"));
    }
    checkAccessRights(req, commandEntry.getGroup());
   
    f.setCommandEntryId(commandEntry.getId());
    f.setSortLabel(commandEntry.getSortLabel());
    f.setUrl(commandEntry.getUrl());
    f.setNofEvaluatedResponseLetters(commandEntry.getNofEvaluatedResponseLetters() + "");
    req.getSession().setAttribute("enterOrEdit", "edit");
    req.getSession().setAttribute("groupId", commandEntry.getGroup().getId()); // the groupId is used by the method getSortedCommandEntries
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
    TreeSet<CommandEntry> sortedCommandEntries = getSortedCommandEntries(req);
    req.getSession().setAttribute("templates",sortedCommandEntries);
   
    Long selectedTemplateId = f.getTemplateId();
View Full Code Here

  // gets sorted template command entries
  private TreeSet<CommandEntry> getSortedCommandEntries(HttpServletRequest req){
    // template selector: first set content from the template, if selected; content will be changed later if not allowed (except destination group, which  has to be checked explicitly)

    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    Set<HttpCommandEntry> commandEntries = commandEntryManager.getTemplateCommandEntries(groupFromSession(req), new HttpCommandEntry());
    TreeSet<CommandEntry> sortedCommandEntries = new TreeSet<CommandEntry>(new Comparator<CommandEntry>(){
      public int compare(CommandEntry o1, CommandEntry o2) {
        String leftName = o1.getSortLabel();
        String rightName = o2.getSortLabel();
        if (leftName.startsWith("(") && !rightName.startsWith("(")) {  // "(no template)" first in list
View Full Code Here

    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof HttpCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
   
    HttpCommandEntry httpCommandEntry = (HttpCommandEntry)commandEntry;
    checkAccessRights(req, httpCommandEntry.getGroup());
    commandEntryManager.evict(httpCommandEntry)// do not modify in this session yet (might be erroneous)

    httpCommandEntry.setSortLabel(f.getSortLabel());
    httpCommandEntry.setUrl(f.getUrl());
    httpCommandEntry.setNofEvaluatedResponseLetters(Integer.parseInt(f.getNofEvaluatedResponseLetters()))
    LOGGER.info("User " + UserManagerBase.toString(webUser) + ": http interaction entry with id: " + commandEntryId + " has been modified");
    setCommandEntryInRequest(req, httpCommandEntry);
    return mapping.findForward("modified");
  }
View Full Code Here

TOP

Related Classes of evolaris.framework.smsservices.datamodel.HttpCommandEntry

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.