com.filenet.wcm.toolkit.server.util
Class DisplayNameUtil

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.DisplayNameUtil

public class DisplayNameUtil
extends java.lang.Object


Constructor Summary
DisplayNameUtil(WcmDataStore ds)
           
 
Method Summary
static void addDisplayName(java.lang.String id, java.lang.String displayName)
          Adds a new id -> displayName pair to the cache
static void addShortName(java.lang.String fullName, java.lang.String shortName)
           
static void clearCache()
          Clears the display name cache.
static void clearShortNameCache()
           
static java.util.Set extractUserNames(org.w3c.dom.Document xml)
          Parses the XML and returns a Set of values of user name properties.
static int getCacheSize()
          Returns the size of the cache.
static java.lang.String getShortName(java.lang.String fullName)
           
static int getShortNameCacheSize()
           
static java.lang.String lookupDisplayName(java.lang.String id)
          Called from XSL where session is not available.
static java.lang.String lookupDisplayName(java.lang.String id, com.filenet.wcm.api.Realm realm)
          Looks up a singe display name value.
static java.lang.String lookupDisplayName(java.lang.String id, WcmDataStore ds)
          Lookup the display name value.
static void lookupDisplayNames(org.w3c.dom.Document xml, WcmDataStore ds)
          Deprecated. this is a very CPU intensive operation for large documents. If you are using this method, consider using something else. Looks up all display names contained in the XML document. The display name values are added to the cache.
static void lookupDisplayNames(java.util.Set ids, com.filenet.wcm.api.Session s, com.filenet.wcm.api.Realm realm)
          Looks ups a display names for Set ids.
static void lookupDisplayNames(java.util.Set ids, WcmDataStore ds)
          Looks up the display names for values in the ids Set.
 void lookupDisplayNamesFromXSL(org.w3c.dom.NodeList nl)
           
static java.lang.String lookupDisplayNameSimple(java.lang.String id)
          Called from code where session is not available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayNameUtil

public DisplayNameUtil(WcmDataStore ds)
Method Detail

lookupDisplayNamesFromXSL

public void lookupDisplayNamesFromXSL(org.w3c.dom.NodeList nl)

addShortName

public static void addShortName(java.lang.String fullName,
                                java.lang.String shortName)

getShortName

public static java.lang.String getShortName(java.lang.String fullName)

clearShortNameCache

public static void clearShortNameCache()

getShortNameCacheSize

public static int getShortNameCacheSize()

clearCache

public static void clearCache()
Clears the display name cache.


getCacheSize

public static int getCacheSize()
Returns the size of the cache.

Returns:
cache size

lookupDisplayName

public static java.lang.String lookupDisplayName(java.lang.String id)
Called from XSL where session is not available. If the display name is not found, id is returned.

Parameters:
id -
Returns:
display name if found, id if not found

lookupDisplayNameSimple

public static java.lang.String lookupDisplayNameSimple(java.lang.String id)
Called from code where session is not available. If the display name is not found, null is returned.

Parameters:
id -
Returns:
display name if found, null if not found

addDisplayName

public static void addDisplayName(java.lang.String id,
                                  java.lang.String displayName)
Adds a new id -> displayName pair to the cache

Parameters:
id -
displayName -

lookupDisplayName

public static java.lang.String lookupDisplayName(java.lang.String id,
                                                 com.filenet.wcm.api.Realm realm)
                                          throws java.lang.Exception
Looks up a singe display name value. If the value is not in the cache, the method looks up the value

Parameters:
id -
realm -
Returns:
display name
Throws:
java.lang.Exception

lookupDisplayNames

public static void lookupDisplayNames(org.w3c.dom.Document xml,
                                      WcmDataStore ds)
                               throws java.lang.Exception
Deprecated. this is a very CPU intensive operation for large documents. If you are using this method, consider using something else. Looks up all display names contained in the XML document. The display name values are added to the cache.

Parameters:
xml -
ds -
Throws:
java.lang.Exception

lookupDisplayNames

public static void lookupDisplayNames(java.util.Set ids,
                                      WcmDataStore ds)
                               throws java.lang.Exception
Looks up the display names for values in the ids Set. The display name values are added to the cache.

Parameters:
ids -
ds - DataStore object
Throws:
java.lang.Exception

lookupDisplayName

public static java.lang.String lookupDisplayName(java.lang.String id,
                                                 WcmDataStore ds)
                                          throws java.lang.Exception
Lookup the display name value. The value is added to the cache and returned by the method.

Parameters:
id -
ds -
Returns:
Throws:
java.lang.Exception

lookupDisplayNames

public static void lookupDisplayNames(java.util.Set ids,
                                      com.filenet.wcm.api.Session s,
                                      com.filenet.wcm.api.Realm realm)
                               throws java.lang.Exception
Looks ups a display names for Set ids. The display name values are added to the cache.

Parameters:
ids - Set of ids
s - Session object
realm - Real object
Throws:
java.lang.Exception

extractUserNames

public static java.util.Set extractUserNames(org.w3c.dom.Document xml)
Parses the XML and returns a Set of values of user name properties.

Parameters:
xml -
Returns:
Set of user names


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.