Examples of CategoryReference


Examples of com.volantis.mcs.policies.variants.selection.CategoryReference

        List categoryValues = ((PolicyEditorContext) context).getCategoryValues();
        if (categoryValues != null && !categoryValues.isEmpty()) {
            Iterator it = categoryValues.iterator();
            while (it.hasNext()) {
                String value = (String) it.next();
                CategoryReference categoryRef =
                        POLICY_FACTORY.createCategoryReference(value);
                categories.add(categoryRef);
            }
        }
View Full Code Here

Examples of com.volantis.mcs.policies.variants.selection.CategoryReference

            // Append the categories
            List refs = selection.getModifiableCategoryReferences();
            if (refs != null && !refs.isEmpty()) {
                Iterator it = refs.iterator();
                while (it.hasNext()) {
                    CategoryReference categoryReference =
                            (CategoryReference) it.next();
                    appendText(categoryReference.getCategoryName());
                }
            }

            // Append the devices
            refs = selection.getModifiableDeviceReferences();
View Full Code Here

Examples of com.volantis.mcs.policies.variants.selection.CategoryReference

        List categoryValues = context.getCategoryValues();
        if (categoryValues != null && !categoryValues.isEmpty()) {
            Iterator it = categoryValues.iterator();
            while (it.hasNext()) {
                String value = (String) it.next();
                CategoryReference categoryRef =
                        policyFactory.createCategoryReference(value);
                categories.add(categoryRef);
            }
        }
        return categories;
View Full Code Here

Examples of com.volantis.mcs.policies.variants.selection.CategoryReference

     *         was null and an entry had to be added.
     */
    private Map targetVariantAtCategories(
            Variant variant, List categories, Map category2Variant) {
        for (int j = 0; j < categories.size(); j++) {
            CategoryReference reference = (CategoryReference) categories.get(j);
            String categoryName = reference.getCategoryName();
            if (category2Variant == null) {
                category2Variant = new HashMap();
            }
            category2Variant.put(categoryName, variant);
        }
View Full Code Here

Examples of org.rssowl.core.model.reference.CategoryReference

  @Test
  public void testAddAndDeleteFeedCategory() {
    try {
      ICategory category = createFeedCategory();
      ICategory savedCategory = fModelDAO.saveCategory(category);
      fModelDAO.deleteCategory(new CategoryReference(savedCategory.getId()));
    } catch (PersistenceException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

Examples of org.rssowl.core.model.reference.CategoryReference

  @Test
  public void testAddAndDeleteNewsCategory() {
    try {
      ICategory category = createNewsCategory();
      ICategory savedCategory = fModelDAO.saveCategory(category);
      fModelDAO.deleteCategory(new CategoryReference(savedCategory.getId()));
    } catch (PersistenceException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

Examples of org.rssowl.core.model.reference.CategoryReference

      };
      NewsModel.getDefault().addCategoryListener(categoryListener);
      fModelDAO.saveCategory(initialCategory[0]);
      assertTrue(categoryAddedCalled[0]);
      assertTrue(categoryUpdatedCalled[0]);
      fModelDAO.deleteCategory(new CategoryReference(updatedCategory[0].getId()));
    } catch (PersistenceException e) {
      fail(e.getMessage());
    } finally {
      if (categoryListener != null) {
        NewsModel.getDefault().removeCategoryListener(categoryListener);
View Full Code Here

Examples of org.rssowl.core.model.reference.CategoryReference

    IFeed feed = createFeed("http://www.rssowl.org");
    feed = fDao.saveFeed(feed);
    INews news = fFactory.createNews(null, feed, new Date());
    fFactory.createCategory(null, news);
    INews savedNews = fDao.saveNews(news);
    fDao.deleteCategory(new CategoryReference(news.getCategories().get(0).getId()));
    savedNews = fDao.loadNews(savedNews.getId());
    assertNotNull(savedNews);
  }
View Full Code Here

Examples of org.rssowl.core.model.reference.CategoryReference

  @Test
  public void testRemoveCategoryWithoutFeed() throws Exception {
    IFeed feed = createFeed("http://www.rssowl.org");
    fFactory.createCategory(null, feed);
    IFeed savedFeed = fDao.saveFeed(feed);
    fDao.deleteCategory(new CategoryReference(feed.getCategories().get(0).getId()));
    savedFeed = fDao.loadFeed(savedFeed.getId());
    assertNotNull(savedFeed);
  }
View Full Code Here

Examples of org.rssowl.core.model.reference.CategoryReference

      };
      fModel.addPersonListener(personListener);

      /* Check Category Deleted */
      final ICategory category1 = fFactory.createCategory(null, newsRef1.resolve());
      final CategoryReference categoryRef1 = new CategoryReference(fDao.saveCategory(category1).getId());
      final ICategory category2 = fFactory.createCategory(null, newsRef2.resolve());
      final CategoryReference categoryRef2 = new CategoryReference(fDao.saveCategory(category2).getId());

      final boolean categoryDeleted[] = new boolean[2];
      categoryListener = new CategoryAdapter() {
        @Override
        public void categoryDeleted(Set<CategoryEvent> events) {
          for (CategoryEvent event : events) {
            assertFalse("Expected this Event to be no Root Event", event.isRoot());

            ICategory category = event.getEntity();

            if (categoryRef1.references(category))
              categoryDeleted[0] = true;

            else if (categoryRef2.references(category))
              categoryDeleted[1] = true;
          }
        }
      };
      fModel.addCategoryListener(categoryListener);
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.