Package net.sourceforge.pebble.api.decorator

Examples of net.sourceforge.pebble.api.decorator.ContentDecoratorContext


  protected void setUp() throws Exception {
    super.setUp();

    blogEntry = new BlogEntry(blog);
    decorator = new SocialBookmarksDecorator();
    context = new ContentDecoratorContext();
  }
View Full Code Here


    trackBack2.setApproved();
    blogEntry.addTrackBack(trackBack2);

    SecurityUtils.runAsAnonymous();

    ContentDecoratorContext context = new ContentDecoratorContext();
    decorator.decorate(context, blogEntry);
    assertEquals(1, blogEntry.getComments().size());
    assertEquals(1, blogEntry.getTrackBacks().size());

    assertSame(comment2, blogEntry.getComments().get(0));
View Full Code Here

    blogEntry.addTrackBack(trackBack);

    SecurityUtils.runAsBlogContributor();
    blog.setProperty(Blog.BLOG_CONTRIBUTORS_KEY, "some_contributor");

    ContentDecoratorContext context = new ContentDecoratorContext();
    decorator.decorate(context, blogEntry);
    assertEquals(0, blogEntry.getComments().size());
    assertEquals(0, blogEntry.getTrackBacks().size());
  }
View Full Code Here

    TrackBack trackBack = blogEntry.createTrackBack("title", "excerpt", "url", "blogName", "127.0.0.1");
    trackBack.setPending();
    blogEntry.addTrackBack(trackBack);

    ContentDecoratorContext context = new ContentDecoratorContext();

    SecurityUtils.runAsBlogContributor();

    decorator.decorate(context, blogEntry);
    assertEquals(1, blogEntry.getComments().size());
View Full Code Here

    SecurityUtils.runAsAnonymous();

    blogEntry = (BlogEntry)blogEntry.clone();

    ContentDecoratorContext context = new ContentDecoratorContext();
    decorator.decorate(context, blogEntry);
    assertEquals(0, blogEntry.getComments().size());
    assertEquals(0, blogEntry.getTrackBacks().size());
  }
View Full Code Here

   * Tests that comments and TrackBacks are disabled.
   */
  public void testImageUriInBody() throws Exception {
    blogEntry.setCommentsEnabled(true);
    blogEntry.setTrackBacksEnabled(true);
    ContentDecoratorContext context = new ContentDecoratorContext();
    decorator.decorate(context, blogEntry);
    assertFalse(blogEntry.isCommentsEnabled());
    assertTrue(blogEntry.isTrackBacksEnabled());
  }
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();

    blogEntry = new BlogEntry(blog);
    decorator = new TechnoratiTagsDecorator();
    context = new ContentDecoratorContext();
  }
View Full Code Here

    super.setUp();

    blogEntry = new BlogEntry(blog);
    staticPage = new StaticPage(blog);
    decorator = new RelativeUriDecorator();
    context = new ContentDecoratorContext();
    decorator.setBlog(blog);
  }
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();
    blogEntryOne = new BlogEntry(blog);
    decorator = new EntryToPdfDecorator();
    context = new ContentDecoratorContext();
  }
View Full Code Here

    ValidationContext context = validateComment(comment);

    // are we previewing or adding the comment?
    String previewButton = I18n.getMessage(blog, "comment.previewButton");

    ContentDecoratorContext decoratorContext = new ContentDecoratorContext();
    decoratorContext.setView(ContentDecoratorContext.DETAIL_VIEW);
    decoratorContext.setMedia(ContentDecoratorContext.HTML_PAGE);

    Comment decoratedComment = (Comment)comment.clone();
    blog.getContentDecoratorChain().decorate(decoratorContext, decoratedComment);
    getModel().put("decoratedComment", decoratedComment);
    getModel().put("undecoratedComment", comment);
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.api.decorator.ContentDecoratorContext

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.