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 boxvoid
getCssFiles(java.util.List<java.io.File> jcmsChoice)
Hook called by PortalManager to change available css files in the portal editor.java.lang.String
getInnerClasses(PortalElement portlet)
Hook called by PortalManager to add more classes for the given PortalElement's insidejava.lang.String
getInnerStyles(PortalElement portlet)
Hook called by PortalManager to add more styles for the given PortalElement's insidejava.lang.String
getOutterClasses(PortalElement portlet)
Hook called by PortalManager to add more classes for the given PortalElement's outsidejava.lang.String
getOutterStyles(PortalElement portlet)
Hook called by PortalManager to add more styles for the given PortalElement's outsidejava.lang.String
getSkinTemplateUsage(Data data, java.lang.String usage)
Overrides the skin usage decided by JCMS and previous pluginsTypeTemplateEntry
getTemplateEntry(java.lang.String usage, Data data, TypeTemplateEntry tte)
This method is a hook to display a custom template, different from the default selected one.TypeTemplateEntry
getTemplateEntry(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.String
getTemplateUsage(Data data, java.lang.String usage)
Overrides the usage decided by JCMS and previous pluginsjava.lang.String
getTemplateUsage(java.lang.Class<?> pubClass, java.lang.String usage)
Overrides the usage decided by JCMS and previous pluginsvoid
handleCondition(java.lang.String[] conditions)
Hook called by doInitPortlet.jsp to handle custom portlet condition.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
-
-
-
-
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 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:TemplatePolicyFilter
This 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:
getTemplateEntry
in 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:TemplatePolicyFilter
This 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:
getTemplateEntry
in 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:TemplatePolicyFilter
Overrides the usage decided by JCMS and previous plugins- Specified by:
getTemplateUsage
in 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:TemplatePolicyFilter
Overrides the usage decided by JCMS and previous plugins- Specified by:
getTemplateUsage
in 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:TemplatePolicyFilter
Overrides the skin usage decided by JCMS and previous plugins- Specified by:
getSkinTemplateUsage
in 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:TemplatePolicyFilter
Hook called by PortalManager to add more classes for the given PortalElement's inside- Specified by:
getInnerClasses
in 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:TemplatePolicyFilter
Hook called by PortalManager to add more classes for the given PortalElement's outside- Specified by:
getOutterClasses
in 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:TemplatePolicyFilter
Hook called by PortalManager to add more styles for the given PortalElement's inside- Specified by:
getInnerStyles
in 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:TemplatePolicyFilter
Hook called by PortalManager to add more styles for the given PortalElement's outside- Specified by:
getOutterStyles
in 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:TemplatePolicyFilter
Hook 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:
getCssFiles
in 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:TemplatePolicyFilter
Hook called by doEditCommonPortlet to update labels to Condition's combo box- Specified by:
getConditionLabels
in 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:TemplatePolicyFilter
Hook called by doEditCommonPortlet to update values to Condition's combo box- Specified by:
getConditionValues
in 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:TemplatePolicyFilter
Hook called by doInitPortlet.jsp to handle custom portlet condition.- Specified by:
handleCondition
in interfaceTemplatePolicyFilter
- Parameters:
conditions
- String array of codition for the given portlet- See Also:
TemplatePolicyFilter.handleCondition(String[])
-
-