com.filenet.wcm.toolkit.server.base
Interface WcmModuleInterface

All Known Subinterfaces:
WcmDpModuleInterface, WcmHeaderModuleInterface, WcmUiModuleInterface
All Known Implementing Classes:
WcmDpModule, WcmHeaderModule, WcmModule, WcmUiModule

public interface WcmModuleInterface

WcmModuleInterface is the base for all modules, and defines methods that are common to all modules.


Method Summary
 void addDataProvider(WcmDpModuleInterface dp)
          Associate an instance of a data provider with this module.
 void cleanup()
          Called by WcmController after persist(), when it's about to go to another JSP page.
 WcmDataStore getDataStore()
          Get the data store object.
 java.lang.Object getModuleProperty(java.lang.String key)
          Get a module-scoped property from the Data Store.
 java.lang.String getName()
          Get the unique name for this module.
 WcmModuleInterface getParent()
          Get the module's parent if this is a contained module.
 void initialize()
          Called by WcmController when the module is registered, and has access to the data store.
 void persist()
          Called by WcmController before cleanup(), when it's about to go to another Java™Server Pages (JSP) page.
 WcmDpModuleInterface queryDataProvider(java.lang.String type)
          Query for a data provider of the specified type.
 void setController(WcmController c)
          Called by WcmController as part of module registration/un-registration.
 void setModuleProperty(java.lang.String key, java.lang.Object value)
          Set a module-scoped property in the data store.
 void setName(java.lang.String value)
          Set the unique name for this module.
 void setParent(WcmModuleInterface m)
          Set the specified module as the parent of this module.
 

Method Detail

persist

public void persist()
             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.

Throws:
java.lang.Exception

cleanup

public void cleanup()
             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 reconstruct later to minimize memory consumption.

Throws:
java.lang.Exception

initialize

public void initialize()
                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.

Throws:
java.lang.Exception

setName

public void setName(java.lang.String value)
             throws java.lang.Exception
Set the unique name for this module.
All modules must be given a unique string name. This will be used for two things:

  1. As part of the DataStore key that gets constructed when you use the setModuleProperty/getModuleProperty methods (to provide scoping)
  2. For the controller to dispatch events (i.e. eventTarget=name )

Parameters:
value - The name value.
Throws:
WcmException - toolkit.WcmModule.nameInvalid, if the name contains the illegal characters NAME_DELIMITER or ( . ).
java.lang.Exception

getName

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.

Returns:
The fully qualified name value.
Throws:
WcmException - toolkit.WcmModule.nameInvalid, if the name contains the illegal characters NAME_DELIMITER or ( . ).

addDataProvider

public void addDataProvider(WcmDpModuleInterface dp)
Associate an instance of a data provider with this module. The data providers are keyed by their class name.

Parameters:
dp - A reference to a data provider.

queryDataProvider

public WcmDpModuleInterface queryDataProvider(java.lang.String type)
Query for a data provider of the specified type. If you have one, a reference to it is returned. If not, a null pointer is returned.

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

public void setModuleProperty(java.lang.String key,
                              java.lang.Object value)
                       throws java.lang.Exception
Set a module-scoped property in the data store.

Parameters:
key - The key name to use.
value - The value to set. null is valid, and clears the key.
Throws:
WcmException - (toolkit.WcmModule.setModulePropertyNullKey)
WcmException - (toolkit.WcmModule.dataStoreUndefined)
java.lang.Exception

getModuleProperty

public java.lang.Object getModuleProperty(java.lang.String key)
                                   throws java.lang.Exception
Get a module-scoped property from the Data Store.

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

getDataStore

public WcmDataStore getDataStore()
                          throws java.lang.Exception
Get the data store object.

Returns:
The reference to the data store.
Throws:
WcmException - (toolkit.WcmModule.moduleNotRegistered)
WcmException - (toolkit.WcmModule.dataStoreUndefined)
java.lang.Exception

setParent

public void setParent(WcmModuleInterface m)
               throws java.lang.Exception
Set the specified module as the parent of this module. This registers the module.

Parameters:
m - The module that is to be this module's parent.
Throws:
WcmException - (toolkit.WcmModule.setParentAlreadyRegistered)
java.lang.Exception

getParent

public WcmModuleInterface getParent()
Get the module's parent if this is a contained module.

Returns:
A reference to the parent module or null if this is module is not contained.
Throws:
java.lang.Exception

setController

public void setController(WcmController c)
                   throws java.lang.Exception
Called by WcmController as part of module registration/un-registration.

Returns:
A valid reference to the controller when registering. null when un-registering.
Throws:
WcmException - (toolkit.wcmModule.setControllerOnUnregisteredModule)
WcmException - (toolkit.wcmModule.setControllerRegisteredModule)
java.lang.Exception


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