cancel
Showing results for 
Search instead for 
Did you mean: 

Navigation Connector Service will not start

Former Member
0 Kudos

Hello,

I am trying to program a custom Navigation Connector. As I have read in the documentation, you have to also implement a regular portal service with the purpose of registering the Navigation Connector.

This is the code for the Navigation Connector class. Really simple, just to see if it's working (NavigationEnum is an implementation of the javax.naming.NamingEnumeration).

public class NavConnector extends AbstractNavigationConnectorExt {
	
	public NavConnector() {
	}

	public NamingEnumeration getInitialNodes(Hashtable arg0) {
		return NavigationEnum.EMPTY_ENUM;
	}

	public INavigationConnectorNode getNode(Hashtable arg0, String arg1) {
		return new NavConnectorNode();
	}

	public NamingEnumeration getNodes(Hashtable arg0, Vector arg1) {
		return NavigationEnum.EMPTY_ENUM;
	}

	public String getConnectorCacheDiscriminator(Hashtable arg0) {
		return "fluffyCache";
	}

	public NamingEnumeration getNodeByQuickLink(Hashtable arg0, String arg1) {
		return NavigationEnum.EMPTY_ENUM;
	}

}

Then, in a regular service I coded, in the afterInit() method, I have put this:

		INavigationConnectorRegistration service = null;
		try {
			service = (INavigationConnectorRegistration)getContext().getService(INavigationService.KEY);
		} catch (Exception e) {
			logger.warningT("[NavConnectorService.afterInit] exception getting registrator: " + e.toString());
		}
		DefaultNavigationNamingHandler defaultNamingHandler = DefaultNavigationNamingHandler.getInstance();
		if (service != null) {
			service.registerConnector(NAVCONNECTOR_PREFIX, navConnector, defaultNamingHandler);
		}

Can you tell if there is something I am doing wrong?

The service will not start up neither on par upload nor on portal startup.

Thanks in advance.

Silviu.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Silviu,

I don't know if you still need the answer to you question, but this is it:

Instead of extending AbstractNavigationConnectorExt (this will be the right way from SP16 onwards I think) you should implement INavigationConnector.

Using INavigationConnector caching is not possible in your code, but you can configure the portal to cache all navigation on a global level.

kind regards,

Caspar

Answers (0)