portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shins...@apache.org
Subject svn commit: r351853 - in /portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration: ForgottenPasswordPortlet.java UserRegistrationPortlet.java
Date Fri, 02 Dec 2005 23:48:32 GMT
Author: shinsuke
Date: Fri Dec  2 15:48:27 2005
New Revision: 351853

URL: http://svn.apache.org/viewcvs?rev=351853&view=rev
Log:
check if the template exists. if not, not changed to l10ned template.

Modified:
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java?rev=351853&r1=351852&r2=351853&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java
Fri Dec  2 15:48:27 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.jetspeed.portlets.registration;
 
+import java.io.File;
 import java.io.IOException;
 import java.security.Principal;
 import java.util.ArrayList;
@@ -307,9 +308,13 @@
             String language = locale.getLanguage();
             String templ = this.template;
             int period = templ.lastIndexOf(".");
-            if(period >0) {
-                String fixedTempl = templ.substring(0,period)+ "_"+language+"."+templ.substring(period+1);
-                this.template = fixedTempl;
+            if (period > 0)
+            {
+                String fixedTempl = templ.substring(0, period) + "_" + language + "." + templ.substring(period
+ 1);
+                if (new File(getPortletContext().getRealPath(fixedTempl)).exists())
+                {
+                    this.template = fixedTempl;
+                }
             }
             
             if (this.template == null) 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java?rev=351853&r1=351852&r2=351853&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
Fri Dec  2 15:48:27 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.jetspeed.portlets.registration;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -422,9 +423,13 @@
             String language = locale.getLanguage();
             String templ = this.emailTemplate;
             int period = templ.lastIndexOf(".");
-            if(period >0) {
-                String fixedTempl = templ.substring(0,period)+ "_"+language+"."+templ.substring(period+1);
-                this.emailTemplate = fixedTempl;
+            if (period > 0)
+            {
+                String fixedTempl = templ.substring(0, period) + "_" + language + "." + templ.substring(period
+ 1);
+                if (new File(getPortletContext().getRealPath(fixedTempl)).exists())
+                {
+                    this.emailTemplate = fixedTempl;
+                }
             }
             
             if (this.emailTemplate == null) 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message