Show TOC

Creating Navigation ConnectorsLocate this document in the navigation structure

Use

The navigation service creates a tree of navigation nodes for the current user from the registered navigation connectors. Navigation iViews can display these nodes to enable the user to navigate within the portal.

The portal comes with the roles navigation connector, which creates nodes based on objects defined in the PCD and is closely linked with the roles hierarchy defined by a content administrator. A user administrator assigns roles to individual users. The roles navigation connector then creates a set of navigation nodes based on the current user and the roles assigned to the user.

You can create additional connectors for creating additional navigation nodes.

A navigation connector is packaged in a portal application (EAR file). The following are the steps for creating a navigation connector:

Several methods of your navigation connector ( INavigationConnector ) and navigation connector node ( INavigationConnectorNode ) return a javax.naming.NamingEnumeration object. You may need to write an implementation for this interface. The examples in this section make use of the class NavigationEnum , which is a sample implementation of NamingEnumeration for this example only. The implementation is not described here.

Adding Nodes to the Middle of the Hierarchy

Generally, the navigation service calls all connectors - getInitialNodes() - to supply nodes for the top-level of the navigation hierarchy. Each of these nodes is then responsible for supplying its children.

However, you may want to create a navigation connector that adds nodes to the middle of the navigation hierarchy. For example, you may use the roles connector to create the top of the navigation hierarchy, based on user roles. Then, you may want to use a web content management (WCM) system to create pages and add navigation nodes for these pages to a role folder somewhere in the middle of the roles hierarchy.

For information on how to create a navigation connection that supplies nodes to the middle of the hierarchy, see Creating an External Connector .

Navigation Cache

The portal provides a mechanism for caching navigation nodes, which improves performance. When creating a connector, you can implement additional methods to determine if and how the navigation nodes are cached.

For more information, see Navigation Cache .

Environment Variables

The navigation service passes a Hashtable of environment variables to many methods that must be implemented in order to create a navigation connector.

The following is a table of the variables passed into these methods, with the key constant for retrieving the value from the Hashtable :

Value

Key Constant

Current User (IUser)

INavigationConstants.NAVIGATION_PRINCIPAL

Navigation Target (String)

INavigationConstants.MANADATORY_PARAM_NAME

Previous Navigation Target (String)

INavigationConstants.PREVIOUS_NAVIGATION_TARGET

Execution Flag

Indicates whether to execute the navigation node locally or on the remote portal. For remote scenarios only.

INavigationConstants.EXECUTE_LOCALLY

In addition, you can specify that your custom URL parameters are to be available as an environment variable.

To make a URL parameter available as an environment variable, add the name of the parameter to the EnvironmentParameters property of the navigation_events_helper in the com.sap.portal.navigation.helperservice application. Separate parameter names with a semicolon.

To retrieve the value, use the name of the URL property as the key in the environment variable Hashtable .