Show TOC

Navigation ServiceLocate this document in the navigation structure

Use

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 can be launched. If the first node cannot be launched, 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 doNavigate() for navigation to a navigation target.

    For more information, see Triggering Navigation and Enterprise Portal Client Framework (EPCF) .

  • 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 access these interfaces, call the INavigationService.Key method to obtain the navigation service object and use it to call the relevant interface methods. For example:

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