Class TemplateUtils

java.lang.Object
org.exoplatform.commons.notification.template.TemplateUtils

public class TemplateUtils extends Object
  • 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:
    • 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 id
      language - 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:
    • getResourceBundle

      public static String getResourceBundle(String key, Locale locale, String resourcePath)
      Gets Resource Bundle value
      Parameters:
      key -
      locale -
      resourcePath -
      Returns: