portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r484928 - /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java
Date Sat, 09 Dec 2006 05:16:01 GMT
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


Mime
View raw message