Author: thomas.heute(a)jboss.com
Date: 2008-04-08 07:45:42 -0400 (Tue, 08 Apr 2008)
New Revision: 10518
Modified:
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java
Log:
JBPORTAL-1975: Cannot load email templates in core-identity
Modified:
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java 2008-04-08
11:42:53 UTC (rev 10517)
+++
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java 2008-04-08
11:45:42 UTC (rev 10518)
@@ -66,7 +66,7 @@
private static final String TEMPLATE_PATH = "conf/templates/";
/** The template prefix. */
- private static final String TEMPLATE_PREFIX = "/emailTemplate_";
+ private static final String TEMPLATE_PREFIX = "/emailTemplate";
/** The core-identity configuration service. */
private IdentityUIConfigurationService identityUIConfigurationService;
@@ -215,10 +215,10 @@
private String generateEmailText(String templateLocation, Map<String, String>
mailData, Locale locale) throws IOException, TemplateException
{
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
- URL config = tcl.getResource(TEMPLATE_PATH + templateLocation + TEMPLATE_PREFIX +
locale.getLanguage() + "_" + locale.getCountry() + ".tpl");
+ URL config = tcl.getResource(TEMPLATE_PATH + templateLocation + TEMPLATE_PREFIX +
"_" + locale.getLanguage() + "_" + locale.getCountry() +
".tpl");
if (config == null)
{
- config = tcl.getResource(TEMPLATE_PATH + templateLocation + TEMPLATE_PREFIX +
locale.getLanguage() + ".tpl");
+ config = tcl.getResource(TEMPLATE_PATH + templateLocation + TEMPLATE_PREFIX +
"_" + locale.getLanguage() + ".tpl");
}
if (config == null)
{
@@ -226,7 +226,7 @@
}
if (config == null)
{
- throw new FileNotFoundException("Cannot load a suitable email templte in:
" + TEMPLATE_PATH);
+ throw new FileNotFoundException("Cannot load a suitable email template in:
" + TEMPLATE_PATH);
}
InputStream in = config.openStream();
Show replies by date