Oracle GlassFish Server 3.0.1 Add-On Component Development Guide

Adding a Node to the Navigation Tree

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:navNode. 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 GlassFish Server node


Under the Applications node


Under the Resources node


Under the Configuration node


Under the Web Container node


Under the HTTP Service node

Note –

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.

Example 3–2 Example Tree Node Integration Point

For example, the following integration-point element uses a parentId of tree to place the new node at the top level.


This example specifies the following values in addition to the parentId:

The example console-config.xml file provides other examples of tree nodes under the Resources and Configuration nodes.

Creating a JavaServer Faces Page for Your Node

A JavaServer Faces page for a tree node uses the tag sun:treeNode. This tag provides all the capabilities of the Project Woodstock tag webuijsf:treeNode.

Example 3–3 Example JavaServer Faces Page for a Tree Node

In the example, the sampleNode.jsf file has the following content:

            imageURL="resource/sample/images/sample.png" />

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 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 this image is an absolute path, /resource/sample/images/sample.png, where sample in the path is the integration point id value (see Specifying the ID of an Add-On Component).