public class EmailHelper extends Object
Constructor and Description |
---|
EmailHelper() |
Modifier and Type | Method and Description |
---|---|
String |
getEmailTemplate(String clientName,
String emailTemplatePath,
String fallbackTemplatePath)
Gets the email template path or the given fallback template path.
|
org.alfresco.service.cmr.repository.NodeRef |
getLocalizedEmailTemplateNodeRef(String emailTemplateXPath)
Gets the localized email template nodeRef.
|
Locale |
getUserLocaleOrDefault(String userId)
Gets the user's locale.
|
void |
init() |
void |
setCompanyHomeChildName(String companyHomeChildName) |
void |
setPreferenceService(PreferenceService preferenceService) |
void |
setRepositoryHelper(Repository repositoryHelper) |
void |
setServiceRegistry(ServiceRegistry serviceRegistry) |
void |
setTemplateLoader(freemarker.cache.TemplateLoader templateLoader) |
public void setServiceRegistry(ServiceRegistry serviceRegistry)
public void setPreferenceService(PreferenceService preferenceService)
public void setRepositoryHelper(Repository repositoryHelper)
public void setTemplateLoader(freemarker.cache.TemplateLoader templateLoader)
public void setCompanyHomeChildName(String companyHomeChildName)
public void init()
public String getEmailTemplate(String clientName, String emailTemplatePath, String fallbackTemplatePath)
clientName
- optional client app name (used only for logging)emailTemplatePath
- the email template xpath or class pathfallbackTemplatePath
- the fallback templateemailTemplatePath
is empty the fallback template is returned.emailTemplatePath
is an xpath (i.e. starts with app:company_home),
then an xpath search will be performed to find the NodeRef
. If no nodeRef
is found, the fallback template is returned. emailTemplatePath
is a nodeRef and the node does not exist, the fallback
template is returned, otherwise a string representation of the NodeRef is returned.emailTemplatePath
is a class path which results in a template being found,
then the emailTemplatePath
is returned; otherwise, the fallback template is returned.public org.alfresco.service.cmr.repository.NodeRef getLocalizedEmailTemplateNodeRef(String emailTemplateXPath)
emailTemplateXPath
- the xpath of the templateNodeRef
of the localized template or null if no node is foundCopyright © 2005–2017 Alfresco Software. All rights reserved.