Package com.jalios.jcms.policy
Class BasicChannelPolicyFilter
- java.lang.Object
-
- com.jalios.jcms.policy.AbstractPolicyFilter
-
- com.jalios.jcms.policy.BasicChannelPolicyFilter
-
- All Implemented Interfaces:
PluginComponent,ChannelPolicyFilter,PolicyFilter,java.lang.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
- Author:
- Jean-Philippe Encausse
- See Also:
ChannelPolicyFilter
-
-
Field Summary
-
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order
-
-
Constructor Summary
Constructors Constructor Description BasicChannelPolicyFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckJAVAMetaTemplates(java.util.Map templateMap, java.lang.String className, org.jdom.Element typeElt, boolean isExtension)This method is a Hook to generate custom JAVA templates for a given type or extensionvoidcheckJSPMetaTemplates(java.util.Map templateMap, java.lang.String className, org.jdom.Element typeElt, boolean isExtension)This method is a Hook to generate custom JSP templates for a given type or extensionDatagetData(java.lang.String id)Retrieve a Data from its id.booleaninit(Plugin plugin)Initialize the component with the given plugin configurationbooleanisCompatibleWorkflow(Workflow workflow, java.lang.Class typeClass)This method is a Hook to indicate if aWorkflowis compatible with a type class-
Methods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
compareTo, equals, getOrder, setOrder
-
-
-
-
Method Detail
-
init
public boolean init(Plugin plugin)
Description copied from interface:PluginComponentInitialize the component with the given plugin configuration- Specified by:
initin interfacePluginComponent- 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(java.util.Map templateMap, java.lang.String className, org.jdom.Element typeElt, boolean isExtension)Description copied from interface:ChannelPolicyFilterThis method is a Hook to generate custom JSP templates for a given type or extension
The templateMap contains the template file to generate.
- Keys: the name of the file to generate in Type folder
- Values: the name of the metatemplate file to use (in WEB-INF/template/ folder)
- Specified by:
checkJSPMetaTemplatesin interfaceChannelPolicyFilter- Parameters:
templateMap- The map of key/value = file/templateclassName- The classname of the processing typetypeElt- The XML Element of the processing typeisExtension- 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(java.util.Map templateMap, java.lang.String className, org.jdom.Element typeElt, boolean isExtension)Description copied from interface:ChannelPolicyFilterThis method is a Hook to generate custom JAVA templates for a given type or extension
The templateMap contains the template file to generate.
- Keys: the name of the file (without .java extension)
- Values: the name of the metatemplate file to use (in WEB-INF/template/ folder)
- Specified by:
checkJAVAMetaTemplatesin interfaceChannelPolicyFilter- Parameters:
templateMap- The map of key/value = file/templateclassName- The classname of the processing typetypeElt- The XML Element of the processing typeisExtension- 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(java.lang.String id)
Description copied from interface:ChannelPolicyFilterRetrieve 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:
getDatain interfaceChannelPolicyFilter- 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)
-
isCompatibleWorkflow
public boolean isCompatibleWorkflow(Workflow workflow, java.lang.Class typeClass)
Description copied from interface:ChannelPolicyFilterThis method is a Hook to indicate if a
Workflowis compatible with a type class- Specified by:
isCompatibleWorkflowin interfaceChannelPolicyFilter- Parameters:
workflow- theWorkflowto testtypeClass- the typeClass- Returns:
- true if the workflow is compatible with the given type class, false otherwise (or if workflow or type is null) Called in private method com.jalios.jcms.WorkflowManager#isCompatibleWorkflow()
- Since:
- jcms-8.0
- See Also:
ChannelPolicyFilter.isCompatibleWorkflow(Workflow, Class)
-
-