Show TOC

Step 1: Creating a Navigation Connector NodeLocate this document in the navigation structure

Context

Your navigation connector is, essentially, a supplier of navigation nodes. Each navigation node is an INavigationConnectorNode object, and you must create a class that determines the values of navigation attributes.

Procedure


  1. Create a new class that extends AbstractNavigationConnectorNode .

  2. Implement the INavigationConnectorNode methods that return attribute values for the navigation connector node - methods that start with get and is .

  3. Implement listBindings() , which returns a javax.naming.NamingEnumeration of nodes related to the current node, for example, the children of the current node. The mode parameter determines the type of nodes to return, which can be one of the following:

    • Children of the current node

    • First child of the current node

    • Dynamic navigation iViews for the current node

    • Drag&Relate targets for the current node

    • Related links for the current node

    The following is a sample implementation, in which the navigation connector node class holds the relevant nodes in several local variables and returns the relevant set of nodes depending on the mode. For example, childrenNodeBindings is a List that holds the children of the current node.

    The mode constants are defined by the AbstractNavigationConnectorNode class.

    public NamingEnumeration listBindings(String binding, String mode,
                  Hashtable filterParameters)
                          throws NamingException {
     
        if (mode.equals(NAVIGATION_GET_CHILDREN))
            return new NavigationEnum(childrenNodeBindings);
        if (mode.equals(NAVIGATION_GET_RELATED_SEE_ALSO))
            return new NavigationEnum(relatedSeeAlsoNodeBindings);
        if (mode.equals(NAVIGATION_GET_RELATED_DR_TARGETS))
            return new NavigationEnum(relatedTargetNodeBindings);
        if (mode.equals(NAVIGATION_GET_FIRST_CHILD)){
            return new NavigationEnum(
                Collections.singletonList(childrenNodeBindings.get(0)));
        }
        else throw new NamingException("Unknown mode named "+mode);
    }
    
                         

    The Hashtable parameter contains environment variables, as described in Creating Navigation Connectors .