portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r331191 [1/2] - in /portals/jetspeed-2/trunk: 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/impl/ components/page-mana...
Date Mon, 07 Nov 2005 03:55:35 GMT
Author: rwatler
Date: Sun Nov  6 19:55:13 2005
New Revision: 331191

URL: http://svn.apache.org/viewcvs?rev=331191&view=rev
Log:
- SecurityConstraints persistence support for Folder/Page PSML elements in DB PageManager
- Implement PageSecurity singleton document support in DB PageManager
- Extend DB PageManager test case
- Add reset() API to PageManager to force subsequent refresh from persistent store
- Add String[] setters for SecurityConstraint API for users, roles, groups, and permissions

Note that security constraints/permissions checking is not yet implemented in the DB PageManager with this commit.
 

Added:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraint.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsRef.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintImpl.java
      - copied, changed from r330607, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintsDefImpl.java
      - copied, changed from r330607, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsDefImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraint.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraintsRef.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraint.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsRef.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraint.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsRef.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityGlobalSecurityConstraintsRef.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecuritySecurityConstraintsDef.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java   (with props)
Removed:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsDefImpl.java
Modified:
    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/page/impl/BaseElementImpl.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/PageImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.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/om/page/psml/SecurityConstraintsImpl.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/DelegatingPageManager.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/TestDatabasePageManager.java
    portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml
    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/page/PageManager.java

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=331191&r1=331190&r2=331191&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 Sun Nov  6 19:55:13 2005
@@ -401,7 +401,7 @@
     </field>
 
     <field name="securityConstraints"
-           type="org.apache.jetspeed.om.page.psml.SecurityConstraintImpl"
+           type="org.apache.jetspeed.om.page.SecurityConstraintImpl"
            collection="collection">
       <bind-xml name="security-constraint"/>
     </field>
@@ -413,7 +413,7 @@
     </field>
   </class>
 
-  <class name="org.apache.jetspeed.om.page.psml.SecurityConstraintImpl">
+  <class name="org.apache.jetspeed.om.page.SecurityConstraintImpl">
     <map-to xml="security-constraint"/>
 
     <field name="users" type="java.lang.String">
@@ -437,7 +437,7 @@
     <map-to xml="page-security"/>
 
     <field name="securityConstraintsDefs"
-           type="org.apache.jetspeed.om.page.psml.SecurityConstraintsDefImpl"
+           type="org.apache.jetspeed.om.page.SecurityConstraintsDefImpl"
            collection="collection">
       <bind-xml name="security-constraints-def"/>
     </field>
@@ -449,7 +449,7 @@
     </field>
   </class>
 
-  <class name="org.apache.jetspeed.om.page.psml.SecurityConstraintsDefImpl">
+  <class name="org.apache.jetspeed.om.page.SecurityConstraintsDefImpl">
     <map-to xml="security-constraints-def"/>
 
     <field name="name" type="java.lang.String">
@@ -457,7 +457,7 @@
     </field>
 
     <field name="securityConstraints"
-           type="org.apache.jetspeed.om.page.psml.SecurityConstraintImpl"
+           type="org.apache.jetspeed.om.page.SecurityConstraintImpl"
            collection="collection">
       <bind-xml name="security-constraint"/>
     </field>

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=331191&r1=331190&r2=331191&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 Sun Nov  6 19:55:13 2005
@@ -56,6 +56,7 @@
           auto-update="object"
           proxy="true"
       >
+         <orderby name="name" sort="ASC"/>
          <inverse-foreignkey field-ref="parentId"/>
       </collection-descriptor>
 
@@ -67,6 +68,18 @@
           auto-update="object"
           proxy="true"
       >
+         <orderby name="name" sort="ASC"/>
+         <inverse-foreignkey field-ref="parentId"/>
+      </collection-descriptor>
+
+      <collection-descriptor
+          name="pageSecurity"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecurityImpl"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
          <inverse-foreignkey field-ref="parentId"/>
       </collection-descriptor>
 
@@ -165,6 +178,34 @@
          column="EXT_ATTR_VALUE"
          jdbc-type="VARCHAR"
       />
+
+      <field-descriptor
+         name="constraints::owner"
+         column="OWNER_PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <collection-descriptor
+          name="constraints::constraints"
+          element-class-ref="org.apache.jetspeed.om.folder.impl.FolderSecurityConstraint"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+      >
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="folderId"/>
+      </collection-descriptor>
+
+      <collection-descriptor
+          name="constraints::constraintsRefs"
+          element-class-ref="org.apache.jetspeed.om.folder.impl.FolderSecurityConstraintsRef"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+      >
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="folderId"/>
+      </collection-descriptor>
    </class-descriptor>
 
    <class-descriptor
@@ -206,6 +247,92 @@
       />
    </class-descriptor>
 
+   <class-descriptor
+      class="org.apache.jetspeed.om.folder.impl.FolderSecurityConstraint"
+      table="FOLDER_SECURITY_CONSTRAINT"
+   >
+      <field-descriptor
+         name="id"
+         column="CONSTRAINT_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="folderId"
+        column="FOLDER_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="applyOrder"
+         column="APPLY_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="userPrincipals"
+         column="USER_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="rolePrincipals"
+         column="ROLE_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="groupPrincipals"
+         column="GROUP_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="permissions"
+         column="PERMISSIONS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.folder.impl.FolderSecurityConstraintsRef"
+      table="FOLDER_SECURITY_CONSTRAINTS_REF"
+   >
+      <field-descriptor
+         name="id"
+         column="CONSTRAINTS_REF_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="folderId"
+        column="FOLDER_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="applyOrder"
+         column="APPLY_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+   </class-descriptor>
+
    <!-- Page mapping -->
 
    <class-descriptor
@@ -239,7 +366,7 @@
       </reference-descriptor>
 
       <collection-descriptor
-          name="fragments"
+          name="fragment"
           element-class-ref="org.apache.jetspeed.om.page.impl.FragmentImpl"
           auto-retrieve="true"
           auto-delete="object"
@@ -356,6 +483,34 @@
          column="EXT_ATTR_VALUE"
          jdbc-type="VARCHAR"
       />
+
+      <field-descriptor
+         name="constraints::owner"
+         column="OWNER_PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <collection-descriptor
+          name="constraints::constraints"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecurityConstraint"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+      >
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="pageId"/>
+      </collection-descriptor>
+
+      <collection-descriptor
+          name="constraints::constraintsRefs"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecurityConstraintsRef"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+      >
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="pageId"/>
+      </collection-descriptor>
    </class-descriptor>
 
    <class-descriptor
@@ -397,6 +552,92 @@
       />
    </class-descriptor>
 
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageSecurityConstraint"
+      table="PAGE_SECURITY_CONSTRAINT"
+   >
+      <field-descriptor
+         name="id"
+         column="CONSTRAINT_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="pageId"
+        column="PAGE_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="applyOrder"
+         column="APPLY_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="userPrincipals"
+         column="USER_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="rolePrincipals"
+         column="ROLE_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="groupPrincipals"
+         column="GROUP_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="permissions"
+         column="PERMISSIONS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageSecurityConstraintsRef"
+      table="PAGE_SECURITY_CONSTRAINTS_REF"
+   >
+      <field-descriptor
+         name="id"
+         column="CONSTRAINTS_REF_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="pageId"
+        column="PAGE_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="applyOrder"
+         column="APPLY_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+   </class-descriptor>
+
    <!-- Fragment mapping -->
 
    <class-descriptor
@@ -426,6 +667,7 @@
           auto-update="object"
           proxy="true"
       >
+         <orderby name="id" sort="ASC"/>
          <inverse-foreignkey field-ref="parentId"/>
       </collection-descriptor>
 
@@ -517,6 +759,328 @@
       <field-descriptor
          name="extendedPropertyValue2"
          column="EXT_PROP_VALUE_2"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="constraints::owner"
+         column="OWNER_PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <collection-descriptor
+          name="constraints::constraints"
+          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentSecurityConstraint"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+      >
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="fragmentId"/>
+      </collection-descriptor>
+
+      <collection-descriptor
+          name="constraints::constraintsRefs"
+          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentSecurityConstraintsRef"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+      >
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="fragmentId"/>
+      </collection-descriptor>
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.FragmentSecurityConstraint"
+      table="FRAGMENT_SECURITY_CONSTRAINT"
+   >
+      <field-descriptor
+         name="id"
+         column="CONSTRAINT_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="fragmentId"
+        column="FRAGMENT_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="applyOrder"
+         column="APPLY_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="userPrincipals"
+         column="USER_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="rolePrincipals"
+         column="ROLE_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="groupPrincipals"
+         column="GROUP_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="permissions"
+         column="PERMISSIONS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.FragmentSecurityConstraintsRef"
+      table="FRAGMENT_SECURITY_CONSTRAINTS_REF"
+   >
+      <field-descriptor
+         name="id"
+         column="CONSTRAINTS_REF_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="fragmentId"
+        column="FRAGMENT_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="applyOrder"
+         column="APPLY_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+   </class-descriptor>
+
+   <!-- PageSecurity mapping -->
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageSecurityImpl"
+      table="PAGE_SECURITY"
+   >
+      <field-descriptor
+         name="id"
+         column="PAGE_SECURITY_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="parentId"
+        column="PARENT_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <reference-descriptor
+          name="parent"
+          class-ref="org.apache.jetspeed.om.folder.impl.FolderImpl"
+          auto-retrieve="true"
+          auto-delete="none"
+          auto-update="none"
+          proxy="true"
+          >
+         <foreignkey field-ref="parentId"/>
+      </reference-descriptor>
+
+      <field-descriptor
+         name="attributes::path"
+         column="PATH"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="attributes::subsite"
+         column="SUBSITE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="attributes::user"
+         column="USER_PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="attributes::role"
+         column="ROLE_PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="attributes::group"
+         column="GROUP_PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="attributes::mediatype"
+         column="MEDIATYPE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="attributes::locale"
+         column="LOCALE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="attributes::extendedAttributeName"
+         column="EXT_ATTR_NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="attributes::extendedAttributeValue"
+         column="EXT_ATTR_VALUE"
+         jdbc-type="VARCHAR"
+      />
+
+      <collection-descriptor
+          name="constraintsDefs"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecuritySecurityConstraintsDef"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+      >
+         <orderby name="name" sort="ASC"/>
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="pageSecurityId"/>
+      </collection-descriptor>
+
+      <collection-descriptor
+          name="globalConstraintsRefs"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecurityGlobalSecurityConstraintsRef"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+      >
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="pageSecurityId"/>
+      </collection-descriptor>
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageSecuritySecurityConstraintsDef"
+      table="PAGE_SECURITY_SECURITY_CONSTRAINTS_DEF"
+   >
+      <field-descriptor
+         name="id"
+         column="CONSTRAINTS_DEF_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="pageSecurityId"
+        column="PAGE_SECURITY_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="applyOrder"
+         column="APPLY_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="userPrincipals"
+         column="USER_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="rolePrincipals"
+         column="ROLE_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="groupPrincipals"
+         column="GROUP_PRINCIPALS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+
+      <field-descriptor
+         name="permissions"
+         column="PERMISSIONS_ACL"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.CSVtoCollectionFieldConversion"
+      />
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageSecurityGlobalSecurityConstraintsRef"
+      table="PAGE_SECURITY_GLOBAL_SECURITY_CONSTRAINTS_REF"
+   >
+      <field-descriptor
+         name="id"
+         column="CONSTRAINTS_REF_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="pageSecurityId"
+        column="PAGE_SECURITY_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="applyOrder"
+         column="APPLY_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
          jdbc-type="VARCHAR"
       />
    </class-descriptor>

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=331191&r1=331190&r2=331191&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 Sun Nov  6 19:55:13 2005
@@ -16,6 +16,7 @@
 package org.apache.jetspeed.om.folder.impl;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
@@ -26,6 +27,7 @@
 import org.apache.jetspeed.om.page.PageMetadataImpl;
 import org.apache.jetspeed.om.page.PageSecurity;
 import org.apache.jetspeed.om.page.impl.PageImpl;
+import org.apache.jetspeed.om.page.impl.PageSecurityImpl;
 import org.apache.jetspeed.page.PageNotFoundException;
 import org.apache.jetspeed.page.document.DocumentException;
 import org.apache.jetspeed.page.document.DocumentNotFoundException;
@@ -46,11 +48,17 @@
     private String defaultPage;
     private List folders;
     private List pages;
+    private Collection pageSecurity;
 
     private NodeSet allNodeSet;
     private NodeSet foldersNodeSet;
     private NodeSet pagesNodeSet;
 
+    public FolderImpl()
+    {
+        super(new FolderSecurityConstraintsImpl());
+    }
+
     /**
      * addFolder
      *
@@ -133,10 +141,41 @@
         pagesNodeSet = null;
     }
 
+    /**
+     * setPageSecurity
+     *
+     * Sets the page security singleton in the persistent collection and resets cached node sets.
+     *
+     * @param pageSecurity new page security impl
+     */
+    public void setPageSecurity(PageSecurityImpl newPageSecurity)
+    {
+        if (newPageSecurity != null)
+        {
+            // add to page security collection
+            if (pageSecurity == null)
+            {
+                pageSecurity = new ArrayList(1);
+            }
+            pageSecurity.add(newPageSecurity);            
+        }
+        else
+        {
+            // clear page security collection
+            if ((pageSecurity != null) && !pageSecurity.isEmpty())
+            {
+                pageSecurity.clear();
+            }
+        }
+
+        // reset cached node sets
+        allNodeSet = null;
+    }
+    
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.document.impl.NodeImpl#newPageMetadata(java.util.List)
+     * @see org.apache.jetspeed.page.document.impl.NodeImpl#newPageMetadata(java.util.Collection)
      */
-    public PageMetadataImpl newPageMetadata(List fields)
+    public PageMetadataImpl newPageMetadata(Collection fields)
     {
         PageMetadataImpl pageMetadata = new PageMetadataImpl(FolderMetadataLocalizedFieldImpl.class);
         pageMetadata.setFields(fields);
@@ -269,7 +308,12 @@
      */
     public PageSecurity getPageSecurity() throws DocumentNotFoundException, NodeException
     {
-        return null; // NYI
+        // get singleton page security
+        if ((pageSecurity != null) && !pageSecurity.isEmpty())
+        {
+            return (PageSecurity)pageSecurity.iterator().next();
+        }
+        return null;
     }
     
     /* (non-Javadoc)
@@ -287,6 +331,10 @@
             if (pages != null)
             {
                 all.addAll(pages);
+            }
+            if (pageSecurity != null)
+            {
+                all.addAll(pageSecurity);
             }
             if (!all.isEmpty())
             {

Added: 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/FolderSecurityConstraint.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraint.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraint.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,29 @@
+/*
+ * 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 org.apache.jetspeed.om.page.impl.BaseSecurityConstraint;
+
+/**
+ * FolderSecurityConstraint
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class FolderSecurityConstraint extends BaseSecurityConstraint
+{
+    // new class defined only to facilitate OJB table/class mapping
+}

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

Added: 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=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsImpl.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,45 @@
+/*
+ * 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 org.apache.jetspeed.om.page.impl.BaseSecurityConstraint;
+import org.apache.jetspeed.om.page.impl.BaseSecurityConstraintsRef;
+import org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl;
+
+/**
+ * FolderSecurityConstraintsImpl
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class FolderSecurityConstraintsImpl extends SecurityConstraintsImpl
+{
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl#newSecurityConstraint()
+     */
+    public BaseSecurityConstraint newSecurityConstraint()
+    {
+        return new FolderSecurityConstraint();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl#newSecurityConstraintsRef()
+     */
+    public BaseSecurityConstraintsRef newSecurityConstraintsRef()
+    {
+        return new FolderSecurityConstraintsRef();
+    }
+}

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

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsRef.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsRef.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsRef.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderSecurityConstraintsRef.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,29 @@
+/*
+ * 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 org.apache.jetspeed.om.page.impl.BaseSecurityConstraintsRef;
+
+/**
+ * FolderSecurityConstraintsRef
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class FolderSecurityConstraintsRef extends BaseSecurityConstraintsRef
+{
+    // new class defined only to facilitate OJB table/class mapping
+}

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

Copied: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintImpl.java (from r330607, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintImpl.java)
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintImpl.java?p2=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintImpl.java&p1=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintImpl.java&r1=330607&r2=331191&rev=331191&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintImpl.java Sun Nov  6 19:55:13 2005
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jetspeed.om.page.psml;
+package org.apache.jetspeed.om.page;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -91,6 +91,20 @@
 
     /**
      * <p>
+     * setUsers
+     * </p>
+     *
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#setUsers(java.util.List)
+     * @param users
+     */
+    public void setUsers(List users)
+    {
+        this.users = formatCSVList(users);
+        usersList = users;
+    }
+
+    /**
+     * <p>
      * getRoles
      * </p>
      *
@@ -131,6 +145,20 @@
 
     /**
      * <p>
+     * setRoles
+     * </p>
+     *
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#setRoles(java.util.List)
+     * @param roles
+     */
+    public void setRoles(List roles)
+    {
+        this.roles = formatCSVList(roles);
+        rolesList = roles;
+    }
+
+    /**
+     * <p>
      * getGroups
      * </p>
      *
@@ -171,6 +199,20 @@
 
     /**
      * <p>
+     * setGroups
+     * </p>
+     *
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#setGroups(java.util.List)
+     * @param groups
+     */
+    public void setGroups(List groups)
+    {
+        this.groups = formatCSVList(groups);
+        groupsList = groups;
+    }
+
+    /**
+     * <p>
      * getPermissions
      * </p>
      *
@@ -211,6 +253,20 @@
 
     /**
      * <p>
+     * setPermissions
+     * </p>
+     *
+     * @see org.apache.jetspeed.om.common.SecurityConstraint#setPermissions(java.util.List)
+     * @param permissions
+     */
+    public void setPermissions(List permissions)
+    {
+        this.permissions = formatCSVList(permissions);
+        permissionsList = permissions;
+    }
+
+    /**
+     * <p>
      * principalsMatch
      * </p>
      * <p>
@@ -280,6 +336,36 @@
                 csvList.add(csv);
             }
             return csvList;
+        }
+        return null;
+    }
+
+    /**
+     * <p>
+     * formatCSVList
+     * </p>
+     * <p>
+     * Utility to format CSV List values into strings.
+     * </p>
+     *
+     * @param list
+     * @return formatted string value.
+     */
+    public static String formatCSVList(List list)
+    {
+        if ((list != null) && !list.isEmpty())
+        {
+            StringBuffer csv = new StringBuffer();
+            Iterator listIter = list.iterator();
+            while (listIter.hasNext())
+            {
+                if (csv.length() > 0)
+                {
+                    csv.append(",");
+                }
+                csv.append((String)listIter.next());
+            }
+            return csv.toString();
         }
         return null;
     }

Copied: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintsDefImpl.java (from r330607, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsDefImpl.java)
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintsDefImpl.java?p2=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintsDefImpl.java&p1=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsDefImpl.java&r1=330607&r2=331191&rev=331191&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsDefImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/SecurityConstraintsDefImpl.java Sun Nov  6 19:55:13 2005
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jetspeed.om.page.psml;
+package org.apache.jetspeed.om.page;
 
 import java.util.List;
 

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=331191&r1=331190&r2=331191&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 Sun Nov  6 19:55:13 2005
@@ -15,8 +15,11 @@
  */
 package org.apache.jetspeed.om.page.impl;
 
-import org.apache.jetspeed.om.page.BaseElement;
 import org.apache.jetspeed.om.common.SecurityConstraints;
+import org.apache.jetspeed.om.page.BaseElement;
+import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.PersistenceBrokerAware;
+import org.apache.ojb.broker.PersistenceBrokerException;
 
 /**
  * BaseElementImpl
@@ -24,12 +27,18 @@
  * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
  * @version $Id$
  */
-public abstract class BaseElementImpl implements BaseElement
+public abstract class BaseElementImpl implements BaseElement, PersistenceBrokerAware
 {
     private int id;
     private String name;
     private String title;
     private String shortTitle;
+    private SecurityConstraintsImpl constraints;
+
+    protected BaseElementImpl(SecurityConstraintsImpl constraints)
+    {
+        this.constraints = constraints;
+    }
 
     /**
      * getName
@@ -64,7 +73,7 @@
      */
     public SecurityConstraints getSecurityConstraints()
     {
-        return null; // NYI
+        return constraints;
     }
     
     /* (non-Javadoc)
@@ -72,7 +81,13 @@
      */
     public void setSecurityConstraints(SecurityConstraints constraints)
     {
-        // NYI
+        // copy constraints to maintain persistent types
+        if (this.constraints != null)
+        {
+            this.constraints.setOwner(constraints.getOwner());
+            this.constraints.setSecurityConstraints(constraints.getSecurityConstraints());
+            this.constraints.setSecurityConstraintsRefs(constraints.getSecurityConstraintsRefs());
+        }
     }
 
     /* (non-Javadoc)
@@ -145,5 +160,71 @@
     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();
+        }
     }
 }

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraint.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraint.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraint.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraint.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,134 @@
+/*
+ * 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.List;
+
+/**
+ * BaseSecurityConstraint
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class BaseSecurityConstraint
+{
+    private int id;
+    private int applyOrder;
+    private List userPrincipals;
+    private List rolePrincipals;
+    private List groupPrincipals;
+    private List permissions;
+
+    /**
+     * getApplyOrder
+     *
+     * @return apply order for constraints
+     */
+    public int getApplyOrder()
+    {
+        return applyOrder;
+    }
+
+    /**
+     * setApplyOrder
+     *
+     * @param order apply order for constraints
+     */
+    public void setApplyOrder(int order)
+    {
+        applyOrder = order;
+    }
+
+    /**
+     * getUserPrincipals
+     *
+     * @return user principal names list
+     */
+    public List getUserPrincipals()
+    {
+        return userPrincipals;
+    }
+
+    /**
+     * setUserPrincipals
+     *
+     * @param principals user principal names list
+     */
+    public void setUserPrincipals(List principals)
+    {
+        userPrincipals = principals;
+    }
+
+    /**
+     * getRolePrincipals
+     *
+     * @return role principal names list
+     */
+    public List getRolePrincipals()
+    {
+        return rolePrincipals;
+    }
+
+    /**
+     * setRolePrincipals
+     *
+     * @param principals role principal names list
+     */
+    public void setRolePrincipals(List principals)
+    {
+        rolePrincipals = principals;
+    }
+
+    /**
+     * getGroupPrincipals
+     *
+     * @return group principal names list
+     */
+    public List getGroupPrincipals()
+    {
+        return groupPrincipals;
+    }
+
+    /**
+     * setGroupPrincipals
+     *
+     * @param principals group principal names list
+     */
+    public void setGroupPrincipals(List principals)
+    {
+        groupPrincipals = principals;
+    }
+
+    /**
+     * getPermissions
+     *
+     * @return permissions names list
+     */
+    public List getPermissions()
+    {
+        return permissions;
+    }
+
+    /**
+     * setPermissions
+     *
+     * @param permissions permissions names list
+     */
+    public void setPermissions(List permissions)
+    {
+        this.permissions = permissions;
+    }
+}

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

Added: 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=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraintsRef.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseSecurityConstraintsRef.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,71 @@
+/*
+ * 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.List;
+
+/**
+ * BaseSecurityConstraintsRef
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class BaseSecurityConstraintsRef
+{
+    private int id;
+    private int applyOrder;
+    private String name;
+
+    /**
+     * getApplyOrder
+     *
+     * @return apply order for constraints
+     */
+    public int getApplyOrder()
+    {
+        return applyOrder;
+    }
+
+    /**
+     * setApplyOrder
+     *
+     * @param order apply order for constraints
+     */
+    public void setApplyOrder(int order)
+    {
+        applyOrder = order;
+    }
+
+    /**
+     * getName
+     *
+     * @return name of referenced constraint
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * setName
+     *
+     * @param name name of referenced constraint
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+}

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

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=331191&r1=331190&r2=331191&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 Sun Nov  6 19:55:13 2005
@@ -23,7 +23,6 @@
 
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.ojb.broker.PersistenceBroker;
-import org.apache.ojb.broker.PersistenceBrokerAware;
 import org.apache.ojb.broker.PersistenceBrokerException;
 
 /**
@@ -32,7 +31,7 @@
  * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
  * @version $Id$
  */
-public class FragmentImpl extends BaseElementImpl implements Fragment, PersistenceBrokerAware
+public class FragmentImpl extends BaseElementImpl implements Fragment
 {
     private List fragments;
     private String type;
@@ -49,6 +48,11 @@
 
     private Map properties;
 
+    public FragmentImpl()
+    {
+        super(new FragmentSecurityConstraintsImpl());
+    }
+
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getType()
      */
@@ -127,7 +131,7 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.Fragment#getProperty(java.lang.String,java.lang.String)
+     * @see org.apache.jetspeed.om.page.Fragment#getProperty(java.lang.String)
      */
     public String getProperty(String propName)
     {
@@ -139,7 +143,7 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.Fragment#getProperty(java.lang.String,java.lang.String)
+     * @see org.apache.jetspeed.om.page.Fragment#getIntProperty(java.lang.String)
      */
     public int getIntProperty(String propName)
     {
@@ -210,7 +214,7 @@
         if (column >= 0)
         {
             getProperties().put(COLUMN_PROPERTY_NAME, String.valueOf(column));
-    }
+        }
         else if (properties != null)
         {
             properties.remove(COLUMN_PROPERTY_NAME);
@@ -259,21 +263,11 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeInsert(org.apache.ojb.broker.PersistenceBroker)
-     */
-    public void beforeInsert(PersistenceBroker broker) throws PersistenceBrokerException
-    {
-        // execute update hook
-        beforeUpdate(broker);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.ojb.broker.PersistenceBrokerAware#afterInsert(org.apache.ojb.broker.PersistenceBroker)
+     * @see org.apache.jetspeed.om.page.Fragment#getPreferences()
      */
-    public void afterInsert(PersistenceBroker broker) throws PersistenceBrokerException
+    public List getPreferences()
     {
-        // execute update hook
-        afterUpdate(broker);
+        return null; // NYI
     }
     
     /* (non-Javadoc)
@@ -281,6 +275,9 @@
      */
     public void beforeUpdate(PersistenceBroker broker) throws PersistenceBrokerException
     {
+        // propagate to super
+        super.beforeUpdate(broker);
+
         // update concrete fields with properties
         layoutRowProperty = -1;
         layoutColumnProperty = -1;
@@ -302,7 +299,7 @@
                     if (propName.equals(ROW_PROPERTY_NAME))
                     {
                         layoutRowProperty = Integer.parseInt(propValue);
-    }
+                    }
                     else if (propName.equals(COLUMN_PROPERTY_NAME))
                     {
                         layoutColumnProperty = Integer.parseInt(propValue);
@@ -327,41 +324,13 @@
     }
 
     /* (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
-    }
-    
-    public List getPreferences()
-    {
-      // TODO This needs to be implemented in the DB version
-      throw new UnsupportedOperationException("Not Yet Implemented"); // NYI
-    }
-    
-    /* (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
     {
+        // propagate to super
+        super.afterLookup(broker);
+
         // load properties from concrete fields
         if (layoutRowProperty >= 0)
         {

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraint.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraint.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraint.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraint.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,27 @@
+/*
+ * 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;
+
+/**
+ * PageSecurityConstraint
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class FragmentSecurityConstraint extends BaseSecurityConstraint
+{
+    // new class defined only to facilitate OJB table/class mapping
+}

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

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsImpl.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsImpl.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,41 @@
+/*
+ * 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;
+
+/**
+ * FragmentSecurityConstraintsImpl
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class FragmentSecurityConstraintsImpl extends SecurityConstraintsImpl
+{
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl#newSecurityConstraint()
+     */
+    public BaseSecurityConstraint newSecurityConstraint()
+    {
+        return new FragmentSecurityConstraint();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl#newSecurityConstraintsRef()
+     */
+    public BaseSecurityConstraintsRef newSecurityConstraintsRef()
+    {
+        return new FragmentSecurityConstraintsRef();
+    }
+}

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

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsRef.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsRef.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsRef.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentSecurityConstraintsRef.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,27 @@
+/*
+ * 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;
+
+/**
+ * PageSecurityConstraintsRef
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class FragmentSecurityConstraintsRef extends BaseSecurityConstraintsRef
+{
+    // new class defined only to facilitate OJB table/class mapping
+}

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

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageImpl.java?rev=331191&r1=331190&r2=331191&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageImpl.java Sun Nov  6 19:55:13 2005
@@ -16,6 +16,7 @@
 package org.apache.jetspeed.om.page.impl;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Stack;
@@ -33,15 +34,20 @@
  */
 public class PageImpl extends NodeImpl implements Page
 {
-    private List fragments;
+    private Collection fragment;
     private String skin;
     private String defaultLayoutDecorator;
     private String defaultPortletDecorator;
 
+    public PageImpl()
+    {
+        super(new PageSecurityConstraintsImpl());
+    }
+
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.document.impl.NodeImpl#newPageMetadata(java.util.List)
+     * @see org.apache.jetspeed.page.document.impl.NodeImpl#newPageMetadata(java.util.Collection)
      */
-    public PageMetadataImpl newPageMetadata(List fields)
+    public PageMetadataImpl newPageMetadata(Collection fields)
     {
         PageMetadataImpl pageMetadata = new PageMetadataImpl(PageMetadataLocalizedFieldImpl.class);
         pageMetadata.setFields(fields);
@@ -109,9 +115,9 @@
     public Fragment getRootFragment()
     {
         // get singleton fragment
-        if ((fragments != null) && !fragments.isEmpty())
+        if ((fragment != null) && !fragment.isEmpty())
         {
-            return (Fragment)fragments.get(0);
+            return (Fragment)fragment.iterator().next();
         }
         return null;
     }
@@ -122,24 +128,19 @@
     public void setRootFragment(Fragment fragment)
     {
         // delete existing fragments if required
-        if ((fragments != null) && !fragments.isEmpty())
+        if ((this.fragment != null) && !this.fragment.isEmpty())
         {
-            Iterator removeIter = fragments.iterator();
-            while (removeIter.hasNext())
-            {
-                removeIter.next();
-                removeIter.remove();
-            }
+            this.fragment.clear();
         }
 
         // add new singleton fragment
         if (fragment != null)
         {
-            if (fragments == null)
+            if (this.fragment == null)
             {
-                fragments = new ArrayList(1);
+                this.fragment = new ArrayList(1);
             }
-            fragments.add(fragment);
+            this.fragment.add(fragment);
         }
     }
 

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraint.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraint.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraint.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraint.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,27 @@
+/*
+ * 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;
+
+/**
+ * PageSecurityConstraint
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class PageSecurityConstraint extends BaseSecurityConstraint
+{
+    // new class defined only to facilitate OJB table/class mapping
+}

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

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsImpl.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsImpl.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,41 @@
+/*
+ * 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;
+
+/**
+ * PageSecurityConstraintsImpl
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class PageSecurityConstraintsImpl extends SecurityConstraintsImpl
+{
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl#newSecurityConstraint()
+     */
+    public BaseSecurityConstraint newSecurityConstraint()
+    {
+        return new PageSecurityConstraint();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl#newSecurityConstraintsRef()
+     */
+    public BaseSecurityConstraintsRef newSecurityConstraintsRef()
+    {
+        return new PageSecurityConstraintsRef();
+    }
+}

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

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsRef.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsRef.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsRef.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsRef.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,27 @@
+/*
+ * 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;
+
+/**
+ * PageSecurityConstraintsRef
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class PageSecurityConstraintsRef extends BaseSecurityConstraintsRef
+{
+    // new class defined only to facilitate OJB table/class mapping
+}

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

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityGlobalSecurityConstraintsRef.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityGlobalSecurityConstraintsRef.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityGlobalSecurityConstraintsRef.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityGlobalSecurityConstraintsRef.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,27 @@
+/*
+ * 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;
+
+/**
+ * PageSecurityConstraintsRef
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class PageSecurityGlobalSecurityConstraintsRef extends BaseSecurityConstraintsRef
+{
+    // new class defined only to facilitate OJB table/class mapping
+}

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

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityImpl.java?rev=331191&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityImpl.java Sun Nov  6 19:55:13 2005
@@ -0,0 +1,319 @@
+/*
+ * 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.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jetspeed.om.common.SecurityConstraint;
+import org.apache.jetspeed.om.page.PageSecurity;
+import org.apache.jetspeed.om.page.SecurityConstraintImpl;
+import org.apache.jetspeed.om.page.SecurityConstraintsDef;
+import org.apache.jetspeed.om.page.SecurityConstraintsDefImpl;
+import org.apache.jetspeed.page.document.impl.NodeImpl;
+import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.PersistenceBrokerException;
+
+/**
+ * PageSecurityImpl
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class PageSecurityImpl extends NodeImpl implements PageSecurity
+{
+    private List constraintsDefs;
+    private List globalConstraintsRefs;
+
+    private List securityConstraintsDefs;
+    private Map securityConstraintsDefsMap;
+    private List globalSecurityConstraintsRefs;
+
+    public PageSecurityImpl()
+    {
+        super(null);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.PageSecurity#getSecurityConstraintsDefs()
+     */
+    public List getSecurityConstraintsDefs()
+    {
+        return securityConstraintsDefs;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.PageSecurity#setSecurityConstraintsDefs(java.util.List)
+     */
+    public void setSecurityConstraintsDefs(List definitions)
+    {
+        securityConstraintsDefs = definitions;
+        securityConstraintsDefsMap = null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.PageSecurity#getSecurityConstraintsDef(java.lang.String)
+     */
+    public SecurityConstraintsDef getSecurityConstraintsDef(String name)
+    {
+        if ((securityConstraintsDefs != null) && (securityConstraintsDefsMap == null))
+        {
+            securityConstraintsDefsMap = new HashMap((securityConstraintsDefs.size() * 2) + 1);
+            Iterator definitionsIter = securityConstraintsDefs.iterator();
+            while (definitionsIter.hasNext())
+            {
+                SecurityConstraintsDef definition = (SecurityConstraintsDef)definitionsIter.next();
+                String definitionName = definition.getName();
+                if (!securityConstraintsDefsMap.containsKey(definitionName))
+                {
+                    securityConstraintsDefsMap.put(definitionName, definition);
+                }
+            }
+        }
+        if (securityConstraintsDefsMap != null)
+        {
+            return (SecurityConstraintsDef) securityConstraintsDefsMap.get(name);
+        }
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.PageSecurity#getGlobalSecurityConstraintsRefs()
+     */
+    public List getGlobalSecurityConstraintsRefs()
+    {
+        return globalSecurityConstraintsRefs;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.PageSecurity#setGlobalSecurityConstraintsRefs(java.util.List)
+     */
+    public void setGlobalSecurityConstraintsRefs(List constraintsRefs)
+    {
+        globalSecurityConstraintsRefs = constraintsRefs;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.document.Node#getType()
+     */
+    public String getType()
+    {
+        return DOCUMENT_TYPE;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeUpdate(org.apache.ojb.broker.PersistenceBroker)
+     */
+    public void beforeUpdate(PersistenceBroker broker) throws PersistenceBrokerException
+    {
+        // propagate to super
+        super.beforeUpdate(broker);
+
+        // synchronize persistent constraints definitions
+        if ((securityConstraintsDefs != null) && !securityConstraintsDefs.isEmpty())
+        {
+            // get sorted list of definition names and required
+            // size of constraints definitions collection
+            List securityConstraintsDefNames = new ArrayList(securityConstraintsDefs.size());
+            int securityConstraintsDefsSize = 0;
+            Iterator definitionsIter = securityConstraintsDefs.iterator();
+            while (definitionsIter.hasNext())
+            {
+                SecurityConstraintsDef securityConstraintsDef = (SecurityConstraintsDef)definitionsIter.next();
+                String securityConstraintsDefName = securityConstraintsDef.getName();
+                if ((securityConstraintsDef.getSecurityConstraints() != null) &&
+                    (securityConstraintsDefName != null) &&
+                    !securityConstraintsDefNames.contains(securityConstraintsDefName))
+                {
+                    securityConstraintsDefsSize += securityConstraintsDef.getSecurityConstraints().size();
+                    securityConstraintsDefNames.add(securityConstraintsDefName);
+                }
+            }
+            Collections.sort(securityConstraintsDefNames);
+            // update constraints definitions collection size
+            if (constraintsDefs == null)
+            {
+                constraintsDefs = new ArrayList(securityConstraintsDefsSize);
+            }
+            while (constraintsDefs.size() < securityConstraintsDefsSize)
+            {
+                constraintsDefs.add(new PageSecuritySecurityConstraintsDef());
+            }
+            while (constraintsDefs.size() > securityConstraintsDefsSize)
+            {
+                constraintsDefs.remove(constraintsDefs.size()-1);
+            }
+            // update constraints definitions
+            Iterator updateIter0 = securityConstraintsDefNames.iterator();
+            Iterator updateIter1 = constraintsDefs.iterator();
+            while (updateIter0.hasNext() && updateIter1.hasNext())
+            {
+                // update by definition name
+                String securityConstraintsDefName = (String)updateIter0.next();
+                // find named definition
+                SecurityConstraintsDef securityConstraintsDef = null;
+                Iterator findDefinitionIter = securityConstraintsDefs.iterator();
+                while ((securityConstraintsDef == null) && findDefinitionIter.hasNext())
+                {
+                    SecurityConstraintsDef testSecurityConstraintsDef = (SecurityConstraintsDef)findDefinitionIter.next();
+                    if (securityConstraintsDefName.equals(testSecurityConstraintsDef.getName()))
+                    {
+                        securityConstraintsDef = testSecurityConstraintsDef;
+                    }
+                }
+                // update constraints definition
+                if ((securityConstraintsDef != null) && (securityConstraintsDef.getSecurityConstraints() != null))
+                {
+                    Iterator updateIter2 = securityConstraintsDef.getSecurityConstraints().iterator();
+                    for (int i = 0; (updateIter1.hasNext() && updateIter2.hasNext()); i++)
+                    {
+                        SecurityConstraint securityConstraint = (SecurityConstraint)updateIter2.next();
+                        PageSecuritySecurityConstraintsDef constraintsDef = (PageSecuritySecurityConstraintsDef)updateIter1.next();
+                        constraintsDef.setName(securityConstraintsDefName);
+                        constraintsDef.setApplyOrder(i);
+                        constraintsDef.setUserPrincipals(securityConstraint.getUsersList());
+                        constraintsDef.setRolePrincipals(securityConstraint.getRolesList());
+                        constraintsDef.setGroupPrincipals(securityConstraint.getGroupsList());
+                        constraintsDef.setPermissions(securityConstraint.getPermissionsList());
+                    }
+                }
+            }
+        }
+        else
+        {
+            // empty constraints definitions collection
+            if (constraintsDefs != null)
+            {
+                constraintsDefs.clear();
+            }
+        }
+
+        // synchronize persistent global constraints references
+        if ((globalSecurityConstraintsRefs != null) && !globalSecurityConstraintsRefs.isEmpty())
+        {
+            // update global constraints references collection size
+            if (globalConstraintsRefs == null)
+            {
+                globalConstraintsRefs = new ArrayList(globalSecurityConstraintsRefs.size());
+            }
+            while (globalConstraintsRefs.size() < globalSecurityConstraintsRefs.size())
+            {
+                PageSecurityGlobalSecurityConstraintsRef globalConstraintsRef = new PageSecurityGlobalSecurityConstraintsRef();
+                globalConstraintsRef.setApplyOrder(globalConstraintsRefs.size());
+                globalConstraintsRefs.add(globalConstraintsRef);
+            }
+            while (globalConstraintsRefs.size() > globalSecurityConstraintsRefs.size())
+            {
+                globalConstraintsRefs.remove(globalConstraintsRefs.size()-1);
+            }
+            // update global constraints references
+            Iterator updateIter0 = globalSecurityConstraintsRefs.iterator();
+            Iterator updateIter1 = globalConstraintsRefs.iterator();
+            while (updateIter0.hasNext() && updateIter1.hasNext())
+            {
+                String securityConstraintsRef = (String)updateIter0.next();
+                PageSecurityGlobalSecurityConstraintsRef globalConstraintsRef = (PageSecurityGlobalSecurityConstraintsRef)updateIter1.next();
+                globalConstraintsRef.setName(securityConstraintsRef);
+            }
+        }
+        else
+        {
+            // empty global constraints references collection
+            if (globalConstraintsRefs != null)
+            {
+                globalConstraintsRefs.clear();
+            }
+        }
+    }
+
+    /* (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);
+
+        // synchronize constraints definitions
+        if ((constraintsDefs != null) && !constraintsDefs.isEmpty())
+        {
+            // initialize security constraints definitions collection
+            if (securityConstraintsDefs == null)
+            {
+                securityConstraintsDefs = new ArrayList(4);
+            }
+            else
+            {
+                securityConstraintsDefs.clear();
+            }
+            // construct security constraints definitions
+            Iterator updateIter = constraintsDefs.iterator();
+            SecurityConstraintsDef securityConstraintsDef = null;
+            while (updateIter.hasNext())
+            {
+                PageSecuritySecurityConstraintsDef constraintsDef = (PageSecuritySecurityConstraintsDef)updateIter.next();
+                if ((securityConstraintsDef == null) || !securityConstraintsDef.getName().equals(constraintsDef.getName()))
+                {
+                    securityConstraintsDef = new SecurityConstraintsDefImpl();
+                    securityConstraintsDef.setName(constraintsDef.getName());
+                    securityConstraintsDef.setSecurityConstraints(new ArrayList(4));
+                    securityConstraintsDefs.add(securityConstraintsDef);
+                }
+                SecurityConstraint securityConstraint = new SecurityConstraintImpl();
+                securityConstraint.setUsers(constraintsDef.getUserPrincipals());
+                securityConstraint.setRoles(constraintsDef.getRolePrincipals());
+                securityConstraint.setGroups(constraintsDef.getGroupPrincipals());
+                securityConstraint.setPermissions(constraintsDef.getPermissions());
+                securityConstraintsDef.getSecurityConstraints().add(securityConstraint);
+            }
+        }
+        else
+        {
+            // remove security constraints collection
+            securityConstraintsDefs = null;
+        }
+        securityConstraintsDefsMap = null;
+
+        // synchronize global constraints references
+        if ((globalConstraintsRefs != null) && !globalConstraintsRefs.isEmpty())
+        {
+            // update global security constraints references
+            if (globalSecurityConstraintsRefs == null)
+            {
+                globalSecurityConstraintsRefs = new ArrayList(globalConstraintsRefs.size());
+            }
+            else
+            {
+                globalSecurityConstraintsRefs.clear();
+            }
+            Iterator updateIter = globalConstraintsRefs.iterator();
+            while (updateIter.hasNext())
+            {
+                PageSecurityGlobalSecurityConstraintsRef globalConstraintsRef = (PageSecurityGlobalSecurityConstraintsRef)updateIter.next();
+                globalSecurityConstraintsRefs.add(globalConstraintsRef.getName());
+            }
+        }
+        else
+        {
+            // remove global security constraints references collection
+            globalSecurityConstraintsRefs = null;
+        }
+    }
+}



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