Show TOC Start of Content Area

Background documentation Navigation Service  Locate the document in its SAP Library structure

The navigation service enables you to retrieve information about the navigation hierarchy for a specific user.

The service can be obtained with the following code:

INavigationService service = (INavigationService)
    PortalRuntime.getRuntimeResources().getService(INavigationService.KEY);

The service provides the following methods:

·        getInitialNodes(): Queries the navigation connectors and returns all the top-level nodes.

·        getFirstNode(): Returns the first node in the navigation hierarchy, if it is launchable. If the first node is not launchable, the method returns the first child of the first node in the navigation hierarchy.

·        getNode(): Returns the INavigationNode for a specified navigation target.

·        getNodes(): Returns a Vector of INavigationNode objects for a specified Vector of navigation targets.

·        getNodeByQuickLink(): Returns the navigation node for a specified quick link.

·        getNavigationNodeHashedName(): Takes the long name for a navigation node and returns the node’s hashed name.

·        getNavigationNodeOriginalName(): Takes the hashed name for a navigation node and returns the node’s long name.

All of the navigation service methods require you to pass a Hashtable of environment variables, one of which must be an IUser object for the current user. This value must be stored with the key NavigationPrincipal; a constant is defined for this value in INavigationConstants.

Note

Note that navigation connectors supply INavigationConnectorNode (AbstractNavigationConnectorNode) objects to the navigation service, while the navigation service supplies INavigationNode objects to navigation iViews (and all other components that call the service).

Additional Interfaces

The navigation service also implements the following interfaces, which provide additional methods for working with the navigation hierarchy:

      INavigationConnectorRegistration: provides methods for registering a navigation connector and redirector.

For more information, see Creating Navigation Connectors.

      INavigationNamingHandler: provides methods for composing navigation node names.  

      INavigationRedirector: provides a method to retrieve redirected node names. A redirector must be registered that recognizes the prefix of the navigation target.

For more information, see Redirectors.

      INavigationGenerator: provides methods for creating the JavaScript (such as the doNavigate() method) for navigation to a navigation target.

For more information on triggering navigation, see Triggering Navigation and Client-Side Eventing.

      IObjectBasedNavigation: provides methods for creating object-based navigation links.

For more information, see Object-Based Navigation.

·        InavigationCacheManager: provides methods to manage the navigation cache.

For more information, see Managing the Navigation Cache.

 

To obtain an object that implements one of these interfaces, get the navigation service (with INavigationService.Key) and use it to call the relevant interface methods.

For example:

INavigationNamingHandler service = (INavigationNamingHandler)
    PortalRuntime.getRuntimeResources().getService(INavigationService.KEY);

 

End of Content Area