Package net.sourceforge.pebble.domain

Examples of net.sourceforge.pebble.domain.Category


  /**
   * Tests that a blog entry with tags gets modified, when output to a HTML page.
   */
  public void testBlogEntryHasTagsAndMediaIsHtml() throws Exception {
    Category category = new Category("/java", "Java");
    category.setBlog(blog);
    category.setTags("java");
    blogEntry.addCategory(category);
    blogEntry.setExcerpt("Excerpt - here is some text");
    blogEntry.setBody("Body - here is some text");
    blogEntry.setTags("junit, automated unit testing");
    context.setMedia(ContentDecoratorContext.HTML_PAGE);
View Full Code Here


  /**
   * Tests that a blog entry with tags gets modified, when output to a newsfeed.
   */
  public void testBlogEntryHasTagsAndMediaIsNewsfeed() throws Exception {
    Category category = new Category("/java", "Java");
    category.setBlog(blog);
    category.setTags("java");
    blogEntry.addCategory(category);
    blogEntry.setExcerpt("Excerpt - here is some text");
    blogEntry.setBody("Body - here is some text");
    blogEntry.setTags("junit, automated unit testing");
    context.setMedia(ContentDecoratorContext.NEWS_FEED);
View Full Code Here

  /**
   * Tests that a blog entry with tags gets modified, when output to a HTML page.
   */
  public void testBlogEntryHasTagsAndMediaIsHtml() throws Exception {
    Category category = new Category("/java", "Java");
    category.setBlog(blog);
    category.setTags("java");
    blogEntry.addCategory(category);
    blogEntry.setExcerpt("Excerpt - here is some text");
    blogEntry.setBody("Body - here is some text");
    blogEntry.setTags("junit, automated unit testing");
    context.setMedia(ContentDecoratorContext.HTML_PAGE);
View Full Code Here

  /**
   * Tests that a blog entry with tags gets modified, when output to a newsfeed.
   */
  public void testBlogEntryHasTagsAndMediaIsNewsfeed() throws Exception {
    Category category = new Category("/java", "Java");
    category.setBlog(blog);
    category.setTags("java");
    blogEntry.addCategory(category);
    blogEntry.setExcerpt("Excerpt - here is some text");
    blogEntry.setBody("Body - here is some text");
    blogEntry.setTags("junit, automated unit testing");
    context.setMedia(ContentDecoratorContext.NEWS_FEED);
View Full Code Here

    post.put(POST_ID, formatPostId(entry.getBlog().getId(), entry.getId()));

    Vector categories = new Vector();
    Iterator it = entry.getCategories().iterator();
    while (it.hasNext()) {
      Category cat = (Category)it.next();
      categories.add(cat.getId());
    }
    post.put(CATEGORIES, categories);

    //Get Tags
    Vector tags = new Vector();
View Full Code Here

    entry.setCommentsEnabled(allowComments.equals("1"));
    entry.setTrackBacksEnabled(allowPings.equals("1"));

    for (String categoryStr : categories) {
      if(categoryStr != null && categoryStr.trim().length() > 0) {
        Category category = new Category(categoryStr.trim(), categoryStr.trim());
        DAOFactory factory = DAOFactory.getConfiguredFactory();
        CategoryDAO dao = factory.getCategoryDAO();
        dao.addCategory(category, blog);
        blog.addCategory(category);
        entry.addCategory(category);
View Full Code Here

      entry.setAuthor(username);

      Vector categories = (Vector)struct.get(CATEGORIES);
      if (categories != null) {
          for (int i = 0; i < categories.size(); i++) {
              Category c = entry.getBlog().getCategory((String)categories.get(i));
              if (c != null)
                  entry.addCategory(c);
          }
      }
View Full Code Here

    post.put(UUID, formatPostId(entry.getBlog().getId(), entry.getId()));

    Vector categories = new Vector();
    Iterator it = entry.getCategories().iterator();
    while (it.hasNext()) {
      Category cat = (Category)it.next();
      categories.add(cat.getId());
    }
    post.put(CATEGORIES, categories);

    Vector tags = new Vector();
    it = entry.getTagsAsList().iterator();
View Full Code Here

        buf.append("<div class=\"categories\"><span>");
        buf.append(I18n.getMessage(blogEntry.getBlog(), "category.categories"));
        buf.append(" : </span>");
        while (categories.hasNext()) {
          Category category = (Category)categories.next();
          buf.append("<a href=\"");
          buf.append(category.getPermalink());
          buf.append("\">");
          buf.append(category.getName());
          buf.append("</a>");

          if (categories.hasNext()) {
            buf.append(", ");
          }
View Full Code Here

    private Hashtable adaptBlogEntry(BlogEntry entry) {
        Hashtable post = new Hashtable();
        String categories = "";
        Iterator it = entry.getCategories().iterator();
        while (it.hasNext()) {
            Category category = (Category)it.next();
            categories += category.getId();
            if (it.hasNext()) {
                categories += ",";
            }
        }
        post.put(DATE_CREATED, entry.getDate());
View Full Code Here

TOP

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

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.