Interface IFreeMarkerTemplateService
- All Known Implementing Classes:
AbstractFreeMarkerTemplateService
public interface IFreeMarkerTemplateService
IFreeMarkerTemplateService
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAutoImport(String strNamespace, String strFile) Add an auto import filevoidaddAutoInclude(String strFile) Add an auto include filevoidaddPluginAutoImport(String strNamespace, String strFileName) Adds an import file brought by a plugin.voidaddPluginAutoInclude(String strFileName) Adds a macro file (like the main commons.html) brought by a plugin.voidaddPluginMacros(String strFileName) Deprecated.getAbsolutePathFromRelativePath(String strPath) Get the absolute path from relative pathGet the list of auto imports filesGet the list of auto includes filesgetDefaultPattern(Locale locale) Get the default date patternvoidDeprecated.voidInitializes the service with the templates's pathvoidInitializes the service with the templates's path and servletContextloadTemplate(String strPath, String strTemplate) Load a templateloadTemplate(String strPath, String strTemplate, Locale locale, Object rootMap) Load a template and process a modelloadTemplateFromStringFtl(String strTemplateName, String strTemplateData, Locale locale, Object rootMap, boolean bResetCacheTemplate) Load a template from a String and process a model.loadTemplateFromStringFtl(String strTemplateData, Locale locale, Object rootMap) Load a template from a String and process a model.voidremoveAutoImport(String strNamespace) Remove an auto import filevoidremoveAutoInclude(String strFile) Remove an auto include filevoidReset the cachevoidClears the configuration cachevoidsetSharedVariable(String name, Object obj) Add a shared variable into every templatevoidsetTemplateAutoEscape(boolean bTemplateAutoEscape) Set the template autoescapingvoidsetTemplateUpdateDelay(int nTemplateUpdateDelay) Set the template update delay
-
Method Details
-
getAbsolutePathFromRelativePath
Get the absolute path from relative path- Parameters:
strPath- the path- Returns:
- the absolute path from relative path
-
getDefaultPattern
Get the default date pattern- Parameters:
locale- the locale- Returns:
- the default date pattern
-
setTemplateUpdateDelay
void setTemplateUpdateDelay(int nTemplateUpdateDelay) Set the template update delay- Parameters:
nTemplateUpdateDelay- the template update delay
-
setTemplateAutoEscape
void setTemplateAutoEscape(boolean bTemplateAutoEscape) Set the template autoescaping- Parameters:
bTemplateAutoEscape- true to enable autoescaping
-
addPluginMacros
Deprecated.Adds a macro file (like the main commons.html) brought by a plugin. This file will be included for every template (autoinclude).- Parameters:
strFileName- the filename
-
addPluginAutoInclude
Adds a macro file (like the main commons.html) brought by a plugin. This file will be included for every template (auto-include).- Parameters:
strFileName- the filename
-
addPluginAutoImport
Adds an import file brought by a plugin. This file will be imported for every template (auto-import).- Parameters:
strNamespace- The namespace corresponding to the import filestrFileName- the filename
-
init
Deprecated.Initializes the service with the templates's path- Parameters:
strTemplatePath- The template path
-
init
Initializes the service with the templates's path and servletContext- Parameters:
strTemplatePath- The template pathcontext- The servlet context
-
init
Initializes the service with the templates's path- Parameters:
strTemplatePath- The template pathbAcceptIncompatibleImprovements- Use Freemarker new features or stay backward compatible
-
loadTemplate
Load a template- Parameters:
strPath- the root pathstrTemplate- the path of the template from the root path- Returns:
- the html template
-
loadTemplate
Load a template and process a model- Parameters:
strPath- the root pathstrTemplate- the path of the template from the root pathlocale- The localerootMap- the model root- Returns:
- the processed html template
-
loadTemplateFromStringFtl
Load a template from a String and process a model. the template data is stored in the StringTemplateLoader of freemarker. the template key is generate by a hash of the template data.- Parameters:
strTemplateData- The template as a stringlocale- TheLocalerootMap- the model root- Returns:
- the processed html template
-
loadTemplateFromStringFtl
HtmlTemplate loadTemplateFromStringFtl(String strTemplateName, String strTemplateData, Locale locale, Object rootMap, boolean bResetCacheTemplate) Load a template from a String and process a model. the template data is stored in the StringTemplateLoader of freemarker using strTemplateName as key- Parameters:
strTemplateName- the key of the template put in the StringTemplateLoader. The template name must be a Fully qualified name (skin.plugins.myplugin.manage_my_objects)strTemplateData- The template as a stringlocale- TheLocalerootMap- the model rootbResetCacheTemplate- force the update of the template data stored in the StringTemplateLoader- Returns:
- the processed html template
-
resetConfiguration
void resetConfiguration()Clears the configuration cache -
resetCache
void resetCache()Reset the cache -
getAutoIncludes
Get the list of auto includes files- Returns:
- The list or null if no configuration is available
-
addAutoInclude
Add an auto include file- Parameters:
strFile- The file to add
-
removeAutoInclude
Remove an auto include file- Parameters:
strFile- The file to remove
-
getAutoImports
Get the list of auto imports files- Returns:
- The list or null if no configuration is available
-
addAutoImport
Add an auto import file- Parameters:
strNamespace- The namespace corresponding to the import filestrFile- The file to add
-
removeAutoImport
Remove an auto import file- Parameters:
strNamespace- The namespace corresponding to the import file to remove
-