portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r584854 - /portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java
Date Mon, 15 Oct 2007 19:09:23 GMT
Author: smilek
Date: Mon Oct 15 12:09:11 2007
New Revision: 584854

URL: http://svn.apache.org/viewvc?rev=584854&view=rev
Log:
added support for 'update-portlet-decorator' as method parameter value - this allows for changing
the portlet-decorator on a per-portlet basis

Modified:
    portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java?rev=584854&r1=584853&r2=584854&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java
Mon Oct 15 12:09:11 2007
@@ -220,7 +220,18 @@
                     return false;                    
                 }                
                 count = removeFragment(requestContext, resultMap, page, fragmentId);    
           
-            }            
+            }
+            else if (method.equals("update-portlet-decorator"))
+            {
+                String fragmentId = getActionParameter(requestContext, PORTLETID);
+            	String portletDecorator = getActionParameter(requestContext, "portlet-decorator");
+                if (isBlank(fragmentId) || isBlank(portletDecorator))
+                {
+                    resultMap.put(REASON, "Missing parameter to update portlet decorator");
               
+                    return false;                    
+                }                
+                count = updatePortletDecorator(requestContext, resultMap, page, fragmentId,
portletDecorator);
+            }
             else
             {
                 success = false;
@@ -241,6 +252,19 @@
             success = false;
         }
         return success;
+    }
+    
+    protected int updatePortletDecorator(RequestContext requestContext, Map resultMap, Page
page, String fragmentId, String portletDecorator)
+    throws PortletEntityNotStoredException, FailedToRetrievePortletWindow
+    {
+    	int count = 0;
+    	Fragment fragment = page.getFragmentById(fragmentId);
+        if (fragment != null)
+        {                
+        	fragment.setDecorator( portletDecorator );
+        	count++;
+        }
+    	return count;
     }
     
     protected int updateFragment(RequestContext requestContext, Map resultMap, Page page,
String fragmentId, String layout)



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