You can add a node to the navigation tree, either at the top level or under another node. To add a node, use an integration point of type org.glassfish.admingui:treeNode. Use the parentId attribute to specify where the new node should be placed. Any tree node, including those added by other add-on components, can be specified. Examples include the following:
At the top level
Under the Application Server node
Under the Applications node
Under the Web Applications node
Under the Resources node
Under the Configuration node
Under the Web Container node
Under the HTTP Service node
The webContainer and httpService nodes are available only if you installed the web container module for the Administration Console (the console-web-gui.jar OSGi bundle).
If you do not specify a parentId, the new content is added to the root of the integration point, in this case the top level node, tree.
For example, the following integration-point element uses a parentId of tree to place the new node at the top level.
<integration-point id="sampleNode" parentId="tree" type="org.glassfish.admingui:treeNode" priority="200" content="sampleNode.jsf" />
This example specifies the following values in addition to the parentId:
The id value, sampleNode, specifies the integration point ID.
The type value, org.glassfish.admingui:treeNode, specifies the integration point type as a tree node.
The priority value, 200, specifies the order of the node on the tree.
The content value, sampleNode.jsf, specifies the JavaServer Faces page that displays the node.
The example console-config.xml file provides other examples of tree nodes under the Resources and Configuration nodes.
A JavaServer Faces page for a tree node uses the JSFTemplating tag sun:treeNode. This tag provides all the capabilities of the Project Woodstock tag webuijsf:treeNode.
In the example, the sampleNode.jsf file has the following content:
<sun:treeNode id="treeNode1" text="SampleTop" url="/sample/page/testPage.jsf?name=SampleTop" target="main" imageURL="resource/sample/images/sample.png" > <sun:treeNode id="treeNodeBB" text="SampleBB" url="/sample/page/testPage.jsf?name=SampleBB" target="main" imageURL="resource/sample/images/sample.png" /> </sun:treeNode>
This file uses the sun:treenode tag to specify both a top-level tree node and another node nested beneath it. In your own JavaServer Faces pages, specify the attributes of this tag as follows:
A unique identifier for the tree node.
The node name that appears in the tree.
The location of the JavaServer Faces page that appears when you click the node. In the example, most of the integration points use a very simple JavaServer Faces page called testPage.jsf, which is in the src/main/resources/page/ directory. Specify the integration point id value as the root of the URL; in this case, it is sample (see Specifying the ID of an Add-On Component). The rest of the URL is relative to the src/main/resources/ directory, where sampleNode.jsf resides.
The url tag in this example passes a name parameter to the JavaServer Faces page.
The frame in which to display the JavaServer Faces page specified by the url tag. Normally, the value is main.
The location of a graphic to display next to the node name. In the example, the graphic is always sample.png, which is in the src/main/resources/images/ directory. The URL for the deployed images directory is relative to resource/idval/, where idval is the integration point id value (see Specifying the ID of an Add-On Component).