Examples of BlogCommandEntry


Examples of evolaris.framework.smsservices.datamodel.BlogCommandEntry

    MessageResources resources = getResources(req);
    if (f.getSortLabel() == null ||  f.getSortLabel().equals("")) {
      throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
    }
   
    BlogCommandEntry commandEntry = new BlogCommandEntry();
    Group group = groupFromSession(req);
    checkAccessRights(req, group);
    commandEntry.setGroup(group);
    if (f.getBlogId() > 0) {
      BlogManager blogMgr = new BlogManager(locale, session);
      Blog blog = blogMgr.getBlog(f.getBlogId());
      if (blog == null) {
        throw new InputException(resources.getMessage(locale, "smssvc.selectedBlogNotFound"));
      }
      commandEntry.setBlog(blog);
    } else {
      commandEntry.setBlog(null);
    }
    commandEntry.setTitle(f.getTitle());
    commandEntry.setContent(f.getContent());
    commandEntry.setTags(f.getTags());
    commandEntry.setSortLabel(f.getSortLabel());
    commandEntry.setMaxImageWidth((f.getMaxImageWidth()==null || f.getMaxImageWidth().trim().length() == 0)?null:Integer.parseInt(f.getMaxImageWidth()));
   
    LOGGER.info("User " + UserManagerBase.toString(webUser) + ": Created new blog interaction");
    setCommandEntryInRequest(req, commandEntry);
    return mapping.findForward("created");
  }
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.BlogCommandEntry

  }

  public ActionForward edit(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {
    BlogInteractionEnterOrEditForm f = (BlogInteractionEnterOrEditForm)form;
   
    BlogCommandEntry commandEntry = (BlogCommandEntry)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.setBlogId(commandEntry.getBlog() == null ? 0 : commandEntry.getBlog().getId());
    f.setSortLabel(commandEntry.getSortLabel());
    f.setTags(commandEntry.getTags());
    f.setTitle(commandEntry.getTitle());
    f.setContent(commandEntry.getContent());
    f.setMaxImageWidth(commandEntry.getMaxImageWidth()==null?null:commandEntry.getMaxImageWidth().toString());
   
    List<Blog> blogList = getBlogList(commandEntry.getGroup());
    req.getSession().setAttribute("blogList", blogList);   
    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.BlogCommandEntry

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

    blogCommandEntry.setSortLabel(f.getSortLabel());
    if (f.getBlogId() > 0) {
      BlogManager blogMgr = new BlogManager(locale, session);
      Blog blog = blogMgr.getBlog(f.getBlogId());
      if (blog == null) {
        throw new InputException(resources.getMessage(locale, "smssvc.selectedBlogNotFound"));
      }     
      blogCommandEntry.setBlog(blog);
    } else {
      blogCommandEntry.setBlog(null);
    }
    blogCommandEntry.setTags(f.getTags());
    blogCommandEntry.setTitle(f.getTitle());
    blogCommandEntry.setContent(f.getContent())
    blogCommandEntry.setMaxImageWidth(f.getMaxImageWidth()==null||f.getMaxImageWidth().length()==0?null:Integer.parseInt(f.getMaxImageWidth()));
    LOGGER.info("User " + UserManagerBase.toString(webUser) + ": blog interaction entry with id: " + commandEntryId + " has been modified");
    setCommandEntryInRequest(req, blogCommandEntry);
    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.