portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r350016 - in /portals/jetspeed-2/trunk/applications/j2-admin/src: java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java webapp/WEB-INF/portlet.xml
Date Wed, 30 Nov 2005 19:01:32 GMT
Author: taylor
Date: Wed Nov 30 11:01:29 2005
New Revision: 350016

URL: http://svn.apache.org/viewcvs?rev=350016&view=rev
Log:
generate true portal URLs on the fly

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/webapp/WEB-INF/portlet.xml

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=350016&r1=350015&r2=350016&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
Wed Nov 30 11:01:29 2005
@@ -32,6 +32,7 @@
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
@@ -284,14 +285,17 @@
             publishRenderMessage(
                     request,
                     MSG_CHANGEDPW_MSG,
+                    // TODO: localize this!
                     makeMessage("An email has been sent to you.  Please follow the link in
the email"));
             
-            response.sendRedirect(this.redirectPath);
-        } catch (AdministrationEmailException e)
+            response.sendRedirect(generateRedirectURL(request, response));
+        } 
+        catch (AdministrationEmailException e)
         {
             publishRenderMessage(request, CTX_MESSAGE, makeMessage(e
                     .getMessage()));
-        } catch (Exception e)
+        } 
+        catch (Exception e)
         {
             publishRenderMessage(request, CTX_MESSAGE,
                     makeMessage("Failed to send password: " + e.toString()));
@@ -315,12 +319,23 @@
         return this.emailSubject;
     }
 
-    protected String generateReturnURL(ActionRequest request,
-            ActionResponse response, String urlGUID)
+    protected String generateReturnURL(PortletRequest request,
+                                       PortletResponse response,
+                                       String urlGUID)
     {
-        return this.returnUrlPath + "?guid=" + urlGUID;
+        String fullPath = this.returnUrlPath + "?guid=" + urlGUID; 
+        // NOTE: getPortalURL will encode the fullPath for us
+        String url = admin.getPortalURL(request, response, fullPath);
+        return url;
     }
 
+    protected String generateRedirectURL(PortletRequest request,
+                                         PortletResponse response)
+                                         
+    {
+        return admin.getPortalURL(request, response, this.redirectPath);
+    }
+    
     protected String getUserName(User user)
     {
         Principal principal = null;

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml?rev=350016&r1=350015&r2=350016&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml Wed Nov
30 11:01:29 2005
@@ -853,12 +853,12 @@
      <init-param>
         <description>This parameter sets the url to which folks will return after they
receive an email</description>
         <name>returnURL</name>
-            <value>http://localhost:8080/jetspeed/portal/something.vm</value>
+            <value>/complete-registration.psml</value>
      </init-param>   
      <init-param>
         <description>This parameter sets the URL to which people will go after they
successfully complete their form for forgotten password</description>
         <name>redirectPath</name>
-            <value>http://localhost:8080/jetspeed/portal/</value>
+            <value>/forgotten-password.psml</value>
      </init-param>   
 
     <portlet-name>ForgottenPasswordPortlet</portlet-name>



---------------------------------------------------------------------
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