Examples of addCategory()


Examples of net.sourceforge.pebble.dao.CategoryDAO.addCategory()

        }

        blog.addCategory(category);
        DAOFactory factory = DAOFactory.getConfiguredFactory();
        CategoryDAO dao = factory.getCategoryDAO();
        dao.addCategory(category, blog);
      }
    } catch (Exception e) {
      log.error("Exception encountered", e);
    }
  }
View Full Code Here

Examples of net.sourceforge.pebble.domain.Blog.addCategory()

      if (category == null) {
        // this is a new category
        category = new Category();
        category.setId(id);
        category.setName(name);
        blog.addCategory(category);
        category.setTags(tags);
        try {
          // add it to the persistent store
          DAOFactory factory = DAOFactory.getConfiguredFactory();
          CategoryDAO dao = factory.getCategoryDAO();
View Full Code Here

Examples of net.sourceforge.pebble.domain.BlogEntry.addCategory()

        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);
      }
    }
    entry.setPublished("Publish".equals(status));

    BlogService service = new BlogService();
View Full Code Here

Examples of net.sourceforge.pebble.domain.CategoryBuilder.addCategory()

        for (CategoryType categoryType : categoriesType.getCategory()) {
          Category category = new Category(categoryType.getId(), categoryType.getName());
          category.setBlog(blog);
          category.setTags(categoryType.getTags());

          categoryBuilder.addCategory(category);
        }
      } catch (Exception e) {
        log.error(e.getMessage(), e);
        e.printStackTrace();
        throw new PersistenceException(e.getMessage());
View Full Code Here

Examples of org.apache.abdera.model.Categories.addCategory()

      Categories cats = ((FOMFactory)factory).newCategories();
      cats.setFixed(fixed);
      if (scheme != null) cats.setScheme(scheme);
      if (categories != null) {
        for (Category category : categories) {
          cats.addCategory(category);
        }
      }
      addCategories(cats);
      return cats;
  }
View Full Code Here

Examples of org.apache.abdera.model.Entry.addCategory()

        // process category
        // TODO category object
        Object categoryProperty = ScriptableObject.getProperty(nativeEntry, "category");
        if (categoryProperty instanceof String) {
            entry.addCategory((String) (categoryProperty));
        }
        Object categoriesProperty = ScriptableObject.getProperty(nativeEntry, "categories");
        if (categoriesProperty instanceof String) {
            String categoriesString = (String) (categoriesProperty);
            String[] categories = categoriesString.split(",");
View Full Code Here

Examples of org.apache.abdera.model.Feed.addCategory()

    feed.setTitle("Example Feed");
    feed.addLink("http://example.org/");
    feed.addAuthor("John Doe");
    feed.setId("urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", false);
    feed.addContributor("Bob Jones");
    feed.addCategory("example");
   
    Entry entry = feed.insertEntry();
    entry.setTitle("Atom-Powered Robots Run Amok");
    entry.addLink("http://example.org/2003/12/13/atom03");
    entry.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", false);
View Full Code Here

Examples of org.apache.abdera.model.Feed.addCategory()

    feed.setTitle("Example Feed");
    feed.addLink("http://example.org/");
    feed.addAuthor("John Doe");
    feed.setId("urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", false);
    feed.addContributor("Bob Jones");
    feed.addCategory("example");
   
    Entry entry = feed.insertEntry();
    entry.setTitle("Atom-Powered Robots Run Amok");
    entry.addLink("http://example.org/2003/12/13/atom03");
    entry.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", false);
View Full Code Here

Examples of org.apache.ambari.server.controller.internal.ResourceImpl.addCategory()

    String categoryId = PropertyHelper.getPropertyId("category1", null);
    Predicate predicate = new CategoryIsEmptyPredicate(categoryId);

    Assert.assertTrue(predicate.evaluate(resource));

    resource.addCategory(categoryId);
    Assert.assertTrue(predicate.evaluate(resource));

    String propertyId = PropertyHelper.getPropertyId("category1", "bar");
    resource.setProperty(propertyId, "value1");
    Assert.assertFalse(predicate.evaluate(resource));
View Full Code Here

Examples of org.apache.ambari.server.controller.spi.Resource.addCategory()

  @Test
  public void testAddCategory() {
    Resource resource = new ResourceImpl(Resource.Type.Cluster);

    resource.addCategory("c1");
    resource.addCategory("c2/sub2");
    resource.addCategory("c3/sub3/sub3a");

    Assert.assertTrue(resource.getPropertiesMap().containsKey("c1"));
    Assert.assertTrue(resource.getPropertiesMap().containsKey("c2/sub2"));
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.