You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by sh...@apache.org on 2005/12/03 00:48:32 UTC

svn commit: r351853 - in /portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration: ForgottenPasswordPortlet.java UserRegistrationPortlet.java

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


Re: svn commit: r351853 - in /portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration: ForgottenPasswordPortlet.java UserRegistrationPortlet.java

Posted by Shinsuke SUGAYA <sh...@yahoo.co.jp>.
David Sean Taylor wrote:
> shinsuke@apache.org wrote:
> 
>> 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.
>>
> Ugh
> This is why I didnt want to commit this
> Now we have other committers adapting a new algorithm for locating 
> fucking localized resources, instead of the template locator algorithm 
> that I asked for and that has been 'standard' in jetspeed for years

I also prefer jetspeed template locator algorithm.
(I'm thinking that it's better to replace it..)
But I'm not sure if I have time to replace it..
So, I put the simple fix.. If not fixing the issue, non english user
cannot use user registration and forgotten password portlet. It's
a major issue..

Thanks,
  shinsuke

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

--------------------------------------
STOP HIV/AIDS.
Yahoo! JAPAN Redribbon Campaign 2005
http://pr.mail.yahoo.co.jp/redribbon/

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


Re: svn commit: r351853 - in /portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration: ForgottenPasswordPortlet.java UserRegistrationPortlet.java

Posted by David Sean Taylor <da...@bluesunrise.com>.
shinsuke@apache.org wrote:
> 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.
>
Ugh
This is why I didnt want to commit this
Now we have other committers adapting a new algorithm for locating 
fucking localized resources, instead of the template locator algorithm 
that I asked for and that has been 'standard' in jetspeed for years


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