|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.base.util.EmailTemplateUtil
public final class EmailTemplateUtil
Used for doing transformations on email template content, and storing customized versions of email templates.
XML Configuration files must be in the file format<email-templates> <template name="" country="" language=""> <![CDATA[template content]]> </template> </email-templates>
Method Summary | |
---|---|
static void |
addConfiguration(java.io.Reader reader)
Adds an additional *-email-templates.xml configuration file to this class. |
static java.lang.String |
applyFreemarkerTemplate(java.util.Map properties,
java.lang.String templateName,
java.util.Locale locale)
Assumes that the template is a freemarker template and applies a freemarker transformation to it. |
static java.lang.String |
applyFreemarkerTemplateSrc(java.util.Map properties,
java.lang.String templateSrc)
Assumes that the template is a freemarker template and applies a freemarker transformation to it. |
static void |
deleteCustomEmailTemplate(java.lang.String templateName,
java.util.Locale locale)
Deletes a customized template |
static void |
destroy()
Removes all template content |
static java.lang.String |
getEmailTemplate(java.lang.String templateName,
java.util.Locale locale)
Get the raw email template source for a specific template templateName. |
static java.util.List |
getEmailTemplateLocales(java.lang.String templateName)
Returns a list of locales for the given template name. |
static java.lang.String |
getHtmlEscapedEmailTemplate(java.lang.String templateName,
java.util.Locale locale)
Returns an HTML escaped template String. |
static void |
setEmailTemplate(java.lang.String templateName,
java.lang.String templateSource,
java.util.Locale locale)
This method can be used to override the default source for a template. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void addConfiguration(java.io.Reader reader)
reader
- Reader for an email template xml filepublic static void destroy()
public static java.lang.String applyFreemarkerTemplate(java.util.Map properties, java.lang.String templateName, java.util.Locale locale)
properties
- Used for the freemarker contexttemplateName
- Name of the template (from properties)locale
- Used to choose which language of template to use
public static java.lang.String applyFreemarkerTemplateSrc(java.util.Map properties, java.lang.String templateSrc)
properties
- Used for the freemarker contexttemplateSrc
- Freemarker template source
public static java.lang.String getEmailTemplate(java.lang.String templateName, java.util.Locale locale)
JiveGlobals.getLocalizedJiveProperty(String, java.util.Locale)
. If no overriden
version is found then the default template will be pulled from the XML content added to this
class via addConfiguration(java.io.Reader)
.
templateName
- The email template templateNamelocale
- Which localized version of the email template to grab
public static java.lang.String getHtmlEscapedEmailTemplate(java.lang.String templateName, java.util.Locale locale)
getEmailTemplate(String, Locale)
.
templateName
- The email template templateNamelocale
- Which localized version of the email template to grab
public static void setEmailTemplate(java.lang.String templateName, java.lang.String templateSource, java.util.Locale locale)
JiveGlobals.setLocalizedJiveProperty(String, String, java.util.Locale)
to set the
template source inside the jive properties. If null is passed in for a templateSource value
then the jive property for the template source will be deleted and the default template
source will be used.
templateName
- The name of the templatetemplateSource
- source of the template to overridelocale
- which locale version of the source to overridepublic static void deleteCustomEmailTemplate(java.lang.String templateName, java.util.Locale locale)
templateName
- The name of the template to deletelocale
- which locale to delete the template forpublic static java.util.List getEmailTemplateLocales(java.lang.String templateName)
locales
for the given template name. This can be used
to list currently installed locales for a given template. This method returns an
empty list if no templates are found.
templateName
- the name of the template.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |