Package evolaris.framework.async.datamodel

Examples of evolaris.framework.async.datamodel.FragmentCommandEntry


  public ActionForward create(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp)  {
    FragmentInteractionEnterOrEditForm f = (FragmentInteractionEnterOrEditForm)form;
    MessageResources resources = getResources(req);
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    FragmentCommandEntry fragmentCommandEntry = f.toEntry(new FragmentCommandEntry(), group, locale, session, resources);
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Created fragment entry #" + fragmentCommandEntry.getId());
    setCommandEntryInRequest(req, fragmentCommandEntry);
    return mapping.findForward("created");
  }
View Full Code Here


 
 
  protected ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {
    FragmentInteractionEnterOrEditForm fragmentForm = (FragmentInteractionEnterOrEditForm)form;
    MessageResources resources = getResources(req);
    FragmentCommandEntry commandEntry = (FragmentCommandEntry)commandEntryFromRequest(req);
    if(commandEntry == null){
      throw new InputException(resources.getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"));
    }
    checkAccessRights(req, commandEntry.getGroup());
    fragmentForm.initialize(commandEntry, locale, session, getResources(req));
    SmsDbManager smsDbManager = new SmsDbManager(locale,session);
    req.getSession().setAttribute("fragments", smsDbManager.getFragments(groupFromSession(req)));
    req.getSession().setAttribute("enterOrEdit", "edit");
    req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
View Full Code Here

    CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
    CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
    if (commandEntry == null || !(commandEntry instanceof FragmentCommandEntry)){
      throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore"))// may have been deleted
    }
    FragmentCommandEntry fragmentCommandEntry = (FragmentCommandEntry)commandEntry;
    checkAccessRights(req, fragmentCommandEntry.getGroup());
    commandEntryManager.evict(fragmentCommandEntry)// do not modify in this session yet (might be erroneous)
    f.toEntry(fragmentCommandEntry,fragmentCommandEntry.getGroup(), locale, session, resources);
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Command Entry with id: " + commandEntryId + " has been modified");
    setCommandEntryInRequest(req, fragmentCommandEntry);
    return mapping.findForward("modified");
  }
View Full Code Here

   * @return the created or modified object
   */
  public FragmentCommandEntry toEntry(FragmentCommandEntry entry, Group group, Locale locale, Session session, MessageResources resources) {
    FragmentInteractionEnterOrEditForm f = this;
    if (entry == null){
      entry = new FragmentCommandEntry();
    }
    entry.setGroup(group);
    if (f.getSortLabel() == null ||  f.getSortLabel().equals("")){
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }
View Full Code Here

        interaction.setInteractionDescription(((InteractionLogCommandEntryExtender) commandEntryExtender).readableCommandDescription(req,operationPrefix));
      }
     
      // expand and check fragments and include if required
      if (commandEntry instanceof FragmentCommandEntry){
        FragmentCommandEntry fragmentCommandEntry = (FragmentCommandEntry)commandEntry;
        Fragment fragment = fragmentCommandEntry.getFragment();
        if (expandFragments){
          interaction.setInteractionDescription(((FragmentCommandEntryExtender) commandEntryExtender).readableCommandDescription(req,false))// do not show operation prefix, because it will be visible in the embedded entries
        }
        SortedSet<CommandEntry> sortedFragmentCommandEntries = CommandEntryManager.sortedCommandEntries(fragment.getCommandEntries());
        String addedOperationPrefix = fragmentCommandEntry.getOperationPrefix();
        String combinedOperationPrefix = operationPrefix == null ? addedOperationPrefix : (operationPrefix + (addedOperationPrefix == null ? "" : addedOperationPrefix));
        nestedInteractionList = subInteractionList(req, group, sortedFragmentCommandEntries,isFragment, expandFragments, withinLoop, contactAvailable, combinedOperationPrefix,
            indentation, new SortLabelStack(sortLabelStack,sortLabel));
        if (nestedInteractionList == null){
          if (!interaction.isError()){
View Full Code Here

TOP

Related Classes of evolaris.framework.async.datamodel.FragmentCommandEntry

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.