Package com.jalios.jcms.policy
Class BasicTemplatePolicyFilter
- java.lang.Object
-
- com.jalios.jcms.policy.AbstractPolicyFilter
-
- com.jalios.jcms.policy.BasicTemplatePolicyFilter
-
- All Implemented Interfaces:
PluginComponent,PolicyFilter,TemplatePolicyFilter,java.lang.Comparable
- Direct Known Subclasses:
ConditionTemplatePolicyFilter
public class BasicTemplatePolicyFilter extends AbstractPolicyFilter implements TemplatePolicyFilter, PluginComponent
This class is a hook to allow developer to select custom templates and css for a given publication- Since:
- jcms-5.7.0
- Author:
- Jean-Philippe Encausse
- See Also:
TemplatePolicyFilter
-
-
Field Summary
-
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order
-
-
Constructor Summary
Constructors Constructor Description BasicTemplatePolicyFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]getConditionLabels(java.lang.String[] labels, java.lang.Class<? extends PortalElement> portlet, java.lang.String userLang)Hook called by doEditCommonPortlet to update labels to Condition's combo boxjava.lang.String[]getConditionValues(java.lang.String[] values, java.lang.Class<? extends PortalElement> portlet)Hook called by doEditCommonPortlet to update values to Condition's combo boxvoidgetCssFiles(java.util.List<java.io.File> jcmsChoice)Hook called by PortalManager to change available css files in the portal editor.java.lang.StringgetInnerClasses(PortalElement portlet)Hook called by PortalManager to add more classes for the given PortalElement's insidejava.lang.StringgetInnerStyles(PortalElement portlet)Hook called by PortalManager to add more styles for the given PortalElement's insidejava.lang.StringgetOutterClasses(PortalElement portlet)Hook called by PortalManager to add more classes for the given PortalElement's outsidejava.lang.StringgetOutterStyles(PortalElement portlet)Hook called by PortalManager to add more styles for the given PortalElement's outsidejava.lang.StringgetSkinTemplateUsage(Data data, java.lang.String usage)Overrides the skin usage decided by JCMS and previous pluginsTypeTemplateEntrygetTemplateEntry(java.lang.String usage, Data data, TypeTemplateEntry tte)This method is a hook to display a custom template, different from the default selected one.TypeTemplateEntrygetTemplateEntry(java.lang.String usage, java.lang.Class<? extends Data> dataClass, Workspace ws, TypeTemplateEntry tte)This method is a hook to display a custom template, different from the default selected one.java.lang.StringgetTemplateUsage(Data data, java.lang.String usage)Overrides the usage decided by JCMS and previous pluginsjava.lang.StringgetTemplateUsage(java.lang.Class<?> pubClass, java.lang.String usage)Overrides the usage decided by JCMS and previous pluginsvoidhandleCondition(java.lang.String[] conditions)Hook called by doInitPortlet.jsp to handle custom portlet condition.booleaninit(Plugin plugin)Initialize the component with the given plugin configuration-
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)
-
getTemplateEntry
public TypeTemplateEntry getTemplateEntry(java.lang.String usage, Data data, TypeTemplateEntry tte)
Description copied from interface:TemplatePolicyFilterThis method is a hook to display a custom template, different from the default selected one. Use the method channel.getCurrentJcmsContext() do get clue about the current request.- Specified by:
getTemplateEntryin interfaceTemplatePolicyFilter- Parameters:
usage- the template usagedata- the working publication- Returns:
- tte the chosen TypeTemplateEntry
- See Also:
TemplatePolicyFilter.getTemplateEntry(String, Data, TypeTemplateEntry)
-
getTemplateEntry
public TypeTemplateEntry getTemplateEntry(java.lang.String usage, java.lang.Class<? extends Data> dataClass, Workspace ws, TypeTemplateEntry tte)
Description copied from interface:TemplatePolicyFilterThis method is a hook to display a custom template, different from the default selected one. Use the method channel.getCurrentJcmsContext() do get clue about the current request.- Specified by:
getTemplateEntryin interfaceTemplatePolicyFilter- Parameters:
usage- the template usagedataClass- the working Classws- the working Workspace- Returns:
- tte the chosen TypeTemplateEntry
- See Also:
TemplatePolicyFilter.getTemplateEntry(String, Class, Workspace, TypeTemplateEntry)
-
getTemplateUsage
public java.lang.String getTemplateUsage(Data data, java.lang.String usage)
Description copied from interface:TemplatePolicyFilterOverrides the usage decided by JCMS and previous plugins- Specified by:
getTemplateUsagein interfaceTemplatePolicyFilter- Parameters:
data- the working datausage- is the current usage- Returns:
- String the overrided usage
- See Also:
TemplatePolicyFilter.getTemplateUsage(Data, String)
-
getTemplateUsage
public java.lang.String getTemplateUsage(java.lang.Class<?> pubClass, java.lang.String usage)Description copied from interface:TemplatePolicyFilterOverrides the usage decided by JCMS and previous plugins- Specified by:
getTemplateUsagein interfaceTemplatePolicyFilter- Parameters:
pubClass- the class of the publicationusage- is the current usage- Returns:
- String the overrided usage
- See Also:
TemplatePolicyFilter.getTemplateUsage(Class, String)
-
getSkinTemplateUsage
public java.lang.String getSkinTemplateUsage(Data data, java.lang.String usage)
Description copied from interface:TemplatePolicyFilterOverrides the skin usage decided by JCMS and previous plugins- Specified by:
getSkinTemplateUsagein interfaceTemplatePolicyFilter- Parameters:
data- the working datausage- is the current usage- Returns:
- String the overrided usage
- See Also:
TemplatePolicyFilter.getSkinTemplateUsage(Data, String)
-
getInnerClasses
public java.lang.String getInnerClasses(PortalElement portlet)
Description copied from interface:TemplatePolicyFilterHook called by PortalManager to add more classes for the given PortalElement's inside- Specified by:
getInnerClassesin interfaceTemplatePolicyFilter- Parameters:
portlet- the working PortalElement- Returns:
- String the inner classes to add
- See Also:
TemplatePolicyFilter.getInnerClasses(PortalElement)
-
getOutterClasses
public java.lang.String getOutterClasses(PortalElement portlet)
Description copied from interface:TemplatePolicyFilterHook called by PortalManager to add more classes for the given PortalElement's outside- Specified by:
getOutterClassesin interfaceTemplatePolicyFilter- Parameters:
portlet- the working PortalElement- Returns:
- String the outter classes to add
- See Also:
TemplatePolicyFilter.getOutterClasses(PortalElement)
-
getInnerStyles
public java.lang.String getInnerStyles(PortalElement portlet)
Description copied from interface:TemplatePolicyFilterHook called by PortalManager to add more styles for the given PortalElement's inside- Specified by:
getInnerStylesin interfaceTemplatePolicyFilter- Parameters:
portlet- the working PortalElement- Returns:
- String the inner styles to add
- See Also:
TemplatePolicyFilter.getInnerStyles(PortalElement)
-
getOutterStyles
public java.lang.String getOutterStyles(PortalElement portlet)
Description copied from interface:TemplatePolicyFilterHook called by PortalManager to add more styles for the given PortalElement's outside- Specified by:
getOutterStylesin interfaceTemplatePolicyFilter- Parameters:
portlet- the working PortalElement- Returns:
- String the outter styles to add
- See Also:
TemplatePolicyFilter.getOutterStyles(PortalElement)
-
getCssFiles
public void getCssFiles(java.util.List<java.io.File> jcmsChoice)
Description copied from interface:TemplatePolicyFilterHook called by PortalManager to change available css files in the portal editor. It can be used to add files from other place of the jcms webapp.- Specified by:
getCssFilesin interfaceTemplatePolicyFilter- Parameters:
jcmsChoice- files selected by JCMS- See Also:
TemplatePolicyFilter.getCssFiles(List)
-
getConditionLabels
public java.lang.String[] getConditionLabels(java.lang.String[] labels, java.lang.Class<? extends PortalElement> portlet, java.lang.String userLang)Description copied from interface:TemplatePolicyFilterHook called by doEditCommonPortlet to update labels to Condition's combo box- Specified by:
getConditionLabelsin interfaceTemplatePolicyFilter- Parameters:
labels- String[] I18N array of labelsportlet- the portlet classuserLang- the lang of the user- Returns:
- String[] I18N array of labels
- See Also:
TemplatePolicyFilter.getConditionLabels(String[], Class, String)
-
getConditionValues
public java.lang.String[] getConditionValues(java.lang.String[] values, java.lang.Class<? extends PortalElement> portlet)Description copied from interface:TemplatePolicyFilterHook called by doEditCommonPortlet to update values to Condition's combo box- Specified by:
getConditionValuesin interfaceTemplatePolicyFilter- Parameters:
values- String[] of valuesportlet- he portlet class- Returns:
- String[] an array of conditional values
- See Also:
TemplatePolicyFilter.getConditionValues(String[], Class)
-
handleCondition
public void handleCondition(java.lang.String[] conditions)
Description copied from interface:TemplatePolicyFilterHook called by doInitPortlet.jsp to handle custom portlet condition.- Specified by:
handleConditionin interfaceTemplatePolicyFilter- Parameters:
conditions- String array of codition for the given portlet- See Also:
TemplatePolicyFilter.handleCondition(String[])
-
-