Examples of BlogService


Examples of net.sourceforge.pebble.domain.BlogService

    try {
      Blog blog = getBlogWithPostId(postid);
      postid = getPostId(postid);
      authenticate(blog, username, password);
      BlogService service = new BlogService();
      BlogEntry entry = service.getBlogEntry(blog, postid);

      if (entry != null) {
        populateEntry(entry, struct, username);
        entry.setPublished(publish);

        service.putBlogEntry(entry);
      } else {
        throw new XmlRpcException(0, "Blog entry with ID of " + postid + " was not found.");
      }

      return true;
View Full Code Here

Examples of net.sourceforge.pebble.domain.BlogService

    }

    Pageable pageable = new Pageable(responses) {
      public List getListForPage() {
        List responses = new ArrayList();
        BlogService service = new BlogService();
        Iterator it = super.getListForPage().iterator();
        while (it.hasNext()) {
          try {
            responses.add(service.getResponse(blog, (String)it.next()));
          } catch (BlogServiceException e) {
            // do nothing - some responses just won't get shown,
            // but a message will be sent to the blog
          }
        }
View Full Code Here

Examples of net.sourceforge.pebble.domain.BlogService

  }

  public void testFriendlyNamesForBlogEntries() throws Exception {
    BlogEntry be = new BlogEntry(blog);
    be.setTitle("Test blog entry");
    BlogService service = new BlogService();
    service.putBlogEntry(be);
    String permalink = "/" + be.getPermalink().substring(PebbleContext.getInstance().getConfiguration().getUrl().length());
    url = new Request(permalink, blog);
    assertEquals("Blog Entry : Test blog entry", url.getName());
  }
View Full Code Here

Examples of net.sourceforge.pebble.domain.BlogService

  }

  public void testFriendlyNamesForBlogEntriesUsingDefaultPermalinkProvider() throws Exception {
    BlogEntry be = new BlogEntry(blog);
    be.setTitle("Test blog entry");
    BlogService service = new BlogService();
    service.putBlogEntry(be);
    String permalink = "/" + be.getPermalink().substring(PebbleContext.getInstance().getConfiguration().getUrl().length());
    blog.setPermalinkProvider(new TitlePermalinkProvider());
    url = new Request(permalink, blog);
    assertEquals("Blog Entry : Test blog entry", url.getName());
  }
View Full Code Here

Examples of net.sourceforge.pebble.domain.BlogService

  /**
   * 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);

    String prefix = "/";
    String suffix = "";

    blogEntry.setTitle("Here is a title");
View Full Code Here

Examples of net.sourceforge.pebble.domain.BlogService

  /**
   * Tests that a permalink can be generated for a blog entry when there are
   * duplicate titles for the same day.
   */
  public void testBlogEntryPermalinkForEntriesWithSameTitle() throws Exception {
    BlogService service = new BlogService();

    BlogEntry blogEntry1 = new BlogEntry(blog);
    blogEntry1.setTitle("A Title");
    service.putBlogEntry(blogEntry1);

    String prefix = "/";
    String suffix = "";
    assertEquals(prefix + "a-title" + suffix, permalinkProvider.getPermalink(blogEntry1));

    // now add another with the same name
    BlogEntry blogEntry2 = new BlogEntry(blog);
    blogEntry2.setTitle("A Title");
    service.putBlogEntry(blogEntry2);

    assertEquals(prefix + "a-title" + suffix, permalinkProvider.getPermalink(blogEntry1));
    assertEquals(prefix + "a-title_" + blogEntry2.getId() + suffix, permalinkProvider.getPermalink(blogEntry2));

    // now add another with the same name a year ahead
    BlogEntry blogEntry3 = new BlogEntry(blog);
    blogEntry3.setTitle("A Title");
    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.YEAR, 1);
    blogEntry3.setDate(cal.getTime());
    service.putBlogEntry(blogEntry3);

    assertEquals(prefix + "a-title" + suffix, permalinkProvider.getPermalink(blogEntry1));
    assertEquals(prefix + "a-title_" + blogEntry2.getId() + suffix, permalinkProvider.getPermalink(blogEntry2));
    assertEquals(prefix + "a-title_" + blogEntry3.getId() + suffix, permalinkProvider.getPermalink(blogEntry3));
  }
View Full Code Here

Examples of net.sourceforge.pebble.domain.BlogService

  /**
   * Tests that the correct blog entry can be found from a permalink.
   */
  public void testGetBlogEntry() throws Exception {
    BlogService service = new BlogService();

    BlogEntry blogEntry1 = new BlogEntry(blog);
    blogEntry1.setTitle("A Title");
    service.putBlogEntry(blogEntry1);

    BlogEntry blogEntry2 = new BlogEntry(blog);
    blogEntry2.setTitle("Some other title");
    service.putBlogEntry(blogEntry2);

    BlogEntry blogEntry3 = new BlogEntry(blog);
    blogEntry3.setTitle("Some other itle");
    service.putBlogEntry(blogEntry3);

    BlogEntry blogEntry4 = new BlogEntry(blog);
    blogEntry4.setTitle("������");
    service.putBlogEntry(blogEntry4);

    String uri = permalinkProvider.getPermalink(blogEntry1);
    assertEquals(blogEntry1, permalinkProvider.getBlogEntry(uri));
    uri = permalinkProvider.getPermalink(blogEntry2);
    assertEquals(blogEntry2, permalinkProvider.getBlogEntry(uri));
View Full Code Here

Examples of net.sourceforge.pebble.domain.BlogService

    String trackBackUrl = request.getParameter("url");
    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);
      }
    }
View Full Code Here

Examples of net.sourceforge.pebble.domain.BlogService

  /**
   * Tests that the correct aggregated blog entry can be found from a permalink.
   */
  public void testGetAggregatedBlogEntry() throws Exception {
    BlogService service = new BlogService();

    BlogEntry blogEntry = new BlogEntry(blog);
    blogEntry.setTitle("A Title");
    blogEntry.setOriginalPermalink("http://www.someotherdomain.com/blog/abc.html");
    service.putBlogEntry(blogEntry);

    String uri = permalinkProvider.getPermalink(blogEntry);
    assertEquals(blogEntry, permalinkProvider.getBlogEntry(uri));
  }
View Full Code Here

Examples of net.sourceforge.pebble.domain.BlogService

   * Tests that a permalink is changed when the blog entry title changes.
   */
  public void testBlogEntryPermalinkChangesWithTitle() throws Exception {
    blog.setPermalinkProvider(new Latin1SeoPermalinkProvider());

    BlogService service = new BlogService();

    BlogEntry blogEntry = new BlogEntry(blog);
    service.putBlogEntry(blogEntry);

    String prefix = blog.getUrl();
    String suffix = "";

    blogEntry.setTitle("Here is a title");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.