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 ResourceLoader |
resourceLoader |
Constructor and Description |
---|
TemplateVariationDefinitionBasedTemplateLoader(TemplateRepositoryService repositoryService,
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 ResourceLoader resourceLoader
public TemplateVariationDefinitionBasedTemplateLoader(TemplateRepositoryService repositoryService, ResourceLoader resourceLoader)
public Object findTemplateSource(String templateVariationId) throws IOException
findTemplateSource
in interface freemarker.cache.TemplateLoader
IOException
public long getLastModified(Object templateSource)
getLastModified
in interface freemarker.cache.TemplateLoader
public Reader getReader(Object templateSource, String encoding) throws IOException
getReader
in interface freemarker.cache.TemplateLoader
IOException
public void closeTemplateSource(Object templateSource) throws IOException
closeTemplateSource
in interface freemarker.cache.TemplateLoader
IOException
protected TemplateRepositoryService getRepositoryService()