com.jalios.jcms.policy
Class BasicChannelPolicyFilter

java.lang.Object
  extended by com.jalios.jcms.policy.AbstractPolicyFilter
      extended by com.jalios.jcms.policy.BasicChannelPolicyFilter
All Implemented Interfaces:
PluginComponent, ChannelPolicyFilter, PolicyFilter, Comparable

public class BasicChannelPolicyFilter
extends AbstractPolicyFilter
implements ChannelPolicyFilter, PluginComponent

This class allow developers to put hooks to change channel mechanism behaviour. To get more information about the current request in hooks, the method Channel#getCurrentJcmsContext() must be called.

Since:
jcms-5.7.0
Version:
$Revision: 22357 $
Author:
Jean-Philippe Encausse
See Also:
ChannelPolicyFilter

Field Summary
static String REVISION
           
 
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order
 
Constructor Summary
BasicChannelPolicyFilter()
           
 
Method Summary
 void checkJAVAMetaTemplates(Map templateMap, String className, org.jdom.Element typeElt, boolean isExtension)
          This method is a Hook to generate custom JAVA templates for a given type or extension
 void checkJSPMetaTemplates(Map templateMap, String className, org.jdom.Element typeElt, boolean isExtension)
          This method is a Hook to generate custom JSP templates for a given type or extension
 Data getData(String id)
          Retrieve a Data from its id.
 boolean init(Plugin plugin)
          Initialize the component with the given plugin configuration
 
Methods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
compareTo, equals, getOrder, setOrder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

BasicChannelPolicyFilter

public BasicChannelPolicyFilter()
Method Detail

init

public boolean init(Plugin plugin)
Description copied from interface: PluginComponent
Initialize the component with the given plugin configuration

Specified by:
init in interface PluginComponent
Parameters:
plugin - the calling plugin
Returns:
true if the component has been correctly initialized.
Since:
jcms-5.7.1
See Also:
PluginComponent.init(Plugin)

checkJSPMetaTemplates

public void checkJSPMetaTemplates(Map templateMap,
                                  String className,
                                  org.jdom.Element typeElt,
                                  boolean isExtension)
Description copied from interface: ChannelPolicyFilter

This method is a Hook to generate custom JSP templates for a given type or extension

The templateMap contains the template file to generate.

Specified by:
checkJSPMetaTemplates in interface ChannelPolicyFilter
Parameters:
templateMap - The map of key/value = file/template
className - The classname of the processing type
typeElt - The XML Element of the processing type
isExtension - boolean true if the type is an Extension Called in private method com.jalios.jcms.TypeProcessor#generateTypeJSP(String, Element)
Since:
jcms-5.7.0
See Also:
ChannelPolicyFilter.checkJSPMetaTemplates(Map, String, Element, boolean)

checkJAVAMetaTemplates

public void checkJAVAMetaTemplates(Map templateMap,
                                   String className,
                                   org.jdom.Element typeElt,
                                   boolean isExtension)
Description copied from interface: ChannelPolicyFilter

This method is a Hook to generate custom JAVA templates for a given type or extension

The templateMap contains the template file to generate.

Specified by:
checkJAVAMetaTemplates in interface ChannelPolicyFilter
Parameters:
templateMap - The map of key/value = file/template
className - The classname of the processing type
typeElt - The XML Element of the processing type
isExtension - boolean true if the type is an Extension Called in private method com.jalios.jcms.TypeProcessor#processTypes()
Since:
jcms-5.7.0
See Also:
ChannelPolicyFilter.checkJAVAMetaTemplates(Map, String, Element, boolean)

getData

public Data getData(String id)
Description copied from interface: ChannelPolicyFilter
Retrieve a Data from its id.

This method is invoked only when JCMS internal method could not find any data associated with the specified id (and if no other ChannelPolicyFilter did return a Data).
May be invoked frequently !! Ensure high performance.

This hook can be implemented by plugins creating transient Data (e.g through QueryFilter).

Example :

  public Data getData(String id) {
    if (!id.startsWith("someprefix_") {
      return null;
    }
    // perform data retrieval (preferably using a internal cache on your side)
    // ...
  }
 

Specified by:
getData in interface ChannelPolicyFilter
Parameters:
id - the id to look for (never null)
Returns:
a Data or null if no Data matching the specified id could be found
Since:
jcms-6.0
See Also:
ChannelPolicyFilter.getData(String)


Copyright © 2001-2010 Jalios SA. All Rights Reserved.