com.ibm.xsp.library
Class AbstractXspLibrary

java.lang.Object
  extended by com.ibm.xsp.library.AbstractXspLibrary
All Implemented Interfaces:
XspLibrary

public abstract class AbstractXspLibrary
extends java.lang.Object
implements XspLibrary

Abstract XSP library.

See Also:
XspLibrary

Constructor Summary
AbstractXspLibrary()
           
 
Method Summary
 java.lang.String[] getDependencies()
          null or the list of libraries that this one depends one.
 java.lang.String[] getFacesConfigFiles()
          Return the list of faces config files contained in the library.
 java.lang.String getPluginId()
          Get the plug-in id.
 java.lang.String getTagVersion()
          Usually like the library plugin version, except without the datestamp at the end.
 java.lang.String[] getXspConfigFiles()
          Return the list of Xsp config files contained in the library.
 boolean isEnabled()
          Return true if the library is valid for the duration of this JVM.
 boolean isGlobalScope()
          Check if this library should be globally available to all applications at runtime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.xsp.library.XspLibrary
getLibraryId
 

Constructor Detail

AbstractXspLibrary

public AbstractXspLibrary()
Method Detail

isGlobalScope

public boolean isGlobalScope()
Description copied from interface: XspLibrary
Check if this library should be globally available to all applications at runtime. Normally a library dependency will not exist in an application at runtime unless it was configured as a dependency at design-time; the explicit dependency is required for compile-time resolving of classes in other plugins. For global libraries, the dependency is available at runtime, even when it was not explicitly listed in the design-time dependencies. Such global libraries may be useful for contributing renderers, or converter-for-class configuration, or other runtime-only artifacts, contributed to every application that is running on the server or in the Notes Client install. That is a limited use-case, as there are not many runtime-only artifacts, for example you cannot use a control from a global library without an explicit dependency on that library, because controls require the compile-time library dependency so that the generated XPage java file will compile.

Specified by:
isGlobalScope in interface XspLibrary
Returns:
false by default, or true if this library should be available on the classpath of every application on the server, and should contribute it's faces-config.xml files to every application.

getDependencies

public java.lang.String[] getDependencies()
Description copied from interface: XspLibrary
null or the list of libraries that this one depends one. This is used to compute the load order of the libraries. Circular dependency loops will lead to problems.

Specified by:
getDependencies in interface XspLibrary
Returns:
the list of libraries this library depends on

getXspConfigFiles

public java.lang.String[] getXspConfigFiles()
Description copied from interface: XspLibrary
Return the list of Xsp config files contained in the library. Those files contain the definitions for controls and other tags. The files usually will have the file Extension ".xsp-config", but it is not necessary. These files are only loaded in Designer, and used to verify that the tags in the XPages source are valid, and to generate a compiled version of the XPage (using each tag's corresponding Java class).

Specified by:
getXspConfigFiles in interface XspLibrary
Returns:
the list of the xsp config files

getFacesConfigFiles

public java.lang.String[] getFacesConfigFiles()
Description copied from interface: XspLibrary
Return the list of faces config files contained in the library. Those file contains the faces definitions (renderers...).

Specified by:
getFacesConfigFiles in interface XspLibrary
Returns:
the list of the faces config files

isEnabled

public boolean isEnabled()
Description copied from interface: XspLibrary
Return true if the library is valid for the duration of this JVM. This implementation should not depend on the current request, but may check server-wide configuration options or for the existence of classes it depends on. If returning false, the implementation should log the reason why it is not enabled, so that admins can understand the problem when applications that depend on this library cannot resolve it.

Specified by:
isEnabled in interface XspLibrary
Returns:
true by default, or false if the application is not valid in the current runtime environment.

getPluginId

public java.lang.String getPluginId()
Description copied from interface: XspLibrary
Get the plug-in id. This is used by the Designer plugin.xml builder to generating the design-time plug-in dependencies, used by the Java builder to compile the XPage Java files. This is not used at runtime. Only one plug-in is allowed, because only one library plug-in will added as a runtime dependency. If more than one plugin is needed to use the library, then the library should be configured to re-export its dependencies.

Specified by:
getPluginId in interface XspLibrary
Returns:
the ID of the plug-in required at design-time to compile applications using controls from this plug-in.

getTagVersion

public java.lang.String getTagVersion()
Description copied from interface: XspLibrary
Usually like the library plugin version, except without the datestamp at the end. This is used with the xsp-config "since" element. In the first release of the library this can return null, and the xsp-config files do not need to contain any since elements. However, if subsequent releases of the library are defining new tags or new properties on those tags, then those tags should be defined with a since version, like since>2.0<, indicating that the tag was added in version 2 of the library. Once some tags are using a since version, this method should be updated to return that version, or some later version. There will be a runtime check, when the XPage is using a tag from version 2 of the library, if the library XspLibrary.getTagVersion() does not return version 2 or later, then it is assumed that the initial version of the library is installed, and the XPage will fail with an error message explaining that version 2 of the library is needed.

Specified by:
getTagVersion in interface XspLibrary
Returns:
null or a version String like "1.5.3"