Creates a Menu Model from a TreeModel where nodes in the treeModel
contain viewId information.

Each node must have either a bean getter method or a Map property
that returns a viewId. There are several restrictions on the data:

o The nodes in the tree must either be all beans or all maps,
but not a mix of beans and maps.
o The viewId of a node can be null, but if set it must be unique.
o The tree cannot be mutable.

The getFocusRowKey method

o gets the current viewId by calling
FacesContext.getCurrentInstance().getViewRoot().getViewId()
o compares the current viewId with the viewId's in the viewIdFocusPathMap
that was built by traversing the tree when the model was created.
o returns the focus path to the node with the current viewId or null if the
current viewId can't be found.
o in the case where a viewId has multiple focus paths, the currently
selected node is used as a key into the nodeFocusPathMap to return the
correct focus path.

The Model is created by specifying it in the faces-config.xml file
as follows

getFocusRowKey()
Returns the rowKey to the current viewId, or in the case of where the
model has nodes with duplicate viewId's and one is encountered, we
return the rowKey of the currently selected node.

XMLMenuModel

public XMLMenuModel()

Method Detail

isCompatibilityMode

protected boolean isCompatibilityMode()

This needs to be overriden by classes extending XmlMenuModel and using APIs for the nodes
of XmlMenuModel. Default value returned is true for backward compatibilty. The models using
the external APIs for their nodes must return false.

getSource

setCreateHiddenNodes

public void setCreateHiddenNodes(boolean createHiddenNodes)

Sets the boolean value that determines whether or not to create
nodes whose rendered attribute value is false. The default
value is false.
This is set through a managed property of the XMLMenuModel
managed bean -- typically in the faces-config.xml file for
a faces application.

getCreateHiddenNodes

public boolean getCreateHiddenNodes()

Gets the boolean value that determines whether or not to create
nodes whose rendered attribute value is false. The default
value is false.
This is called by the contentHandler when parsing the XML metadata
for each node.

Returns:

the boolean value that determines whether or not to create
nodes whose rendered attribute value is false.

getCustomProperty

Gets the list of custom properties from the node
and returns the value of propName. Node must be an itemNode.
If it is not an itemNode, the node will not have any custom
properties and null will be returned.