com.sapportals.portal.navigation

Class DefaultNavigationNamingHandler

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

public class DefaultNavigationNamingHandler
extends Object
implements INavigationConnectorNamingHandler

 Implements a naming handler for backward compatibility.
 It can be used also for cases where the connector's naming repository is
 simple, therefor the logic behind 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 separator, "." 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.
 

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

Constructor Summary
DefaultNavigationNamingHandler()
           
 
Method Summary
 String composeName(Hashtable environment, String activeNodeURL, int numOfLevelsUp, 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
 

Constructor Detail

DefaultNavigationNamingHandler

public DefaultNavigationNamingHandler()
Method Detail

getInstance

public static DefaultNavigationNamingHandler getInstance()

composeName

public String composeName(Hashtable environment,
                          String activeNodeURL,
                          int numOfLevelsUp,
                          String[] childrenArr)
                   throws 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 separator 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).
activeNodeURL - the URL of the active node for which relative URL is created
numOfLevelsUp - the number of ancestors needed to be searched.
childrenArr - 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/folder3/workset1/page1 to pcd:role1/folder1/folder2/folder4/workset2/page2 the API should be composeName ("pcd:role1/folder1/folder2/folder3/workset1/page1", 3, {"folder4", "workset2", "page2"});
Returns:
URL of the relative node.
Throws:
NamingException - will never be thrown because no validation checks are done.


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.