public interface TemplateProcessor
Modifier and Type | Interface and Description |
---|---|
static interface |
TemplateProcessor.SpecificationItem
Inner interface for specification items
|
Modifier and Type | Method and Description |
---|---|
java.util.Map |
getContext()
Get the template context as unmodifiable map.
|
java.lang.String |
getOutput(java.util.Map map)
Parses and renders the (portal-wide) template identified by a single classification map
|
java.lang.String |
getOutput(java.util.Map[] maps)
Parses and renders the (portal-wide) template identified by an array of classification maps
|
java.lang.String |
getOutput(java.util.Map[] maps,
GenticsPlugin plugin)
Parses the template source.
|
java.lang.String |
getOutput(java.util.Map[] maps,
GenticsPortlet module)
Parses the template source.
|
java.lang.String |
getOutput(java.util.Map map,
GenticsPlugin plugin)
Parses the template source.
|
java.lang.String |
getOutput(java.util.Map map,
GenticsPortlet module)
Parses the template source.
|
java.lang.String |
getOutput(java.lang.String templateId)
Parses and renders the (portal-wide) template identified by id
|
java.lang.String |
getOutput(java.lang.String templateId,
GenticsPlugin plugin)
Parses the template source replacing variables with their actual values,
given by id, with the context The context constist of default objects
(i18n, formatters, ...) and the objects given via
put(String, Object) |
java.lang.String |
getOutput(java.lang.String templateId,
GenticsPortlet module)
Parses the template source replacing variables with their actual values,
given by id, with the context The context constist of default objects
(i18n, formatters, ...) and the objects given via
put(String, Object) |
java.lang.String |
getOutputForSource(java.lang.String templateSource)
Parse and render the template given by source
|
java.lang.String |
getOutputForSource(java.lang.String templateSource,
GenticsPlugin plugin)
Parses the given template source
|
java.lang.String |
getOutputForSource(java.lang.String templateSource,
GenticsPortlet portlet)
Parses the given template source
|
TemplateProcessor.SpecificationItem |
getSpecificationItem(java.lang.String key,
java.lang.String value)
Get a specification item with given key and value
|
java.lang.String |
getTemplate(java.util.Map map)
Get the template source for the (portal-wide) template identified by a classification map
|
java.lang.String |
getTemplate(java.util.Map[] maps)
Get the template source for the (portal-wide) template identified by an array of classification maps
|
java.lang.String |
getTemplate(java.util.Map[] maps,
GenticsPlugin plugin)
Get the template source, given by a map of parameters and implements a
fallback according the array exception TemplateNotFoundException
|
java.lang.String |
getTemplate(java.util.Map[] maps,
GenticsPortlet module)
Get the template source, given by a map of parameters and implements a
fallback according the array exception TemplateNotFoundException
|
java.lang.String |
getTemplate(java.util.Map map,
GenticsPlugin plugin)
Get the template source, given by hashmap exception
TemplateNotFoundException
|
java.lang.String |
getTemplate(java.util.Map map,
GenticsPortlet module)
Get the template source, given by hashmap exception
TemplateNotFoundException
|
java.lang.String |
getTemplate(java.lang.String templateId)
Get the template source for the (portal-wide) template identified by id
|
java.lang.String |
getTemplate(java.lang.String templateId,
GenticsPlugin plugin)
Get the template source, given by id exception TemplateNotFoundException
|
java.lang.String |
getTemplate(java.lang.String templateId,
GenticsPortlet module)
Get the template source, given by id exception TemplateNotFoundException
|
void |
put(java.lang.String key,
java.lang.Object object)
Used to store objects in the template processor which will be available
in the template source as variables.
|
void |
putAll(java.util.Map map)
Store all objects in the given map into the context of the template
processor
|
void |
reset()
Prepares the object for reuse.
|
void put(java.lang.String key, java.lang.Object object) throws PrivateKeyException
key
- The name of the variable.object
- The value of the variable.PrivateKeyException
- is thrown if you are trying to overwrite a
private object within the template (e.g. portal in pn3)void putAll(java.util.Map map) throws PrivateKeyException
map
- map of objectsPrivateKeyException
- when one of the objects in the map is stored
with a key that cannot be overwrittenjava.util.Map getContext()
java.lang.String getOutput(java.lang.String templateId) throws TemplateNotFoundException
templateId
- template idTemplateNotFoundException
java.lang.String getOutput(java.util.Map map) throws TemplateNotFoundException
map
- classification mapTemplateNotFoundException
java.lang.String getOutput(java.util.Map[] maps) throws TemplateNotFoundException
maps
- array of classification mapsTemplateNotFoundException
java.lang.String getTemplate(java.lang.String templateId) throws TemplateNotFoundException
templateId
- template idTemplateNotFoundException
java.lang.String getTemplate(java.util.Map map) throws TemplateNotFoundException
map
- classification mapTemplateNotFoundException
java.lang.String getTemplate(java.util.Map[] maps) throws TemplateNotFoundException
maps
- array of classification mapsTemplateNotFoundException
java.lang.String getOutputForSource(java.lang.String templateSource) throws TemplateNotFoundException
templateSource
- template sourceTemplateNotFoundException
java.lang.String getOutput(java.lang.String templateId, GenticsPortlet module) throws TemplateNotFoundException
put(String, Object)
templateId
- The id of the template.module
- the module for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.java.lang.String getOutput(java.util.Map map, GenticsPortlet module) throws TemplateNotFoundException
map
- Hashmap of parametersmodule
- the module for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.getOutput(java.lang.String,
com.gentics.api.portalnode.portlet.GenticsPortlet)
java.lang.String getOutput(java.util.Map[] maps, GenticsPortlet module) throws TemplateNotFoundException
maps
- Array of Hashmaps of parametersmodule
- the module for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.getOutput(java.lang.String,
com.gentics.api.portalnode.portlet.GenticsPortlet)
java.lang.String getTemplate(java.lang.String templateId, GenticsPortlet module) throws TemplateNotFoundException
templateId
- id of the templatemodule
- the module for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.java.lang.String getTemplate(java.util.Map map, GenticsPortlet module) throws TemplateNotFoundException
map
- Hashmap of parametersmodule
- the module for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.java.lang.String getTemplate(java.util.Map[] maps, GenticsPortlet module) throws TemplateNotFoundException
maps
- Array of Hashmaps of parametersmodule
- the module for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.java.lang.String getOutput(java.lang.String templateId, GenticsPlugin plugin) throws TemplateNotFoundException
put(String, Object)
templateId
- The id of the template.plugin
- the plugin for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.java.lang.String getOutput(java.util.Map map, GenticsPlugin plugin) throws TemplateNotFoundException
map
- Hashmap of parametersplugin
- the plugin for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.getOutput(java.lang.String,
com.gentics.api.portalnode.portlet.GenticsPortlet)
java.lang.String getOutput(java.util.Map[] maps, GenticsPlugin plugin) throws TemplateNotFoundException
maps
- Array of Hashmaps of parametersplugin
- the plugin for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.getOutput(java.lang.String,
com.gentics.api.portalnode.portlet.GenticsPortlet)
java.lang.String getOutputForSource(java.lang.String templateSource, GenticsPortlet portlet) throws TemplateNotFoundException
templateSource
- source of the templateportlet
- calling portletTemplateNotFoundException
java.lang.String getOutputForSource(java.lang.String templateSource, GenticsPlugin plugin) throws TemplateNotFoundException
templateSource
- source of the templateplugin
- calling pluginTemplateNotFoundException
java.lang.String getTemplate(java.lang.String templateId, GenticsPlugin plugin) throws TemplateNotFoundException
templateId
- id of the templateplugin
- the plugin for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.java.lang.String getTemplate(java.util.Map map, GenticsPlugin plugin) throws TemplateNotFoundException
map
- Hashmap of parametersplugin
- the plugin for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.java.lang.String getTemplate(java.util.Map[] maps, GenticsPlugin plugin) throws TemplateNotFoundException
maps
- Array of Hashmaps of parametersplugin
- the plugin for which calledTemplateNotFoundException
- is only thrown when the parameter
on.invalid.template.halt is true. otherwise the error message
defined in the parameter on.invalid.template.message is returned.void reset()
TemplateProcessor.SpecificationItem getSpecificationItem(java.lang.String key, java.lang.String value)
key
- key of the specification itemvalue
- value of the specification itemCopyright © 2022 Gentics Software. All Rights Reserved.