Class TemplateUtils
java.lang.Object
org.exoplatform.commons.notification.template.TemplateUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcleanHtmlTags(String str) Clean all HTML tags on stringstatic StringgetExcerptSubject(String subject) Get the excerpt subject of notification mail from origin string - Just contains plain text - Limit number of charactersstatic org.exoplatform.commons.api.notification.plugin.config.PluginConfiggetPluginConfig(String pluginId) Gets Plugin configuration for specified PluginIdstatic StringgetResourceBundle(String key, Locale locale, String resourcePath) Gets Resource Bundle valuestatic InputStreamgetTemplateInputStream(String templatePath) Gets InputStream for groovy templatestatic org.exoplatform.commons.api.notification.template.ElementloadGroovyElement(String pluginId, String language) Load the Groovy template element.static StringloadGroovyTemplate(String templatePath) Loads the Groovy template filestatic StringprocessDigest(org.exoplatform.commons.api.notification.service.template.TemplateContext ctx) Render for digest templatestatic StringprocessGroovy(org.exoplatform.commons.api.notification.service.template.TemplateContext ctx) Process the Groovy template associate with Template context to generate It will be use for digest mailstatic StringprocessSubject(org.exoplatform.commons.api.notification.service.template.TemplateContext ctx) Render for Subject template
-
Constructor Details
-
TemplateUtils
public TemplateUtils()
-
-
Method Details
-
processGroovy
public static String processGroovy(org.exoplatform.commons.api.notification.service.template.TemplateContext ctx) Process the Groovy template associate with Template context to generate It will be use for digest mail- Parameters:
ctx-- Returns:
-
processSubject
public static String processSubject(org.exoplatform.commons.api.notification.service.template.TemplateContext ctx) Render for Subject template- Parameters:
ctx-- Returns:
-
processDigest
public static String processDigest(org.exoplatform.commons.api.notification.service.template.TemplateContext ctx) Render for digest template- Parameters:
ctx-- Returns:
-
loadGroovyTemplate
Loads the Groovy template file- Parameters:
templatePath-- Returns:
- Groovy Template File content
-
loadGroovyElement
public static org.exoplatform.commons.api.notification.template.Element loadGroovyElement(String pluginId, String language) Load the Groovy template element.- Parameters:
pluginId- The plugin's idlanguage- The language's id.- Returns:
- The Groovy element
-
getExcerptSubject
Get the excerpt subject of notification mail from origin string - Just contains plain text - Limit number of characters- Parameters:
subject- the origin string- Returns:
- the excerpt of subject
- Since:
- 4.1.x
-
cleanHtmlTags
Clean all HTML tags on string- Parameters:
str- the origin string- Returns:
- The string has not contain HTML tags.
- Since:
- 4.1.x
-
getPluginConfig
public static org.exoplatform.commons.api.notification.plugin.config.PluginConfig getPluginConfig(String pluginId) Gets Plugin configuration for specified PluginId- Parameters:
pluginId-- Returns:
-
getResourceBundle
Gets Resource Bundle value- Parameters:
key-locale-resourcePath-- Returns:
-
getTemplateInputStream
Gets InputStream for groovy template- Parameters:
templatePath-- Returns:
InputStreamcorresponding to relative or absolute template path
-