Show TOC

MethodsLocate this document in the navigation structure

Use

This section describes the methods provided by the navigation helper service.

Retrieving Nodes

The following methods enable you to retrieve nodes in the navigation hierarchy based on the node selected by the user:

  • getCurrentNavNode(): Returns the current node, which is the current navigation target.

  • getCurrentLaunchNavNode(): Returns the launched node, which is displayed in the content area. If the current node cannot be launched node, the first node in the level below is launched.

  • getCurrentContextNavNode(): Returns the context node, which is highlighted in the top-level or detailed navigation iView.

    In most cases, the context node is the same as the current node. But can be different if the current node is invisible, or if a different context node was specified in the navigation link.

The following methods enable you to retrieve other nodes in the navigation hierarchy:

  • getPersonalizePortalNode(): Returns the initial node for portal personalization, which is the initial node with a merge ID of PORTAL_PERSONALIZATION.

  • getRealInitialNodes(): Returns the initial nodes, without the portal personalization node. The navigation service's getInitialNodes() returns all the initial nodes.

  • getFirstNode(): Returns the first navigation node in the highest level of the navigation hierarchy. If this node cannot be launched, the first node of the second level is returned.

  • getParentNode(): Returns the parent node of the specified node.

Retrieving the Navigation Path

The following methods enable you to retrieve the nodes in the navigation path:

  • getNavNodesListForTarget(): Returns the navigation nodes from the specified node to its entry point. In other words, the method returns the nodes along the navigation path.

  • getNavNodesPathIndexesList(): Returns an array of integers that represent the navigation path.

    For example, if the current context node is Start of the navigation path System Administration Next navigation step Support Next navigation step PCD Tools End of the navigation path, the method might return 3, 5, 0 - where 3 is the index of SystemAdministration in the initial nodes, 5 is the index of the Support node in the children of SystemAdministration, and so on.

    This method can be helpful for creating a navigation iView. Once a navigation tree is rendered, you can then use the getNavNodesPathIndexesList() method to retrieve the indexes of the nodes to display, and update the navigation tree without creating the entire tree from scratch.

Parsing a Navigation Target

The following methods enable you to get sections of a specific navigation target URL:

  • getInternalURL(): Returns the specified navigation target URL without the prefix.

  • getPrefix(): Returns the prefix of the specified navigation target URL.