portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r836049 - /portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
Date Fri, 13 Nov 2009 22:57:48 GMT
Author: taylor
Date: Fri Nov 13 22:57:47 2009
New Revision: 836049

URL: http://svn.apache.org/viewvc?rev=836049&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-1057
fix up a few casting issues

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

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java?rev=836049&r1=836048&r2=836049&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
Fri Nov 13 22:57:47 2009
@@ -76,11 +76,6 @@
             request.getPortletSession().removeAttribute("spaces");
             request.getPortletSession().removeAttribute("space");
         }
-        else
-        {
-            spaceName = (String)request.getPortletSession().getAttribute("space");      
        
-        }
-        Space space = null;
         List<Space> spaces = (List<Space>)request.getPortletSession().getAttribute("spaces");
         if (spaces == null)
         {
@@ -89,8 +84,9 @@
             request.setAttribute("spaces", spaces);        
             request.getPortletSession().setAttribute("spaces", spaces);        
         }              
-        request.setAttribute("spaces", spaces);        
-        if (spaceName != null)
+        request.setAttribute("spaces", spaces);
+        Space space = (Space)request.getPortletSession().getAttribute("space");         
     
+        if (space == null && spaceName != null)
         {
             for (Space sp: spaces)
             {
@@ -100,25 +96,15 @@
                     break;
                 }
             }
-            if (space == null)
-            {                
-                spaceName = null;
-            }            
         }
-        if (spaceName == null)
+        if (space== null)
         {
-            request.setAttribute("title", "Default Spaces");
             space = spaces.get(0);
             spaceName = space.getName();
         }
-        else
-        {
-            request.setAttribute("title", spaceName);
-        }
-        
+        request.setAttribute("title", spaceName);        
         request.setAttribute("space", space);
-        request.getPortletSession().setAttribute("space", spaceName);        
-        
+        request.getPortletSession().setAttribute("space", space);                
         try
         {
             super.doView(request, response);
@@ -132,15 +118,15 @@
     public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException,
     IOException
     {
-        String space = actionRequest.getParameter("space");
-        if (space != null)
+        String spaceName = actionRequest.getParameter("space");
+        if (spaceName != null)
         {
-            Space s = getSpaceFromName(space);
-            if (s != null)
+            Space space = getSpaceFromName(spaceName);
+            if (space != null)
             {
-                String path = admin.getPortalURL(actionRequest, actionResponse, s.getPath());
+                String path = admin.getPortalURL(actionRequest, actionResponse, space.getPath());
                 actionRequest.getPortletSession().setAttribute("space", space);     
-                PortletMessaging.publish(actionRequest, "PageNavigator", "spaceChange", space);
+                PortletMessaging.publish(actionRequest, "PageNavigator", "spaceChange", spaceName);
                 actionResponse.sendRedirect(path);
             }
             return;



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