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,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:
-
Field Summary
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]getConditionLabels(String[] labels, Class<? extends PortalElement> portlet, String userLang) Hook called by doEditCommonPortlet to update labels to Condition's combo boxString[]getConditionValues(String[] values, Class<? extends PortalElement> portlet) Hook called by doEditCommonPortlet to update values to Condition's combo boxvoidgetCssFiles(List<File> jcmsChoice) Hook called by PortalManager to change available css files in the portal editor.getInnerClasses(PortalElement portlet) Hook called by PortalManager to add more classes for the given PortalElement's insidegetInnerStyles(PortalElement portlet) Hook called by PortalManager to add more styles for the given PortalElement's insidegetOutterClasses(PortalElement portlet) Hook called by PortalManager to add more classes for the given PortalElement's outsidegetOutterStyles(PortalElement portlet) Hook called by PortalManager to add more styles for the given PortalElement's outsidegetSkinTemplateUsage(Data data, String usage) Overrides the skin usage decided by JCMS and previous pluginsgetTemplateEntry(String usage, Data data, TypeTemplateEntry tte) This method is a hook to display a custom template, different from the default selected one.getTemplateEntry(String usage, Class<? extends Data> dataClass, Workspace ws, TypeTemplateEntry tte) This method is a hook to display a custom template, different from the default selected one.getTemplateUsage(Data data, String usage) Overrides the usage decided by JCMS and previous pluginsgetTemplateUsage(Class<?> pubClass, String usage) Overrides the usage decided by JCMS and previous pluginsvoidhandleCondition(String[] conditions) Hook called by doInitPortlet.jsp to handle custom portlet condition.booleanInitialize the component with the given plugin configurationMethods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
compareTo, equals, getOrder, setOrderMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareTo
-
Constructor Details
-
BasicTemplatePolicyFilter
public BasicTemplatePolicyFilter()
-
-
Method Details
-
init
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:
-
getTemplateEntry
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:
-
getTemplateEntry
public TypeTemplateEntry getTemplateEntry(String usage, 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:
-
getTemplateUsage
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:
-
getTemplateUsage
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:
-
getSkinTemplateUsage
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:
-
getInnerClasses
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:
-
getOutterClasses
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:
-
getInnerStyles
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:
-
getOutterStyles
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:
-
getCssFiles
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:
-
getConditionLabels
public String[] getConditionLabels(String[] labels, Class<? extends PortalElement> portlet, 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:
-
getConditionValues
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:
-
handleCondition
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:
-