Package net.sourceforge.pebble.domain

Examples of net.sourceforge.pebble.domain.Comment


   * Called when a comment has been removed.
   *
   * @param event a CommentEvent instance
   */
  public void commentRemoved(CommentEvent event) {
    Comment comment = event.getComment();
    AuditTrail.log("Comment \"" + comment.getTitle() + "\" from " + comment.getAuthor() + " (" + comment.getGuid() + ") removed");
  }
View Full Code Here


   * Called when a comment has been approved.
   *
   * @param event a CommentEvent instance
   */
  public void commentApproved(CommentEvent event) {
    Comment comment = event.getComment();
    AuditTrail.log("Comment \"" + comment.getTitle() + "\" from " + comment.getAuthor() + " (" + comment.getGuid() + ") approved");
  }
View Full Code Here

   * Called when a comment has been rejected.
   *
   * @param event a CommentEvent instance
   */
  public void commentRejected(CommentEvent event) {
    Comment comment = event.getComment();
    AuditTrail.log("Comment \"" + comment.getTitle() + "\" from " + comment.getAuthor() + " (" + comment.getGuid() + ") rejected");
  }
View Full Code Here

   * Called when a comment has been added.
   *
   * @param event a CommentEvent instance
   */
  public void commentAdded(CommentEvent event) {
    Comment comment = event.getComment();
    comment.getBlogEntry().getBlog().getResponseIndex().index(comment);
  }
View Full Code Here

   * Called when a comment has been removed.
   *
   * @param event a CommentEvent instance
   */
  public void commentRemoved(CommentEvent event) {
    Comment comment = event.getComment();
    comment.getBlogEntry().getBlog().getResponseIndex().unindex(comment);
  }
View Full Code Here

   * Called when a comment has been approved.
   *
   * @param event a CommentEvent instance
   */
  public void commentApproved(CommentEvent event) {
    Comment comment = event.getComment();
    comment.getBlogEntry().getBlog().getResponseIndex().unindex(comment);
    comment.getBlogEntry().getBlog().getResponseIndex().index(comment);
  }
View Full Code Here

   * Called when a comment has been rejected.
   *
   * @param event a CommentEvent instance
   */
  public void commentRejected(CommentEvent event) {
    Comment comment = event.getComment();
    comment.getBlogEntry().getBlog().getResponseIndex().unindex(comment);
    comment.getBlogEntry().getBlog().getResponseIndex().index(comment);
  }
View Full Code Here

  /**
   * Tests that a CommentEvent instance is correctly constructed.
   */
  public void testConstruction() {
    Comment comment = new BlogEntry(blog).createComment("Title", "Body", "Author", "me@somedomain.com", "http://www.google.com", "http://graph.facebook.com/user/picture", "127.0.0.1");
    event = new CommentEvent(comment, CommentEvent.COMMENT_ADDED);

    assertEquals(comment, event.getSource());
    assertEquals(comment, event.getComment());
    assertEquals(CommentEvent.COMMENT_ADDED, event.getType());
View Full Code Here

    BlogEntry blogEntry = new BlogEntry(blog);
    service.putBlogEntry(blogEntry);
    blogEntry = service.getBlogEntry(blog, blogEntry.getId());

    for (int i = 0; i < numberOfComments; i++) {
      Comment comment = blogEntry.createComment("title", "body"+i, "author", "email", "website", "avatar", "127.0.0.1");
      blogEntry.addComment(comment);
    }
    service.putBlogEntry(blogEntry);

    for (Comment comment : blogEntry.getComments()) {
      comment.setApproved();
    }
    service.putBlogEntry(blogEntry);
   

    View view = action.process(request, response);
View Full Code Here

    assertTrue(view instanceof CommentConfirmationView);

    blogEntry = service.getBlogEntry(blog, blogEntry.getId());
    assertEquals(1, blogEntry.getComments().size());

    Comment comment = blogEntry.getComments().get(0);
    assertEquals("Test Title", comment.getTitle());
    assertEquals("Test Body", comment.getBody());
    assertEquals("Test Author", comment.getAuthor());
    assertEquals("http://www.somedomain.com", comment.getWebsite());
    assertEquals("http://www.somedomain.com/avatar", comment.getAvatar());
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.domain.Comment

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.