Example #1
0
  /**
   * Searchs for subgroups of a determined group
   *
   * @param n GroupNode
   */
  private void checkExtraNodes(GroupNode n) {

    LOG.trace("checkExtraNodes");
    TreeGroupDAO tgm = DataAccessDriver.getInstance().newTreeGroupDAO();

    List childGroups = tgm.selectGroups(n.getId());

    for (Iterator iter = childGroups.iterator(); iter.hasNext(); ) {
      GroupNode f = (GroupNode) iter.next();

      this.checkExtraNodes(f);

      n.addNode(f);
    }
  }
Example #2
0
  /**
   * Process the group hierarchy.
   *
   * @return <code>List</code> containing the complete group hierarchy. Each
   *         element from the list represents a single
   *         <code>GroupNode<code> object.
   * */
  public List getNodes() {

    LOG.trace("getNodes");
    List nodes = new ArrayList();

    TreeGroupDAO tgm = DataAccessDriver.getInstance().newTreeGroupDAO();

    List rootGroups = tgm.selectGroups(0);

    for (Iterator iter = rootGroups.iterator(); iter.hasNext(); ) {
      GroupNode n = (GroupNode) iter.next();

      this.checkExtraNodes(n);

      nodes.add(n);
    }

    return nodes;
  }