com.jalios.jcms.policy
Class BasicTemplatePolicyFilter

java.lang.Object
  extended by com.jalios.jcms.policy.AbstractPolicyFilter
      extended by 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
Version:
$Revision: 28817 $
Author:
Jean-Philippe Encausse
See Also:
TemplatePolicyFilter

Field Summary
static String REVISION
           
 
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order
 
Constructor Summary
BasicTemplatePolicyFilter()
           
 
Method Summary
 String[] getConditionLabels(String[] labels, Class<? extends PortalElement> portlet, String userLang)
          Hook called by doEditCommonPortlet to update labels to Condition's combo box
 String[] getConditionValues(String[] values, Class<? extends PortalElement> portlet)
          Hook called by doEditCommonPortlet to update values to Condition's combo box
 void getCssFiles(List<String> jcmsChoice)
          Hook called by PortalManager to change available css files in the portal editor.
 String getInnerClasses(PortalElement portlet)
          Hook called by PortalManager to add more classes for the given PortalElement's inside
 String getInnerStyles(PortalElement portlet)
          Hook called by PortalManager to add more styles for the given PortalElement's inside
 String getOutterClasses(PortalElement portlet)
          Hook called by PortalManager to add more classes for the given PortalElement's outside
 String getOutterStyles(PortalElement portlet)
          Hook called by PortalManager to add more styles for the given PortalElement's outside
 String getSkinTemplateUsage(Data data, String usage)
          Overrides the skin usage decided by JCMS and previous plugins
 TypeTemplateEntry 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.
 TypeTemplateEntry getTemplateEntry(String usage, Data data, TypeTemplateEntry tte)
          This method is a hook to display a custom template, different from the default selected one.
 String getTemplateUsage(Class<?> pubClass, String usage)
          Overrides the usage decided by JCMS and previous plugins
 String getTemplateUsage(Data data, String usage)
          Overrides the usage decided by JCMS and previous plugins
 void handleCondition(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
 
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

BasicTemplatePolicyFilter

public BasicTemplatePolicyFilter()
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)

getTemplateEntry

public TypeTemplateEntry getTemplateEntry(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 interface TemplatePolicyFilter
Parameters:
usage - the template usage
data - the working publication
Returns:
tte the chosen TypeTemplateEntry
See Also:
TemplatePolicyFilter.getTemplateEntry(String, Data, TypeTemplateEntry)

getTemplateEntry

public TypeTemplateEntry getTemplateEntry(String usage,
                                          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 interface TemplatePolicyFilter
Parameters:
usage - the template usage
dataClass - the working Class
ws - the working Workspace
Returns:
tte the chosen TypeTemplateEntry
See Also:
TemplatePolicyFilter.getTemplateEntry(String, Class, Workspace, TypeTemplateEntry)

getTemplateUsage

public String getTemplateUsage(Data data,
                               String usage)
Description copied from interface: TemplatePolicyFilter
Overrides the usage decided by JCMS and previous plugins

Specified by:
getTemplateUsage in interface TemplatePolicyFilter
Parameters:
data - the working data
usage - is the current usage
Returns:
String the overrided usage
See Also:
TemplatePolicyFilter.getTemplateUsage(Data, String)

getTemplateUsage

public String getTemplateUsage(Class<?> pubClass,
                               String usage)
Description copied from interface: TemplatePolicyFilter
Overrides the usage decided by JCMS and previous plugins

Specified by:
getTemplateUsage in interface TemplatePolicyFilter
Parameters:
pubClass - the class of the publication
usage - is the current usage
Returns:
String the overrided usage
See Also:
TemplatePolicyFilter.getTemplateUsage(Class, String)

getSkinTemplateUsage

public String getSkinTemplateUsage(Data data,
                                   String usage)
Description copied from interface: TemplatePolicyFilter
Overrides the skin usage decided by JCMS and previous plugins

Specified by:
getSkinTemplateUsage in interface TemplatePolicyFilter
Parameters:
data - the working data
usage - is the current usage
Returns:
String the overrided usage
See Also:
TemplatePolicyFilter.getSkinTemplateUsage(Data, String)

getInnerClasses

public 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 interface TemplatePolicyFilter
Parameters:
portlet - the working PortalElement
Returns:
String the inner classes to add
See Also:
TemplatePolicyFilter.getInnerClasses(PortalElement)

getOutterClasses

public 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 interface TemplatePolicyFilter
Parameters:
portlet - the working PortalElement
Returns:
String the outter classes to add
See Also:
TemplatePolicyFilter.getOutterClasses(PortalElement)

getInnerStyles

public 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 interface TemplatePolicyFilter
Parameters:
portlet - the working PortalElement
Returns:
String the inner styles to add
See Also:
TemplatePolicyFilter.getInnerStyles(PortalElement)

getOutterStyles

public 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 interface TemplatePolicyFilter
Parameters:
portlet - the working PortalElement
Returns:
String the outter styles to add
See Also:
TemplatePolicyFilter.getOutterStyles(PortalElement)

getCssFiles

public void getCssFiles(List<String> 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 interface TemplatePolicyFilter
Parameters:
jcmsChoice - files selected by JCMS
See Also:
TemplatePolicyFilter.getCssFiles(List)

getConditionLabels

public String[] getConditionLabels(String[] labels,
                                   Class<? extends PortalElement> portlet,
                                   String userLang)
Description copied from interface: TemplatePolicyFilter
Hook called by doEditCommonPortlet to update labels to Condition's combo box

Specified by:
getConditionLabels in interface TemplatePolicyFilter
Parameters:
labels - String[] I18N array of labels
portlet - the portlet class
userLang - the lang of the user
Returns:
String[] I18N array of labels
See Also:
TemplatePolicyFilter.getConditionLabels(String[], Class, String)

getConditionValues

public String[] getConditionValues(String[] values,
                                   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 interface TemplatePolicyFilter
Parameters:
values - String[] of values
portlet - he portlet class
Returns:
String[] an array of conditional values
See Also:
TemplatePolicyFilter.getConditionValues(String[], Class)

handleCondition

public void handleCondition(String[] conditions)
Description copied from interface: TemplatePolicyFilter
Hook called by doInitPortlet.jsp to handle custom portlet condition.

Specified by:
handleCondition in interface TemplatePolicyFilter
Parameters:
conditions - String array of codition for the given portlet
See Also:
TemplatePolicyFilter.handleCondition(String[])


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