com.plumtree.portaluiinfrastructure.tags.manager
Class TagLibManager

java.lang.Object
  extended by com.plumtree.portaluiinfrastructure.tags.manager.TagLibManager
All Implemented Interfaces:
ITagLibManager

public class TagLibManager
extends java.lang.Object
implements ITagLibManager

The TagLibManager is a singleton class that returns tags. This uses dynamic discovery to import all of the ATag and ITagLibrary objects in certain locations, and then maintain a hashmap of clones, with possible resource pooling.

Author:
donh, caiusv

Method Summary
static ITagLibManager getInstance()
           
 XPHashtable GetLibraries()
          Return a data structure holding name and version number of all libraries loaded.
 XPArrayList GetLibraryTagList(java.lang.String _sLibname, double _dVersion)
          Return tag info for a specific library TODO this may not be the form we really want to return this data in that's still being figured out - CVN
 XPArrayList GetLibraryTags(java.lang.String _sLibname, double _dVersion)
          Return all tags in library TODO this may not be the form we really want to return this data in that's still being figured out - CVN
 int GetNumCustomTagLibraries()
          This method returns the number of custom Tag Libraries currently loaded.
 int GetNumCustomTags()
          This method returns the number of custom Tags currently loaded.
 ATag GetTag(java.lang.String _strTagName, java.lang.String _strLibraryName)
          Create the requested Tag.
 ATag GetTag(java.lang.String _strTagName, java.lang.String _strLibraryName, double _dLibraryVersion)
          Create the requested Tag.
 TagLibraryMetaData GetTagLibMetadata(java.lang.String _sLibname, double _dVersion)
          Return library meta data on a specific library and version.
 void GetTagMetadata(java.lang.String _sLibname, double _dVersion, java.lang.String _sTagname)
          Return metadata or something on all tags in library TODO not yet implemented cvn
 boolean HasTag(java.lang.String _strTagName, java.lang.String _strLibraryName)
          Return true if the tag specified by the parameters exists otherwise return false.
 boolean HasTag(java.lang.String _strTagName, java.lang.String _strLibraryName, double _dLibraryVersion)
          Return true if the tag specified by the parameters exists otherwise return false.
 void LoadClasses(java.lang.String strLibDir, java.lang.String strConfigFile)
          This method initializes the TagLibManager and should only be called by the Application Warmup.
 void LoadCustomClasses(java.lang.String strLibDir, java.lang.String strConfigFile)
          This method initializes the TagLibManager with custom tags to overwrite the original ones and should only be called by the the Application Warmup.
 void ReloadAllTagLibraries()
          This method reloads both the standard and custom tag libraries from the config files.
 void ReloadTagLibrary(java.lang.String _sLibname, double _dVersion)
          This method reloads a particular version of a tag library from the same library file (i.e.
static void setTestInstance(ITagLibManager testManager)
          Unit tests should use this method to overwrite/teardown existing singleton.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ITagLibManager getInstance()
Returns:
the singleton TagLibManager instance.

setTestInstance

public static void setTestInstance(ITagLibManager testManager)
Unit tests should use this method to overwrite/teardown existing singleton. DO NOT USE for production code.


GetTag

public ATag GetTag(java.lang.String _strTagName,
                   java.lang.String _strLibraryName,
                   double _dLibraryVersion)
Description copied from interface: ITagLibManager
Create the requested Tag. (Use this method where the library version is specified where possible as it is more efficient.) This method should not be called by developers. It is only for the Tag Framework.

Specified by:
GetTag in interface ITagLibManager
_dLibraryVersion - The version of the library that contains the requested tag
Returns:
ATag The requested tag, null on failure

GetTag

public ATag GetTag(java.lang.String _strTagName,
                   java.lang.String _strLibraryName)
Description copied from interface: ITagLibManager
Create the requested Tag. (Avoid this method where the library version is not specified where possible as it is less efficient.) This method should not be called by developers. It is only for the Tag Framework.

Specified by:
GetTag in interface ITagLibManager
Returns:
ATag The requested tag, null on failure

HasTag

public boolean HasTag(java.lang.String _strTagName,
                      java.lang.String _strLibraryName,
                      double _dLibraryVersion)
Description copied from interface: ITagLibManager
Return true if the tag specified by the parameters exists otherwise return false. Use this method specifying the library version rather than not where possible as it is much more efficient.

Specified by:
HasTag in interface ITagLibManager
_dLibraryVersion - The version of the library that contains the requested tag
Returns:
true if the tag exists otherwise false.

HasTag

public boolean HasTag(java.lang.String _strTagName,
                      java.lang.String _strLibraryName)
Description copied from interface: ITagLibManager
Return true if the tag specified by the parameters exists otherwise return false. Use the method specifying the library version rather than this where possible as it is much more efficient.

Specified by:
HasTag in interface ITagLibManager
Returns:
true if the tag exists otherwise false.

LoadClasses

public void LoadClasses(java.lang.String strLibDir,
                        java.lang.String strConfigFile)
Description copied from interface: ITagLibManager
This method initializes the TagLibManager and should only be called by the Application Warmup. This method can only be called once.

Specified by:
LoadClasses in interface ITagLibManager
Parameters:
strLibDir - The file directory where jars and dlls can be found
strConfigFile - the name of the config file

LoadCustomClasses

public void LoadCustomClasses(java.lang.String strLibDir,
                              java.lang.String strConfigFile)
Description copied from interface: ITagLibManager
This method initializes the TagLibManager with custom tags to overwrite the original ones and should only be called by the the Application Warmup.

Specified by:
LoadCustomClasses in interface ITagLibManager
Parameters:
strLibDir - The file directory where jars and dlls can be found
strConfigFile - the name of the custom config file

GetLibraries

public XPHashtable GetLibraries()
Description copied from interface: ITagLibManager
Return a data structure holding name and version number of all libraries loaded. TODO this may not be the form we really want to return this data in that's still being figured out - CVN

Specified by:
GetLibraries in interface ITagLibManager

GetTagLibMetadata

public TagLibraryMetaData GetTagLibMetadata(java.lang.String _sLibname,
                                            double _dVersion)
Description copied from interface: ITagLibManager
Return library meta data on a specific library and version. TODO this may not be the form we really want to return this data in that's still being figured out - CVN

Specified by:
GetTagLibMetadata in interface ITagLibManager

GetLibraryTagList

public XPArrayList GetLibraryTagList(java.lang.String _sLibname,
                                     double _dVersion)
Description copied from interface: ITagLibManager
Return tag info for a specific library TODO this may not be the form we really want to return this data in that's still being figured out - CVN

Specified by:
GetLibraryTagList in interface ITagLibManager

GetLibraryTags

public XPArrayList GetLibraryTags(java.lang.String _sLibname,
                                  double _dVersion)
Description copied from interface: ITagLibManager
Return all tags in library TODO this may not be the form we really want to return this data in that's still being figured out - CVN

Specified by:
GetLibraryTags in interface ITagLibManager

GetTagMetadata

public void GetTagMetadata(java.lang.String _sLibname,
                           double _dVersion,
                           java.lang.String _sTagname)
Description copied from interface: ITagLibManager
Return metadata or something on all tags in library TODO not yet implemented cvn

Specified by:
GetTagMetadata in interface ITagLibManager

ReloadTagLibrary

public void ReloadTagLibrary(java.lang.String _sLibname,
                             double _dVersion)
Description copied from interface: ITagLibManager
This method reloads a particular version of a tag library from the same library file (i.e. jar or dll) that it was originally loaded from.

Specified by:
ReloadTagLibrary in interface ITagLibManager
Parameters:
_sLibname - String The name of the library to reload (not display name).
_dVersion - double The version number of the library to reload.

ReloadAllTagLibraries

public void ReloadAllTagLibraries()
Description copied from interface: ITagLibManager
This method reloads both the standard and custom tag libraries from the config files.

Specified by:
ReloadAllTagLibraries in interface ITagLibManager

GetNumCustomTagLibraries

public int GetNumCustomTagLibraries()
Description copied from interface: ITagLibManager
This method returns the number of custom Tag Libraries currently loaded. This number is reset every time custom objects are loaded.

Specified by:
GetNumCustomTagLibraries in interface ITagLibManager
Returns:
The number of custom Tag Libraries currently loaded.

GetNumCustomTags

public int GetNumCustomTags()
Description copied from interface: ITagLibManager
This method returns the number of custom Tags currently loaded. This number is reset every time custom objects are loaded.

Specified by:
GetNumCustomTags in interface ITagLibManager
Returns:
The number of custom Tagss currently loaded.



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.