Package net.sourceforge.pebble.domain

Examples of net.sourceforge.pebble.domain.BlogEntry


   * Called when a blog entry has been added.
   *
   * @param event   a BlogEntryEvent instance
   */
  public void blogEntryAdded(BlogEntryEvent event) {
    BlogEntry blogEntry = event.getBlogEntry();
    sendNotification((BlogEntry)blogEntry.clone());
  }
View Full Code Here


   * Called when a blog entry has been changed.
   *
   * @param event a BlogEntryEvent instance
   */
  public void blogEntryChanged(BlogEntryEvent event) {
    BlogEntry blogEntry = event.getBlogEntry();
    sendNotification((BlogEntry)blogEntry.clone());
  }
View Full Code Here

   * Called when a blog entry has been published.
   *
   * @param event a BlogEntryEvent instance
   */
  public void blogEntryPublished(BlogEntryEvent event) {
    BlogEntry blogEntry = event.getBlogEntry();
    sendNotification((BlogEntry)blogEntry.clone());
  }
View Full Code Here

   * Called when a blog entry has been published.
   *
   * @param event a BlogEntryEvent instance
   */
  public void blogEntryPublished(BlogEntryEvent event) {
    BlogEntry blogEntry = event.getBlogEntry();
    sendNotification((BlogEntry)blogEntry.clone());
  }
View Full Code Here

    String excerpt = request.getParameter("excerpt");
    String trackBackResponseMessage;
    Integer trackBackResponseCode;

    BlogService service = new BlogService();
    BlogEntry blogEntry = null;
    if (entryId != null) {
      try {
        blogEntry = service.getBlogEntry(blog, entryId);
      } catch (BlogServiceException e) {
        throw new ServletException(e);
      }
    }

    if (blogEntry == null) {
      // the entry cannot be found - it may have been removed or the
      // requesting URL was wrong

      return new NotFoundView();
    } else if (trackBackUrl == null || trackBackUrl.trim().length() == 0) {
      getModel().put(Constants.BLOG_ENTRY_KEY, blogEntry);
      return new TrackBackFormView();
    } else {
      // extract the information to send in the trackback
      String title = blogEntry.getTitle();
      String blogName = blogEntry.getBlog().getName();
      String url = blogEntry.getPermalink();

      // now send the trackback
      try {
        HttpClient httpClient = new HttpClient();
        PostMethod postMethod = new PostMethod(trackBackUrl);
View Full Code Here

  public void prepare() {
    ContentDecoratorContext context = new ContentDecoratorContext();
    context.setView(ContentDecoratorContext.DETAIL_VIEW);
    context.setMedia(ContentDecoratorContext.HTML_PAGE);

    BlogEntry blogEntry = (BlogEntry)getModel().get(Constants.BLOG_ENTRY_KEY);
    blogEntry.getBlog().getContentDecoratorChain().decorate(context, blogEntry);
  }
View Full Code Here

   * Gets the title of this view.
   *
   * @return the title as a String
   */
  public String getTitle() {
    BlogEntry blogEntry = (BlogEntry)getModel().get(Constants.BLOG_ENTRY_KEY);
    return blogEntry.getTitle();
  }
View Full Code Here

   * Gets the title of this view.
   *
   * @return the title as a String
   */
  public String getTitle() {
    BlogEntry blogEntry = (BlogEntry)getModel().get(Constants.BLOG_ENTRY_KEY);
    return blogEntry.getTitle();
  }
View Full Code Here

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

    blog.getPluginProperties().setProperty(ContentSpamListener.REGEX_LIST_KEY, "test");
    listener = new ContentSpamListener();
    BlogEntry blogEntry = new BlogEntry(blog);
    comment = blogEntry.createComment("Title", "Body", "Author", "me@somedomain.com", "http://www.google.com", "http://graph.facebook.com/user/picture", "127.0.0.1");
    commentEvent = new CommentEvent(comment, CommentEvent.COMMENT_ADDED);
    trackBack = blogEntry.createTrackBack("Title", "Excerpt", "url", "blogName", "127.0.0.1");
    trackBackEvent = new TrackBackEvent(trackBack, TrackBackEvent.TRACKBACK_ADDED);
  }
View Full Code Here

  /**
   * Tests that a permalink can be generated for a blog entry.
   */
  public void testBlogEntryPermalink() throws Exception {
    BlogService service = new BlogService();
    BlogEntry blogEntry = new BlogEntry(blog);
    service.putBlogEntry(blogEntry);

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy'/'MM'/'dd'/'");
    sdf.setTimeZone(blog.getTimeZone());
    StringBuffer buf = new StringBuffer();
    buf.append("/");
    buf.append(sdf.format(blogEntry.getDate()));
    buf.append(blogEntry.getId());
    buf.append(".html");
    assertEquals(buf.toString(), permalinkProvider.getPermalink(blogEntry));
  }
View Full Code Here

TOP

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

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.