com.ibm.xsp.library
Interface XspLibrary

All Known Implementing Classes:
AbstractXspLibrary

public interface XspLibrary

Defines a Xsp library.

Implementations should inherit from AbstractXspLibrary and should not have any public or protected methods, so that methods added to this interface do not break the implementations. Any new methods will have a default implementation in 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 getLibraryId()
          Get the library id
 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.
 

Method Detail

isEnabled

boolean isEnabled()
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.

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

getLibraryId

java.lang.String getLibraryId()
Get the library id

Returns:
the id that applications will use to depend on the library

getPluginId

java.lang.String getPluginId()
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.

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

isGlobalScope

boolean isGlobalScope()
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.

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

java.lang.String[] getDependencies()
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.

Returns:
the list of libraries this library depends on

getXspConfigFiles

java.lang.String[] getXspConfigFiles()
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).

Returns:
the list of the xsp config files

getFacesConfigFiles

java.lang.String[] getFacesConfigFiles()
Return the list of faces config files contained in the library. Those file contains the faces definitions (renderers...).

Returns:
the list of the faces config files

getTagVersion

java.lang.String getTagVersion()
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 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.

Returns:
null or a version String like "1.5.3"