Examples of BlogArticleCommentForm


Examples of evolaris.framework.blog.web.form.BlogArticleCommentForm

    }
    return mapping.findForward("view");
  }

  public ActionForward addComment(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    BlogArticleCommentForm f = (BlogArticleCommentForm)form;
    BlogManager blogMgr = new BlogManager(locale, session);
    Article article = blogMgr.getArticle(f.getArticleId());
    if (article == null) {
      throw new InputException(getLocalizedMessage("BloggingWeb", "blog.ArticleNotFound", f.getArticleId()));
    }
    Set<Long> permissions = getPermissions(article.getBlog(), webUser);
    if (!permissions.contains(PermissionManager.ADD_COMMENT_PERMISSION)) {
      throw new InputException(getLocalizedMessage("BloggingWeb", "blog.insufficientRights"));
    }   
    if (f.getContent() != null && f.getContent().trim().length() > 0) {
      Comment comment = blogMgr.addComment(article, f.getContent(), webUser);
      LOGGER.info("User "+UserManagerBase.toString(webUser)+" added comment #"+comment.getId()+" to article #"+article.getId()+" ("+article.getTitle()+") of blog #"+article.getBlog().getId()+" ("+article.getBlog().getName()+")");
    }
    ActionForward fwd = injectId(mapping.findForward("view"), f.getArticleId());
    return fwd;
  }
View Full Code Here

Examples of evolaris.framework.blog.web.form.BlogArticleCommentForm

    return injectId(mapping.findForward("deleted"), id);
 
 
  @Override
  public ActionForward cancel(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    BlogArticleCommentForm f = (BlogArticleCommentForm)form;
    return injectId(mapping.findForward("cancelled"), f.getArticleId());
  }
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.