@ProviderType
public interface TemplateHandler
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getClassName()
Returns the template handler's class name.
|
java.util.Map<java.lang.String,java.lang.Object> |
getCustomContextObjects() |
java.util.List<Element> |
getDefaultTemplateElements()
Returns the elements containing the information of the portlet display
templates to be installed by default.
|
java.lang.String |
getDefaultTemplateKey()
Returns the key of the template handler's default template.
|
java.lang.String |
getName(java.util.Locale locale)
Returns the template handler's name.
|
java.lang.String |
getResourceName()
Returns the name of the resource associated with the template.
|
java.lang.String[] |
getRestrictedVariables(java.lang.String language)
Returns the restricted variables that are excluded from the template's
context.
|
java.lang.String |
getTemplatesHelpContent(java.lang.String language)
Returns initial template content for helping the user create a new
template.
|
java.lang.String |
getTemplatesHelpPath(java.lang.String language)
Returns the path to the template's help content.
|
java.lang.String |
getTemplatesHelpPropertyKey()
Returns the name of the property in
portal.properties that
defines the path to the template's help content. |
java.util.Map<java.lang.String,TemplateVariableGroup> |
getTemplateVariableGroups(long classPK,
java.lang.String language,
java.util.Locale locale)
Returns the template's map of script variable groups for which hints are
displayed in the template editor palette.
|
boolean |
isDisplayTemplateHandler() |
java.lang.String getClassName()
java.util.Map<java.lang.String,java.lang.Object> getCustomContextObjects()
java.util.List<Element> getDefaultTemplateElements() throws java.lang.Exception
java.lang.Exception
- if an exception occurred assembling the default
template elementsjava.lang.String getDefaultTemplateKey()
java.lang.String getName(java.util.Locale locale)
locale
- the locale of the template handler name to getjava.lang.String getResourceName()
java.lang.String[] getRestrictedVariables(java.lang.String language)
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.java.lang.String getTemplatesHelpContent(java.lang.String language)
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.java.lang.String getTemplatesHelpPath(java.lang.String language)
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.java.lang.String getTemplatesHelpPropertyKey()
portal.properties
that
defines the path to the template's help content.portal.properties
that
defines the path to the template's help contentjava.util.Map<java.lang.String,TemplateVariableGroup> getTemplateVariableGroups(long classPK, java.lang.String language, java.util.Locale locale) throws java.lang.Exception
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.
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 getjava.lang.Exception
- if an exception occurred retrieving the template
variable groupsboolean isDisplayTemplateHandler()