Package net.sourceforge.pebble.api.confirmation

Examples of net.sourceforge.pebble.api.confirmation.CommentConfirmationStrategy


    request.getSession().setAttribute("rememberMe", request.getParameter("rememberMe"));

    if (submitType == null || submitType.equalsIgnoreCase(previewButton) || context.hasErrors()) {
      return new CommentFormView();
    } else {
      CommentConfirmationStrategy strategy = blog.getCommentConfirmationStrategy();

      Comment clonedComment = (Comment)comment.clone();
      request.getSession().setAttribute(Constants.COMMENT_KEY, comment);

      if (strategy.confirmationRequired(clonedComment)) {
        strategy.setupConfirmation(request);
        return new ConfirmCommentView();
      } else {
        try {
          saveComment(request, response, blogEntry, comment);
          request.getSession().removeAttribute(Constants.COMMENT_KEY);
View Full Code Here


   *
   * @return the URI as a String
   */
  public String getUri() {
    Blog blog = (Blog)getModel().get(Constants.BLOG_KEY);
    CommentConfirmationStrategy strategy = blog.getCommentConfirmationStrategy();
    return strategy.getUri();
  }
View Full Code Here

    getModel().put("decoratedComment", decoratedComment);
    getModel().put("undecoratedComment", comment);
    getModel().put(Constants.BLOG_ENTRY_KEY, blogEntry);
    getModel().put(Constants.COMMENT_KEY, comment);

    CommentConfirmationStrategy strategy = blog.getCommentConfirmationStrategy();

    Comment clonedComment = (Comment)comment.clone();

    if (strategy.isConfirmed(request)) {
      try {
        saveComment(request, response, blogEntry, comment);
        request.getSession().removeAttribute(Constants.COMMENT_KEY);
        return new CommentConfirmationView();
      } catch (BlogServiceException be) {
        log.error(be.getMessage(), be);
        throw new ServletException(be);
      }
    } else {
      // try again!
      strategy.setupConfirmation(request);
      return new ConfirmCommentView();
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.api.confirmation.CommentConfirmationStrategy

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.