Show TOC Start of Content Area

Procedure documentation Creating an External Connector  Locate the document in its SAP Library structure

An external connector, which supplies nodes to the middle of the navigation hierarchy, is built just like a regular connector, with the following changes:

      Return nodes based on the external connector key

When a connector is called in order to supply navigation nodes to the middle of the hierarchy, a key is sent in the environment variables. The connector's getInitialNodes() should return the appropriate nodes for the key.

For example, a Web content management system creates content in a set of folders, News and Product Management. For a specific workset, an administrator sets the external connector key to Product Management. The connector created for supplying navigation nodes for this content returns nodes for the content in the Product Management folder.

The key, the one entered by the administrator in the External Connector property for a role, workset or role folder, is passed in the environment with the key INavigationConstants.EXTERNAL_CONNECTOR_KEY.

For more information on setting the External Connector property, see Adding External Connector Nodes.

·        Return a node based on the default node flag

When the children of a role, workset or role folder come from an external connector, the navigation service retrieves the node's default node by calling the external connector's getInitialNodes() method and passing a flag. The flag indicates that only the default node is needed, not all the children.

The navigation connector's getInitialNodes() method should check this flag, and return the default node.

The flag is passed in the environment with the key INavigationConstants.NAVIGATION_GET_DEFAULT_NODE.

·        Implement a naming handler for the connector

A naming handler defines how navigation node names are constructed, for example, what delimiter is used to show a hierarchy (nodeA/nodeB/nodeC or nodeA.nodeB.nodeC). If a navigation connector does not define a naming handler, a default naming handler is used.

The naming handler of a connector can be queried to get the name of a node, which is specified in relation to another node. For example, the navigation service can ask for name of the node two levels up from nodeA.

If an external connector creates a hierarchy of nodes, and then exposes subsets of the nodes based on keys, then you must implement a naming handler.

The naming handler must return null for the name of the parent of any initial node, even if within the navigation connector's hierarchy the node does have a parent.

For more information on building a connector, see Creating Navigation Connectors.

Note

An external connector cannot define Related Links for nodes that are inserted in the middle of the hierarchy.

for the middle

Entry Points

Like a standard connector, an external connector can also supply entry points to be displayed in the top-level navigation iView. To do this, return nodes in the getInitialNodes() method without checking the key, as follows:

public NamingEnumeration getInitialNodes(Hashtable environment) {

 

    String myKey = environment
        .get(INavigationConstants.EXTERNAL_CONNECTOR_KEY);

 

    if(myKey.equals("A")) {

        // Return nodes for key A;

    } else if(myKey.equals("B")) {

        // Return nodes for key A;

    } else {

        // Return entry point nodes;

    }

}

Note

When getInitialNodes() is called by the navigation service to add nodes to the middle of the hierarchy (and not to get the entry points), you cannot make a node an entry point, even by setting the Entry Point property to true.

End of Content Area