portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r829497 [1/2] - in /portals/jetspeed-2/portal/branches/JETSPEED-2.1.4: components/page-manager/src/java/JETSPEED-INF/castor/ components/page-manager/src/java/JETSPEED-INF/ojb/ components/page-manager/src/java/org/apache/jetspeed/om/folder/p...
Date Sun, 25 Oct 2009 05:40:16 GMT
Author: rwatler
Date: Sun Oct 25 05:40:13 2009
New Revision: 829497

URL: http://svn.apache.org/viewvc?rev=829497&view=rev
Log:
Persistent DBPM Fragment Ids - JS2-876
------------------------------------------------------
- add persistent fragment string id field to DBPM objects and schema
- add fragment id generator to DBPM configuration
- remove bogus internal Castor PSML fragment id generator and replace with fragment id generator in document handler configuration
- add alternative copy page, deep copy folder, and deep merge folder APIs to support copying fragments while preserving ids
- change PSML import/export and folder move operations to preserve fragment ids
- remove duplicate fragment ids in demo/min PSML pages


Modified:
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderMetaDataImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/DocumentImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/LinkImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/PageManagerUtils.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/AbstractNode.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/database-page-manager-base.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/database-page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/secure-database-page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/secure-permissions-database-page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/test/JETSPEED-INF/spring/test-spring.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdateFolderAction.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/test/resources/assembly/page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/registry/src/test/org/apache/jetspeed/components/portletentity/ContentFragmentTestImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/build.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/import/assembly/import-page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/schema/phase2-schema.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/installer/etc/database/build.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/installer/etc/database/import/assembly/import-page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/build.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/src/archetype/archetype-resources/etc/build.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/src/archetype/archetype-resources/etc/dbpsml/assembly/alternate/db-page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/src/archetype/archetype-resources/etc/dbpsml/assembly/import-page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-plugin/plugin.jelly
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/src/webapp/WEB-INF/assembly/alternate/db-page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/src/webapp/WEB-INF/assembly/importer-page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/src/webapp/WEB-INF/assembly/page-manager.xml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/src/webapp/WEB-INF/pages/__subsite-root/_role/subsite/system/customizer/portlet-selector.psml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/src/webapp/WEB-INF/pages/_role/user/top-links/top-page.psml
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/src/webapp/WEB-INF/pages/_user/guest/_mediatype/xhtml-basic/default-page.psml

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml Sun Oct 25 05:40:13 2009
@@ -88,7 +88,7 @@
   <class name="org.apache.jetspeed.om.page.psml.FragmentImpl">
     <map-to xml="fragment"/>
 
-    <field name="id" type="string" set-method="%1" get-method="getId">
+    <field name="id" type="string">
       <bind-xml name="id" node="attribute"/>
     </field>
 

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml Sun Oct 25 05:40:13 2009
@@ -1531,6 +1531,12 @@
       />
 
       <field-descriptor
+         name="fragmentId"
+         column="FRAGMENT_STRING_ID"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
          name="name"
          column="NAME"
          jdbc-type="VARCHAR"

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java Sun Oct 25 05:40:13 2009
@@ -23,6 +23,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.om.common.GenericMetadata;
 import org.apache.jetspeed.om.common.SecurityConstraints;
@@ -906,17 +907,21 @@
     /**
      * unmarshalled - notification that this instance has been
      *                loaded from the persistent store
+     * @param generator id generator
+     * @return dirty flag
      */
-    public void unmarshalled()
+    public boolean unmarshalled(IdGenerator generator)
     {
         // notify super class implementation
-        super.unmarshalled();
+        boolean dirty = super.unmarshalled(generator);
 
         // default title of pages to name
         if (getTitle() == null)
         {
             setTitle(getTitleName());
         }
+        
+        return dirty;
     }
     
     public boolean isReserved()

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderMetaDataImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderMetaDataImpl.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderMetaDataImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderMetaDataImpl.java Sun Oct 25 05:40:13 2009
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.page.Document;
 import org.apache.jetspeed.om.page.psml.DefaultsImpl;
 import org.apache.jetspeed.om.page.psml.DocumentImpl;
@@ -215,11 +216,13 @@
     /**
      * unmarshalled - notification that this instance has been
      *                loaded from the persistent store
+     * @param generator id generator
+     * @return dirty flag
      */
-    public void unmarshalled()
+    public boolean unmarshalled(IdGenerator generator)
     {
         // notify super class implementation
-        super.unmarshalled();
+        boolean dirty = super.unmarshalled(generator);
 
         // propagate unmarshalled notification
         // to all menu definitions
@@ -231,6 +234,8 @@
                 ((MenuDefinitionImpl)menuIter.next()).unmarshalled();
             }
         }
+        
+        return dirty;
     }
 
     /**

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java Sun Oct 25 05:40:13 2009
@@ -56,7 +56,7 @@
         this.cachedFragments = cachedFragments;
         this.instantlyRendered = instantlyRendered;
     }
-
+    
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.ContentFragment#getContentFragments()
      */
@@ -468,6 +468,14 @@
     }
 
     /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#setId(java.lang.String)
+     */
+    public void setId(String fragmentId)
+    {
+        // cannot set fragment id from content fragment
+    }
+
+    /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.BaseElement#setShortTitle(java.lang.String)
      */
     public void setShortTitle(String title)

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java Sun Oct 25 05:40:13 2009
@@ -472,7 +472,18 @@
      */
     public String getId()
     {
-        return Integer.toString(id);
+        // by default, return identity
+        return Integer.toString(getIdentity());
+    }
+    
+    /**
+     * Get implementation identity key.
+     * 
+     * @return identity key.
+     */
+    public int getIdentity()
+    {
+        return id;
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java Sun Oct 25 05:40:13 2009
@@ -37,6 +37,7 @@
 public class FragmentImpl extends BaseElementImpl implements Fragment
 {
     private List fragments;
+    private String fragmentId;
     private String type;
     private String skin;
     private String decorator;
@@ -586,6 +587,26 @@
     }
 
     /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.impl.BaseElementImpl#getId()
+     */
+    public String getId()
+    {
+        if (fragmentId != null)
+        {
+            return fragmentId;
+        }
+        return super.getId();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#setId(java.lang.String)
+     */
+    public void setId(String fragmentId)
+    {
+        this.fragmentId = fragmentId;
+    }
+
+    /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getType()
      */
     public String getType()

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java Sun Oct 25 05:40:13 2009
@@ -29,6 +29,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.common.SecuredResource;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraints;
@@ -666,10 +667,13 @@
     /**
      * unmarshalled - notification that this instance has been
      *                loaded from the persistent store
+     * @param generator id generator
+     * @return dirty flag
      */
-    public void unmarshalled()
+    public boolean unmarshalled(IdGenerator generator)
     {
         // by default, no action required
+        return false;
     }
 
     /**

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/DocumentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/DocumentImpl.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/DocumentImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/DocumentImpl.java Sun Oct 25 05:40:13 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.jetspeed.om.page.psml;
 
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.page.Document;
 import org.apache.jetspeed.page.document.psml.AbstractNode;
 
@@ -38,20 +39,24 @@
     private String version;
     private boolean dirty=false;
 
-	/**
+    /**
      * unmarshalled - notification that this instance has been
      *                loaded from the persistent store
+     * @param generator id generator
+     * @return dirty flag
      */
-    public void unmarshalled()
+    public boolean unmarshalled(IdGenerator generator)
     {
         // notify super class implementation
-        super.unmarshalled();
+        boolean dirty = super.unmarshalled(generator);
 
         // default version of pages to name
         if (getVersion() == null)
         {
             setVersion(getVersion());
         }
+        
+        return dirty;
     }
     /**
      * @return Returns the version.

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java Sun Oct 25 05:40:13 2009
@@ -25,6 +25,7 @@
 import java.util.Map;
 
 import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.PageSecurity;
@@ -35,9 +36,6 @@
  */
 public class FragmentImpl extends AbstractBaseElement implements Fragment, java.io.Serializable
 {
-
-	private static int fragment_id_counter = 0;
-	
     private String type = null;
 
     private String state = null;
@@ -72,16 +70,6 @@
     {
     }
 
-    public FragmentImpl(String id)
-    {
-    	if (id == null || id.length() == 0){
-    		setId(generateId());
-    		dirty=true;
-    	} else {
-    		setId(id);
-    	}    	
-    }
-
     public String getType()
     {
         return this.type;
@@ -571,18 +559,27 @@
     /**
      * unmarshalled - notification that this instance has been
      *                loaded from the persistent store
+     * @param generator id generator
+     * @return dirty flag
      */
-    public void unmarshalled()
+    public boolean unmarshalled(IdGenerator generator)
     {
         // notify super class implementation
-        super.unmarshalled();
-
+        boolean dirty = super.unmarshalled(generator);
+        
         // propagate unmarshalled notification
         // to all fragments
         Iterator fragmentIter = fragments.iterator();
         while (fragmentIter.hasNext())
         {
-            ((FragmentImpl)fragmentIter.next()).unmarshalled();
+            dirty = ((FragmentImpl)fragmentIter.next()).unmarshalled(generator) || dirty;
+        }
+
+        // generate id if required
+        if (getId() == null)
+        {
+            setId(generator.getNextPeid());
+            dirty = true;
         }
 
         // load the properties map from list
@@ -593,6 +590,8 @@
             PropertyImpl prop = (PropertyImpl) propsIter.next();
             propertiesMap.put(prop.getName(), prop.getValue());
         }
+        
+        return dirty;
     }
 
     /**
@@ -705,8 +704,4 @@
         }
         return fragments;
     }
-    
-    private synchronized static String generateId(){
-    	return new StringBuffer("F.").append(Long.toHexString(System.currentTimeMillis())).append(".").append(fragment_id_counter++).toString();
-    }
 }

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/LinkImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/LinkImpl.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/LinkImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/LinkImpl.java Sun Oct 25 05:40:13 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.jetspeed.om.page.psml;
 
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.page.Link;
 
 /**
@@ -100,16 +101,20 @@
     /**
      * unmarshalled - notification that this instance has been
      *                loaded from the persistent store
+     * @param generator id generator
+     * @return dirty flag
      */
-    public void unmarshalled()
+    public boolean unmarshalled(IdGenerator generator)
     {
         // notify super class implementation
-        super.unmarshalled();
+        boolean dirty = super.unmarshalled(generator);
 
         // default title of pages to name
         if (getTitle() == null)
         {
             setTitle(getTitleName());
         }
+        
+        return dirty;
     }
 }

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java Sun Oct 25 05:40:13 2009
@@ -23,6 +23,7 @@
 import java.util.Map;
 import java.util.Stack;
 
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.MenuDefinition;
 import org.apache.jetspeed.om.folder.MenuExcludeDefinition;
@@ -388,11 +389,13 @@
     /**
      * unmarshalled - notification that this instance has been
      *                loaded from the persistent store
+     * @param generator id generator
+     * @return dirty flag
      */
-    public void unmarshalled()
+    public boolean unmarshalled(IdGenerator generator)
     {
         // notify super class implementation
-        super.unmarshalled();
+        boolean dirty = super.unmarshalled(generator);
 
         // propagate unmarshalled notification
         // to all menu definitions
@@ -409,7 +412,7 @@
         // to root fragment
         if (root != null)
         {
-            ((FragmentImpl)root).unmarshalled();
+            dirty = (((FragmentImpl)root).unmarshalled(generator) || dirty);
         }
 
         // default title of pages to name
@@ -417,6 +420,8 @@
         {
             setTitle(getTitleName());
         }
+        
+        return dirty;
     }
 
     /**

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java Sun Oct 25 05:40:13 2009
@@ -26,6 +26,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.folder.Folder;
@@ -89,6 +90,8 @@
     protected Class securityConstraintsDefClass;
     protected Class fragmentPreferenceClass;
 
+    private IdGenerator generator;
+
     private boolean permissionsEnabled;
 
     private boolean constraintsEnabled;
@@ -97,8 +100,9 @@
     
     private long nodeReapingInterval = DEFAULT_NODE_REAPING_INTERVAL;
 
-    public AbstractPageManager(boolean permissionsEnabled, boolean constraintsEnabled)
+    public AbstractPageManager(IdGenerator generator, boolean permissionsEnabled, boolean constraintsEnabled)
     {
+        this.generator = generator;
         this.permissionsEnabled = permissionsEnabled;
         this.constraintsEnabled = constraintsEnabled;
         // start node reaping deamon thread
@@ -128,9 +132,9 @@
         }
     }
     
-    public AbstractPageManager(boolean permissionsEnabled, boolean constraintsEnabled, Map modelClasses)
+    public AbstractPageManager(IdGenerator generator, boolean permissionsEnabled, boolean constraintsEnabled, Map modelClasses)
     {
-        this(permissionsEnabled, constraintsEnabled);     
+        this(generator, permissionsEnabled, constraintsEnabled);     
 
         this.fragmentClass = (Class)modelClasses.get("FragmentImpl");
         this.pageClass = (Class)modelClasses.get("PageImpl");
@@ -293,7 +297,8 @@
         try
         {
             fragment = (Fragment)createObject(this.fragmentClass);
-            fragment.setType(Fragment.LAYOUT);          
+            fragment.setType(Fragment.LAYOUT);
+            fragment.setId(generator.getNextPeid());
         }
         catch (ClassCastException e)
         {
@@ -314,6 +319,7 @@
         {
             fragment = (Fragment)createObject(this.fragmentClass);
             fragment.setType(Fragment.PORTLET);          
+            fragment.setId(generator.getNextPeid());
         }
         catch (ClassCastException e)
         {
@@ -900,8 +906,20 @@
         return folder;
     }
     
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#copyPage(org.apache.jetspeed.om.page.Page, java.lang.String)
+     */
     public Page copyPage(Page source, String path)
-    throws NodeException
+        throws NodeException
+    {
+        return copyPage(source, path, false);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#copyPage(org.apache.jetspeed.om.page.Page, java.lang.String, boolean)
+     */
+    public Page copyPage(Page source, String path, boolean copyIds)
+        throws NodeException
     {
         // create the new page and copy attributes
         Page page = newPage(path);
@@ -933,17 +951,33 @@
         }        
         
         // copy fragments
-        Fragment root = copyFragment(source.getRootFragment(), source.getRootFragment().getName());
+        Fragment root = copyFragment(source.getRootFragment(), source.getRootFragment().getName(), copyIds);
         page.setRootFragment(root);
         
         return page;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#copyFragment(org.apache.jetspeed.om.page.Fragment, java.lang.String)
+     */
     public Fragment copyFragment(Fragment source, String name)
-    throws NodeException
+        throws NodeException
+    {
+        return copyFragment(source, name, false);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#copyFragment(org.apache.jetspeed.om.page.Fragment, java.lang.String, boolean)
+     */
+    public Fragment copyFragment(Fragment source, String name, boolean copyIds)
+        throws NodeException
     {
         // create the new fragment and copy attributes
         Fragment copy = newFragment();
+        if (copyIds)
+        {
+            copy.setId(source.getId());
+        }
         copy.setDecorator(source.getDecorator());
         copy.setName(name);
         copy.setShortTitle(source.getShortTitle());
@@ -992,7 +1026,7 @@
         while (fragments.hasNext())
         {
             Fragment fragment = (Fragment)fragments.next();
-            Fragment copiedFragment = copyFragment(fragment, fragment.getName());
+            Fragment copiedFragment = copyFragment(fragment, fragment.getName(), copyIds);
             copy.getFragments().add(copiedFragment);
         }
         return copy;
@@ -1269,30 +1303,42 @@
         return security;
     }
     
-    /**
-     * Deep copy a folder
-     *  
-     * @param source source folder
-     * @param dest destination folder
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#deepCopyFolder(org.apache.jetspeed.om.folder.Folder, java.lang.String, java.lang.String)
      */
     public void deepCopyFolder(Folder srcFolder, String destinationPath, String owner)
-    throws NodeException
+        throws NodeException
     {
-        PageManagerUtils.deepCopyFolder(this, srcFolder, destinationPath, owner);
+        deepCopyFolder(srcFolder, destinationPath, owner, false);
     }
-            
-    /**
-     * Deep merge a folder
-     *  
-     * @param source source folder
-     * @param dest destination folder
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#deepCopyFolder(org.apache.jetspeed.om.folder.Folder, java.lang.String, java.lang.String, boolean)
+     */
+    public void deepCopyFolder(Folder srcFolder, String destinationPath, String owner, boolean copyIds)
+        throws NodeException
+    {
+        PageManagerUtils.deepCopyFolder(this, srcFolder, destinationPath, owner, copyIds);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#deepMergeFolder(org.apache.jetspeed.om.folder.Folder, java.lang.String, java.lang.String)
      */
     public void deepMergeFolder(Folder srcFolder, String destinationPath, String owner)
-    throws NodeException
+        throws NodeException
     {
-        PageManagerUtils.deepMergeFolder(this, srcFolder, destinationPath, owner);
+        deepMergeFolder(srcFolder, destinationPath, owner, false);
     }
     
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#deepMergeFolder(org.apache.jetspeed.om.folder.Folder, java.lang.String, java.lang.String, boolean)
+     */
+    public void deepMergeFolder(Folder srcFolder, String destinationPath, String owner, boolean copyIds)
+        throws NodeException
+    {
+        PageManagerUtils.deepMergeFolder(this, srcFolder, destinationPath, owner, copyIds);
+    }
+        
     public Page getUserPage(String userName, String pageName)
     throws PageNotFoundException, NodeException
     {

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java Sun Oct 25 05:40:13 2009
@@ -18,6 +18,7 @@
 
 import java.util.Map;
 
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.folder.InvalidFolderException;
@@ -44,11 +45,12 @@
 public class DelegatingPageManager extends AbstractPageManager
 {
     public DelegatingPageManager(
+            IdGenerator generator,
             boolean isPermissionsSecurity, 
             boolean isConstraintsSecurity,
             Map modelClasses)
     {
-        super(isPermissionsSecurity, isConstraintsSecurity, modelClasses);
+        super(generator, isPermissionsSecurity, isConstraintsSecurity, modelClasses);
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java Sun Oct 25 05:40:13 2009
@@ -194,7 +194,7 @@
                 {
                     System.out.println("overwriting page " + srcPage.getPath());                            
                     destManager.removePage(dstPage);
-                    dstPage = destManager.copyPage(srcPage, srcPage.getPath());
+                    dstPage = destManager.copyPage(srcPage, srcPage.getPath(), true);
                     destManager.updatePage(dstPage);
                     pageCount++;                    
                 }
@@ -204,7 +204,7 @@
             else            
             {
                 System.out.println("importing new page " + srcPage.getPath());
-                dstPage = destManager.copyPage(srcPage, srcPage.getPath());
+                dstPage = destManager.copyPage(srcPage, srcPage.getPath(), true);
                 destManager.updatePage(dstPage);
                 pageCount++;
             }

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/PageManagerUtils.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/PageManagerUtils.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/PageManagerUtils.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/PageManagerUtils.java Sun Oct 25 05:40:13 2009
@@ -214,10 +214,13 @@
     /**
      * Deep copy a folder
      *  
-     * @param source source folder
-     * @param dest destination folder
+     * @param pageManager target page manager
+     * @param srcFolder source folder
+     * @param destinationPath destination folder
+     * @param owner user name of owner or null
+     * @param copyIds flag indicating whether to copy ids
      */
-    public static void deepCopyFolder(PageManager pageManager, Folder srcFolder, String destinationPath, String owner)
+    public static void deepCopyFolder(PageManager pageManager, Folder srcFolder, String destinationPath, String owner, boolean copyIds)
     throws NodeException
     {
         boolean found = true;
@@ -251,7 +254,7 @@
         {
             Page srcPage = (Page)pages.next();
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcPage.getName());
-            Page dstPage = pageManager.copyPage(srcPage, path);
+            Page dstPage = pageManager.copyPage(srcPage, path, copyIds);
             pageManager.updatePage(dstPage);
         }
      
@@ -269,17 +272,20 @@
         {
             Folder folder = (Folder)folders.next();
             String newPath = concatenatePaths(destinationPath, folder.getName()); 
-            deepCopyFolder(pageManager, folder, newPath, null);
+            deepCopyFolder(pageManager, folder, newPath, null, copyIds);
         }        
     }
 
     /**
      * Deep merge a folder
      *  
-     * @param source source folder
-     * @param dest destination folder
+     * @param pageManager target page manager
+     * @param srcFolder source folder
+     * @param destinationPath destination folder
+     * @param owner user name of owner or null
+     * @param copyIds flag indicating whether to copy ids on merge
      */
-    public static void deepMergeFolder(PageManager pageManager, Folder srcFolder, String destinationPath, String owner)
+    public static void deepMergeFolder(PageManager pageManager, Folder srcFolder, String destinationPath, String owner, boolean copyIds)
     throws NodeException
     {
         boolean found = true;
@@ -314,7 +320,7 @@
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcPage.getName());
             if (!pageManager.pageExists(path))
             {
-                Page dstPage = pageManager.copyPage(srcPage, path);
+                Page dstPage = pageManager.copyPage(srcPage, path, copyIds);
                 pageManager.updatePage(dstPage);
             }
         }
@@ -336,7 +342,7 @@
         {
             Folder folder = (Folder)folders.next();
             String newPath = concatenatePaths(destinationPath, folder.getName()); 
-            deepMergeFolder(pageManager, folder, newPath, null);
+            deepMergeFolder(pageManager, folder, newPath, null, copyIds);
         }        
     }
     

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/AbstractNode.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/AbstractNode.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/AbstractNode.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/AbstractNode.java Sun Oct 25 05:40:13 2009
@@ -21,6 +21,7 @@
 import java.util.Locale;
 
 import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.common.GenericMetadata;
 import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.page.PageMetadataImpl;
@@ -487,20 +488,24 @@
     /**
      * unmarshalled - notification that this instance has been
      *                loaded from the persistent store
+     * @param generator id generator
+     * @return dirty flag
      */
-    public void unmarshalled()
+    public boolean unmarshalled(IdGenerator generator)
     {
         // notify super class implementation
-        super.unmarshalled();
+        boolean dirty = super.unmarshalled(generator);
 
         // force metadata update after unmarshalled since
         // metadata collection can be side effected by
-        // unmarshalling colection accessors
+        // unmarshalling collection accessors
         Collection metadataFields = getMetadataFields();
         if (metadataFields != null)
         {
             setMetadataFields(metadataFields);
         }
+        
+        return dirty;
     }
 
 	public boolean isDirty() {

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java Sun Oct 25 05:40:13 2009
@@ -36,6 +36,7 @@
 import org.apache.jetspeed.cache.file.FileCache;
 import org.apache.jetspeed.cache.file.FileCacheEntry;
 import org.apache.jetspeed.cache.file.FileCacheEventListener;
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.folder.psml.FolderImpl;
 import org.apache.jetspeed.om.page.Document;
 import org.apache.jetspeed.om.page.psml.AbstractBaseElement;
@@ -87,6 +88,7 @@
 
     private final static String PSML_DOCUMENT_ENCODING = "UTF-8";
 
+    protected IdGenerator generator;
     protected String documentType;
     protected Class expectedReturnType;
     protected String documentRoot;
@@ -100,6 +102,8 @@
 
     /**
      * 
+     * @param generator
+     *            id generator for unmarshalled documents
      * @param mappingFile
      *            Castor mapping file. THe mapping file must be in the class
      *            path
@@ -107,10 +111,11 @@
      * @param expectedReturnType
      * @throws FileNotFoundException
      */
-    public CastorFileSystemDocumentHandler( String mappingFile, String documentType, Class expectedReturnType,
+    public CastorFileSystemDocumentHandler( IdGenerator generator, String mappingFile, String documentType, Class expectedReturnType,
             String documentRoot, FileCache fileCache ) throws FileNotFoundException,SAXException,ParserConfigurationException, MappingException
     {
         super();
+        this.generator = generator;
         this.documentType = documentType;
         this.expectedReturnType = expectedReturnType;
         this.documentRoot = documentRoot;
@@ -135,10 +140,10 @@
         createCastorClassDescriptorResolver(mappingFile);
     }
     
-    public CastorFileSystemDocumentHandler( String mappingFile, String documentType, String expectedReturnType,
+    public CastorFileSystemDocumentHandler( IdGenerator generator, String mappingFile, String documentType, String expectedReturnType,
             String documentRoot, FileCache fileCache ) throws FileNotFoundException, ClassNotFoundException,SAXException,ParserConfigurationException, MappingException
     {
-        this(mappingFile, documentType, Class.forName(expectedReturnType), documentRoot, fileCache);
+        this(generator, mappingFile, documentType, Class.forName(expectedReturnType), documentRoot, fileCache);
     }
 
     /**
@@ -528,8 +533,8 @@
             documentImpl.setHandlerFactory(handlerFactory);
             documentImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
             documentImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
-            documentImpl.unmarshalled();
-            if (document.isDirty()){
+            boolean dirty = documentImpl.unmarshalled(generator);
+            if (dirty || document.isDirty()){
                 updateDocument(document, true);
                 document.setDirty(false);
             }

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java Sun Oct 25 05:40:13 2009
@@ -28,6 +28,7 @@
 import org.apache.jetspeed.cache.file.FileCache;
 import org.apache.jetspeed.cache.file.FileCacheEntry;
 import org.apache.jetspeed.cache.file.FileCacheEventListener;
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.folder.InvalidFolderException;
@@ -35,7 +36,6 @@
 import org.apache.jetspeed.om.folder.psml.FolderImpl;
 import org.apache.jetspeed.om.folder.psml.FolderMetaDataImpl;
 import org.apache.jetspeed.om.page.Document;
-
 import org.apache.jetspeed.page.document.DocumentHandler;
 import org.apache.jetspeed.page.document.DocumentHandlerFactory;
 import org.apache.jetspeed.page.document.DocumentNotFoundException;
@@ -63,6 +63,7 @@
 public class FileSystemFolderHandler implements FolderHandler, FileCacheEventListener
 {
 
+    private IdGenerator generator;
     private File documentRootDir;
     private DocumentHandler metadataDocHandler;
     private DocumentHandlerFactory handlerFactory;
@@ -82,6 +83,8 @@
 
     /**
      * 
+     * @param generator
+     *            id generator for unmarshalled documents
      * @param documentRoot
      *            directory on file system to use as the root when locating
      *            folders
@@ -96,10 +99,11 @@
      *             supports folder metadata (folder.metadata) in the
      *             <code>handlerFactory</code>.
      */
-    public FileSystemFolderHandler( String documentRoot, DocumentHandlerFactory handlerFactory, FileCache fileCache )
+    public FileSystemFolderHandler( IdGenerator generator, String documentRoot, DocumentHandlerFactory handlerFactory, FileCache fileCache )
             throws FileNotFoundException, UnsupportedDocumentTypeException
     {
         super();
+        this.generator = generator;
         this.documentRootDir = new File(documentRoot);
         verifyPath(documentRootDir);
         this.handlerFactory = handlerFactory;
@@ -213,7 +217,7 @@
             }
 
             // folder unmarshalled
-            ((FolderImpl) folder).unmarshalled();
+            ((FolderImpl) folder).unmarshalled(generator);
 
             // add to cache
             if (fromCache)

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java Sun Oct 25 05:40:13 2009
@@ -27,6 +27,7 @@
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.cache.JetspeedCache;
 import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
+import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.folder.Folder;
@@ -134,10 +135,10 @@
     
     private PageManager pageManagerProxy;
 
-    public DatabasePageManager(String repositoryPath, boolean isPermissionsSecurity, boolean isConstraintsSecurity, JetspeedCache oidCache, JetspeedCache pathCache)
+    public DatabasePageManager(String repositoryPath, IdGenerator generator, boolean isPermissionsSecurity, boolean isConstraintsSecurity, JetspeedCache oidCache, JetspeedCache pathCache)
     {
         super(repositoryPath);
-        delegator = new DelegatingPageManager(isPermissionsSecurity, isConstraintsSecurity, modelClasses);
+        delegator = new DelegatingPageManager(generator, isPermissionsSecurity, isConstraintsSecurity, modelClasses);
         DatabasePageManagerCache.cacheInit(oidCache, pathCache, this);
     }
 
@@ -670,7 +671,7 @@
         {
             // query for folders
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId()));
+            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
             QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter);
             Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query);
 
@@ -727,7 +728,7 @@
         {
             // query for pages
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId()));
+            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
             QueryByCriteria query = QueryFactory.newQuery(PageImpl.class, filter);
             Collection pages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
 
@@ -784,7 +785,7 @@
         {
             // query for links
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId()));
+            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
             QueryByCriteria query = QueryFactory.newQuery(LinkImpl.class, filter);
             Collection links = getPersistenceBrokerTemplate().getCollectionByQuery(query);
 
@@ -846,7 +847,7 @@
             {
                 // query for page security
                 Criteria filter = new Criteria();
-                filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId()));
+                filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
                 QueryByCriteria query = QueryFactory.newQuery(PageSecurityImpl.class, filter);
                 PageSecurity document = (PageSecurity)getPersistenceBrokerTemplate().getObjectByQuery(query);
 
@@ -884,7 +885,7 @@
             // query for all nodes
             List all = DatabasePageManagerUtils.createList();
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId()));
+            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
             QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter);
             Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (folders != null)
@@ -1081,6 +1082,7 @@
         {
             // dereference folder in case proxy is supplied
             folder = (Folder)ProxyHelper.getRealObject(folder);
+            FolderImpl folderImpl = (FolderImpl)folder;
 
             // look up and set parent folder if required
             FolderImpl parent = (FolderImpl)folder.getParent();
@@ -1122,7 +1124,7 @@
             else
             {
                 // determine if folder is new by checking autoincrement id
-                boolean newFolder = folder.getId().equals("0");
+                boolean newFolder = (folderImpl.getIdentity() == 0);
 
                 // check for edit access on folder and parent folder
                 // if not being initially created; access is not
@@ -1135,7 +1137,7 @@
 
                 // create root folder or update folder and mark cache transaction
                 storeEntity(folder, folderPath);
-                if (newFolder && !folder.getId().equals("0"))
+                if (newFolder && (folderImpl.getIdentity() != 0))
                 {
                     DatabasePageManagerCache.addTransaction(new TransactionedOperation(folderPath, TransactionedOperation.ADD_OPERATION));
                 }
@@ -1154,7 +1156,7 @@
                 }
 
                 // notify page manager listeners
-                if (newFolder && !folder.getId().equals("0"))
+                if (newFolder && (folderImpl.getIdentity() != 0))
                 {
                     delegator.notifyNewNode(folder);
                 }
@@ -1168,7 +1170,7 @@
             if (deep)
             {
                 // update recursively, (breadth first)
-                updateFolderNodes((FolderImpl)folder);
+                updateFolderNodes(folderImpl);
             }
         }
         catch (FolderNotUpdatedException fnue)
@@ -1197,7 +1199,7 @@
         {
             // construct general node query criteria
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId()));
+            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
 
             // update pages
             QueryByCriteria query = QueryFactory.newQuery(PageImpl.class, filter);
@@ -1310,7 +1312,7 @@
     }
 
     /**
-     * removeFolderNodes - recusively remove all folder nodes
+     * removeFolderNodes - recursively remove all folder nodes
      *
      * @param folderImpl folder whose nodes are to be removed
      * @param throws FolderNotRemovedException
@@ -1321,7 +1323,7 @@
         {
             // construct general node query criteria
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId()));
+            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
 
             // remove folders first: depth first recursion
             QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter);
@@ -1703,6 +1705,15 @@
     }
 
     /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#copyPage(org.apache.jetspeed.om.page.Page, java.lang.String, boolean)
+     */
+    public Page copyPage(Page source, String path, boolean copyIds)
+    throws NodeException, PageNotUpdatedException
+    {
+        return this.delegator.copyPage(source, path, copyIds);
+    }
+
+    /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#copyLink(org.apache.jetspeed.om.page.Link,java.lang.String)
      */
     public Link copyLink(Link source, String path)
@@ -1730,6 +1741,15 @@
     }
     
     /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#copyFragment(org.apache.jetspeed.om.page.Fragment, java.lang.String, boolean)
+     */
+    public Fragment copyFragment(Fragment source, String name, boolean copyIds)
+    throws NodeException, PageNotUpdatedException
+    {
+        return this.delegator.copyFragment(source, name, copyIds);
+    }
+    
+    /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#copyPageSecurity(org.apache.jetspeed.om.page.PageSecurity)
      */
     public PageSecurity copyPageSecurity(PageSecurity source) 
@@ -1846,21 +1866,42 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#deepCopyFolder(org.apache.jetspeed.om.folder.Folder,java.lang.String,java.lang.String)
+     * @see org.apache.jetspeed.page.PageManager#deepCopyFolder(org.apache.jetspeed.om.folder.Folder, java.lang.String, java.lang.String)
      */
     public void deepCopyFolder(Folder srcFolder, String destinationPath, String owner)
     throws NodeException, PageNotUpdatedException
     {
-        PageManagerUtils.deepCopyFolder(this, srcFolder, destinationPath, owner);
+        deepCopyFolder(srcFolder, destinationPath, owner, false);
     }
-    
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#deepCopyFolder(org.apache.jetspeed.om.folder.Folder, java.lang.String, java.lang.String, boolean)
+     */
+    public void deepCopyFolder(Folder srcFolder, String destinationPath, String owner, boolean copyIds)
+    throws NodeException, PageNotUpdatedException
+    {
+        PageManagerUtils.deepCopyFolder(this, srcFolder, destinationPath, owner, copyIds);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#deepMergeFolder(org.apache.jetspeed.om.folder.Folder, java.lang.String, java.lang.String)
+     */
     public void deepMergeFolder(Folder srcFolder, String destinationPath, String owner)
     throws NodeException, PageNotUpdatedException
     {
-        PageManagerUtils.deepMergeFolder(this, srcFolder, destinationPath, owner);
+        deepMergeFolder(srcFolder, destinationPath, owner, false);
     }
     
     /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#deepMergeFolder(org.apache.jetspeed.om.folder.Folder, java.lang.String, java.lang.String, boolean)
+     */
+    public void deepMergeFolder(Folder srcFolder, String destinationPath, String owner, boolean copyIds)
+    throws NodeException, PageNotUpdatedException
+    {
+        PageManagerUtils.deepMergeFolder(this, srcFolder, destinationPath, owner, copyIds);
+    }
+        
+    /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#addPages(org.apache.jetspeed.om.page.Page[])
      */
     public int addPages(Page[] pages)

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java Sun Oct 25 05:40:13 2009
@@ -40,7 +40,6 @@
 import org.apache.jetspeed.om.folder.psml.MenuSeparatorDefinitionImpl;
 import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.om.page.ContentPageImpl;
-import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
@@ -110,7 +109,6 @@
         modelClasses.put("FragmentPreferenceImpl", FragmentPreferenceImpl.class);
     }
 
-    private IdGenerator generator = null;
     private DocumentHandlerFactory handlerFactory;
     private FolderHandler folderHandler;
     private FileCache fileCache;
@@ -119,8 +117,7 @@
                                  FolderHandler folderHandler, FileCache fileCache,
                                  boolean permissionsEnabled, boolean constraintsEnabled ) throws FileNotFoundException
     {
-        super(permissionsEnabled, constraintsEnabled, modelClasses);
-        this.generator = generator;
+        super(generator, permissionsEnabled, constraintsEnabled, modelClasses);
         handlerFactory.setPermissionsEnabled(permissionsEnabled);
         handlerFactory.setConstraintsEnabled(constraintsEnabled);
         this.handlerFactory = handlerFactory;
@@ -131,31 +128,6 @@
 
     /**
      * <p>
-     * newFragment
-     * </p>
-     * 
-     * @see org.apache.jetspeed.page.PageManager#newFragment()
-     * @return fragment
-     */
-    public Fragment newFragment()
-    {
-        // FragmentImpl requires generated ids
-        FragmentImpl fragment = (FragmentImpl)super.newFragment();
-        fragment.setId(generator.getNextPeid());
-        return fragment;
-    }
-
-    public Fragment newPortletFragment()
-    {
-        // FragmentImpl requires generated ids
-        FragmentImpl fragment = (FragmentImpl)super.newFragment();
-        fragment.setType(Fragment.PORTLET);
-        fragment.setId(generator.getNextPeid());
-        return fragment;
-    }
-        
-    /**
-     * <p>
      * getPage
      * </p>
      * 

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/database-page-manager-base.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/database-page-manager-base.xml?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/database-page-manager-base.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/database-page-manager-base.xml Sun Oct 25 05:40:13 2009
@@ -18,6 +18,13 @@
 -->
 <beans>
 
+    <!-- Id Generator -->
+    <bean id="idGenerator" class="org.apache.jetspeed.idgenerator.JetspeedIdGenerator" init-method="start" destroy-method="stop">
+        <constructor-arg index="0"><value>65536</value></constructor-arg>
+        <constructor-arg index="1"><value>P-</value></constructor-arg>
+        <constructor-arg index="2"><value></value></constructor-arg>
+    </bean>
+
     <!-- Page Manager Caches -->
     <bean id="cacheManagerConfig" class="org.apache.jetspeed.cache.impl.EhCacheConfigResource">
         <property name="defaultConfigResource" value="ehcache.xml"/>

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/database-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/database-page-manager.xml?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/database-page-manager.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/database-page-manager.xml Sun Oct 25 05:40:13 2009
@@ -24,14 +24,16 @@
     <bean id="pageManagerImpl" init-method="init" class="org.apache.jetspeed.page.impl.DatabasePageManager">
         <!-- OJB configuration file resource path -->
         <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>
+        <!-- fragment id generator -->
+        <constructor-arg index="1"><ref bean="idGenerator"/></constructor-arg>
         <!-- permissions security enabled flag, default=false -->
-        <constructor-arg index="1"><value>false</value></constructor-arg>
-        <!-- constraints security enabled flag, default=true -->
         <constructor-arg index="2"><value>false</value></constructor-arg>
+        <!-- constraints security enabled flag, default=true -->
+        <constructor-arg index="3"><value>false</value></constructor-arg>
         <!-- folder/page/link cache -->
-        <constructor-arg index="3"><ref bean="pageManagerOidCache"/></constructor-arg>
+        <constructor-arg index="4"><ref bean="pageManagerOidCache"/></constructor-arg>
         <!-- folder/page/link path cache -->
-        <constructor-arg index="4"><ref bean="pageManagerPathCache"/></constructor-arg>
+        <constructor-arg index="5"><ref bean="pageManagerPathCache"/></constructor-arg>
     </bean>
 
 </beans>

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java Sun Oct 25 05:40:13 2009
@@ -126,17 +126,17 @@
             IdGenerator idGen = new JetspeedIdGenerator(65536,"P-","");
             FileCache cache = new FileCache(10, 12);
             
-            DocumentHandler psmlHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml", Page.DOCUMENT_TYPE, PageImpl.class, "target/testdata/" + pagesDirName, cache);
-            DocumentHandler linkHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml", Link.DOCUMENT_TYPE, LinkImpl.class, "target/testdata/" + pagesDirName, cache);
-            DocumentHandler folderMetaDataHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml", FolderMetaDataImpl.DOCUMENT_TYPE, FolderMetaDataImpl.class, "target/testdata/" + pagesDirName, cache);
-            DocumentHandler pageSecurityHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml", PageSecurityImpl.DOCUMENT_TYPE, PageSecurity.class, "target/testdata/" + pagesDirName, cache);
+            DocumentHandler psmlHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", Page.DOCUMENT_TYPE, PageImpl.class, "target/testdata/" + pagesDirName, cache);
+            DocumentHandler linkHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", Link.DOCUMENT_TYPE, LinkImpl.class, "target/testdata/" + pagesDirName, cache);
+            DocumentHandler folderMetaDataHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", FolderMetaDataImpl.DOCUMENT_TYPE, FolderMetaDataImpl.class, "target/testdata/" + pagesDirName, cache);
+            DocumentHandler pageSecurityHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", PageSecurityImpl.DOCUMENT_TYPE, PageSecurity.class, "target/testdata/" + pagesDirName, cache);
             
             DocumentHandlerFactory handlerFactory = new DocumentHandlerFactoryImpl();
             handlerFactory.registerDocumentHandler(psmlHandler);
             handlerFactory.registerDocumentHandler(linkHandler);
             handlerFactory.registerDocumentHandler(folderMetaDataHandler);
             handlerFactory.registerDocumentHandler(pageSecurityHandler);
-            FolderHandler folderHandler = new FileSystemFolderHandler("target/testdata/" + pagesDirName, handlerFactory, cache);
+            FolderHandler folderHandler = new FileSystemFolderHandler(idGen, "target/testdata/" + pagesDirName, handlerFactory, cache);
 
             return new CastorXmlPageManager(idGen, handlerFactory, folderHandler, cache, permissionsEnabled, constraintsEnabled);
         }

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java Sun Oct 25 05:40:13 2009
@@ -26,6 +26,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.apache.jetspeed.idgenerator.IdGenerator;
+import org.apache.jetspeed.idgenerator.JetspeedIdGenerator;
 import org.apache.jetspeed.om.page.Document;
 import org.apache.jetspeed.om.folder.psml.FolderMetaDataImpl;
 import org.apache.jetspeed.page.psml.CastorXmlPageManager;
@@ -58,8 +60,11 @@
     protected void setUp() throws Exception
     {
         super.setUp();
+
+        IdGenerator idGen = new JetspeedIdGenerator(65536,"P-","");
         
         folderMetaDataDocumentHandler = new CastorFileSystemDocumentHandler(
+            idGen,
             "/JETSPEED-INF/castor/page-mapping.xml",
             "folder.metadata",
             FolderMetaDataImpl.class,

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/secure-database-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/secure-database-page-manager.xml?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/secure-database-page-manager.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/secure-database-page-manager.xml Sun Oct 25 05:40:13 2009
@@ -24,14 +24,16 @@
     <bean id="pageManagerImpl" init-method="init" class="org.apache.jetspeed.page.impl.DatabasePageManager">
         <!-- OJB configuration file resource path -->
         <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>       
+        <!-- fragment id generator -->
+        <constructor-arg index="1"><ref bean="idGenerator"/></constructor-arg>
         <!-- permissions security enabled flag, default=false -->
-        <constructor-arg index="1"><value>false</value></constructor-arg>
+        <constructor-arg index="2"><value>false</value></constructor-arg>
         <!-- constraints security enabled flag, default=true -->
-        <constructor-arg index="2"><value>true</value></constructor-arg>
+        <constructor-arg index="3"><value>true</value></constructor-arg>
         <!-- folder/page/link cache -->
-        <constructor-arg index="3"><ref bean="pageManagerOidCache"/></constructor-arg>
+        <constructor-arg index="4"><ref bean="pageManagerOidCache"/></constructor-arg>
         <!-- folder/page/link path cache -->
-        <constructor-arg index="4"><ref bean="pageManagerPathCache"/></constructor-arg>
+        <constructor-arg index="5"><ref bean="pageManagerPathCache"/></constructor-arg>
     </bean>
 
 </beans>

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/secure-permissions-database-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/secure-permissions-database-page-manager.xml?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/secure-permissions-database-page-manager.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/secure-permissions-database-page-manager.xml Sun Oct 25 05:40:13 2009
@@ -23,15 +23,17 @@
     <!-- Page Manager -->
     <bean name="pageManagerImpl" init-method="init" class="org.apache.jetspeed.page.impl.DatabasePageManager">
         <!-- OJB configuration file resource path -->
-        <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>       
+        <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>
+        <!-- fragment id generator -->
+        <constructor-arg index="1"><ref bean="idGenerator"/></constructor-arg>
         <!-- permissions security enabled flag, default=false -->
-        <constructor-arg index="1"><value>true</value></constructor-arg>
+        <constructor-arg index="2"><value>true</value></constructor-arg>
         <!-- constraints security enabled flag, default=true -->
-        <constructor-arg index="2"><value>false</value></constructor-arg>
+        <constructor-arg index="3"><value>false</value></constructor-arg>
         <!-- folder/page/link cache -->
-        <constructor-arg index="3"><ref bean="pageManagerOidCache"/></constructor-arg>
+        <constructor-arg index="4"><ref bean="pageManagerOidCache"/></constructor-arg>
         <!-- folder/page/link path cache -->
-        <constructor-arg index="4"><ref bean="pageManagerPathCache"/></constructor-arg>
+        <constructor-arg index="5"><ref bean="pageManagerPathCache"/></constructor-arg>
     </bean>
 
 </beans>

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/test/JETSPEED-INF/spring/test-spring.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/test/JETSPEED-INF/spring/test-spring.xml?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/test/JETSPEED-INF/spring/test-spring.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/test/JETSPEED-INF/spring/test-spring.xml Sun Oct 25 05:40:13 2009
@@ -46,38 +46,42 @@
   <!-- DocumentHandlerFactory -->
   <bean id="PsmlDocumentHandler"      
        class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >         
-       <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
-       <constructor-arg index="1"><value>.psml</value></constructor-arg>
-       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.psml.PageImpl</value></constructor-arg>       
-       <constructor-arg index="3" ><value>target/testdata/pages</value></constructor-arg>
-       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
+       <constructor-arg index="0"><ref bean="IdGenerator"/></constructor-arg>
+       <constructor-arg index="1"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
+       <constructor-arg index="2"><value>.psml</value></constructor-arg>
+       <constructor-arg index="3" ><value>org.apache.jetspeed.om.page.psml.PageImpl</value></constructor-arg>       
+       <constructor-arg index="4" ><value>target/testdata/pages</value></constructor-arg>
+       <constructor-arg index="5" ><ref bean="PageFileCache"/></constructor-arg>
   </bean>
   
   <bean id="LinkDocumentHandler"       
        class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >         
-       <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
-       <constructor-arg index="1"><value>.link</value></constructor-arg>
-       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.psml.LinkImpl</value></constructor-arg>       
-       <constructor-arg index="3" ><value>target/testdata/pages</value></constructor-arg>
-       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
+       <constructor-arg index="0"><ref bean="IdGenerator"/></constructor-arg>
+       <constructor-arg index="1"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
+       <constructor-arg index="2"><value>.link</value></constructor-arg>
+       <constructor-arg index="3" ><value>org.apache.jetspeed.om.page.psml.LinkImpl</value></constructor-arg>       
+       <constructor-arg index="4" ><value>target/testdata/pages</value></constructor-arg>
+       <constructor-arg index="5" ><ref bean="PageFileCache"/></constructor-arg>
   </bean>
   
   <bean id="FolderMetaDataDocumentHandler"         
        class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >         
-       <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
-       <constructor-arg index="1"><value>folder.metadata</value></constructor-arg>
-       <constructor-arg index="2" ><value>org.apache.jetspeed.om.folder.psml.FolderMetaDataImpl</value></constructor-arg>       
-       <constructor-arg index="3" ><value>target/testdata/pages</value></constructor-arg>
-       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
+       <constructor-arg index="0"><ref bean="IdGenerator"/></constructor-arg>
+       <constructor-arg index="1"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
+       <constructor-arg index="2"><value>folder.metadata</value></constructor-arg>
+       <constructor-arg index="3" ><value>org.apache.jetspeed.om.folder.psml.FolderMetaDataImpl</value></constructor-arg>       
+       <constructor-arg index="4" ><value>target/testdata/pages</value></constructor-arg>
+       <constructor-arg index="5" ><ref bean="PageFileCache"/></constructor-arg>
   </bean>
   
   <bean id="PageSecurityDocumentHandler"       
        class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >         
-       <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
-       <constructor-arg index="1"><value>page.security</value></constructor-arg>
-       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.psml.PageSecurityImpl</value></constructor-arg>       
-       <constructor-arg index="3" ><value>target/testdata/pages</value></constructor-arg>
-       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
+       <constructor-arg index="0"><ref bean="IdGenerator"/></constructor-arg>
+       <constructor-arg index="1"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
+       <constructor-arg index="2"><value>page.security</value></constructor-arg>
+       <constructor-arg index="3" ><value>org.apache.jetspeed.om.page.psml.PageSecurityImpl</value></constructor-arg>       
+       <constructor-arg index="4" ><value>target/testdata/pages</value></constructor-arg>
+       <constructor-arg index="5" ><ref bean="PageFileCache"/></constructor-arg>
   </bean>
   
   <bean id="DocumentHandlerFactory"        
@@ -103,9 +107,10 @@
   <!-- FolderHandler -->
   <bean id="FolderHandler"         
        class="org.apache.jetspeed.page.document.psml.FileSystemFolderHandler" >         
-       <constructor-arg index="0"><value>target/testdata/pages</value></constructor-arg>
-       <constructor-arg index="1"><ref bean="DocumentHandlerFactory"/></constructor-arg>
-       <constructor-arg index="2"><ref bean="PageFileCache"/></constructor-arg>        
+       <constructor-arg index="0"><ref bean="IdGenerator"/></constructor-arg>
+       <constructor-arg index="1"><value>target/testdata/pages</value></constructor-arg>
+       <constructor-arg index="2"><ref bean="DocumentHandlerFactory"/></constructor-arg>
+       <constructor-arg index="3"><ref bean="PageFileCache"/></constructor-arg>        
   </bean>
 
   <!-- PageManager -->

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java Sun Oct 25 05:40:13 2009
@@ -120,6 +120,13 @@
     {
         return id;
     }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#setId(java.lang.String)
+     */
+    public void setId(String fragmentId)
+    {
+    }
     
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.BaseElement#getTitle()

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdateFolderAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdateFolderAction.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdateFolderAction.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdateFolderAction.java Sun Oct 25 05:40:13 2009
@@ -155,7 +155,7 @@
             	String destination = getActionParameter(requestContext, "destination");
             	String name = getActionParameter(requestContext, RESOURCE_NAME);            	
             	destination = destination + Folder.PATH_SEPARATOR + name;
-            	pageManager.deepCopyFolder(folder,destination,null);            	
+            	pageManager.deepCopyFolder(folder,destination,null,true);            	
             	pageManager.removeFolder(folder);
             }            
             else if (method.equals("remove"))

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java?rev=829497&r1=829496&r2=829497&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java Sun Oct 25 05:40:13 2009
@@ -181,7 +181,7 @@
             	String destination = getActionParameter(requestContext, "destination");
             	String name = getActionParameter(requestContext, RESOURCE_NAME);            	
             	destination = destination + Folder.PATH_SEPARATOR + name;
-            	Page newPage = pageManager.copyPage(page, destination);
+            	Page newPage = pageManager.copyPage(page, destination, true);
             	pageManager.updatePage(newPage);
             	pageManager.removePage(page);
             } 



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