Class TemplateVariationDefinitionBasedTemplateLoader
java.lang.Object
com.flowable.template.engine.impl.processor.TemplateVariationDefinitionBasedTemplateLoader
- All Implemented Interfaces:
freemarker.cache.TemplateLoader
public class TemplateVariationDefinitionBasedTemplateLoader
extends Object
implements freemarker.cache.TemplateLoader
A freemarker based template loader loading template content based on a
TemplateVariationModel
which
is loaded through the TemplateRepositoryService
by its id which is passed in as the template name. However, FreeMarker adds the locale to the
template name and we have to strip it away as variations are handled by the template engine rather than FreeMarker.- Author:
- Micha Kiener
-
Field Summary
Modifier and TypeFieldDescriptionprotected final TemplateRepositoryService
protected final ResourceLoader
-
Constructor Summary
ConstructorDescriptionTemplateVariationDefinitionBasedTemplateLoader
(TemplateRepositoryService repositoryService, ResourceLoader resourceLoader) -
Method Summary
Modifier and TypeMethodDescriptionvoid
closeTemplateSource
(Object templateSource) findTemplateSource
(String templateVariationId) long
getLastModified
(Object templateSource) protected TemplateRepositoryService
-
Field Details
-
repositoryService
-
resourceLoader
-
-
Constructor Details
-
TemplateVariationDefinitionBasedTemplateLoader
public TemplateVariationDefinitionBasedTemplateLoader(TemplateRepositoryService repositoryService, ResourceLoader resourceLoader)
-
-
Method Details
-
findTemplateSource
- Specified by:
findTemplateSource
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-
getLastModified
- Specified by:
getLastModified
in interfacefreemarker.cache.TemplateLoader
-
getReader
- Specified by:
getReader
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-
closeTemplateSource
- Specified by:
closeTemplateSource
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-
getRepositoryService
-