Class TemplateUtils
- java.lang.Object
-
- org.exoplatform.commons.notification.template.TemplateUtils
-
public class TemplateUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description TemplateUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 StringgetResourceBundle(String key, Locale locale, String resourcePath)Gets Resource Bundle valuestatic 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
-
-
-
Method Detail
-
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:
-
loadGroovyTemplate
public static String loadGroovyTemplate(String templatePath) throws Exception
Loads the Groovy template file- Parameters:
templatePath-- Returns:
- Throws:
Exception
-
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
-
processSubject
public static String processSubject(org.exoplatform.commons.api.notification.service.template.TemplateContext ctx)
Render for Subject template- Parameters:
ctx-- Returns:
-
getExcerptSubject
public static String getExcerptSubject(String subject)
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
public static String cleanHtmlTags(String str)
Clean all HTML tags on string- Parameters:
str- the origin string- Returns:
- The string has not contain HTML tags.
- Since:
- 4.1.x
-
processDigest
public static String processDigest(org.exoplatform.commons.api.notification.service.template.TemplateContext ctx)
Render for digest template- Parameters:
ctx-- Returns:
-
-