com.sapportals.portal.navigation
Interface INavigationNamingHandler


public interface INavigationNamingHandler

 Copyright(c) 2003 SAP.  All Rights Reserved.

 Description:  INavigationNamingHandler interface may be implemented by
 any navigation model handle a connector.  
 The APIs declared in this interface usually call the implmentation of the connectors, 
 which implement the INavigationConnectorNamingHandler.
 Thus, some of the APIs in this interface has exactly the same signature 
 as in the INavigationConnectorNamingHandler, and the others wrap the original 
 APIs for simplicity. 
 For example:
 getNavNodeParentName will eventually uses the composeName, but it would need less 
 parameters, as the numOfLevelsUp paramter is always equals to 1.

Version:
2.0
See Also:
com.sapportals.portal.navigation.DefaultNavigationNamingHandler, com.sapportals.portal.navigation.INavigationConnectorNamingHandler, com.sapportals.portal.navigation.NavigationService

Method Summary
 java.lang.String composeName(java.util.Hashtable environment, java.lang.String baseNodeURL, int numberOfLevelsUp, java.lang.String[] children)
          Creates the URL of the navigation target node by the active node and a relative path to it.
 java.lang.String composeName(java.util.Hashtable environment, java.lang.String connectorPrefix, java.lang.String baseNodeURL, int numberOfLevelsUp, java.lang.String[] children)
          Creates the URL of the navigation target node by the active node and a relative path to it.
 INavigationNode createNavigationNode(INavigationConnectorNode connNode, java.lang.String connectorPrefix, java.lang.String nodeName, java.util.Hashtable environment)
          Create an INavigationNode object (a wrapper node for INavigationConnectorNode).
 java.lang.String getNavNodeChildName(java.util.Hashtable environment, java.lang.String activeNodeName, java.lang.String childNodeName)
          Retrieves the child Navigation Name of the supplied node, acoording to the atomic child name.
 java.lang.String getNavNodeParentName(java.util.Hashtable environment, java.lang.String childNodeName)
          Retrieves the parent Navigation Nameof the supplied node.
 

Method Detail

getNavNodeParentName

public java.lang.String getNavNodeParentName(java.util.Hashtable environment,
                                             java.lang.String childNodeName)
                                      throws javax.naming.NamingException
Retrieves the parent Navigation Nameof the supplied node. When parent node doesn't exists (when supplied node is an initial node), a null value is returned.
Parameters:
childNodeName - the child node anme for which the parent Name is requested.
Returns:
parent node nameof the supplied node.
Throws:
javax.naming.NamingException - is thrown if a validation check is done and the recieved node name is not valid (child node cannot be retrieved).

getNavNodeChildName

public java.lang.String getNavNodeChildName(java.util.Hashtable environment,
                                            java.lang.String activeNodeName,
                                            java.lang.String childNodeName)
                                     throws javax.naming.NamingException
Retrieves the child Navigation Name of the supplied node, acoording to the atomic child name.
Parameters:
activeNodeName - the parent node name from which the child should be retrieved.
childNodeName - the atomic child node name.
Returns:
parent node nameof the supplied node.
Throws:
javax.naming.NamingException - is thrown if a validation check is done and the recieved node name is not valid (child node cannot be retrieved).

composeName

public java.lang.String composeName(java.util.Hashtable environment,
                                    java.lang.String baseNodeURL,
                                    int numberOfLevelsUp,
                                    java.lang.String[] children)
                             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. The method expects to get a full qualified URL for the baseNodeURL.
Parameters:
baseNodeURL - the full qualified URL of the active node for which relative URL is created
numberOfLevelsUp - 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. For example: In order to go from pcd:role1/folder1/folder2/fodler3/workset1/page1 to pcd:role1/folder1/folder2/fodler4/workset2/page2 the API should be composeName ("pcd:role1/folder1/folder2/fodler3/workset1/page1", 3, {"fodler4", "workset2", "page2"});
Returns:
URL of the relative node.
Throws:
javax.naming.NamingException - if a validation check is done and the active node doesn't exist (child node cannot be retrieved).

composeName

public java.lang.String composeName(java.util.Hashtable environment,
                                    java.lang.String connectorPrefix,
                                    java.lang.String baseNodeURL,
                                    int numberOfLevelsUp,
                                    java.lang.String[] children)
                             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. The method expects to get only the internal name of the node for the baseNodeURL.
Parameters:
connectorPrefix - the connector prefix for this node.
baseNodeURL - the internal URL of the active node for which relative URL is created (no connector prefix is expected).
numberOfLevelsUp - 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 - if a validation check is done and the active node doesn't exist (child node cannot be retrieved).

createNavigationNode

public INavigationNode createNavigationNode(INavigationConnectorNode connNode,
                                            java.lang.String connectorPrefix,
                                            java.lang.String nodeName,
                                            java.util.Hashtable environment)
Create an INavigationNode object (a wrapper node for INavigationConnectorNode).
Parameters:
connNode - the INavigationConnectorNode retrieved by the navigation connector.
connectorPrefix - the prefix of the navigation connector (is used as the prefix for all the navigation connectors nodes).
Returns:
an INavigationNode object (a wrapper node for the INavigationConnectorNode)