com.filenet.wcm.toolkit.server.base

Class WcmModule

  1. java.lang.Object
  2. extended bycom.filenet.wcm.toolkit.server.base.WcmDpContainer
  3. extended bycom.filenet.wcm.toolkit.server.base.WcmModule
All implemented interfaces:
WcmModuleInterface
Direct known subclasses:
EProcessGranteeUtil, GlobalEventModule, WcmAuthoringUtil, WcmDpModule, WcmEProcessUtil, WcmWorkflowUtil

  1. public class WcmModule
  2. extends WcmDpContainer
  3. implements WcmModuleInterface
WcmModule is the default base class for all UI and data provider modules. It defines behavior and functionality that is common to all modules.

Field Summary

Modifier and Type Field and Description
  1. protected
  2. java.util.Locale
locale
  1. static
  2. java.lang.String
NAME_DELIMITER
The delimiter used between qualifiers in the qualified (parented) module name (getName).

Constructor Summary

Constructor and Description
WcmModule()

Method Summary

Modifier and Type Method and Description
  1. WcmModuleInterface
addChild(java.lang.Class moduleClass,java.lang.String moduleName)
Creates a new instance of a module, sets it's name, and adds it as a child to this module.
  1. void
addChild(WcmModuleInterface m)
Add the specified module as a child to this module.
  1. void
addChild(WcmModuleInterface m,java.lang.String moduleName)
Add the specified module as a child to this module.
  1. void
cleanup()
Called by WcmController after persist(), when it's about to go to another JSP page.
  1. void
debugTrace(java.lang.Object output)
Prints out a debug message to the java console
  1. java.lang.Object
getClassProperty(java.lang.String key)
Get a key-value in the data store.
  1. java.lang.Object
getClassProperty(java.lang.String key,java.lang.Object defaultValue,boolean setIfNotFound,boolean constructClass)
Get a key-value in the data store.
  1. protected
  2. java.util.List
getClassPropertyKeys()
Deprecated.
  1. WcmConfigurationInterface
getConfiguration()
Returns WcmConfigurationInterface
  1. WcmController
getController()
Get the reference to the controller.
  1. WcmDataStore
getDataStore()
Get the data store object.
  1. java.lang.Object
getModuleProperty(java.lang.String key)
Get a key-value from the data store.
  1. java.lang.Object
getModuleProperty(java.lang.String key,java.lang.Object defaultValue)
Get a key-value from the data store.
  1. java.lang.Object
getModuleProperty(java.lang.String key,java.lang.Object defaultValue,boolean setIfNotFound)
Get a key-value from the data store.
  1. java.lang.Object
getModuleProperty(java.lang.String key,java.lang.Object defaultValue,boolean setIfNotFound,boolean constructClass)
Get a key-value from the data store.
  1. protected
  2. java.util.List
getModulePropertyKeys()
Deprecated.
  1. java.lang.String
getName()
Get the unique name for this module.
  1. WcmModuleInterface
getParent()
Get the module's parent if this is a contained module.
  1. java.lang.Object
getWindowProperty(java.lang.String key)
Get a key-value in the data store.
  1. java.lang.Object
getWindowProperty(java.lang.String key,java.lang.Object defaultValue,boolean setIfNotFound,boolean constructClass)
Get a key-value in the data store.
  1. void
initialize()
Called by WcmController when the module is registered, and has access to the data store.
  1. void
persist()
Called by WcmController before cleanup(), when it's about to go to another Java™Server Pages (JSP) page.
  1. WcmDpModuleInterface
queryDataProvider(java.lang.String type)
Query for an associated data provider (added with addDataProvider) of the specified type.
  1. void
setClassProperty(java.lang.String key,java.lang.Object value)
  1. void
setClassProperty(java.lang.String key,java.lang.Object value,boolean bForCache)
Set a key-value in the data store.
  1. void
setController(WcmController c)
Called by WcmController as part of module registration/un-registration.
  1. void
setModuleProperty(java.lang.String key,java.lang.Object value)
  1. void
setModuleProperty(java.lang.String key,java.lang.Object value,boolean bForCache)
Set a key-value in the data store.
  1. void
setName(java.lang.String value)
Set the unique name for this module.
  1. void
setParent(WcmModuleInterface m)
Set the specified module as the parent of this module.
  1. protected
  2. void
setPortletParent(WcmModuleInterface m)
We're in a portlet environment where multiple controllers are being created for a single request.
  1. void
setWindowProperty(java.lang.String key,java.lang.Object value,boolean bForCache)
Set a key-value in the data store.
Methods inherited from class com.filenet.wcm.toolkit.server.base.WcmDpContainer
addDataProvider, addDataProvider
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.filenet.wcm.toolkit.server.base.WcmModuleInterface
addDataProvider

Field Detail

NAME_DELIMITER

  1. public static final java.lang.String NAME_DELIMITER
The delimiter used between qualifiers in the qualified (parented) module name (getName).
See Also:

locale

  1. protected java.util.Locale locale

Constructor Detail

WcmModule

  1. public WcmModule()

Method Detail

initialize

  1. public void initialize()
  2. throws java.lang.Exception
Called by WcmController when the module is registered, and has access to the data store. Do "constructor" types of things here.
Specified by:
Throws:
java.lang.Exception

persist

  1. public void persist()
  2. throws java.lang.Exception
Called by WcmController before cleanup(), when it's about to go to another Java™Server Pages (JSP) page. This is intended for future use.
Specified by:
Throws:
java.lang.Exception

cleanup

  1. public void cleanup()
  2. throws java.lang.Exception
Called by WcmController after persist(), when it's about to go to another JSP page. The module should null out any module properties that it can re-construct later to minimize memory consumption.
Specified by:
Throws:
java.lang.Exception

setName

  1. public void setName(java.lang.String value)
  2. throws java.lang.Exception
Set the unique name for this module.
Specified by:
Parameters:
value - The name value.
Throws:
WcmException - toolkit.WcmModule.nameInvalid, if the name contains the illegal characters NAME_DELIMITER or ( . ).
java.lang.Exception

getName

  1. public java.lang.String getName( )
Get the unique name for this module. This will be different from the value that you pass to setName, if the module is being parented by another module. The name returned here will be fully qualified with any parent names.
Specified by:
Returns:
The fully qualified name value.

queryDataProvider

  1. public WcmDpModuleInterface queryDataProvider( java.lang.String type)
Query for an associated data provider (added with addDataProvider) of the specified type. If not found in this module, queryDataProvider is recursively called up the parents until it finds one. Alternatively, call WcmController.queryDataProvider.
Specified by:
Overrides:
Parameters:
type - The type name for the data provider. All data providers should follow the convention of providing a public static final TYPE that can be passed here.
Returns:
An instance of the data provider if found, otherwise null.

setModuleProperty

  1. public void setModuleProperty(java.lang.String key,
  2. java.lang.Object value)
  3. throws java.lang.Exception
Description copied from interface: WcmModuleInterface
Set a module-scoped property in the data store.
Specified by:
Parameters:
key - The key name to use.
value - The value to set. null is valid, and clears the key.
Throws:
java.lang.Exception
See Also:

setModuleProperty

  1. public void setModuleProperty(java.lang.String key,
  2. java.lang.Object value,
  3. boolean bForCache)
  4. throws java.lang.Exception
Set a key-value in the data store. The key that you pass here is internally scoped to the window/page/module instance.
Parameters:
key - The key name to use.
value - The value to set. null is valid, and clears the key.
bForCache - Adds the value as a SoftReference, which means that when the system is low on memory, the value will automatically be removed.
Throws:
WcmException - (toolkit.WcmModule.setModulePropertyNullKey)
java.lang.Exception

getModuleProperty

  1. public java.lang.Object getModuleProperty( java.lang.String key)
  2. throws java.lang.Exception
Get a key-value from the data store. The key that you pass here is internally scoped to the window/page/module instance.
Specified by:
Parameters:
key - The key name to use.
Returns:
The value associated with the key, or null.
Throws:
WcmException - (toolkit.WcmModule.getModulePropertyNullKey)
WcmException - (toolkit.WcmModule.dataStoreUndefined)
java.lang.Exception

getModulePropertyKeys

  1. protected java.util.List getModulePropertyKeys( )
  2. throws java.lang.Exception
Deprecated.
The keys returned are no longer fully scoped into the dataStore. The keys returned exist in the windowMap for the current window ID.
Throws:
java.lang.Exception

getClassPropertyKeys

  1. protected java.util.List getClassPropertyKeys( )
  2. throws java.lang.Exception
Deprecated.
This method returns valid qualified dataStore keys, but cannot be relied upon in future releases.
Throws:
java.lang.Exception

setClassProperty

  1. public void setClassProperty(java.lang.String key,
  2. java.lang.Object value)
  3. throws java.lang.Exception
Throws:
java.lang.Exception
See Also:

setWindowProperty

  1. public void setWindowProperty(java.lang.String key,
  2. java.lang.Object value,
  3. boolean bForCache)
  4. throws java.lang.Exception
Set a key-value in the data store. The key that you pass here is internally scoped to the class/windowId. These are shared between all instances of a module class in a given window.
Parameters:
key - The key name to use.
value - The value to set. null is valid, and clears the key.
bForCache - Adds the value as a SoftReference, which means that when the system is low on memory, the value will automatically be removed.
Throws:
WcmException - (toolkit.WcmModule.setModulePropertyNullKey)
java.lang.Exception

setClassProperty

  1. public void setClassProperty(java.lang.String key,
  2. java.lang.Object value,
  3. boolean bForCache)
  4. throws java.lang.Exception
Set a key-value in the data store. The key that you pass here is internally scoped to the class. These are shared between all instances of a module class.
Parameters:
key - The key name to use.
value - The value to set. null is valid, and clears the key.
Throws:
WcmException - (toolkit.WcmModule.setModulePropertyNullKey)
java.lang.Exception

getWindowProperty

  1. public java.lang.Object getWindowProperty( java.lang.String key)
  2. throws java.lang.Exception
Get a key-value in the data store. The key that you pass here is internally scoped to the class/windowId. These are shared between all instances of a module class in a given window.
Parameters:
key - The key name to use.
Returns:
The value associated with the key, or null.
Throws:
WcmException - (toolkit.WcmModule.getModulePropertyNullKey)
java.lang.Exception

getWindowProperty

  1. public java.lang.Object getWindowProperty( java.lang.String key,
  2. java.lang.Object defaultValue,
  3. boolean setIfNotFound,
  4. boolean constructClass)
  5. throws java.lang.Exception
Get a key-value in the data store. The key that you pass here is internally scoped to the class/windowId. These are shared between all instances of a module class.
Parameters:
key - The key name to use.
defaultValue - If no value is found for the key, this object is returned.
setIfNotFound - If no value is found for the key, set the newly returned value.
constructClass - If the defaultValue is instanceof Class, construct an instance using the default constructor and return if not found.
Returns:
The value associated with the key, or null.
Throws:
WcmException - (toolkit.WcmModule.getModulePropertyNullKey)
java.lang.Exception

getClassProperty

  1. public java.lang.Object getClassProperty( java.lang.String key)
  2. throws java.lang.Exception
Get a key-value in the data store. The key that you pass here is internally scoped to the class. These are shared between all instances of a module class.
Parameters:
key - The key name to use.
Returns:
The value associated with the key, or null.
Throws:
WcmException - (toolkit.WcmModule.getModulePropertyNullKey)
java.lang.Exception

getClassProperty

  1. public java.lang.Object getClassProperty( java.lang.String key,
  2. java.lang.Object defaultValue,
  3. boolean setIfNotFound,
  4. boolean constructClass)
  5. throws java.lang.Exception
Get a key-value in the data store. The key that you pass here is internally scoped to the class. These are shared between all instances of a module class.
Parameters:
key - The key name to use.
defaultValue - If no value is found for the key, this object is returned.
setIfNotFound - If no value is found for the key, set the newly returned value.
constructClass - If the defaultValue is instanceof Class, construct an instance using the default constructor and return if not found.
Returns:
The value associated with the key, or null.
Throws:
WcmException - (toolkit.WcmModule.getModulePropertyNullKey)
java.lang.Exception

getModuleProperty

  1. public java.lang.Object getModuleProperty( java.lang.String key,
  2. java.lang.Object defaultValue)
  3. throws java.lang.Exception
Get a key-value from the data store. The key that you pass here is internally scoped to the window/page/module instance.
Parameters:
key - The key name to use.
defaultValue - Value to return if the key-value is undefined in the data store.
Returns:
The value associated with the key, or null.
Throws:
WcmException - (toolkit.WcmModule.getModulePropertyNullKey)
java.lang.Exception

getModuleProperty

  1. public java.lang.Object getModuleProperty( java.lang.String key,
  2. java.lang.Object defaultValue,
  3. boolean setIfNotFound)
  4. throws java.lang.Exception
Get a key-value from the data store. The key that you pass here is internally scoped to the window/page/module instance.
Parameters:
key - The key name to use.
defaultValue - Value to return if the key-value is undefined in the data store.
setIfNotFound - If true, and the key-value is not defined in the data store, set the defaultValue in the data store for this key.
Returns:
The value associated with the key, or null.
Throws:
WcmException - (toolkit.WcmModule.getModulePropertyNullKey)
java.lang.Exception

getModuleProperty

  1. public java.lang.Object getModuleProperty( java.lang.String key,
  2. java.lang.Object defaultValue,
  3. boolean setIfNotFound,
  4. boolean constructClass)
  5. throws java.lang.Exception
Get a key-value from the data store. The key that you pass here is internally scoped to the window/page/module instance.
Parameters:
key - The key name to use.
defaultValue - Value to return if the key-value is undefined in the data store.
setIfNotFound - If true, and the key-value is not defined in the data store, set the defaultValue in the data store for this key.
constructClass - If the defaultValue is instanceof Class, construct an instance using the default constructor and return if not found.
Returns:
The value associated with the key, or null.
Throws:
WcmException - (toolkit.WcmModule.getModulePropertyNullKey)
java.lang.Exception

getDataStore

  1. public final WcmDataStore getDataStore( )
  2. throws java.lang.Exception
Get the data store object.
Specified by:
Returns:
The reference to the data store.
Throws:
WcmException - (toolkit.WcmModule.moduleNotRegistered)
WcmException - (toolkit.WcmModule.dataStoreUndefined)
java.lang.Exception

addChild

  1. public final void addChild(WcmModuleInterface m)
  2. throws java.lang.Exception
Add the specified module as a child to this module. This registers the module.
Parameters:
m - A reference to the module that is to become this module's child.
Throws:
WcmException - (toolkit.WcmModule.setParentAlreadyRegistered)
java.lang.Exception

addChild

  1. public final void addChild(WcmModuleInterface m,
  2. java.lang.String moduleName)
  3. throws java.lang.Exception
Add the specified module as a child to this module. This registers the module.
Parameters:
m - A reference to the module that is to become this module's child.
moduleName - The passed module has its name set to this value.
Throws:
WcmException - (toolkit.WcmModule.setParentAlreadyRegistered)
java.lang.Exception

addChild

  1. public final WcmModuleInterface addChild( java.lang.Class moduleClass,
  2. java.lang.String moduleName)
  3. throws java.lang.Exception
Creates a new instance of a module, sets it's name, and adds it as a child to this module. This registers the module.
Parameters:
moduleClass - The module class to create an instance of.
moduleName - The name to give the new created child.
Returns:
reference to the new child module
Throws:
WcmException - (toolkit.WcmModule.setParentAlreadyRegistered)
java.lang.Exception

setParent

  1. public final void setParent(WcmModuleInterface m)
  2. throws java.lang.Exception
Set the specified module as the parent of this module. This registers the module.
Specified by:
Parameters:
m - The module that is to be this module's parent.
Throws:
WcmException - (toolkit.WcmModule.setParentAlreadyRegistered)
java.lang.Exception

setPortletParent

  1. protected final void setPortletParent( WcmModuleInterface m)
  2. throws java.lang.Exception
We're in a portlet environment where multiple controllers are being created for a single request. Don't call this method!
Parameters:
m - The module that is to be this module's parent.
Throws:
WcmException - (toolkit.WcmModule.setParentAlreadyRegistered)
java.lang.Exception

debugTrace

  1. public void debugTrace(java.lang.Object output)
Prints out a debug message to the java console
Parameters:
output - value to print out.

getConfiguration

  1. public WcmConfigurationInterface getConfiguration( )
  2. throws java.lang.Exception
Returns WcmConfigurationInterface
Returns:
WcmConfigurationInterface
Throws:
java.lang.Exception

setController

  1. public final void setController( WcmController c)
  2. throws java.lang.Exception
Called by WcmController as part of module registration/un-registration.
Specified by:
Parameters:
c - A valid reference to the controller when registering. null when un-registering.
Throws:
WcmException - (toolkit.wcmModule.setControllerOnUnregisteredModule)
WcmException - (toolkit.wcmModule.setControllerRegisteredModule)
java.lang.Exception

getController

  1. public final WcmController getController( )
Get the reference to the controller. This should always return a valid reference. If it returns null, the module is not registered.
Returns:
A reference to the current instance of WcmController.

getParent

  1. public WcmModuleInterface getParent( )
Get the module's parent if this is a contained module.
Specified by:
Returns:
A reference to the parent module or null if this is module is not contained.