Пример #1
0
  public Collection getChildContainerNodes(Integer parentNode) {
    ArrayList ret = new ArrayList();
    cacheLeafs = new ArrayList();

    List children = null;
    try {
      children =
          (ROOT.equals(parentNode))
              ? controller.findRootCategories()
              : controller.findActiveByParent(parentNode);
    } catch (SystemException e) {
      logger.warn("Error getting Category Children", e);
    }

    for (Iterator i = children.iterator(); i.hasNext(); ) {
      CategoryVO vo = (CategoryVO) i.next();

      List grandkids = getGrandKids(vo.getId());

      BaseNode node = new CategoryNodeImpl();
      node.setId(vo.getId());
      node.setTitle(vo.getName());
      node.setContainer(true);
      node.setChildren(!grandkids.isEmpty());
      ret.add(node);
    }

    return ret;
  }
Пример #2
0
 public CategoryNodeSupplier() {
   BaseNode rootNode = new ContentNodeImpl();
   rootNode.setChildren(true);
   rootNode.setId(ROOT); // There is no BASE category so make it up
   rootNode.setTitle("Categories");
   rootNode.setContainer(true);
   setRootNode(rootNode);
 }