13.6. Portal nodes

The portal structure is a tree formed by nodes. It is possible to programmatically access the portal tree in order to
  • discover the tree structure of the portal
  • create URL that will render the different portal nodes
  • access the properties of a specific node
The PortalNode interface
As usual with tree structures, the main interface to study is the org.jboss.portal.api.node.PortalNode. That interface is intentionally intended for obtaining useful information from the tree. It is not possible to use it to modify the tree shape because it is not intended to be a management interface.
public interface PortalNode
{
   int getType();
   String getName();
   String getDisplayName(Locale locale);
   Map getProperties();
   PortalNodeURL createURL(PortalRuntimeContext portalRuntimeContext);
   ...
}
The interface offers methods to retrieve information for a given node such as the node type, the node name or the properties of the node. The noticeable node types are:
  • PortalNode.TYPE_PORTAL : the node represents a portal
  • PortalNode.TYPE_PAGE : the node represents a portal page
  • PortalNode.TYPE_WINDOW : the node represents a page window
The org.jboss.portal.api.node.PortalNodeURL is an extension of the PortalURL interface which adds additional methods useful for setting parameters on the URL. There are no guarantees that the portal node will use the parameters. So far portal node URL parameters are only useful for nodes of type PortalNode.TYPE_WINDOW and they should be treated as portlet render parameters in the case of the portlet is a local portlet and is not a remote portlet. The method that creates portal node URL requires as parameter an instance of PortalRuntimeContext.
The interface also offers methods to navigate the node hierarchy:
public interface PortalNode
{
   ...
   PortalNode getChild(String name);
   Collection getChildren();
   PortalNode getRoot();
   PortalNode getParent();
   ...
}