fr.paris.lutece.portal.service.template
Interface IFreeMarkerTemplateService

All Known Implementing Classes:
AbstractFreeMarkerTemplateService

public interface IFreeMarkerTemplateService

IFreeMarkerTemplateService


Method Summary
 void addPluginMacros(java.lang.String strFileName)
          Adds a macro file (like the main commons.html) brought by a plugin.
 java.lang.String getAbsolutePathFromRelativePath(java.lang.String strPath)
          Get the absolute path from relative path
 java.lang.String getDefaultPattern(java.util.Locale locale)
          Get the default date pattern
 void init(java.lang.String strTemplatePath)
          Initializes the service with the templates's path
 HtmlTemplate loadTemplate(java.lang.String strTemplateData, java.util.Locale locale, java.lang.Object rootMap)
          Deprecated. 
 HtmlTemplate loadTemplate(java.lang.String strPath, java.lang.String strTemplate)
          Load a template
 HtmlTemplate loadTemplate(java.lang.String strPath, java.lang.String strTemplate, java.util.Locale locale, java.lang.Object rootMap)
          Load a template and process a model
 void resetCache()
          Reset the cache
 void resetConfiguration()
          Clears the configuration cache
 void setTemplateUpdateDelay(int nTemplateUpdateDelay)
          Set the template update delay
 

Method Detail

getAbsolutePathFromRelativePath

java.lang.String getAbsolutePathFromRelativePath(java.lang.String strPath)
Get the absolute path from relative path

Parameters:
strPath - the path
Returns:
the absolute path from relative path

getDefaultPattern

java.lang.String getDefaultPattern(java.util.Locale locale)
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

addPluginMacros

void addPluginMacros(java.lang.String strFileName)
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

init

void init(java.lang.String strTemplatePath)
Initializes the service with the templates's path

Parameters:
strTemplatePath - The template path

loadTemplate

HtmlTemplate loadTemplate(java.lang.String strPath,
                          java.lang.String strTemplate)
Load a template

Parameters:
strPath - the root path
strTemplate - the path of the template from the root path
Returns:
the html template

loadTemplate

HtmlTemplate loadTemplate(java.lang.String strPath,
                          java.lang.String strTemplate,
                          java.util.Locale locale,
                          java.lang.Object rootMap)
Load a template and process a model

Parameters:
strPath - the root path
strTemplate - the path of the template from the root path
locale - The locale
rootMap - the model root
Returns:
the processed html template

loadTemplate

@Deprecated
HtmlTemplate loadTemplate(java.lang.String strTemplateData,
                                     java.util.Locale locale,
                                     java.lang.Object rootMap)
Deprecated. 

Load a template from a String and process a model WARNING : This method must not be used in front office (no cache management available).
Deprecated Using Freemarker without cache is huge CPU consuming

Parameters:
strTemplateData - The template as a string
locale - The Locale
rootMap - the model root
Returns:
the processed html template

resetConfiguration

void resetConfiguration()
Clears the configuration cache


resetCache

void resetCache()
Reset the cache



Copyright © 2012 Mairie de Paris. All Rights Reserved.