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
ConstructorDescriptionCmsTemplateLoader
(CmsTemplateService cmsTemplateService, SecurityManager securityManager, org.slf4j.Logger log) -
Method Summary
Modifier and TypeMethodDescriptionvoid
closeTemplateSource
(Object templateSource) findTemplateSource
(String name) long
getLastModified
(Object templateSource) void
invalidate
(String templateName) Invalidate the template with a specific name.void
Invalidate 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:CachingTemplateLoader
Invalidate all templates in the cache.- Specified by:
invalidateAll
in interfaceCachingTemplateLoader
-
invalidate
Description copied from interface:CachingTemplateLoader
Invalidate the template with a specific name.- Specified by:
invalidate
in interfaceCachingTemplateLoader
- Parameters:
templateName
- The name of the template to invalidate.
-
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
-