com.sapportals.portal.navigation

Class DefaultNavigationNamingHandler

java.lang.Object
  extended by com.sapportals.portal.navigation.DefaultNavigationNamingHandler
All Implemented Interfaces:
INavigationConnectorNamingHandler

public class DefaultNavigationNamingHandler
extends Object
implements INavigationConnectorNamingHandler

The class that implements a naming handler to provide backward compatibility. A navigation connector can use this implementation instead of implementing its own naming handler, if it matches the naming convention of the repository.
It determines how the name of the nodes are constructed. The name should be built according to the syntax of the naming interface that the nodes are stored in (such as, LDAP, JNDI, File System).
The default naming handler is implemented by the navigation service. This implementation handles the name according to the UNIX syntax ("/" is a separator, "." is a pointer to the current directory, and ".." is a pointer to a parent directory).
A connector may use this default implementation, or it can implement a naming handler of its own.

See Also:
com.sapportals.portal.navigation.INavigationNamingHandler.java, INavigationConnectorNamingHandler

Constructor Summary
DefaultNavigationNamingHandler()
           
 
Method Summary
 String composeName(Hashtable environment, String activeNodeURL, int numOfLevelsUp, String[] childrenArr)
          Creates the name of the navigation target node specified by the active node and a relative path to it.
static DefaultNavigationNamingHandler getInstance()
          Gets an instance of the default navigation naming handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNavigationNamingHandler

public DefaultNavigationNamingHandler()
Method Detail

getInstance

public static DefaultNavigationNamingHandler getInstance()
Gets an instance of the default navigation naming handler.

Returns:
the default navigation naming handler

composeName

public String composeName(Hashtable environment,
                          String activeNodeURL,
                          int numOfLevelsUp,
                          String[] childrenArr)
                   throws NamingException
Creates the name of the navigation target node specified by the active node and a relative path to it. The caller to this method only needs to know where the target node is located relative to the current node.
This implementation assumes that '/' is the separator between elements in the path and '..' indicates one level up (a parent). The default implementation deals only with a simple naming scheme, and therefore cannot handle federations, LDAP and other compound schemes.
For example, calling this implementation with the parameters below:
composeName ("pcd:role1/folder1/folder2/folder3/workset1/page1", 3, {"folder4", "workset2", "page2"});
returns the path
pcd:role1/folder1/folder2/folder4/workset2/page2.

Specified by:
composeName in interface INavigationConnectorNamingHandler
Parameters:
environment - the user context (ignored in this method)
activeNodeURL - the URL of the active node
numOfLevelsUp - the number of levels of parents to search
childrenArr - an array of the atomic names of the children (including the target node)
Returns:
the name of the relative node
Throws:
NamingException - not thrown because no validation checks are done
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-RUNTIME [sap.com] tc/ep/navigation/api api EP-PIN


Copyright 2011 SAP AG Complete Copyright Notice