Show TOC

Procedure documentationStep 3: Registering the Connector Locate this document in the navigation structure

 

You must register the connector with the navigation service for the navigation service to include your navigation nodes in the portal.

Generally, you create a new service whose only function is to register your connector.

Procedure

  1. Create a portal service, which must implement IService.

  2. Define a constant for the prefix.

    Syntax Syntax

    1. public static String NAV_CONNECTOR_PREFIX = "myPrefix";
    End of the code.
  3. In the service's init() method, create an instance of your INavigationConnector class.

    Syntax Syntax

    1. public void init(IServiceContext serviceContext) {
          mm_serviceContext = serviceContext;
          myConnector = new myConnector();
      }
      
    End of the code.
  4. Register the navigation connector in the service's afterInit() method.

    Syntax Syntax

    1. public void afterInit() {
          INavigationConnectorRegistration service =
              (INavigationConnectorRegistration)
                  getContext().getService(INavigationService.KEY);
          if (service != null) {
              service.registerConnector(
                  NAV_FILE_CONNECTOR_PREFIX, myConnector);
          }
      }
      
    End of the code.
  5. Create a service entry in portalapp.xml for the service, similar to the one shown below:

    Syntax Syntax

    1. <service name="myConnectorService">
          <service-config>
              <property name="className" value="myConnectorService"/>
              <property name="startup" value="true"/>
          </service-config>
      </service>
      
    End of the code.