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 sm...@apache.org on 2006/12/09 06:16:01 UTC

svn commit: r484928 - /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java

Author: smilek
Date: Fri Dec  8 21:16:00 2006
New Revision: 484928

URL: http://svn.apache.org/viewvc?view=rev&rev=484928
Log:
changed updateInformation to avoid setting updates when corresponding parameter is null; when layout fragment name is changed, call setLayoutSizes(null) to start with default column sizes for newly changed layout name

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

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java?view=diff&rev=484928&r1=484927&r2=484928
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java Fri Dec  8 21:16:00 2006
@@ -241,12 +241,24 @@
                     entityAccess.storePortletEntity(window.getPortletEntity());
                     windowAccess.createPortletWindow(window.getPortletEntity(), contentFragment.getId());
                     count++;
+                    if ( isBlank(sizes) )
+                    {
+                        fragment.setLayoutSizes(null);
+                    }
+                    else
+                    {
+                        fragment.setLayoutSizes(sizes);
+                    }
+                    count++;
                 }
             }
-            if (!isBlank(sizes))
+            else
             {
-                fragment.setLayoutSizes(sizes);
-                count++;
+                if (!isBlank(sizes))
+                {
+                    fragment.setLayoutSizes(sizes);
+                    count++;
+                }
             }
         }
         return count;
@@ -294,34 +306,34 @@
         {
             Page page = (Page)node;            
             String title = getActionParameter(requestContext, "title");
-            if (isFieldModified(title, page.getTitle()))
+            if (title != null && isFieldModified(title, page.getTitle()))
                 page.setTitle(title);
             String shortTitle = getActionParameter(requestContext, "short-title");
-            if (isFieldModified(shortTitle, page.getShortTitle()))
+            if (shortTitle != null && isFieldModified(shortTitle, page.getShortTitle()))
                 page.setShortTitle(shortTitle);
             String layoutDecorator = getActionParameter(requestContext, "layout-decorator");
-            if (isFieldModified(layoutDecorator, page.getDefaultDecorator(Fragment.LAYOUT)))
+            if (layoutDecorator != null && isFieldModified(layoutDecorator, page.getDefaultDecorator(Fragment.LAYOUT)))
             {
                 if (isBlank(layoutDecorator))
                     layoutDecorator = null; 
                 page.setDefaultDecorator(layoutDecorator, Fragment.LAYOUT);
             }
             String portletDecorator = getActionParameter(requestContext, "portlet-decorator");
-            if (isFieldModified(portletDecorator, page.getDefaultDecorator(Fragment.PORTLET)))
+            if (portletDecorator != null && isFieldModified(portletDecorator, page.getDefaultDecorator(Fragment.PORTLET)))
             {
                 if (isBlank(portletDecorator))
                     portletDecorator = null;                 
                 page.setDefaultDecorator(portletDecorator, Fragment.PORTLET);
             }
             String theme = getActionParameter(requestContext, "theme");
-            if (isFieldModified(theme, page.getSkin()))
+            if (theme != null && isFieldModified(theme, page.getSkin()))
             {
                 if (isBlank(theme))
                     theme = null;                 
                 page.setSkin(theme);
             }
             String hidden = getActionParameter(requestContext, "hidden");
-            if (isBooleanModified(hidden, page.isHidden()))
+            if (hidden != null && isBooleanModified(hidden, page.isHidden()))
                 page.setHidden(!page.isHidden());                                    
             count++;
         }



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