public class TemplateVariationDefinitionBasedTemplateLoader extends Object implements freemarker.cache.TemplateLoader
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.| Modifier and Type | Field and Description |
|---|---|
protected TemplateRepositoryService |
repositoryService |
protected org.springframework.core.io.ResourceLoader |
resourceLoader |
| Constructor and Description |
|---|
TemplateVariationDefinitionBasedTemplateLoader(TemplateRepositoryService repositoryService,
org.springframework.core.io.ResourceLoader resourceLoader) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeTemplateSource(Object templateSource) |
Object |
findTemplateSource(String templateVariationId) |
long |
getLastModified(Object templateSource) |
Reader |
getReader(Object templateSource,
String encoding) |
protected TemplateRepositoryService |
getRepositoryService() |
protected final TemplateRepositoryService repositoryService
protected final org.springframework.core.io.ResourceLoader resourceLoader
public TemplateVariationDefinitionBasedTemplateLoader(TemplateRepositoryService repositoryService, org.springframework.core.io.ResourceLoader resourceLoader)
public Object findTemplateSource(String templateVariationId) throws IOException
findTemplateSource in interface freemarker.cache.TemplateLoaderIOExceptionpublic long getLastModified(Object templateSource)
getLastModified in interface freemarker.cache.TemplateLoaderpublic Reader getReader(Object templateSource, String encoding) throws IOException
getReader in interface freemarker.cache.TemplateLoaderIOExceptionpublic void closeTemplateSource(Object templateSource) throws IOException
closeTemplateSource in interface freemarker.cache.TemplateLoaderIOExceptionprotected TemplateRepositoryService getRepositoryService()
Copyright © 2019. All rights reserved.