Class CmsTemplateLoader
java.lang.Object
ch.tocco.nice2.optional.cms.impl.publish.output.freemarker.loader.CmsTemplateLoader
- All Implemented Interfaces:
CachingTemplateLoader,freemarker.cache.TemplateLoader
This template loader uses
CmsTemplateService to find
the requested template.
Once loaded a template, it will be cached within this loader. If the template has changed, the cache of
this loader has to be invalidated by calling invalidate(String) or invalidateAll().-
Constructor Summary
ConstructorsConstructorDescriptionCmsTemplateLoader(CmsTemplateService cmsTemplateService, SecurityManager securityManager, org.slf4j.Logger log) -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseTemplateSource(Object templateSource) findTemplateSource(String name) longgetLastModified(Object templateSource) voidinvalidate(String templateName) Invalidate the template with a specific name.voidInvalidate all templates in the cache.
-
Constructor Details
-
CmsTemplateLoader
public CmsTemplateLoader(CmsTemplateService cmsTemplateService, SecurityManager securityManager, org.slf4j.Logger log)
-
-
Method Details
-
invalidateAll
public void invalidateAll()Description copied from interface:CachingTemplateLoaderInvalidate all templates in the cache.- Specified by:
invalidateAllin interfaceCachingTemplateLoader
-
invalidate
Description copied from interface:CachingTemplateLoaderInvalidate the template with a specific name.- Specified by:
invalidatein interfaceCachingTemplateLoader- Parameters:
templateName- The name of the template to invalidate.
-
findTemplateSource
- Specified by:
findTemplateSourcein interfacefreemarker.cache.TemplateLoader- Throws:
IOException
-
getLastModified
- Specified by:
getLastModifiedin interfacefreemarker.cache.TemplateLoader
-
getReader
- Specified by:
getReaderin interfacefreemarker.cache.TemplateLoader- Throws:
IOException
-
closeTemplateSource
- Specified by:
closeTemplateSourcein interfacefreemarker.cache.TemplateLoader- Throws:
IOException
-