Liferay 7.0-ce-b4

com.liferay.portal.kernel.template
Interface TemplateHandler

All Known Implementing Classes:
BasePortletDisplayTemplateHandler, BaseTemplateHandler

@ProviderType
public interface TemplateHandler


Method Summary
 String getClassName()
          Returns the template handler's class name.
 Map<String,Object> getCustomContextObjects()
           
 List<Element> getDefaultTemplateElements()
          Returns the elements containing the information of the portlet display templates to be installed by default.
 String getDefaultTemplateKey()
          Returns the key of the template handler's default template.
 String getName(Locale locale)
          Returns the template handler's name.
 String getResourceName()
          Returns the name of the resource associated with the template.
 String[] getRestrictedVariables(String language)
          Returns the restricted variables that are excluded from the template's context.
 String getTemplatesHelpContent(String language)
          Returns initial template content for helping the user create a new template.
 String getTemplatesHelpPath(String language)
          Returns the path to the template's help content.
 String getTemplatesHelpPropertyKey()
          Returns the name of the property in portal.properties that defines the path to the template's help content.
 Map<String,TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language, Locale locale)
          Returns the template's map of script variable groups for which hints are displayed in the template editor palette.
 boolean isDisplayTemplateHandler()
           
 

Method Detail

getClassName

String getClassName()
Returns the template handler's class name.

Returns:
the template handler's class name

getCustomContextObjects

Map<String,Object> getCustomContextObjects()

getDefaultTemplateElements

List<Element> getDefaultTemplateElements()
                                         throws Exception
Returns the elements containing the information of the portlet display templates to be installed by default.

Returns:
the elements containing the information of the portlet display templates to be installed by default. These templates are installed when registering the portlet.
Throws:
Exception - if an exception occurred assembling the default template elements

getDefaultTemplateKey

String getDefaultTemplateKey()
Returns the key of the template handler's default template.

Returns:
the key of the template handler's default template

getName

String getName(Locale locale)
Returns the template handler's name.

Parameters:
locale - the locale of the template handler name to get
Returns:
the template handler's name

getResourceName

String getResourceName()
Returns the name of the resource associated with the template. Permissions on the resource are checked when adding a new template.

Returns:
the name of the resource associated with the template

getRestrictedVariables

String[] getRestrictedVariables(String language)
Returns the restricted variables that are excluded from the template's context.

Parameters:
language - the template's scripting language. Acceptable values for the FreeMarker, Velocity, or XSL languages are TemplateConstants.LANG_TYPE_FTL, TemplateConstants.LANG_TYPE_VM, or TemplateConstants.LANG_TYPE_XSL, respectively.
Returns:
the restricted variables that are excluded from the template's context

getTemplatesHelpContent

String getTemplatesHelpContent(String language)
Returns initial template content for helping the user create a new template.

Parameters:
language - the template's scripting language. Acceptable values for the FreeMarker, Velocity, or XSL languages are TemplateConstants.LANG_TYPE_FTL, TemplateConstants.LANG_TYPE_VM, or TemplateConstants.LANG_TYPE_XSL, respectively.
Returns:
initial template content for helping the user create a new template

getTemplatesHelpPath

String getTemplatesHelpPath(String language)
Returns the path to the template's help content.

Parameters:
language - the template's scripting language. Acceptable values for the FreeMarker, Velocity, or XSL languages are TemplateConstants.LANG_TYPE_FTL, TemplateConstants.LANG_TYPE_VM, or TemplateConstants.LANG_TYPE_XSL, respectively.
Returns:
the path to the template's help content

getTemplatesHelpPropertyKey

String getTemplatesHelpPropertyKey()
Returns the name of the property in portal.properties that defines the path to the template's help content.

Returns:
the name of the property in portal.properties that defines the path to the template's help content

getTemplateVariableGroups

Map<String,TemplateVariableGroup> getTemplateVariableGroups(long classPK,
                                                            String language,
                                                            Locale locale)
                                                            throws Exception
Returns the template's map of script variable groups for which hints are displayed in the template editor palette.

Script variables can be grouped arbitrarily. As examples, a group of entity fields could be mapped to the keyword Fields, or a group of general variables portal variables could be mapped to the phrase General Variables, etc.

Parameters:
classPK - the primary key of the entity that defines the variable groups for the template. For example, consider specifying the primary key of the structure associated to the template.
language - the template's scripting language. Acceptable values for the FreeMarker, Velocity, or XSL languages are TemplateConstants.LANG_TYPE_FTL, TemplateConstants.LANG_TYPE_VM, or TemplateConstants.LANG_TYPE_XSL, respectively.
locale - the locale of the variable groups to get
Returns:
the template's map of script variable groups for which hints are displayed in the template editor palette
Throws:
Exception - if an exception occurred retrieving the template variable groups

isDisplayTemplateHandler

boolean isDisplayTemplateHandler()

Liferay 7.0-ce-b4