portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r350066 [1/3] - in /portals/jetspeed-2/trunk: components/page-manager/ 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/i...
Date Wed, 30 Nov 2005 22:53:59 GMT
Author: rwatler
Date: Wed Nov 30 14:53:22 2005
New Revision: 350066

URL: http://svn.apache.org/viewcvs?rev=350066&view=rev
Log:
- add FragmentPreference to jetspeed-api
- implement Folder documentOrder for DB PageManager
- implement Fragment preferences for DB PageManager
- remove all OJB specific instance callback processing in DB PageManager om implementation objects
- merge API om implementation objects with the DB PageManager persistent objects to limit runtime translation


Added:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrder.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrderList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintImpl.java
      - copied, changed from r345429, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraint.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceValue.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceValueList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPropertyMap.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintImpl.java
      - copied, changed from r345429, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraint.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintImpl.java
      - copied, changed from r345429, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraint.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsDefList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsRefList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecuritySecurityConstraintImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintDefList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsDefImpl.java
      - copied, changed from r345429, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecuritySecurityConstraintsDef.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsRefList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsDefImpl.java
      - copied, changed from r345429, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintsDefImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java   (with props)
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPreferenceImpl.java
      - copied, changed from r345429, portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPreference.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/preference/
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/preference/FragmentPreference.java
Removed:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraint.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintsDefImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraint.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraint.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraint.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecuritySecurityConstraintsDef.java
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPreference.java
Modified:
    portals/jetspeed-2/trunk/components/page-manager/project.xml
    portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml
    portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraintsRef.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentList.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestSecureDatabasePageManager.java
    portals/jetspeed-2/trunk/components/page-manager/testdata/pages/test001.psml
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java
    portals/jetspeed-2/trunk/components/registry/src/test/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java
    portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml
    portals/jetspeed-2/trunk/etc/sql/derby/schema/phase2-schema.sql
    portals/jetspeed-2/trunk/etc/sql/drop.sql
    portals/jetspeed-2/trunk/etc/sql/oracle/drop.sql
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/SecurityConstraint.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java

Modified: portals/jetspeed-2/trunk/components/page-manager/project.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/project.xml?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/project.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/project.xml Wed Nov 30 14:53:22 2005
@@ -86,6 +86,9 @@
 	<unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory>
 
         <unitTest>
+            <excludes>
+                <exclude>**/PageManagerTestShared.java</exclude>
+            </excludes>
             <resources>
                 <resource>
                     <directory>${basedir}/src/test</directory>

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml Wed Nov 30 14:53:22 2005
@@ -119,7 +119,7 @@
     </field>
     
     <field name="preferences"
-           type="org.apache.jetspeed.om.preference.impl.FragmentPreference" collection="arraylist">
+           type="org.apache.jetspeed.om.preference.impl.FragmentPreferenceImpl" collection="arraylist">
       <bind-xml name="preference"/>
     </field>
   </class>
@@ -428,19 +428,19 @@
   <class name="org.apache.jetspeed.om.page.SecurityConstraintImpl">
     <map-to xml="security-constraint"/>
 
-    <field name="users" type="java.lang.String">
+    <field name="usersAsString" type="java.lang.String">
       <bind-xml name="users"/>
     </field>
 
-    <field name="roles" type="java.lang.String">
+    <field name="rolesAsString" type="java.lang.String">
       <bind-xml name="roles"/>
     </field>
 
-    <field name="groups" type="java.lang.String">
+    <field name="groupsAsString" type="java.lang.String">
       <bind-xml name="groups"/>
     </field>
 
-    <field name="permissions" type="java.lang.String">
+    <field name="permissionsAsString" type="java.lang.String">
       <bind-xml name="permissions"/>
     </field>
   </class>
@@ -453,7 +453,7 @@
     </field>
 
     <field name="securityConstraintsDefs"
-           type="org.apache.jetspeed.om.page.SecurityConstraintsDefImpl"
+           type="org.apache.jetspeed.om.page.psml.SecurityConstraintsDefImpl"
            collection="collection">
       <bind-xml name="security-constraints-def"/>
     </field>
@@ -465,7 +465,7 @@
     </field>
   </class>
 
-  <class name="org.apache.jetspeed.om.page.SecurityConstraintsDefImpl">
+  <class name="org.apache.jetspeed.om.page.psml.SecurityConstraintsDefImpl">
     <map-to xml="security-constraints-def"/>
 
     <field name="name" type="java.lang.String">
@@ -480,7 +480,7 @@
   </class>
   
 
-  <class name="org.apache.jetspeed.om.preference.impl.FragmentPreference">
+  <class name="org.apache.jetspeed.om.preference.impl.FragmentPreferenceImpl">
     <map-to xml="preference"/>
 
     <field name="name" type="string">

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml Wed Nov 30 14:53:22 2005
@@ -189,10 +189,11 @@
 
       <collection-descriptor
           name="constraints::constraints"
-          element-class-ref="org.apache.jetspeed.om.folder.impl.FolderSecurityConstraint"
+          element-class-ref="org.apache.jetspeed.om.folder.impl.FolderSecurityConstraintImpl"
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
+          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="folderId"/>
@@ -204,10 +205,23 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
+          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="folderId"/>
       </collection-descriptor>
+
+      <collection-descriptor
+          name="orders"
+          element-class-ref="org.apache.jetspeed.om.folder.impl.FolderOrder"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <orderby name="sortOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="folderId"/>
+      </collection-descriptor>
    </class-descriptor>
 
    <class-descriptor
@@ -250,7 +264,7 @@
    </class-descriptor>
 
    <class-descriptor
-      class="org.apache.jetspeed.om.folder.impl.FolderSecurityConstraint"
+      class="org.apache.jetspeed.om.folder.impl.FolderSecurityConstraintImpl"
       table="FOLDER_CONSTRAINT"
    >
       <field-descriptor
@@ -275,28 +289,28 @@
       />
 
       <field-descriptor
-         name="userPrincipals"
+         name="usersList"
          column="USER_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="rolePrincipals"
+         name="rolesList"
          column="ROLE_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="groupPrincipals"
+         name="groupsList"
          column="GROUP_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="permissions"
+         name="permissionsList"
          column="PERMISSIONS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
@@ -335,6 +349,38 @@
       />
    </class-descriptor>
 
+   <class-descriptor
+      class="org.apache.jetspeed.om.folder.impl.FolderOrder"
+      table="FOLDER_ORDER"
+   >
+      <field-descriptor
+         name="id"
+         column="ORDER_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="folderId"
+        column="FOLDER_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="sortOrder"
+         column="SORT_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+   </class-descriptor>
+
    <!-- Page mapping -->
 
    <class-descriptor
@@ -502,10 +548,11 @@
 
       <collection-descriptor
           name="constraints::constraints"
-          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecurityConstraint"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecurityConstraintImpl"
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
+          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="pageId"/>
@@ -517,6 +564,7 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
+          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="pageId"/>
@@ -563,7 +611,7 @@
    </class-descriptor>
 
    <class-descriptor
-      class="org.apache.jetspeed.om.page.impl.PageSecurityConstraint"
+      class="org.apache.jetspeed.om.page.impl.PageSecurityConstraintImpl"
       table="PAGE_CONSTRAINT"
    >
       <field-descriptor
@@ -588,28 +636,28 @@
       />
 
       <field-descriptor
-         name="userPrincipals"
+         name="usersList"
          column="USER_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="rolePrincipals"
+         name="rolesList"
          column="ROLE_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="groupPrincipals"
+         name="groupsList"
          column="GROUP_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="permissions"
+         name="permissionsList"
          column="PERMISSIONS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
@@ -780,10 +828,11 @@
 
       <collection-descriptor
           name="constraints::constraints"
-          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentSecurityConstraint"
+          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentSecurityConstraintImpl"
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
+          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="fragmentId"/>
@@ -795,14 +844,27 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
+          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="fragmentId"/>
       </collection-descriptor>
+
+      <collection-descriptor
+          name="preferences"
+          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentPreferenceImpl"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <orderby name="name" sort="ASC"/>
+         <inverse-foreignkey field-ref="fragmentId"/>
+      </collection-descriptor>
    </class-descriptor>
 
    <class-descriptor
-      class="org.apache.jetspeed.om.page.impl.FragmentSecurityConstraint"
+      class="org.apache.jetspeed.om.page.impl.FragmentSecurityConstraintImpl"
       table="FRAGMENT_CONSTRAINT"
    >
       <field-descriptor
@@ -827,28 +889,28 @@
       />
 
       <field-descriptor
-         name="userPrincipals"
+         name="usersList"
          column="USER_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="rolePrincipals"
+         name="rolesList"
          column="ROLE_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="groupPrincipals"
+         name="groupsList"
          column="GROUP_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="permissions"
+         name="permissionsList"
          column="PERMISSIONS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
@@ -887,6 +949,82 @@
       />
    </class-descriptor>
 
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.FragmentPreferenceImpl"
+      table="FRAGMENT_PREF"
+   >
+      <field-descriptor
+         name="id"
+         column="PREF_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="fragmentId"
+        column="FRAGMENT_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="readOnly"
+         column="IS_READ_ONLY"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+
+      <collection-descriptor
+          name="values"
+          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentPreferenceValue"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <inverse-foreignkey field-ref="prefId"/>
+      </collection-descriptor>
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.FragmentPreferenceValue"
+      table="FRAGMENT_PREF_VALUE"
+   >
+      <field-descriptor
+         name="id"
+         column="PREF_VALUE_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="prefId"
+        column="PREF_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="valueOrder"
+         column="VALUE_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="value"
+         column="VALUE"
+         jdbc-type="VARCHAR"
+      />
+   </class-descriptor>
+
    <!-- PageSecurity mapping -->
 
    <class-descriptor
@@ -989,13 +1127,13 @@
 
       <collection-descriptor
           name="constraintsDefs"
-          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecuritySecurityConstraintsDef"
+          element-class-ref="org.apache.jetspeed.om.page.impl.SecurityConstraintsDefImpl"
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
+          proxy="true"
       >
          <orderby name="name" sort="ASC"/>
-         <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="pageSecurityId"/>
       </collection-descriptor>
 
@@ -1005,6 +1143,7 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
+          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="pageSecurityId"/>
@@ -1012,7 +1151,7 @@
    </class-descriptor>
 
    <class-descriptor
-      class="org.apache.jetspeed.om.page.impl.PageSecuritySecurityConstraintsDef"
+      class="org.apache.jetspeed.om.page.impl.SecurityConstraintsDefImpl"
       table="PAGE_SEC_CONSTRAINTS_DEF"
    >
       <field-descriptor
@@ -1036,6 +1175,39 @@
          jdbc-type="VARCHAR"
       />
 
+      <collection-descriptor
+          name="constraintDefs"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecuritySecurityConstraintImpl"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="constraintsDefId"/>
+      </collection-descriptor>
+
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageSecuritySecurityConstraintImpl"
+      table="PAGE_SEC_CONSTRAINT_DEF"
+   >
+      <field-descriptor
+         name="id"
+         column="CONSTRAINT_DEF_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="constraintsDefId"
+        column="CONSTRAINTS_DEF_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
       <field-descriptor
          name="applyOrder"
          column="APPLY_ORDER"
@@ -1043,28 +1215,28 @@
       />
 
       <field-descriptor
-         name="userPrincipals"
+         name="usersList"
          column="USER_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="rolePrincipals"
+         name="rolesList"
          column="ROLE_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="groupPrincipals"
+         name="groupsList"
          column="GROUP_PRINCIPALS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
       />
 
       <field-descriptor
-         name="permissions"
+         name="permissionsList"
          column="PERMISSIONS_ACL"
          jdbc-type="VARCHAR"
          conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java Wed Nov 30 14:53:22 2005
@@ -20,6 +20,7 @@
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
+import java.util.ListIterator;
 
 import org.apache.jetspeed.om.common.SecuredResource;
 import org.apache.jetspeed.om.folder.Folder;
@@ -53,7 +54,9 @@
     private List folders;
     private List pages;
     private List pageSecurity;
+    private List orders;
 
+    private FolderOrderList documentOrder;
     private NodeSet allNodeSet;
     private NodeSet foldersNodeSet;
     private NodeSet pagesNodeSet;
@@ -64,6 +67,23 @@
     }
 
     /**
+     * accessFolderOrders
+     *
+     * Access mutable persistent collection member for List wrappers.
+     *
+     * @return persistent collection
+     */
+    List accessFolderOrders()
+    {
+        // create initial collection if necessary
+        if (orders == null)
+        {
+            orders = new ArrayList();
+        }
+        return orders;
+    }
+
+    /**
      * addFolder
      *
      * Adds a folder to the persistent collection and resets cached node sets.
@@ -75,7 +95,7 @@
         // add to folders collection
         if (folders == null)
         {
-            folders = new ArrayList();
+            folders = new ArrayList(4);
         }
         folders.add(newFolder);
 
@@ -116,7 +136,7 @@
         // add to pages collection
         if (pages == null)
         {
-            pages = new ArrayList();
+            pages = new ArrayList(8);
         }
         pages.add(newPage);
 
@@ -237,15 +257,34 @@
      */
     public List getDocumentOrder()
     {
-        return null; // NYI
+        // return mutable document order list
+        // by using list wrapper to manage sort
+        // order and element uniqueness
+        if (documentOrder == null)
+        {
+            documentOrder = new FolderOrderList(this);
+        }
+        return documentOrder;
     }
     
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.folder.Folder#setDocumentOrder(java.util.List)
      */
-    public void setDocumentOrder(List docIndexes)
+    public void setDocumentOrder(List docNames)
     {
-        // NYI
+        // set document order using ordered document
+        // names by replacing existing entries with
+        // new elements if new collection is specified
+        List documentOrder = getDocumentOrder();
+        if (docNames != documentOrder)
+        {
+            // replace all document order names
+            documentOrder.clear();
+            if (docNames != null)
+            {
+                documentOrder.addAll(docNames);
+            }
+        }
     }
 
     /* (non-Javadoc)

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrder.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrder.java?rev=350066&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrder.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrder.java Wed Nov 30 14:53:22 2005
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+/**
+ * FolderOrder
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class FolderOrder
+{
+    private int id;
+    private int sortOrder;
+    private String name;
+
+    /**
+     * getSortOrder
+     *
+     * @return sort order
+     */
+    public int getSortOrder()
+    {
+        return sortOrder;
+    }
+
+    /**
+     * setSortOrder
+     *
+     * @param order sort order
+     */
+    public void setSortOrder(int order)
+    {
+        sortOrder = order;
+    }
+
+    /**
+     * getName
+     *
+     * @return folder/page/link name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * setName
+     *
+     * @param name folder/page/link name
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals(Object o)
+    {
+        if (o instanceof FolderOrder)
+        {
+            if (name != null)
+            {
+                return name.equals(((FolderOrder)o).getName());
+            }
+            else
+            {
+                return (((FolderOrder)o).getName() == null);
+            }
+        }
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        if (name != null)
+        {
+            return name.hashCode();
+        }
+        return 0;
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrderList.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrderList.java?rev=350066&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrderList.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrderList.java Wed Nov 30 14:53:22 2005
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * FolderOrderList
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+class FolderOrderList extends AbstractList
+{
+    private FolderImpl folder;
+
+    private List removedFolderOrders;
+
+    FolderOrderList(FolderImpl folder)
+    {
+        super();
+        this.folder = folder;
+    }
+
+    /**
+     * wrapNameStringForAdd
+     *
+     * Wraps and validates folder order name string
+     * to be added to this list.
+     *
+     * @param name folder order name string to add
+     * @return list element to add
+     */
+    private FolderOrder wrapNameStringForAdd(String name)
+    {
+        // only non-null names supported
+        if (name == null)
+        {
+            throw new NullPointerException("Unable to add null to list.");
+        }
+        // wrap folder order name string
+        FolderOrder folderOrder = new FolderOrder();
+        folderOrder.setName(name);
+        // make sure element is unique
+        if (folder.accessFolderOrders().contains(folderOrder))
+        {
+            throw new IllegalArgumentException("Unable to add duplicate entry to list: " + folderOrder.getName());
+        }
+        // retrieve from removed list to reuse
+        // previously removed element
+        if (removedFolderOrders != null)
+        {
+            int removedIndex = removedFolderOrders.indexOf(folderOrder);
+            if (removedIndex >= 0)
+            {
+                folderOrder = (FolderOrder)removedFolderOrders.remove(removedIndex);
+            }
+        }
+        return folderOrder;
+    }
+
+    /**
+     * getRemovedFolderOrders
+     *
+     * @return removed folder orders tracking collection
+     */
+    private List getRemovedFolderOrders()
+    {
+        if (removedFolderOrders == null)
+        {
+            removedFolderOrders = new ArrayList(folder.accessFolderOrders().size());
+        }
+        return removedFolderOrders;
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.List#add(int,java.lang.Object)
+     */
+    public void add(int index, Object element)
+    {
+        // implement for modifiable AbstractList:
+        // validate index
+        if ((index < 0) || (index > folder.accessFolderOrders().size()))
+        {
+            throw new IndexOutOfBoundsException("Unable to add to list at index: " + index);
+        }
+        // wrap and verify folder order name string
+        FolderOrder folderOrder = wrapNameStringForAdd((String)element);
+        // add to underlying ordered list
+        folder.accessFolderOrders().add(index, folderOrder);
+        // set sort order in added element
+        if (index > 0)
+        {
+            folderOrder.setSortOrder(((FolderOrder)folder.accessFolderOrders().get(index-1)).getSortOrder() + 1);
+        }
+        else
+        {
+            folderOrder.setSortOrder(0);
+        }
+        // maintain sort order in subsequent elements
+        for (int i = index, limit = folder.accessFolderOrders().size() - 1; (i < limit); i++)
+        {
+            FolderOrder nextFolderOrder = (FolderOrder)folder.accessFolderOrders().get(i + 1);
+            if (nextFolderOrder.getSortOrder() <= folderOrder.getSortOrder())
+            {
+                // adjust sort order for next element
+                nextFolderOrder.setSortOrder(folderOrder.getSortOrder() + 1);
+                folderOrder = nextFolderOrder;
+            }
+            else
+            {
+                // sort order maintained for remaining list elements
+                break;
+            }
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.List#get(int)
+     */
+    public Object get(int index)
+    {
+        // implement for modifiable AbstractList:
+        // unwrap folder order name string
+        return ((FolderOrder)folder.accessFolderOrders().get(index)).getName();
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.List#remove(int)
+     */
+    public Object remove(int index)
+    {
+        // implement for modifiable AbstractList:
+        // save removed element 
+        FolderOrder removed = (FolderOrder)folder.accessFolderOrders().remove(index);
+        if (removed != null)
+        {
+            getRemovedFolderOrders().add(removed);
+        }
+        return removed;
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.List#set(int,java.lang.Object)
+     */
+    public Object set(int index, Object element)
+    {
+        // implement for modifiable AbstractList:
+        // wrap and verify folder order name string
+        FolderOrder newFolderOrder = wrapNameStringForAdd((String)element);
+        // set in underlying ordered list
+        FolderOrder folderOrder = (FolderOrder)folder.accessFolderOrders().set(index, newFolderOrder);
+        // set sort order in new element
+        newFolderOrder.setSortOrder(folderOrder.getSortOrder());
+        // save replaced element
+        getRemovedFolderOrders().add(folderOrder);
+        // return unwrapped folder order name string
+        return folderOrder.getName();
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.List#size()
+     */
+    public int size()
+    {
+        // implement for modifiable AbstractList
+        return folder.accessFolderOrders().size();
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderOrderList.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintImpl.java (from r345429, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraint.java)
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintImpl.java?p2=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintImpl.java&p1=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraint.java&r1=345429&r2=350066&rev=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraint.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintImpl.java Wed Nov 30 14:53:22 2005
@@ -15,15 +15,15 @@
  */
 package org.apache.jetspeed.om.folder.impl;
 
-import org.apache.jetspeed.om.page.impl.BaseSecurityConstraint;
+import org.apache.jetspeed.om.page.SecurityConstraintImpl;
 
 /**
- * FolderSecurityConstraint
+ * FolderSecurityConstraintImpl
  *
  * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
  * @version $Id$
  */
-public class FolderSecurityConstraint extends BaseSecurityConstraint
+public class FolderSecurityConstraintImpl extends SecurityConstraintImpl
 {
     // new class defined only to facilitate OJB table/class mapping
 }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsImpl.java?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsImpl.java Wed Nov 30 14:53:22 2005
@@ -15,8 +15,6 @@
  */
 package org.apache.jetspeed.om.folder.impl;
 
-import org.apache.jetspeed.om.page.impl.BaseSecurityConstraint;
-import org.apache.jetspeed.om.page.impl.BaseSecurityConstraintsRef;
 import org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl;
 
 /**
@@ -28,18 +26,18 @@
 public class FolderSecurityConstraintsImpl extends SecurityConstraintsImpl
 {
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl#newSecurityConstraint()
+     * @see org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl#getSecurityConstraintClass()
      */
-    public BaseSecurityConstraint newSecurityConstraint()
+    public Class getSecurityConstraintClass()
     {
-        return new FolderSecurityConstraint();
+        return FolderSecurityConstraintImpl.class;
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl#newSecurityConstraintsRef()
+     * @see org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl#getSecurityConstraintsRefClass()
      */
-    public BaseSecurityConstraintsRef newSecurityConstraintsRef()
+    public Class getSecurityConstraintsRefClass()
     {
-        return new FolderSecurityConstraintsRef();
+        return FolderSecurityConstraintsRef.class;
     }
 }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java Wed Nov 30 14:53:22 2005
@@ -665,10 +665,19 @@
 
     }
 
-
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#getPreferences()
+     */
     public List getPreferences()
     {
         return fragment.getPreferences();
     }
     
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#setPreferences(java.util.List)
+     */
+    public void setPreferences(List preferences)
+    {
+        fragment.setPreferences(preferences);
+    }
 }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintImpl.java?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintImpl.java Wed Nov 30 14:53:22 2005
@@ -37,227 +37,239 @@
  */
 public class SecurityConstraintImpl implements SecurityConstraint
 {
-    private String users;
+    private int id;
+    private int applyOrder;
     private List usersList;
-
-    private String roles;
     private List rolesList;
-
-    private String groups;
     private List groupsList;
+    private List permissionsList;
 
+    private String users;
+    private String roles;
+    private String groups;
     private String permissions;
-    private List permissionsList;
 
     /**
-     * <p>
-     * getUsers
-     * </p>
+     * getApplyOrder
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#getUsers()
-     * @return
+     * @return apply order for constraints
      */
-    public String getUsers()
+    public int getApplyOrder()
     {
-        return users;
+        return applyOrder;
     }
-    
+
     /**
-     * <p>
-     * getUsersList
-     * </p>
+     * setApplyOrder
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#getUsersList()
-     * @return
+     * @param order apply order for constraints
      */
-    public List getUsersList()
+    public void setApplyOrder(int order)
     {
-        return usersList;
+        applyOrder = order;
     }
-    
+
     /**
-     * <p>
-     * setUsers
-     * </p>
+     * getUsersAsString
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#setUsers(java.lang.String)
-     * @param users
+     * @return users CSV list
      */
-    public void setUsers(String users)
+    public String getUsersAsString()
     {
-        this.users = users;
-        usersList = parseCSVList(users);
+        if ((users == null) && (usersList != null) && !usersList.isEmpty())
+        {
+            users = formatCSVList(usersList);
+        }
+        return users;
     }
 
     /**
-     * <p>
-     * setUsers
-     * </p>
+     * setUsersAsString
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#setUsers(java.util.List)
-     * @param users
+     * @param users users CSV list
      */
-    public void setUsers(List users)
+    public void setUsersAsString(String users)
     {
-        this.users = formatCSVList(users);
-        usersList = users;
+        this.users = users;
+        usersList = parseCSVList(users);
     }
 
     /**
-     * <p>
-     * getRoles
-     * </p>
+     * getRolesAsString
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#getRoles()
-     * @return
+     * @return roles CSV list
      */
-    public String getRoles()
+    public String getRolesAsString()
     {
+        if ((roles == null) && (rolesList != null) && !rolesList.isEmpty())
+        {
+            roles = formatCSVList(rolesList);
+        }
         return roles;
     }
     
     /**
-     * <p>
-     * getRolesList
-     * </p>
+     * setRolesAsString
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#getRolesList()
-     * @return
+     * @param roles roles CSV list
      */
-    public List getRolesList()
+    public void setRolesAsString(String roles)
     {
-        return rolesList;
+        this.roles = roles;
+        rolesList = parseCSVList(roles);
+    }
+
+    /**
+     * getGroupsAsString
+     *
+     * @return groups CSV list
+     */
+    public String getGroupsAsString()
+    {
+        if ((groups == null) && (groupsList != null) && !groupsList.isEmpty())
+        {
+            groups = formatCSVList(groupsList);
+        }
+        return groups;
     }
     
     /**
-     * <p>
-     * setRoles
-     * </p>
+     * setGroupsAsString
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#setRoles(java.lang.String)
-     * @param roles
+     * @param groups groups CSV list
      */
-    public void setRoles(String roles)
+    public void setGroupsAsString(String groups)
     {
-        this.roles = roles;
-        rolesList = parseCSVList(roles);
+        this.groups = groups;
+        groupsList = parseCSVList(groups);
     }
 
     /**
-     * <p>
-     * setRoles
-     * </p>
+     * getPermissionsAsString
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#setRoles(java.util.List)
-     * @param roles
+     * @return permmissions CSV list
      */
-    public void setRoles(List roles)
+    public String getPermissionsAsString()
     {
-        this.roles = formatCSVList(roles);
-        rolesList = roles;
+        if ((permissions == null) && (permissionsList != null) && !permissionsList.isEmpty())
+        {
+            permissions = formatCSVList(permissionsList);
+        }
+        return permissions;
     }
-
+    
     /**
-     * <p>
-     * getGroups
-     * </p>
+     * setPermissionsAsString
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#getGroups()
-     * @return
+     * @param permissions permmissions CSV list
      */
-    public String getGroups()
+    public void setPermissionsAsString(String permissions)
     {
-        return groups;
+        this.permissions = permissions;
+        permissionsList = parseCSVList(permissions);
     }
     
     /**
      * <p>
-     * getGroupsList
+     * getUsers
      * </p>
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#getGroupsList()
-     * @return
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#getUsers()
+     * @return users list
      */
-    public List getGroupsList()
+    public List getUsers()
     {
-        return groupsList;
+        return usersList;
     }
     
     /**
      * <p>
-     * setGroups
+     * setUsers
      * </p>
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#setGroups(java.lang.String)
-     * @param groups
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#setUsers(java.util.List)
+     * @param users users list
      */
-    public void setGroups(String groups)
+    public void setUsers(List users)
     {
-        this.groups = groups;
-        groupsList = parseCSVList(groups);
+        this.users = formatCSVList(users);
+        usersList = users;
     }
 
     /**
      * <p>
-     * setGroups
+     * getRoles
      * </p>
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#setGroups(java.util.List)
-     * @param groups
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#getRoles()
+     * @return roles list
      */
-    public void setGroups(List groups)
+    public List getRoles()
     {
-        this.groups = formatCSVList(groups);
-        groupsList = groups;
+        return rolesList;
     }
-
+    
     /**
      * <p>
-     * getPermissions
+     * setRoles
      * </p>
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#getPermissions()
-     * @return
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#setRoles(java.util.List)
+     * @param roles roles list
      */
-    public String getPermissions()
+    public void setRoles(List roles)
     {
-        return permissions;
+        this.roles = formatCSVList(roles);
+        rolesList = roles;
     }
-    
+
     /**
      * <p>
-     * getPermissionsList
+     * getGroups
      * </p>
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#getPermissionsList()
-     * @return
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#getGroups()
+     * @return groups list
      */
-    public List getPermissionsList()
+    public List getGroups()
     {
-        return permissionsList;
+        return groupsList;
     }
     
     /**
      * <p>
-     * setPermissions
+     * setGroups
      * </p>
      *
-     * @see org.apache.jetspeed.om.common.SecurityConstraint#setPermissions(java.lang.String)
-     * @param permissions
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#setGroups(java.util.List)
+     * @param groups groups list
      */
-    public void setPermissions(String permissions)
+    public void setGroups(List groups)
     {
-        this.permissions = permissions;
-        permissionsList = parseCSVList(permissions);
+        this.groups = formatCSVList(groups);
+        groupsList = groups;
     }
 
     /**
      * <p>
+     * getPermissions
+     * </p>
+     *
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#getPermissions()
+     * @return permissions list
+     */
+    public List getPermissions()
+    {
+        return permissionsList;
+    }
+    
+    /**
+     * <p>
      * setPermissions
      * </p>
      *
      * @see org.apache.jetspeed.om.common.SecurityConstraint#setPermissions(java.util.List)
-     * @param permissions
+     * @param permissions permissions list
      */
     public void setPermissions(List permissions)
     {

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java Wed Nov 30 14:53:22 2005
@@ -34,9 +34,6 @@
 import org.apache.jetspeed.security.PagePermission;
 import org.apache.jetspeed.security.RolePrincipal;
 import org.apache.jetspeed.security.UserPrincipal;
-import org.apache.ojb.broker.PersistenceBroker;
-import org.apache.ojb.broker.PersistenceBrokerAware;
-import org.apache.ojb.broker.PersistenceBrokerException;
 
 /**
  * BaseElementImpl
@@ -44,7 +41,7 @@
  * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
  * @version $Id$
  */
-public abstract class BaseElementImpl implements BaseElement, PersistenceBrokerAware
+public abstract class BaseElementImpl implements BaseElement
 {
     private int id;
     private String name;
@@ -474,71 +471,5 @@
     public void setShortTitle(String title)
     {
         shortTitle = title;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeInsert(org.apache.ojb.broker.PersistenceBroker)
-     */
-    public void beforeInsert(PersistenceBroker broker) throws PersistenceBrokerException
-    {
-        // execute update hook by default
-        beforeUpdate(broker);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterInsert(org.apache.ojb.broker.PersistenceBroker)
-     */
-    public void afterInsert(PersistenceBroker broker) throws PersistenceBrokerException
-    {
-        // execute update hook by default
-        afterUpdate(broker);
-    }
-    
-    /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeUpdate(org.apache.ojb.broker.PersistenceBroker)
-     */
-    public void beforeUpdate(PersistenceBroker broker) throws PersistenceBrokerException
-    {
-        // update constraints to maintain mapping
-        if (constraints != null)
-        {
-            constraints.beforeUpdate();
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterUpdate(org.apache.ojb.broker.PersistenceBroker)
-     */
-    public void afterUpdate(PersistenceBroker broker) throws PersistenceBrokerException
-    {
-        // nothing to do by default
-    }
-    
-    /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeDelete(org.apache.ojb.broker.PersistenceBroker)
-     */
-    public void beforeDelete(PersistenceBroker broker) throws PersistenceBrokerException
-    {
-        // nothing to do by default
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterDelete(org.apache.ojb.broker.PersistenceBroker)
-     */
-    public void afterDelete(PersistenceBroker broker) throws PersistenceBrokerException
-    {
-        // nothing to do by default
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterLookup(org.apache.ojb.broker.PersistenceBroker)
-     */
-    public void afterLookup(PersistenceBroker broker) throws PersistenceBrokerException
-    {
-        // update constraints to maintain mapping
-        if (constraints != null)
-        {
-            constraints.afterLookup();
-        }
     }
 }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraintsRef.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraintsRef.java?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraintsRef.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraintsRef.java Wed Nov 30 14:53:22 2005
@@ -68,4 +68,32 @@
     {
         this.name = name;
     }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals(Object o)
+    {
+        if (o instanceof BaseSecurityConstraintsRef)
+        {
+            if (name != null)
+            {
+                return name.equals(((BaseSecurityConstraintsRef)o).getName());
+            }
+            return (((BaseSecurityConstraintsRef)o).getName() == null);
+        }
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        if (name != null)
+        {
+            return name.hashCode();
+        }
+        return 0;
+    }
 }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java Wed Nov 30 14:53:22 2005
@@ -17,6 +17,7 @@
 
 import java.security.AccessController;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -26,9 +27,9 @@
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.PageSecurity;
+import org.apache.jetspeed.om.preference.FragmentPreference;
+import org.apache.jetspeed.om.preference.impl.FragmentPreferenceImpl;
 import org.apache.jetspeed.security.FragmentPermission;
-import org.apache.ojb.broker.PersistenceBroker;
-import org.apache.ojb.broker.PersistenceBrokerException;
 
 /**
  * FragmentImpl
@@ -39,7 +40,6 @@
 public class FragmentImpl extends BaseElementImpl implements Fragment
 {
     private List fragments;
-    private FragmentList fragmentsList;
     private String type;
     private String skin;
     private String decorator;
@@ -51,8 +51,11 @@
     private String extendedPropertyValue1;
     private String extendedPropertyName2;
     private String extendedPropertyValue2;
+    private List preferences;
 
-    private Map properties;
+    private FragmentList fragmentsList;
+    private FragmentPropertyMap propertiesMap;
+    private FragmentPreferenceList fragmentPreferences;
     private PageImpl page;
 
     public FragmentImpl()
@@ -61,6 +64,40 @@
     }
 
     /**
+     * accessFragments
+     *
+     * Access mutable persistent collection member for List wrappers.
+     *
+     * @return persistent collection
+     */
+    List accessFragments()
+    {
+        // create initial collection if necessary
+        if (fragments == null)
+        {
+            fragments = new ArrayList(4);
+        }
+        return fragments;
+    }
+
+    /**
+     * accessPreferences
+     *
+     * Access mutable persistent collection member for List wrappers.
+     *
+     * @return persistent collection
+     */
+    List accessPreferences()
+    {
+        // create initial collection if necessary
+        if (preferences == null)
+        {
+            preferences = new ArrayList(4);
+        }
+        return preferences;
+    }
+
+    /**
      * getPage
      *
      * Get page implementation that owns fragment.
@@ -171,6 +208,159 @@
         return matchedFragments;
     }
 
+    /**
+     * getPropertyMemberKeys
+     *
+     * Get valid explicit property member keys.
+     *
+     * @return list of property member keys with values
+     */
+    List getPropertyMemberKeys()
+    {
+        List keys = new ArrayList(5);
+        if (layoutRowProperty >= 0)
+        {
+            keys.add(ROW_PROPERTY_NAME);
+        }
+        if (layoutColumnProperty >= 0)
+        {
+            keys.add(COLUMN_PROPERTY_NAME);
+        }
+        if (layoutSizesProperty != null)
+        {
+            keys.add(SIZES_PROPERTY_NAME);
+        }
+        if ((extendedPropertyName1 != null) && (extendedPropertyValue1 != null))
+        {
+            keys.add(extendedPropertyName1);
+        }
+        if ((extendedPropertyName2 != null) && (extendedPropertyValue2 != null))
+        {
+            keys.add(extendedPropertyName2);
+        }
+        return keys;
+    }
+
+    /**
+     * getPropertyMember
+     *
+     * Get explicit property member.
+     *
+     * @param key property name
+     * @return property setting
+     */
+    String getPropertyMember(String key)
+    {
+        // set fragment explicit property member
+        if (key.equals(ROW_PROPERTY_NAME))
+        {
+            if (layoutRowProperty >= 0)
+            {
+                return String.valueOf(layoutRowProperty);
+            }
+        }
+        else if (key.equals(COLUMN_PROPERTY_NAME))
+        {
+            if (layoutColumnProperty >= 0)
+            {
+                return String.valueOf(layoutColumnProperty);
+            }
+        }
+        else if (key.equals(SIZES_PROPERTY_NAME))
+        {
+            return layoutSizesProperty;
+        }
+        else if (key.equals(extendedPropertyName1))
+        {
+            return extendedPropertyValue1;
+        }
+        else if (key.equals(extendedPropertyName2))
+        {
+            return extendedPropertyValue2;
+        }
+        return null;
+    }
+
+    /**
+     * setPropertyMember
+     *
+     * Set explicit property member.
+     *
+     * @param key property name
+     * @param value property setting
+     */
+    void setPropertyMember(String key, String value)
+    {
+        // set fragment explicit property member
+        if (key.equals(ROW_PROPERTY_NAME))
+        {
+            layoutRowProperty = Integer.parseInt(value);
+        }
+        else if (key.equals(COLUMN_PROPERTY_NAME))
+        {
+            layoutColumnProperty = Integer.parseInt(value);
+        }
+        else if (key.equals(SIZES_PROPERTY_NAME))
+        {
+            layoutSizesProperty = value;
+        }
+        else if (key.equals(extendedPropertyName1))
+        {
+            extendedPropertyValue1 = value;
+        }
+        else if (key.equals(extendedPropertyName2))
+        {
+            extendedPropertyValue2 = value;
+        }
+        else if (extendedPropertyName1 == null)
+        {
+            extendedPropertyName1 = key;
+            extendedPropertyValue1 = value;
+        }
+        else if (extendedPropertyName2 == null)
+        {
+            extendedPropertyName2 = key;
+            extendedPropertyValue2 = value;
+        }
+        else
+        {
+            throw new RuntimeException("Unable to set fragment property " + key + ", extended properties already used.");
+        }
+    }
+
+    /**
+     * clearPropertyMember
+     *
+     * Clear explicit property member.
+     *
+     * @param key property name
+     */
+    void clearPropertyMember(String key)
+    {
+        if (key.equals(ROW_PROPERTY_NAME))
+        {
+            layoutRowProperty = -1;
+        }
+        else if (key.equals(COLUMN_PROPERTY_NAME))
+        {
+            layoutColumnProperty = -1;
+        }
+        else if (key.equals(SIZES_PROPERTY_NAME))
+        {
+            layoutSizesProperty = null;
+        }
+        else if (key.equals(extendedPropertyName1))
+        {
+            extendedPropertyName1 = null;
+            extendedPropertyValue1 = null;
+        }
+        else if (key.equals(extendedPropertyName2))
+        {
+            extendedPropertyName2 = null;
+            extendedPropertyValue2 = null;
+        }
+    }
+
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.impl.BaseElementImpl#getEffectivePageSecurity()
      */
@@ -335,13 +525,9 @@
         // access rights to all fragments; otherwise, a copy of
         // the list will be returned and any modifications to the
         // set of fragments in the collection will not be preserved
-        if (fragments == null)
-        {
-            fragments = new ArrayList(4);
-        }
         if (fragmentsList == null)
         {
-            fragmentsList = new FragmentList(this, fragments);
+            fragmentsList = new FragmentList(this);
         }
         return filterFragmentsByAccess(fragmentsList);
     }
@@ -351,11 +537,7 @@
      */
     public String getProperty(String propName)
     {
-        if (properties != null)
-        {
-            return (String)properties.get(propName);
-        }
-        return null;
+        return (String)getProperties().get(propName);
     }
     
     /* (non-Javadoc)
@@ -363,13 +545,10 @@
      */
     public int getIntProperty(String propName)
     {
-        if (properties != null)
+        String propValue = (String)getProperties().get(propName);
+        if (propValue != null)
         {
-            String propValue = (String)properties.get(propName);
-            if (propValue != null)
-            {
-                return Integer.parseInt(propValue);
-    }
+            return Integer.parseInt(propValue);
         }
         return -1;
     }
@@ -380,11 +559,11 @@
     public Map getProperties()
     {
         // initialize and return writable properties map
-        if (properties == null)
+        if (propertiesMap == null)
         {
-            properties = new HashMap(4);
-    }
-        return properties;
+            propertiesMap = new FragmentPropertyMap(this);
+        }
+        return propertiesMap;
     }
     
     /* (non-Javadoc)
@@ -395,7 +574,7 @@
         // get standard int property
         return getIntProperty(ROW_PROPERTY_NAME);
     }
-
+    
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#setLayoutRow(int)
      */
@@ -405,13 +584,13 @@
         if (row >= 0)
         {
             getProperties().put(ROW_PROPERTY_NAME, String.valueOf(row));
-    }
-        else if (properties != null)
+        }
+        else
         {
-            properties.remove(ROW_PROPERTY_NAME);
+            getProperties().remove(ROW_PROPERTY_NAME);
         }
     }
-
+    
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getLayoutColumn()
      */
@@ -420,7 +599,7 @@
         // get standard int property
         return getIntProperty(COLUMN_PROPERTY_NAME);
     }
-
+    
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#setLayoutColumn(int)
      */
@@ -431,9 +610,9 @@
         {
             getProperties().put(COLUMN_PROPERTY_NAME, String.valueOf(column));
         }
-        else if (properties != null)
+        else
         {
-            properties.remove(COLUMN_PROPERTY_NAME);
+            getProperties().remove(COLUMN_PROPERTY_NAME);
         }
     }
 
@@ -456,9 +635,9 @@
         {
             getProperties().put(SIZES_PROPERTY_NAME, sizes);
         }
-        else if (properties != null)
+        else
         {
-            properties.remove(SIZES_PROPERTY_NAME);
+            getProperties().remove(SIZES_PROPERTY_NAME);
         }
     }
     
@@ -483,93 +662,36 @@
      */
     public List getPreferences()
     {
-        return null; // NYI
+        // return mutable preferences list
+        // by using list wrapper to manage
+        // element uniqueness
+        if (fragmentPreferences == null)
+        {
+            fragmentPreferences = new FragmentPreferenceList(this);
+        }
+        return fragmentPreferences;
     }
     
     /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeUpdate(org.apache.ojb.broker.PersistenceBroker)
+     * @see org.apache.jetspeed.om.page.Fragment#setPreferences(java.util.List)
      */
-    public void beforeUpdate(PersistenceBroker broker) throws PersistenceBrokerException
+    public void setPreferences(List preferences)
     {
-        // propagate to super
-        super.beforeUpdate(broker);
-
-        // update concrete fields with properties
-        layoutRowProperty = -1;
-        layoutColumnProperty = -1;
-        layoutSizesProperty = null;
-        extendedPropertyName1 = null;
-        extendedPropertyValue1 = null;
-        extendedPropertyName2 = null;
-        extendedPropertyValue2 = null;
-        if ((properties != null) && !properties.isEmpty())
+        // set preferences by replacing existing
+        // entries with new elements if new collection
+        // is specified
+        List fragmentPreferences = getPreferences();
+        if (preferences != fragmentPreferences)
         {
-            Iterator propsIter = properties.entrySet().iterator();
-            while (propsIter.hasNext())
+            // replace all preferences
+            fragmentPreferences.clear();
+            if (preferences != null)
             {
-                Map.Entry prop = (Map.Entry)propsIter.next();
-                String propName = (String)prop.getKey();
-                String propValue = (String)prop.getValue();
-                if (propValue != null)
-                {
-                    if (propName.equals(ROW_PROPERTY_NAME))
-                    {
-                        layoutRowProperty = Integer.parseInt(propValue);
-                    }
-                    else if (propName.equals(COLUMN_PROPERTY_NAME))
-                    {
-                        layoutColumnProperty = Integer.parseInt(propValue);
-                    }
-                    else if (propName.equals(SIZES_PROPERTY_NAME))
-                    {
-                        layoutSizesProperty = propValue;
-                    }
-                    else if (extendedPropertyName1 == null)
-                    {
-                        extendedPropertyName1 = propName;
-                        extendedPropertyValue1 = propValue;
-                    }
-                    else if (extendedPropertyName2 == null)
-                    {
-                        extendedPropertyName2 = propName;
-                        extendedPropertyValue2 = propValue;
-                    }
-                }
+                fragmentPreferences.addAll(preferences);
             }
         }
     }
-
-    /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterLookup(org.apache.ojb.broker.PersistenceBroker)
-     */
-    public void afterLookup(PersistenceBroker broker) throws PersistenceBrokerException
-    {
-        // propagate to super
-        super.afterLookup(broker);
-
-        // load properties from concrete fields
-        if (layoutRowProperty >= 0)
-        {
-            getProperties().put(ROW_PROPERTY_NAME, String.valueOf(layoutRowProperty));
-        }
-        if (layoutColumnProperty >= 0)
-        {
-            getProperties().put(COLUMN_PROPERTY_NAME, String.valueOf(layoutColumnProperty));
-        }
-        if (layoutSizesProperty != null)
-        {
-            getProperties().put(SIZES_PROPERTY_NAME, layoutSizesProperty);
-        }
-        if ((extendedPropertyName1 != null) && (extendedPropertyValue1 != null))
-        {
-            getProperties().put(extendedPropertyName1, extendedPropertyValue1);
-        }
-        if ((extendedPropertyName2 != null) && (extendedPropertyValue2 != null))
-        {
-            getProperties().put(extendedPropertyName2, extendedPropertyValue2);
-        }
-    }
-
+    
     /**
      * filterFragmentsByAccess
      *

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentList.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentList.java?rev=350066&r1=350065&r2=350066&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentList.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentList.java Wed Nov 30 14:53:22 2005
@@ -15,10 +15,8 @@
  */
 package org.apache.jetspeed.om.page.impl;
 
-import java.util.Collection;
-import java.util.Iterator;
+import java.util.AbstractList;
 import java.util.List;
-import java.util.ListIterator;
 
 /**
  * FragmentList
@@ -26,50 +24,24 @@
  * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
  * @version $Id$
  */
-public class FragmentList implements List
+class FragmentList extends AbstractList
 {
     private FragmentImpl fragment;
-    private List fragments;
 
-    FragmentList(FragmentImpl fragment, List fragments)
+    FragmentList(FragmentImpl fragment)
     {
+        super();
         this.fragment = fragment;
-        this.fragments = fragments;
     }
 
-    /**
-     * getFragment
-     *
-     * Returns fragment implementation associated with this list.
-     *
-     * @return fragment implementation
-     */
-    FragmentImpl getFragment()
-    {
-        return fragment;
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#add(java.lang.Object)
-     */
-    public boolean add(Object o)
-    {
-        // add and maintain page implementation reference
-        boolean added = fragments.add(o);
-        if (added && (fragment.getPage() != null) && (o instanceof FragmentImpl))
-        {
-            ((FragmentImpl)o).setPage(fragment.getPage());
-        }
-        return added;
-    }
-    
     /* (non-Javadoc)
      * @see java.util.List#add(int,java.lang.Object)
      */
     public void add(int index, Object element)
     {
+        // implement for modifiable AbstractList:
         // add and maintain page implementation reference
-        fragments.add(index, element);
+        fragment.accessFragments().add(index, element);
         if ((fragment.getPage() != null) && (element instanceof FragmentImpl))
         {
             ((FragmentImpl)element).setPage(fragment.getPage());
@@ -77,229 +49,12 @@
     }
 
     /* (non-Javadoc)
-     * @see java.util.List#add(java.util.Collection)
-     */
-    public boolean addAll(Collection c)
-    {
-        // add and maintain page implementation reference
-        boolean added = fragments.addAll(c);
-        if (added && (fragment.getPage() != null))
-        {
-            Iterator addedIter = c.iterator();
-            while (addedIter.hasNext())
-            {
-                Object o = addedIter.next();
-                if (fragments.contains(o) && (o instanceof FragmentImpl))
-                {
-                    ((FragmentImpl)o).setPage(fragment.getPage());
-                }
-            }
-        }
-        return added;
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#add(int,java.util.Collection)
-     */
-    public boolean addAll(int index, Collection c)
-    {
-        // add and maintain page implementation reference
-        boolean added = fragments.addAll(index, c);
-        if (added && (fragment.getPage() != null))
-        {
-            Iterator addedIter = c.iterator();
-            while (addedIter.hasNext())
-            {
-                Object o = addedIter.next();
-                if (fragments.contains(o) && (o instanceof FragmentImpl))
-                {
-                    ((FragmentImpl)o).setPage(fragment.getPage());
-                }
-            }
-        }
-        return added;
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#clear()
-     */
-    public void clear()
-    {
-        fragments.clear();
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#contains(java.lang.Object)
-     */
-    public boolean contains(Object o)
-    {
-        return fragments.contains(o);
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.ListcontainsAll#(java.util.Collection)
-     */
-    public boolean containsAll(Collection c)
-    {
-        return fragments.containsAll(c);
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#equals(java.lang.Object)
-     */
-    public boolean equals(Object o)
-    {
-        return fragments.equals(o);
-    }
-
-    /* (non-Javadoc)
      * @see java.util.List#get(int)
      */
     public Object get(int index)
     {
-        return fragments.get(index);
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#hashCode()
-     */
-    public int hashCode()
-    {
-        return fragments.hashCode();
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#indexOf(java.lang.Object)
-     */
-    public int indexOf(Object o)
-    {
-        return fragments.indexOf(o);
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#isEmpty()
-     */
-    public boolean isEmpty()
-    {
-        return fragments.isEmpty();
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#iterator()
-     */
-    public Iterator iterator()
-    {
-        return fragments.iterator();
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#lastIndexOf(java.lang.Object)
-     */
-    public int lastIndexOf(Object o)
-    {
-        return fragments.lastIndexOf(o);
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#listIterator()
-     */
-    public ListIterator listIterator()
-    {
-        return listIterator(0);
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#listIterator(int)
-     */
-    public ListIterator listIterator(final int index)
-    {
-        // return new iterator
-        return new ListIterator()
-            {
-                ListIterator iter = FragmentList.this.fragments.listIterator(index);
-
-                /* (non-Javadoc)
-                 * @see java.util.ListIterator#add(java.lang.Object)
-                 */
-                public void add(Object o)
-                {
-                    // add and maintain page implementation reference
-                    iter.add(o);
-                    if ((FragmentList.this.fragment.getPage() != null) && (o instanceof FragmentImpl))
-                    {
-                        ((FragmentImpl)o).setPage(FragmentList.this.fragment.getPage());
-                    }
-                }
-
-                /* (non-Javadoc)
-                 * @see java.util.ListIterator#hasNext()
-                 */
-                public boolean hasNext()
-                {
-                    return iter.hasNext();
-                }
-
-                /* (non-Javadoc)
-                 * @see java.util.ListIterator#hasPrevious()
-                 */
-                public boolean hasPrevious()
-                {
-                    return iter.hasPrevious();                    
-                }
-
-                /* (non-Javadoc)
-                 * @see java.util.ListIterator#next()
-                 */
-                public Object next()
-                {
-                    return iter.next();
-                }
-
-                /* (non-Javadoc)
-                 * @see java.util.ListIterator#nextIndex()
-                 */
-                public int nextIndex()
-                {
-                    return iter.nextIndex();
-                }
-
-                /* (non-Javadoc)
-                 * @see java.util.ListIterator#previous()
-                 */
-                public Object previous()
-                {
-                    return iter.previous();
-                }
-
-                /* (non-Javadoc)
-                 * @see java.util.ListIterator#previousIndex()
-                 */
-                public int previousIndex()
-                {
-                    return iter.previousIndex();
-                }
-
-                /* (non-Javadoc)
-                 * @see java.util.ListIterator#remove()
-                 */
-                public void remove()
-                {
-                    iter.remove();
-                }
-
-                /* (non-Javadoc)
-                 * @see java.util.ListIterator#set(java.lang.Object)
-                 */
-                public void set(Object o)
-                {
-                    // set and maintain page implementation reference
-                    iter.set(o);
-                    if ((FragmentList.this.fragment.getPage() != null) && (o instanceof FragmentImpl))
-                    {
-                        ((FragmentImpl)o).setPage(FragmentList.this.fragment.getPage());
-                    }
-                }
-            };
+        // implement for modifiable AbstractList
+        return fragment.accessFragments().get(index);
     }
 
     /* (non-Javadoc)
@@ -307,31 +62,8 @@
      */
     public Object remove(int index)
     {
-        return fragments.remove(index);
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#remove(java.lang.Object)
-     */
-    public boolean remove(Object o)
-    {
-        return fragments.remove(o);
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#removeAll(java.util.Collection)
-     */
-    public boolean removeAll(Collection c)
-    {
-        return fragments.removeAll(c);
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#retainAll(java.util.Collection)
-     */
-    public boolean retainAll(Collection c)
-    {
-        return fragments.retainAll(c);
+        // implement for modifiable AbstractList
+        return fragment.accessFragments().remove(index);
     }
 
     /* (non-Javadoc)
@@ -339,8 +71,9 @@
      */
     public Object set(int index, Object element)
     {
+        // implement for modifiable AbstractList:
         // set and maintain page implementation reference
-        Object o = fragments.set(index, element);
+        Object o = fragment.accessFragments().set(index, element);
         if ((fragment.getPage() != null) && (element instanceof FragmentImpl))
         {
             ((FragmentImpl)element).setPage(fragment.getPage());
@@ -353,30 +86,7 @@
      */
     public int size()
     {
-        return fragments.size();
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#subList(int, int)
-     */
-    public List subList(int fromIndex, int toIndex)
-    {
-        return fragments.subList(fromIndex, toIndex);
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#toArray()
-     */
-    public Object[] toArray()
-    {
-        return fragments.toArray();
-    }
-
-    /* (non-Javadoc)
-     * @see java.util.List#toArray(java.lang.Object[])
-     */
-    public Object[] toArray(Object[] a) 
-    {
-        return fragments.toArray(a);
+        // implement for modifiable AbstractList
+        return fragment.accessFragments().size();
     }
 }

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceImpl.java?rev=350066&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceImpl.java Wed Nov 30 14:53:22 2005
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.page.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.jetspeed.om.preference.FragmentPreference;
+
+/**
+ * FragmentPreference
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class FragmentPreferenceImpl implements FragmentPreference
+{
+    private int id;
+    private String name;
+    private boolean readOnly;
+    private List values;
+
+    private FragmentPreferenceValueList preferenceValues;
+
+    /**
+     * accessValues
+     *
+     * Access mutable persistent collection member for List wrappers.
+     *
+     * @return persistent collection
+     */
+    List accessValues()
+    {
+        // create initial collection if necessary
+        if (values == null)
+        {
+            values = new ArrayList(4);
+        }
+        return values;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.preference.FragmentPreference#getName()
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.preference.FragmentPreference#setName(java.lang.String)
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.preference.FragmentPreference#isReadOnly()
+     */
+    public boolean isReadOnly()
+    {
+        return readOnly;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.preference.FragmentPreference#setReadOnly(boolean)
+     */
+    public void setReadOnly(boolean readOnly)
+    {
+        this.readOnly = readOnly;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.preference.FragmentPreference#getValueList()
+     */
+    public List getValueList()
+    {
+        // return mutable preference value list
+        // using list wrapper to manage value order
+        if (preferenceValues == null)
+        {
+            preferenceValues = new FragmentPreferenceValueList(this);
+        }
+        return preferenceValues;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.preference.FragmentPreference#setValueList(java.util.List)
+     */
+    public void setValueList(List values)
+    {
+        // set preference values by replacing existing
+        // entries with new elements if new collection
+        // is specified
+        List preferenceValues = getValueList();
+        if (values != preferenceValues)
+        {
+            // replace all values
+            preferenceValues.clear();
+            if (values != null)
+            {
+                preferenceValues.addAll(values);
+            }
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals(Object o)
+    {
+        if (o instanceof FragmentPreferenceImpl)
+        {
+            if (name != null)
+            {
+                return name.equals(((FragmentPreferenceImpl)o).getName());
+            }
+            return (((FragmentPreferenceImpl)o).getName() == null);
+        }
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        if (name != null)
+        {
+            return name.hashCode();
+        }
+        return 0;
+    }
+}



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