Package net.sourceforge.pebble.domain

Examples of net.sourceforge.pebble.domain.TrackBack


   */
  public void testNoFollowAddedToTrackBacks() throws Exception {
    ContentDecoratorContext context = new ContentDecoratorContext();
    context.setView(ContentDecoratorContext.DETAIL_VIEW);

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

    trackBack1.setExcerpt("<p>Here is an excerpt.</p>");
    trackBack2.setExcerpt("<p>Here is an excerpt again.</p>");
    decorator.decorate(context, trackBack1);
    decorator.decorate(context, trackBack2);
    assertEquals("<p>Here is an excerpt.</p>", trackBack1.getExcerpt());
    assertEquals("<p>Here is an excerpt again.</p>", trackBack2.getExcerpt());

    trackBack1.setExcerpt("<p>Here is a <a href=\"http://www.google.com\">a link</a>.</p>");
    trackBack2.setExcerpt("<p>Here is a <a href=http://www.google.com>a link</a> again.</p>");
    decorator.decorate(context, trackBack1);
    decorator.decorate(context, trackBack2);
    assertEquals("<p>Here is a <a href=\"http://www.google.com\" rel=\"nofollow\">a link</a>.</p>", trackBack1.getExcerpt());
    assertEquals("<p>Here is a <a href=http://www.google.com rel=\"nofollow\">a link</a> again.</p>", trackBack2.getExcerpt());
  }
View Full Code Here


          if (!pingBodyLing.equals("-----")) {
            pingBody.append("<br />");
          }
        }

        TrackBack trackBack = entry.createTrackBack(pingTitle, pingBody.toString(), pingUrl, pingBlogName, pingIpAddress, pingDate, State.APPROVED);
        entry.addTrackBack(trackBack);
      }
      line = reader.readLine();
    }
View Full Code Here

        }
      }

      List trackBacks = blogEntry.getTrackBacks();
      for (int i = trackBacks.size()-1; i >= 0; i--) {
        TrackBack trackBack = (TrackBack)trackBacks.get(i);
        if (!trackBack.isApproved()) {
          blogEntry.removeTrackBack(trackBack.getId());
        }
      }
    }
  }
View Full Code Here

   * Called when a TrackBack has been added.
   *
   * @param event a TrackBackEvent instance
   */
  public void trackBackAdded(TrackBackEvent event) {
    TrackBack trackback = event.getTrackBack();
    AuditTrail.log("TrackBack \"" + trackback.getTitle() + "\" from " + trackback.getBlogName() + " (" + trackback.getGuid() + ") added");
  }
View Full Code Here

   * Called when a TrackBack has been removed.
   *
   * @param event a TrackBackEvent instance
   */
  public void trackBackRemoved(TrackBackEvent event) {
    TrackBack trackback = event.getTrackBack();
    AuditTrail.log("TrackBack \"" + trackback.getTitle() + "\" from " + trackback.getBlogName() + " (" + trackback.getGuid() + ") removed");
  }
View Full Code Here

   * Called when a TrackBack has been approved.
   *
   * @param event a TrackBackEvent instance
   */
  public void trackBackApproved(TrackBackEvent event) {
    TrackBack trackback = event.getTrackBack();
    AuditTrail.log("TrackBack \"" + trackback.getTitle() + "\" from " + trackback.getBlogName() + " (" + trackback.getGuid() + ") approved");
  }
View Full Code Here

   * Called when a TrackBack has been rejected.
   *
   * @param event a TrackBackEvent instance
   */
  public void trackBackRejected(TrackBackEvent event) {
    TrackBack trackback = event.getTrackBack();
    AuditTrail.log("TrackBack \"" + trackback.getTitle() + "\" from " + trackback.getBlogName() + " (" + trackback.getGuid() + ") rejected");
  }
View Full Code Here

   * Called when a TrackBack has been added.
   *
   * @param event a TrackBackEvent instance
   */
  public void trackBackAdded(TrackBackEvent event) {
    TrackBack trackBack = event.getTrackBack();
    trackBack.getBlogEntry().getBlog().getResponseIndex().index(trackBack);
  }
View Full Code Here

   * Called when a TrackBack has been removed.
   *
   * @param event a TrackBackEvent instance
   */
  public void trackBackRemoved(TrackBackEvent event) {
    TrackBack trackBack = event.getTrackBack();
    trackBack.getBlogEntry().getBlog().getResponseIndex().unindex(trackBack);
  }
View Full Code Here

   * Called when a TrackBack has been approved.
   *
   * @param event a TrackBackEvent instance
   */
  public void trackBackApproved(TrackBackEvent event) {
    TrackBack trackBack = event.getTrackBack();
    trackBack.getBlogEntry().getBlog().getResponseIndex().unindex(trackBack);
    trackBack.getBlogEntry().getBlog().getResponseIndex().index(trackBack);
  }
View Full Code Here

TOP

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

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.