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 aTemplateVariationModel
which is loaded through theTemplateRepositoryService
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
Fields Modifier and Type Field Description protected TemplateRepositoryService
repositoryService
protected ResourceLoader
resourceLoader
-
Constructor Summary
Constructors Constructor Description TemplateVariationDefinitionBasedTemplateLoader(TemplateRepositoryService repositoryService, ResourceLoader resourceLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeTemplateSource(Object templateSource)
Object
findTemplateSource(String templateVariationId)
long
getLastModified(Object templateSource)
Reader
getReader(Object templateSource, String encoding)
protected TemplateRepositoryService
getRepositoryService()
-
-
-
Field Detail
-
repositoryService
protected final TemplateRepositoryService repositoryService
-
resourceLoader
protected final ResourceLoader resourceLoader
-
-
Constructor Detail
-
TemplateVariationDefinitionBasedTemplateLoader
public TemplateVariationDefinitionBasedTemplateLoader(TemplateRepositoryService repositoryService, ResourceLoader resourceLoader)
-
-
Method Detail
-
findTemplateSource
public Object findTemplateSource(String templateVariationId) throws IOException
- Specified by:
findTemplateSource
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-
getLastModified
public long getLastModified(Object templateSource)
- Specified by:
getLastModified
in interfacefreemarker.cache.TemplateLoader
-
getReader
public Reader getReader(Object templateSource, String encoding) throws IOException
- Specified by:
getReader
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-
closeTemplateSource
public void closeTemplateSource(Object templateSource) throws IOException
- Specified by:
closeTemplateSource
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-
getRepositoryService
protected TemplateRepositoryService getRepositoryService()
-
-