How to populate a adf tree programmatically

Hi,
I am creating a adf tree (single select) which is the menu of my application.
Each node of my tree is a command link.
I am reading the data from a table through a view object (adfbc).
I want to somehow manipulate my managed bean so that I can display selected rows (permission based) in the adf tree.
If I am using the condition in the rendered attribute then the nodestamp facet is still rendered and there is a blank row displayed for a node which should not be displayed.
The other way I was thinking to Iterate the entire tree in my managed bean and remove the nodes which should not be displayed.
This way the tree is manipulated before it is endered and hence it will not have any blank row in the place of nodes not to be shown.
Please let me know a few iterating code strip and where(in which method) I should put it in my managed bean to make it work?
As of now I was putting a tree iterator code in the getMenuTree() method of my managed bean where menuTree is the RichTree object for the tree which I have to render in my UI.
CollectionModel model = (CollectionModel)this.menuTree.getValue;
treeBinding = (JUCtrlHierBinding)model.getWrappedData();
JUCtrlHierNodeBinding root = treeBinding.getRootNodeBinding();
checkPermission(root);
List<JUCtrlHierNodeBinding> children = root.getChildren();
if (children != null)
for (JUCtrlHierNodeBinding _node : children)
checkPermission(_node);
checkPermission - is the method which reads few bindings from the node and decides that this node id eligible for display or not based on user permission.
But with this code I am getting the node hierarchical structure of the selected node only.
Thanks in advance
Advertisement
Reply

I thought in this direction... but I cannot access the permission data from VO level as I have to provide this menu interface to multiple projects.
And the menu I am creating is in a template from where I need to get permission bean of various other projects.
any other suggestions ?