com.sapportals.portal.navigation
Class DefaultNavigationNamingHandler
java.lang.Object
|
+--com.sapportals.portal.navigation.DefaultNavigationNamingHandler
- All Implemented Interfaces:
- INavigationConnectorNamingHandler
- public class DefaultNavigationNamingHandler
- extends java.lang.Object
- implements INavigationConnectorNamingHandler
Copyright(c) 2003 SAP. All Rights Reserved.
Description: DefaultNavigationNamingHandler class implements a naming handler
for backward compatablility. It can be used also for cases where the connector's naming repository is
simple, therefor the logic behinf this DefaultNamingHandler is sufficient.
It determines how the name of the nodes will be constructed. The name should be built
according to the syntax of the naming interface that the nodes are stored in. (LDAP, JNDI, File System, etc.)
The default naming handler is implemented by the navigation. This implementation handles
name according to the UNIX syntax (consider "/" to be a seperator, "." as a pointer to the
current directory, ".." as a pointer to a parent directory, etc.
Connector may use this default implementation, if it finds it sufficient to its needs,
otherwise (For example - the default implementation does not support federations), it should implement a naming handler of its own.
- Version:
- 2.0
- See Also:
- com.sapportals.portal.navigation.INavigationNamingHandler.java,
com.sapportals.portal.navigation.INavigationConnectorNamingHandler,
com.sapportals.portal.navigation.NavigationService
|
Method Summary |
java.lang.String |
composeName(java.util.Hashtable environment,
java.lang.String activeNodeURL,
int numOfLevelsUp,
java.lang.String[] childrenArr)
Creates the URL of the navigation target node by the active node and a
relative path to it. |
static DefaultNavigationNamingHandler |
getInstance()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultNavigationNamingHandler
public DefaultNavigationNamingHandler()
getInstance
public static DefaultNavigationNamingHandler getInstance()
composeName
public java.lang.String composeName(java.util.Hashtable environment,
java.lang.String activeNodeURL,
int numOfLevelsUp,
java.lang.String[] childrenArr)
throws javax.naming.NamingException
- Creates the URL of the navigation target node by the active node and a
relative path to it. The caller to this API should not know anything about the
naming scheme of the connector. It should only know where the target node is located
in relative to the current node.
This implementation supposes that '/' is the seperator between elements in the path and '..'
indicates one level up (a parent).
The default implementation supplied here deals only with simple naming scheme,
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"});
will return the path
pcd:role1/folder1/folder2/folder4/workset2/page2
- Specified by:
composeName in interface INavigationConnectorNamingHandler
- Parameters:
environment - hashtable that contain the user context. This method ignore this parameter (can be null).baseNodeURL - the URL of the active node for which relative URL is
creatednumberOfLevelsUp - the number of ancestors needed to be searched.children - an array of the atomic names of the children existed
in the way down, including the target node itself.- Returns:
- URL of the relative node.
- Throws:
javax.naming.NamingException - will never be thrown because no validation checks are done.