portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r770586 - /portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java
Date Fri, 01 May 2009 08:53:52 GMT
Author: woonsan
Date: Fri May  1 08:53:51 2009
New Revision: 770586

URL: http://svn.apache.org/viewvc?rev=770586&view=rev
Log:
JS2-946: Fixing init params sharing problem between multiple portlets based on one wicket
application.
Normally, a wicket portlet maps to a wicket application. However, j2 security management portlets
are sharing one wicket application by separating each other by init parameters.
So, the base wicket application for j2 should handle this correctly.

Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java?rev=770586&r1=770585&r2=770586&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java
Fri May  1 08:53:51 2009
@@ -19,6 +19,8 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.security.Principal;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.Map;
 
 import javax.portlet.GenericPortlet;
@@ -50,7 +52,7 @@
  */
 public abstract class AbstractAdminWebApplication extends WebApplication
 {
-    protected Map<String, String> initParams = null;
+    protected Map<String, Map<String, String>> portletInitParameters = Collections.synchronizedMap(new
HashMap<String, Map<String, String>>());
     protected JetspeedServiceLocator serviceLocator;
     public static final String USER_ADMINISTRATION = "J2 User Administration";
 
@@ -122,9 +124,13 @@
     
     public Map<String, String> getInitParams()
     {
+        String portletName = getPortletName();
+        Map<String, String> initParams = portletInitParameters.get(portletName);
+        
         if (initParams == null)
         {
             initParams = (Map<String, String>) getPortletRequest().getAttribute(AdminWicketPortlet.INIT_PARAMS);
+            portletInitParameters.put(portletName, initParams);
         }
         
         return initParams;



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