portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r895837 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/ jetspeed-api/src/main/java/org/apache/jetsp...
Date Tue, 05 Jan 2010 00:24:45 GMT
Author: taylor
Date: Tue Jan  5 00:24:44 2010
New Revision: 895837

URL: http://svn.apache.org/viewvc?rev=895837&view=rev
Log:
JS2-1084
resurrect per user positioning

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/PortletPlacementContextImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PortletPlacementContext.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/PortletPlacementContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/PortletPlacementContextImpl.java?rev=895837&r1=895836&r2=895837&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/PortletPlacementContextImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/PortletPlacementContextImpl.java
Tue Jan  5 00:24:44 2010
@@ -24,6 +24,7 @@
 
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
 import org.apache.jetspeed.layout.Coordinate;
+import org.apache.jetspeed.layout.PageLayoutComponent;
 import org.apache.jetspeed.layout.PortletPlacementException;
 import org.apache.jetspeed.layout.PortletPlacementContext;
 import org.apache.jetspeed.om.page.ContentFragment;
@@ -423,10 +424,17 @@
      */
     public ContentPage syncPageFragments()
     {
-    	syncFragments( true, -1 );
+    	syncFragments(true, -1, null, null);
     	//debugFragments( "syncPage" );
     	return this.page;
     }
+
+    public ContentPage syncPageFragments(String scope, String scopeValue)
+    {
+        syncFragments(true, -1, scope, scopeValue);
+        //debugFragments( "syncPage" );
+        return this.page;
+    }
     
     protected int getLatestColumn( Coordinate coordinate )
     {
@@ -451,7 +459,7 @@
     	return row;
     }
     
-    protected void syncFragments( boolean updateFragmentObjects, int onlyForColumnIndex )
+    protected void syncFragments(boolean updateFragmentObjects, int onlyForColumnIndex, String
scope, String scopeValue)
     {
         for ( int colIndex = 0; colIndex < this.columnsList.length; colIndex++ )
         {
@@ -475,7 +483,7 @@
 	        		}
 	        		if ( updateFragmentObjects )
 	                {
-	        		    fragment.updateRowColumn(rowIndex, colIndex);
+	        		    fragment.updateRowColumn(rowIndex, colIndex, scope, scopeValue);
 	                }
 	            }
         	}
@@ -613,7 +621,7 @@
 			CoordinateImpl coordinate = new CoordinateImpl( newCol, newRow );
         	this.fragmentCoordinateMap.put( fragment.getId(), coordinate );
 			this.fragmentMap.put( fragment.getId(), fragment );
-			syncFragments( false, newCol );
+			syncFragments(false, newCol, PageLayoutComponent.USER_PROPERTY_SCOPE, null);
 		}
 		else
 		{
@@ -638,9 +646,9 @@
 				
 				this.fragmentMap.put( fragment.getId(), fragment );
 				
-				syncFragments( false, currentCol );
+				syncFragments(false, currentCol, PageLayoutComponent.USER_PROPERTY_SCOPE, null);
 				if ( columnChanged )
-					syncFragments( false, newCol );
+					syncFragments(false, newCol, PageLayoutComponent.USER_PROPERTY_SCOPE, null);
 			}
 		}
 		return (Coordinate)this.fragmentCoordinateMap.get( fragment.getId() );
@@ -681,9 +689,9 @@
 				
 				this.fragmentMap.put( fragment.getId(), fragment );
 				
-				syncFragments( false, currentCol );
+				syncFragments(false, currentCol, PageLayoutComponent.USER_PROPERTY_SCOPE, null);
 				if ( newCol != currentCol )
-					syncFragments( false, newCol );
+					syncFragments(false, newCol, PageLayoutComponent.USER_PROPERTY_SCOPE, null);
 			}
 		}
 		return (Coordinate)this.fragmentCoordinateMap.get( fragment.getId() );
@@ -730,7 +738,7 @@
 		this.fragmentCoordinateMap.remove( fragment.getId() );
 		this.fragmentMap.remove( fragment.getId() );
 		
-		syncFragments( false, currentCol );
+		syncFragments(false, currentCol, null, null);
 		
 		return currentCoordinate;
 	}

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java?rev=895837&r1=895836&r2=895837&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java
Tue Jan  5 00:24:44 2010
@@ -315,7 +315,7 @@
                 }
                 
                 // synchronize back to the page layout root fragment
-                contentPage = ppc.syncPageFragments();
+                contentPage = ppc.syncPageFragments(PageLayoutComponent.USER_PROPERTY_SCOPE,
null);
             }
             catch (PortletPlacementException e)
             {
@@ -363,7 +363,7 @@
                     }
                     
                     // synchronize back to the page layout root fragment
-                    contentPage = ppc.syncPageFragments();
+                    contentPage = ppc.syncPageFragments(PageLayoutComponent.USER_PROPERTY_SCOPE,
null);
                 }
                 catch (Exception e)
                 {
@@ -383,9 +383,8 @@
             {
                 if (layoutFragmentId != null && layoutFragmentId.equals("detach"))
                 {
-                    // first time detach, need to reorder
+                    //pageLayoutComponent.moveFragment(contentPage, layoutFragmentId, fromFragmentId,
toFragmentId)
                 }
-                
                 pageLayoutComponent.updatePosition(contentFragment, posX, posY, posZ, posWidth,
posHeight, PageLayoutComponent.USER_PROPERTY_SCOPE, null);
                 pageLayoutComponent.updateStateMode(contentFragment, JetspeedActions.DETACH,
null, PageLayoutComponent.USER_PROPERTY_SCOPE, null);
             }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PortletPlacementContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PortletPlacementContext.java?rev=895837&r1=895836&r2=895837&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PortletPlacementContext.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PortletPlacementContext.java
Tue Jan  5 00:24:44 2010
@@ -153,8 +153,18 @@
      * Takes the internal portlet placement state and writes it back
      * out to the root fragment for the managed page layout.
      * 
+     * @param scope the name of the property scope to update 
+     * @param scopeValue the scope discriminator value, (unless scope is GLOBAL
+     *                   or USER where the default user name is used if null)
      * @return the managed page layout with updated fragment state.
      */
+    public ContentPage syncPageFragments(String scope, String scopeValue);
+
+    /**
+     * Takes the internal portlet placement state and writes it back
+     * out to the root fragment for the managed page layout.
+     * 
+     * @return the managed page layout with updated fragment state.
+     */    
     public ContentPage syncPageFragments();
-        
 }



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