portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r331939 - in /portals/jetspeed-2/trunk: components/page-manager/src/java/JETSPEED-INF/ojb/ components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/ components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/ components/...
Date Wed, 09 Nov 2005 03:39:02 GMT
Author: rwatler
Date: Tue Nov  8 19:38:49 2005
New Revision: 331939

URL: http://svn.apache.org/viewcvs?rev=331939&view=rev
Log:
- rename tables to correct obtuse abbreviations not required to adhere to oracle 31 char limit on DB names.
- remove page attributes, SUBSITE, USER_PRINCIPAL, etc. from PAGE/FOLDER/PAGE_SECURITY lookups and unique keys.
- perform PAGE/FOLDER/PAGE_SECURITY lookups strictly on unique PATH fields.
- support concrete reserved folders in paths and associated parent/child relationships for om object navigation.


Removed:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeAttributes.java
Modified:
    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/psml/FolderImpl.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/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/folder/Folder.java

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=331939&r1=331938&r2=331939&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 Tue Nov  8 19:38:49 2005
@@ -95,7 +95,7 @@
       </collection-descriptor>
 
       <field-descriptor
-         name="attributes::path"
+         name="path"
          column="PATH"
          jdbc-type="VARCHAR"
       />
@@ -132,49 +132,49 @@
       />
 
       <field-descriptor
-         name="attributes::subsite"
+         name="subsite"
          column="SUBSITE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::user"
+         name="user"
          column="USER_PRINCIPAL"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::role"
+         name="role"
          column="ROLE_PRINCIPAL"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::group"
+         name="group"
          column="GROUP_PRINCIPAL"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::mediatype"
+         name="mediatype"
          column="MEDIATYPE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::locale"
+         name="locale"
          column="LOCALE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::extendedAttributeName"
+         name="extendedAttributeName"
          column="EXT_ATTR_NAME"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::extendedAttributeValue"
+         name="extendedAttributeValue"
          column="EXT_ATTR_VALUE"
          jdbc-type="VARCHAR"
       />
@@ -249,11 +249,11 @@
 
    <class-descriptor
       class="org.apache.jetspeed.om.folder.impl.FolderSecurityConstraint"
-      table="FOLDER_CNSTRNT"
+      table="FOLDER_CONSTRAINT"
    >
       <field-descriptor
          name="id"
-         column="CNSTRNT_ID"
+         column="CONSTRAINT_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
@@ -303,11 +303,11 @@
 
    <class-descriptor
       class="org.apache.jetspeed.om.folder.impl.FolderSecurityConstraintsRef"
-      table="FOLDER_CNSTRNTS_REF"
+      table="FOLDER_CONSTRAINTS_REF"
    >
       <field-descriptor
          name="id"
-         column="CNSTRNTS_REF_ID"
+         column="CONSTRAINTS_REF_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
@@ -388,7 +388,7 @@
       </collection-descriptor>
 
       <field-descriptor
-         name="attributes::path"
+         name="path"
          column="PATH"
          jdbc-type="VARCHAR"
       />
@@ -437,49 +437,49 @@
       />
 
       <field-descriptor
-         name="attributes::subsite"
+         name="subsite"
          column="SUBSITE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::user"
+         name="user"
          column="USER_PRINCIPAL"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::role"
+         name="role"
          column="ROLE_PRINCIPAL"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::group"
+         name="group"
          column="GROUP_PRINCIPAL"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::mediatype"
+         name="mediatype"
          column="MEDIATYPE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::locale"
+         name="locale"
          column="LOCALE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::extendedAttributeName"
+         name="extendedAttributeName"
          column="EXT_ATTR_NAME"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::extendedAttributeValue"
+         name="extendedAttributeValue"
          column="EXT_ATTR_VALUE"
          jdbc-type="VARCHAR"
       />
@@ -554,11 +554,11 @@
 
    <class-descriptor
       class="org.apache.jetspeed.om.page.impl.PageSecurityConstraint"
-      table="PAGE_CNSTRNT"
+      table="PAGE_CONSTRAINT"
    >
       <field-descriptor
          name="id"
-         column="CNSTRNT_ID"
+         column="CONSTRAINT_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
@@ -608,11 +608,11 @@
 
    <class-descriptor
       class="org.apache.jetspeed.om.page.impl.PageSecurityConstraintsRef"
-      table="PAGE_CNSTRNTS_REF"
+      table="PAGE_CONSTRAINTS_REF"
    >
       <field-descriptor
          name="id"
-         column="CNSTRNTS_REF_ID"
+         column="CONSTRAINTS_REF_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
@@ -793,11 +793,11 @@
 
    <class-descriptor
       class="org.apache.jetspeed.om.page.impl.FragmentSecurityConstraint"
-      table="FRAGMENT_CNSTRNT"
+      table="FRAGMENT_CONSTRAINT"
    >
       <field-descriptor
          name="id"
-         column="CNSTRNT_ID"
+         column="CONSTRAINT_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
@@ -847,11 +847,11 @@
 
    <class-descriptor
       class="org.apache.jetspeed.om.page.impl.FragmentSecurityConstraintsRef"
-      table="FRAGMENT_CNSTRNTS_REF"
+      table="FRAGMENT_CONSTRAINTS_REF"
    >
       <field-descriptor
          name="id"
-         column="CNSTRNTS_REF_ID"
+         column="CONSTRAINTS_REF_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
@@ -881,11 +881,11 @@
 
    <class-descriptor
       class="org.apache.jetspeed.om.page.impl.PageSecurityImpl"
-      table="PAGE_SEC"
+      table="PAGE_SECURITY"
    >
       <field-descriptor
          name="id"
-         column="PAGE_SEC_ID"
+         column="PAGE_SECURITY_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
@@ -910,7 +910,7 @@
       </reference-descriptor>
 
       <field-descriptor
-         name="attributes::path"
+         name="path"
          column="PATH"
          jdbc-type="VARCHAR"
       />
@@ -922,49 +922,49 @@
       />
 
       <field-descriptor
-         name="attributes::subsite"
+         name="subsite"
          column="SUBSITE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::user"
+         name="user"
          column="USER_PRINCIPAL"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::role"
+         name="role"
          column="ROLE_PRINCIPAL"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::group"
+         name="group"
          column="GROUP_PRINCIPAL"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::mediatype"
+         name="mediatype"
          column="MEDIATYPE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::locale"
+         name="locale"
          column="LOCALE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::extendedAttributeName"
+         name="extendedAttributeName"
          column="EXT_ATTR_NAME"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="attributes::extendedAttributeValue"
+         name="extendedAttributeValue"
          column="EXT_ATTR_VALUE"
          jdbc-type="VARCHAR"
       />
@@ -995,11 +995,11 @@
 
    <class-descriptor
       class="org.apache.jetspeed.om.page.impl.PageSecuritySecurityConstraintsDef"
-      table="PAGE_SEC_CNSTRNTS_DEF"
+      table="PAGE_SECURITY_CONSTRAINTS_DEF"
    >
       <field-descriptor
          name="id"
-         column="CNSTRNTS_DEF_ID"
+         column="CONSTRAINTS_DEF_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
@@ -1007,7 +1007,7 @@
 
       <field-descriptor
         name="pageSecurityId"
-        column="PAGE_SEC_ID"
+        column="PAGE_SECURITY_ID"
         jdbc-type="INTEGER"
         access="anonymous"
       />
@@ -1055,11 +1055,11 @@
 
    <class-descriptor
       class="org.apache.jetspeed.om.page.impl.PageSecurityGlobalSecurityConstraintsRef"
-      table="PAGE_SEC_CNSTRNTS_REF"
+      table="PAGE_SECURITY_CONSTRAINTS_REF"
    >
       <field-descriptor
          name="id"
-         column="CNSTRNTS_REF_ID"
+         column="CONSTRAINTS_REF_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
@@ -1067,7 +1067,7 @@
 
       <field-descriptor
         name="pageSecurityId"
-        column="PAGE_SEC_ID"
+        column="PAGE_SECURITY_ID"
         jdbc-type="INTEGER"
         access="anonymous"
       />

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=331939&r1=331938&r2=331939&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 Tue Nov  8 19:38:49 2005
@@ -183,15 +183,6 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.folder.Folder#isRootFolder()
-     */
-    public boolean isRootFolder()
-    {
-        // test using Node implementation
-        return super.isRootNode();
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.jetspeed.om.folder.Folder#getDocumentOrder()
      */
     public List getDocumentOrder()

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java?rev=331939&r1=331938&r2=331939&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java Tue Nov  8 19:38:49 2005
@@ -99,16 +99,6 @@
         setReservedType();
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jetspeed.om.folder.Folder#isRootFolder()
-     */
-    public boolean isRootFolder()
-    {
-        return getPath().equals(PATH_SEPARATOR);
-    }
-
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.folder.Folder#getDocumentOrder()
      */

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java?rev=331939&r1=331938&r2=331939&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java Tue Nov  8 19:38:49 2005
@@ -18,6 +18,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Locale;
+import java.util.StringTokenizer;
 
 import org.apache.jetspeed.om.common.GenericMetadata;
 import org.apache.jetspeed.om.folder.Folder;
@@ -37,7 +38,15 @@
     private Node parent;
     private boolean hidden;
     private Collection metadataFields;
-    private NodeAttributes attributes = new NodeAttributes();
+    private String path = Folder.PATH_SEPARATOR;
+    private String subsite;
+    private String user;
+    private String role;
+    private String group;
+    private String mediatype;
+    private String locale;
+    private String extendedAttributeName;
+    private String extendedAttributeValue;
 
     private PageMetadataImpl pageMetadata;
 
@@ -47,16 +56,29 @@
     }
 
     /**
-     * isRootNode
+     * getCanonicalNodePath
      *
-     * Test whether node attributes base path is a root node
-     * path, regardless of parent setting.
+     * Format paths used to set and query NodeImpl instances.
      *
-     * @return root node flag
+     * @param path specified path
+     * @return canonical path
      */
-    public boolean isRootNode()
+    public static String getCanonicalNodePath(String path)
     {
-        return attributes.getPath().equals(Folder.PATH_SEPARATOR);
+        // validate and format path
+        if ((path == null) || (path.length() == 0))
+        {
+            path = Folder.PATH_SEPARATOR;
+        }
+        if (!path.startsWith(Folder.PATH_SEPARATOR))
+        {
+            path = Folder.PATH_SEPARATOR + path;
+        }
+        if (path.endsWith(Folder.PATH_SEPARATOR) && !path.equals(Folder.PATH_SEPARATOR))
+        {
+            path = path.substring(0, path.length() - 1);
+        }
+        return path;
     }
 
     /**
@@ -102,7 +124,6 @@
         String name = super.getName();
         if (name == null)
         {
-            String path = attributes.getPath();
             if (path != null)
             {
                 if (!path.equals(Folder.PATH_SEPARATOR))
@@ -115,7 +136,6 @@
                 }
                 super.setName(name);
             }
-
         }
         return name;
     }
@@ -128,19 +148,17 @@
         // set path based on name
         if (name != null)
         {
-            String path = attributes.getPath();
             if (path != null)
             {
                 if (!name.equals(Folder.PATH_SEPARATOR))
                 {
-                    attributes.setPath(path.substring(0, path.lastIndexOf(Folder.PATH_SEPARATOR) + 1) + name);
+                    path = path.substring(0, path.lastIndexOf(Folder.PATH_SEPARATOR) + 1) + name;
                 }
                 else
                 {
-                    attributes.setPath(Folder.PATH_SEPARATOR);
+                    path = Folder.PATH_SEPARATOR;
                 }
             }
-
             super.setName(name);
         }
     }
@@ -165,13 +183,12 @@
         if (parent != null)
         {
             String parentPath = parent.getPath();
-            String path = getPath();
             if ((parentPath.equals(Folder.PATH_SEPARATOR) &&
                  (path.lastIndexOf(Folder.PATH_SEPARATOR) > 0)) ||
                 (!parentPath.equals(Folder.PATH_SEPARATOR) &&
                  !parentPath.equals(path.substring(0, path.lastIndexOf(Folder.PATH_SEPARATOR)))))
             {
-                setPath(parentPath + Folder.PATH_SEPARATOR + getName());
+                path = parentPath + Folder.PATH_SEPARATOR + getName();
             }
         }
     }
@@ -182,7 +199,7 @@
     public String getPath()
     {
         // return path from attributes and base path
-        return attributes.getCanonicalPath();
+        return path;
     }
     
     /* (non-Javadoc)
@@ -190,14 +207,82 @@
      */
     public void setPath(String path)
     {
-        // set attributes and base path
-        attributes.setCanonicalPath(path);
+        // set canonical node path
+        this.path = getCanonicalNodePath(path);
+
+        // parse and set informational attributes from path
+        String attributeName = null;
+        StringTokenizer pathElements = new StringTokenizer(this.path, Folder.PATH_SEPARATOR);
+        while (pathElements.hasMoreTokens())
+        {
+            String pathElement = pathElements.nextToken();
+            if (attributeName != null)
+            {
+                // set last attribute name with attribute value
+                if (attributeName.startsWith(Folder.RESERVED_USER_FOLDER_NAME))
+                {
+                    user = pathElement.toLowerCase();
+                }
+                else if (attributeName.startsWith(Folder.RESERVED_ROLE_FOLDER_NAME))
+                {
+                    role = pathElement.toLowerCase();
+                }
+                else if (attributeName.startsWith(Folder.RESERVED_GROUP_FOLDER_NAME))
+                {
+                    group = pathElement.toLowerCase();
+                }
+                else if (attributeName.startsWith(Folder.RESERVED_MEDIATYPE_FOLDER_NAME))
+                {
+                    mediatype = pathElement.toLowerCase();
+                }
+                else if (attributeName.startsWith(Folder.RESERVED_LANGUAGE_FOLDER_NAME))
+                {
+                    if (locale != null)
+                    {
+                        // compose locale from language + country
+                        locale = pathElement.toLowerCase() + "_" + locale;
+                    }
+                    else
+                    {
+                        locale = pathElement.toLowerCase();
+                    }
+                }
+                else if (attributeName.startsWith(Folder.RESERVED_COUNTRY_FOLDER_NAME))
+                {
+                    if (locale != null)
+                    {
+                        // compose locale from language + country
+                        locale = locale + "_" + pathElement.toLowerCase() ;
+                    }
+                    else
+                    {
+                        locale = pathElement.toLowerCase();
+                    }
+                }
+                else if (attributeName.startsWith(Folder.RESERVED_FOLDER_PREFIX))
+                {
+                    extendedAttributeName = attributeName.substring(Folder.RESERVED_FOLDER_PREFIX.length());
+                    extendedAttributeValue = pathElement.toLowerCase();
+                }
+
+                // reset attribute name
+                attributeName = null;
+            }
+            else if (pathElement.startsWith(Folder.RESERVED_SUBSITE_FOLDER_PREFIX))
+            {
+                subsite = pathElement.substring(Folder.RESERVED_SUBSITE_FOLDER_PREFIX.length()).toLowerCase();
+            }
+            else if (pathElement.startsWith(Folder.RESERVED_FOLDER_PREFIX))
+            {
+                // save attribute name
+                attributeName = pathElement.toLowerCase();
+            }
+        }
 
         // set name based on path
-        path = attributes.getPath();
-        if (!path.equals(Folder.PATH_SEPARATOR))
+        if (!this.path.equals(Folder.PATH_SEPARATOR))
         {
-            super.setName(path.substring(path.lastIndexOf(Folder.PATH_SEPARATOR) + 1));
+            super.setName(this.path.substring(this.path.lastIndexOf(Folder.PATH_SEPARATOR) + 1));
         }
         else
         {
@@ -209,11 +294,11 @@
         {
             String parentPath = parent.getPath();
             if ((parentPath.equals(Folder.PATH_SEPARATOR) &&
-                 (path.lastIndexOf(Folder.PATH_SEPARATOR) > 0)) ||
+                 (this.path.lastIndexOf(Folder.PATH_SEPARATOR) > 0)) ||
                 (!parentPath.equals(Folder.PATH_SEPARATOR) &&
-                 !parentPath.equals(path.substring(0, path.lastIndexOf(Folder.PATH_SEPARATOR)))))
+                 !parentPath.equals(this.path.substring(0, this.path.lastIndexOf(Folder.PATH_SEPARATOR)))))
             {
-                setParent(null);
+                parent = null;
             }
         }
     }
@@ -273,7 +358,7 @@
      */
     public String getUrl()
     {
-        return getPath();
+        return path;
     }
     
     /* (non-Javadoc)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java?rev=331939&r1=331938&r2=331939&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java Tue Nov  8 19:38:49 2005
@@ -60,7 +60,7 @@
 import org.apache.jetspeed.page.document.FailedToUpdateDocumentException;
 import org.apache.jetspeed.page.document.NodeException;
 import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
-import org.apache.jetspeed.page.document.impl.NodeAttributes;
+import org.apache.jetspeed.page.document.impl.NodeImpl;
 import org.apache.ojb.broker.PersistenceBroker;
 import org.apache.ojb.broker.core.proxy.ProxyHelper;
 import org.apache.ojb.broker.query.Criteria;
@@ -266,8 +266,7 @@
     public Page getPage(String path) throws PageNotFoundException, NodeException
     {
         // construct page attributes from path
-        NodeAttributes attributes = new NodeAttributes(path);
-        path = attributes.getCanonicalPath();
+        path = NodeImpl.getCanonicalNodePath(path);
 
         // test cache with canonical path if available
         if (databaseNodeCache.containsKey(path))
@@ -284,7 +283,8 @@
         // retrieve page from database
         try
         {
-            Criteria filter = attributes.newQueryCriteria();
+            Criteria filter = new Criteria();
+            filter.addEqualTo("path", path);
             QueryByCriteria query = QueryFactory.newQuery(PageImpl.class, filter);
             Page page = (Page) getPersistenceBrokerTemplate().getObjectByQuery(query);
             
@@ -298,6 +298,10 @@
             }
             return page;
         }
+        catch (PageNotFoundException pnfe)
+        {
+            throw pnfe;
+        }
         catch (Exception e)
         {
             throw new PageNotFoundException("Page " + path + " not found.", e);
@@ -329,8 +333,6 @@
     {
         // construct document attributes from path
         String path = Folder.PATH_SEPARATOR + PageSecurity.DOCUMENT_TYPE;
-        NodeAttributes attributes = new NodeAttributes(path);
-        path = attributes.getCanonicalPath();
 
         // test cache with canonical path if available
         if (databaseNodeCache.containsKey(path))
@@ -347,7 +349,8 @@
         // retrieve document from database
         try
         {
-            Criteria filter = attributes.newQueryCriteria();
+            Criteria filter = new Criteria();
+            filter.addEqualTo("path", path);
             QueryByCriteria query = QueryFactory.newQuery(PageSecurityImpl.class, filter);
             PageSecurity document = (PageSecurity) getPersistenceBrokerTemplate().getObjectByQuery(query);
             
@@ -361,6 +364,10 @@
             }
             return document;
         }
+        catch (DocumentNotFoundException dnfe)
+        {
+            throw dnfe;
+        }
         catch (Exception e)
         {
             throw new DocumentNotFoundException("Document " + path + " not found.", e);
@@ -373,8 +380,7 @@
     public Folder getFolder(String folderPath) throws FolderNotFoundException, InvalidFolderException, NodeException
     {
         // construct folder attributes from path
-        NodeAttributes attributes = new NodeAttributes(folderPath);
-        folderPath = attributes.getCanonicalPath();
+        folderPath = NodeImpl.getCanonicalNodePath(folderPath);
 
         // test cache with canonical path if available
         if (databaseNodeCache.containsKey(folderPath))
@@ -391,7 +397,8 @@
         // retrieve folder from database
         try
         {
-            Criteria filter = attributes.newQueryCriteria();
+            Criteria filter = new Criteria();
+            filter.addEqualTo("path", folderPath);
             QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter);
             Folder folder = (Folder) getPersistenceBrokerTemplate().getObjectByQuery(query);
             
@@ -405,6 +412,10 @@
             }
             return folder;
         }
+        catch (FolderNotFoundException fnfe)
+        {
+            throw fnfe;
+        }
         catch (Exception e)
         {
             throw new FolderNotFoundException("Folder " + folderPath + " not found.", e);
@@ -441,10 +452,19 @@
                     throw new PageNotUpdatedException("Missing parent folder: " + parentPath);
                 }
                 
-                // update parent folder with added page
-                parent.addPage((PageImpl)page);
-                page.setParent(parent);
-                getPersistenceBrokerTemplate().store(parent);
+                try
+                {
+                    // update parent folder with added page
+                    parent.addPage((PageImpl)page);
+                    page.setParent(parent);
+                    getPersistenceBrokerTemplate().store(parent);
+                }
+                catch (Exception e)
+                {
+                    // cleanup parent folder on error
+                    parent.removePage((PageImpl)page);
+                    throw e;
+                }
                 
                 // update document cache
                 databaseNodeCache.put(pagePath, page);
@@ -458,6 +478,10 @@
                 databaseNodeCache.put(page.getPath(), page);
             }
         }
+        catch (PageNotUpdatedException pnue)
+        {
+            throw pnue;
+        }
         catch (Exception e)
         {
             throw new PageNotUpdatedException("Page " + page.getPath() + " not updated.", e);
@@ -507,8 +531,8 @@
             // dereference folder in case proxy is supplied
             folder = (Folder)ProxyHelper.getRealObject(folder);
 
-            // look up and set parent folder if necessary
-            if ((folder.getParent() == null) && !folder.isRootFolder())
+            // look up and set parent folder if required
+            if ((folder.getParent() == null) && !folder.getPath().equals(Folder.PATH_SEPARATOR))
             {
                 // access folder by path
                 String folderPath = folder.getPath();
@@ -527,13 +551,22 @@
                     throw new FolderNotUpdatedException("Missing parent folder: " + parentPath);
                 }
                 
-                // update parent folder with added folder
-                parent.addFolder((FolderImpl)folder);
-                folder.setParent(parent);
-                getPersistenceBrokerTemplate().store(parent);
-                
-                // update folder cache
-                databaseNodeCache.put(folderPath, folder);
+                try
+                {
+                    // update parent folder with added folder
+                    parent.addFolder((FolderImpl)folder);
+                    folder.setParent(parent);
+                    getPersistenceBrokerTemplate().store(parent);
+                    
+                    // update folder cache
+                    databaseNodeCache.put(folderPath, folder);
+                }
+                catch (Exception e)
+                {
+                    // cleanup parent folder on error
+                    parent.removeFolder((FolderImpl)folder);
+                    throw e;
+                }
             }
             else
             {
@@ -544,6 +577,10 @@
                 databaseNodeCache.put(folder.getPath(), folder);
             }
         }
+        catch (FolderNotUpdatedException fnue)
+        {
+            throw fnue;
+        }
         catch (Exception e)
         {
             throw new FolderNotUpdatedException("Folder " + folder.getPath() + " not updated.", e);
@@ -639,11 +676,20 @@
                 {
                     throw new FailedToUpdateDocumentException("Missing parent folder: " + parentPath);
                 }
-                
-                // update parent folder with added document
-                parent.setPageSecurity((PageSecurityImpl)pageSecurity);
-                pageSecurity.setParent(parent);
-                getPersistenceBrokerTemplate().store(parent);
+
+                try
+                {
+                    // update parent folder with added document
+                    parent.setPageSecurity((PageSecurityImpl)pageSecurity);
+                    pageSecurity.setParent(parent);
+                    getPersistenceBrokerTemplate().store(parent);
+                }
+                catch (Exception e)
+                {
+                    // cleanup parent folder on error
+                    parent.setPageSecurity(null);
+                    throw e;
+                }
                 
                 // update document cache
                 databaseNodeCache.put(pageSecurityPath, pageSecurity);
@@ -656,6 +702,10 @@
                 // update document cache
                 databaseNodeCache.put(pageSecurity.getPath(), pageSecurity);
             }
+        }
+        catch (FailedToUpdateDocumentException fude)
+        {
+            throw fude;
         }
         catch (Exception e)
         {

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java?rev=331939&r1=331938&r2=331939&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java Tue Nov  8 19:38:49 2005
@@ -44,10 +44,8 @@
  */
 public class TestDatabasePageManager extends AbstractSpringTestCase
 {
-    /*
-    private String testAttributesPath = "/__subsite-rootX/_user/userX/_role/roleX/_group/groupX/_mediatype/xhtml/_language/en/_country/us/_custom/customX";
-    private String verifyTestAttributesPath = "/__subsite-rootx/_user/userx/_role/rolex/_group/groupx/_mediatype/xhtml/_language/en/_country/us/_custom/customx";
-    */
+    private String deepFolderPath = "/__subsite-rootx/_user/userx/_role/rolex/_group/groupx/_mediatype/xhtml/_language/en/_country/us/_custom/customx";
+    private String deepPagePath = deepFolderPath + "/default-page.psml";
 
     private PageManager pageManager;
     
@@ -86,355 +84,361 @@
         { "test-repository-datasource-spring.xml" };
     }
 
-    public void testCreates()
+    public void testCreates() throws Exception
     {
-        try
-        {
-            // reset page manager cache
-            pageManager.reset();
+        // reset page manager cache
+        pageManager.reset();
 
-            // test document and folder creation
-            Folder folder = pageManager.newFolder("/");
-            folder.setTitle("Root Folder");
-            folder.setDefaultPage("default-page.psml");
-            folder.setShortTitle("Root");
-            GenericMetadata metadata = folder.getMetadata();
-            metadata.addField(Locale.FRENCH, "title", "[fr] Root Folder");
-            SecurityConstraints folderConstraints = pageManager.newSecurityConstraints();
-            folderConstraints.setOwner("admin");
-            List inlineFolderConstraints = new ArrayList(2);
-            SecurityConstraint folderConstraint = pageManager.newSecurityConstraint();
-            folderConstraint.setUsers("user,admin");
-            folderConstraint.setRoles("manager");
-            folderConstraint.setGroups("*");
-            folderConstraint.setPermissions("view,edit");
-            inlineFolderConstraints.add(folderConstraint);
-            folderConstraint = pageManager.newSecurityConstraint();
-            folderConstraint.setPermissions("edit");
-            inlineFolderConstraints.add(folderConstraint);
-            folderConstraints.setSecurityConstraints(inlineFolderConstraints);
-            List folderConstraintsRefs = new ArrayList(2);
-            folderConstraintsRefs.add("public-view");
-            folderConstraintsRefs.add("public-edit");
-            folderConstraints.setSecurityConstraintsRefs(folderConstraintsRefs);
-            folder.setSecurityConstraints(folderConstraints);
-            pageManager.updateFolder(folder);
-            
-            assertNull(folder.getParent());
+        // test document and folder creation
+        Folder folder = pageManager.newFolder("/");
+        folder.setTitle("Root Folder");
+        folder.setDefaultPage("default-page.psml");
+        folder.setShortTitle("Root");
+        GenericMetadata metadata = folder.getMetadata();
+        metadata.addField(Locale.FRENCH, "title", "[fr] Root Folder");
+        SecurityConstraints folderConstraints = pageManager.newSecurityConstraints();
+        folderConstraints.setOwner("admin");
+        List inlineFolderConstraints = new ArrayList(2);
+        SecurityConstraint folderConstraint = pageManager.newSecurityConstraint();
+        folderConstraint.setUsers("user,admin");
+        folderConstraint.setRoles("manager");
+        folderConstraint.setGroups("*");
+        folderConstraint.setPermissions("view,edit");
+        inlineFolderConstraints.add(folderConstraint);
+        folderConstraint = pageManager.newSecurityConstraint();
+        folderConstraint.setPermissions("edit");
+        inlineFolderConstraints.add(folderConstraint);
+        folderConstraints.setSecurityConstraints(inlineFolderConstraints);
+        List folderConstraintsRefs = new ArrayList(2);
+        folderConstraintsRefs.add("public-view");
+        folderConstraintsRefs.add("public-edit");
+        folderConstraints.setSecurityConstraintsRefs(folderConstraintsRefs);
+        folder.setSecurityConstraints(folderConstraints);
+        pageManager.updateFolder(folder);
+        
+        assertNull(folder.getParent());
+
+        Page page = pageManager.newPage("/default-page.psml");
+        page.setTitle("Default Page");
+        page.setDefaultDecorator("tigris", Fragment.LAYOUT);
+        page.setDefaultDecorator("blue-gradient", Fragment.PORTLET);
+        page.setDefaultSkin("skin-1");
+        page.setShortTitle("Default");
+        metadata = page.getMetadata();
+        metadata.addField(Locale.FRENCH, "title", "[fr] Default Page");
+        metadata.addField(Locale.JAPANESE, "title", "[ja] Default Page");
+        SecurityConstraints pageConstraints = pageManager.newSecurityConstraints();
+        pageConstraints.setOwner("user");
+        List inlinePageConstraints = new ArrayList(1);
+        SecurityConstraint pageConstraint = pageManager.newSecurityConstraint();
+        pageConstraint.setUsers("jetspeed");
+        pageConstraint.setPermissions("edit");
+        inlinePageConstraints.add(pageConstraint);
+        pageConstraints.setSecurityConstraints(inlinePageConstraints);
+        List pageConstraintsRefs = new ArrayList(1);
+        pageConstraintsRefs.add("manager-edit");
+        pageConstraints.setSecurityConstraintsRefs(pageConstraintsRefs);
+        page.setSecurityConstraints(pageConstraints);
+
+        Fragment root = page.getRootFragment();
+        root.setDecorator("blue-gradient");
+        root.setName("jetspeed-layouts::VelocityTwoColumns");
+        root.setShortTitle("Root");
+        root.setTitle("Root Fragment");
+        root.setState("Normal");
+        root.setLayoutSizes("50%,50%");
+        root.getProperties().put("custom-prop1", "custom-prop-value1");
+        root.getProperties().put("custom-prop2", "custom-prop-value2");
+        
+        Fragment portlet = pageManager.newPortletFragment();
+        portlet.setName("security::LoginPortlet");
+        portlet.setShortTitle("Portlet");
+        portlet.setTitle("Portlet Fragment");
+        portlet.setState("Normal");
+        portlet.setLayoutRow(88);
+        portlet.setLayoutColumn(99);
+        root.getFragments().add(portlet);
+
+        pageManager.updatePage(page);
+
+        assertNotNull(page.getParent());
+        assertEquals(page.getParent().getId(), folder.getId());
+
+        PageSecurity pageSecurity = pageManager.newPageSecurity();
+        List constraintsDefs = new ArrayList(2);
+        SecurityConstraintsDef constraintsDef = pageManager.newSecurityConstraintsDef();
+        constraintsDef.setName("public-view");
+        List defConstraints = new ArrayList(1);
+        SecurityConstraint defConstraint = pageManager.newSecurityConstraint();
+        defConstraint.setUsers("*");
+        defConstraint.setPermissions("view");
+        defConstraints.add(defConstraint);
+        constraintsDef.setSecurityConstraints(defConstraints);
+        constraintsDefs.add(constraintsDef);
+        constraintsDef = pageManager.newSecurityConstraintsDef();
+        constraintsDef.setName("admin-all");
+        defConstraints = new ArrayList(2);
+        defConstraint = pageManager.newSecurityConstraint();
+        defConstraint.setRoles("admin");
+        defConstraint.setPermissions("view,edit");
+        defConstraints.add(defConstraint);
+        defConstraint = pageManager.newSecurityConstraint();
+        defConstraint.setRoles("nobody");
+        defConstraints.add(defConstraint);
+        constraintsDef.setSecurityConstraints(defConstraints);
+        constraintsDefs.add(constraintsDef);
+        pageSecurity.setSecurityConstraintsDefs(constraintsDefs);
+        List globalConstraintsRefs = new ArrayList(2);
+        globalConstraintsRefs.add("admin-all");
+        globalConstraintsRefs.add("public-view");
+        pageSecurity.setGlobalSecurityConstraintsRefs(globalConstraintsRefs);
+
+        pageManager.updatePageSecurity(pageSecurity);
 
-            Page page = pageManager.newPage("/default-page.psml");
-            page.setTitle("Default Page");
-            page.setDefaultDecorator("tigris", Fragment.LAYOUT);
-            page.setDefaultDecorator("blue-gradient", Fragment.PORTLET);
-            page.setDefaultSkin("skin-1");
-            page.setShortTitle("Default");
-            metadata = page.getMetadata();
-            metadata.addField(Locale.FRENCH, "title", "[fr] Default Page");
-            metadata.addField(Locale.JAPANESE, "title", "[ja] Default Page");
-            SecurityConstraints pageConstraints = pageManager.newSecurityConstraints();
-            pageConstraints.setOwner("user");
-            List inlinePageConstraints = new ArrayList(1);
-            SecurityConstraint pageConstraint = pageManager.newSecurityConstraint();
-            pageConstraint.setUsers("jetspeed");
-            pageConstraint.setPermissions("edit");
-            inlinePageConstraints.add(pageConstraint);
-            pageConstraints.setSecurityConstraints(inlinePageConstraints);
-            List pageConstraintsRefs = new ArrayList(1);
-            pageConstraintsRefs.add("manager-edit");
-            pageConstraints.setSecurityConstraintsRefs(pageConstraintsRefs);
-            page.setSecurityConstraints(pageConstraints);
-
-            Fragment root = page.getRootFragment();
-            root.setDecorator("blue-gradient");
-            root.setName("jetspeed-layouts::VelocityTwoColumns");
-            root.setShortTitle("Root");
-            root.setTitle("Root Fragment");
-            root.setState("Normal");
-            root.setLayoutSizes("50%,50%");
-            root.getProperties().put("custom-prop1", "custom-prop-value1");
-            root.getProperties().put("custom-prop2", "custom-prop-value2");
-            
-            Fragment portlet = pageManager.newPortletFragment();
-            portlet.setName("security::LoginPortlet");
-            portlet.setShortTitle("Portlet");
-            portlet.setTitle("Portlet Fragment");
-            portlet.setState("Normal");
-            portlet.setLayoutRow(88);
-            portlet.setLayoutColumn(99);
-            root.getFragments().add(portlet);
-
-            pageManager.updatePage(page);
-
-            assertNotNull(page.getParent());
-            assertEquals(page.getParent().getId(), folder.getId());
-
-            PageSecurity pageSecurity = pageManager.newPageSecurity();
-            List constraintsDefs = new ArrayList(2);
-            SecurityConstraintsDef constraintsDef = pageManager.newSecurityConstraintsDef();
-            constraintsDef.setName("public-view");
-            List defConstraints = new ArrayList(1);
-            SecurityConstraint defConstraint = pageManager.newSecurityConstraint();
-            defConstraint.setUsers("*");
-            defConstraint.setPermissions("view");
-            defConstraints.add(defConstraint);
-            constraintsDef.setSecurityConstraints(defConstraints);
-            constraintsDefs.add(constraintsDef);
-            constraintsDef = pageManager.newSecurityConstraintsDef();
-            constraintsDef.setName("admin-all");
-            defConstraints = new ArrayList(2);
-            defConstraint = pageManager.newSecurityConstraint();
-            defConstraint.setRoles("admin");
-            defConstraint.setPermissions("view,edit");
-            defConstraints.add(defConstraint);
-            defConstraint = pageManager.newSecurityConstraint();
-            defConstraint.setRoles("nobody");
-            defConstraints.add(defConstraint);
-            constraintsDef.setSecurityConstraints(defConstraints);
-            constraintsDefs.add(constraintsDef);
-            pageSecurity.setSecurityConstraintsDefs(constraintsDefs);
-            List globalConstraintsRefs = new ArrayList(2);
-            globalConstraintsRefs.add("admin-all");
-            globalConstraintsRefs.add("public-view");
-            pageSecurity.setGlobalSecurityConstraintsRefs(globalConstraintsRefs);
+        assertNotNull(pageSecurity.getParent());
+        assertEquals(pageSecurity.getParent().getId(), folder.getId());
 
-            pageManager.updatePageSecurity(pageSecurity);
+        // test duplicate creates
+        try
+        {
+            Folder dupFolder = pageManager.newFolder("/");
+            pageManager.updateFolder(dupFolder);
+            assertTrue("Duplicate Folder / CREATED", false);
+        }
+        catch (FolderNotUpdatedException e)
+        {
+        }
+        try
+        {
+            Page dupPage = pageManager.newPage("/default-page.psml");
+            pageManager.updatePage(dupPage);
+            assertTrue("Duplicate Page / CREATED", false);
+        }
+        catch (PageNotUpdatedException e)
+        {
+        }
+        try
+        {
+            PageSecurity dupPageSecurity = pageManager.newPageSecurity();
+            pageManager.updatePageSecurity(dupPageSecurity);
+            assertTrue("Duplicate PageSecurity / CREATED", false);
+        }
+        catch (FailedToUpdateDocumentException e)
+        {
+        }
 
-            assertNotNull(pageSecurity.getParent());
-            assertEquals(pageSecurity.getParent().getId(), folder.getId());
+        // test folder/page creation with attributes on deep path
+        int pathIndex = deepFolderPath.indexOf('/', 1);
+        while ((pathIndex != -1) && (pathIndex <= deepFolderPath.length()))
+        {
+            folder = pageManager.newFolder(deepFolderPath.substring(0, pathIndex));
+            pageManager.updateFolder(folder);
+            assertNotNull(folder.getParent());
 
-            // test duplicate creates
-            try
-            {
-                Folder dupFolder = pageManager.newFolder("/");
-                pageManager.updateFolder(dupFolder);
-                assertTrue("Duplicate Folder / CREATED", false);
-            }
-            catch (FolderNotUpdatedException e)
-            {
-            }
-            try
-            {
-                Page dupPage = pageManager.newPage("/default-page.psml");
-                pageManager.updatePage(dupPage);
-                assertTrue("Duplicate Page / CREATED", false);
-            }
-            catch (PageNotUpdatedException e)
-            {
-            }
-            try
+            if (pathIndex < deepFolderPath.length())
             {
-                PageSecurity dupPageSecurity = pageManager.newPageSecurity();
-                pageManager.updatePageSecurity(dupPageSecurity);
-                assertTrue("Duplicate PageSecurity / CREATED", false);
+                pathIndex = deepFolderPath.indexOf('/', pathIndex+1);
+                if (pathIndex == -1)
+                {
+                    pathIndex = deepFolderPath.length();
+                }
             }
-            catch (FailedToUpdateDocumentException e)
+            else
             {
+                pathIndex = -1;
             }
-
-            /*
-            // test folder/page creation with attributes
-            folder = pageManager.newFolder(testAttributesPath);
-            pageManager.updateFolder(folder);
-            assertNull(folder.getParent());
-
-            page = pageManager.newPage(testAttributesPath + "/default-page.psml");
-            pageManager.updatePage(page);
-
-            assertNotNull(page.getParent());
-            assertEquals(page.getParent().getId(), folder.getId());
-            */
-        }
-        catch (Exception e)
-        {
-            fail("testCreates failed: "+e);
-            e.printStackTrace(System.out);
         }
+        page = pageManager.newPage(deepPagePath);
+        pageManager.updatePage(page);
+        assertNotNull(page.getParent());
+        assertEquals(page.getParent().getId(), folder.getId());
     }
     
-    public void testGets()
+    public void testGets() throws Exception
     {
+        // reset page manager cache
+        pageManager.reset();
+        
+        // read documents and folders from persisted store
         try
         {
-            // reset page manager cache
-            pageManager.reset();
-
-            // read documents and folders from persisted store
-            try
-            {
-                PageSecurity check = pageManager.getPageSecurity();
-                assertEquals("/page.security", check.getPath());
-                assertEquals("page.security", check.getName());
-                assertNotNull(check.getSecurityConstraintsDefs());
-                assertEquals(2, check.getSecurityConstraintsDefs().size());
-                assertEquals("admin-all", ((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(0)).getName());
-                assertNotNull(((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(0)).getSecurityConstraints());
-                assertEquals(2, ((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(0)).getSecurityConstraints().size());
-                assertEquals("view,edit", ((SecurityConstraint)((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(0)).getSecurityConstraints().get(0)).getPermissions());
-                assertEquals("public-view", ((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(1)).getName());
-                assertNotNull(((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(1)).getSecurityConstraints());
-                assertEquals(1, ((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(1)).getSecurityConstraints().size());
-                assertEquals("view", ((SecurityConstraint)((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(1)).getSecurityConstraints().get(0)).getPermissions());
-                assertNotNull(check.getGlobalSecurityConstraintsRefs());
-                assertEquals(2, check.getGlobalSecurityConstraintsRefs().size());
-                assertEquals("admin-all", (String)check.getGlobalSecurityConstraintsRefs().get(0));
-                assertEquals("public-view", (String)check.getGlobalSecurityConstraintsRefs().get(1));
-            }
-            catch (DocumentNotFoundException e)
-            {
-                assertTrue("PageSecurity NOT FOUND", false);
-            }
-            try
-            {
-                Page check = pageManager.getPage("/default-page.psml");
-                assertEquals("/default-page.psml", check.getPath());
-                assertEquals("default-page.psml", check.getName());
-                assertEquals("Default Page", check.getTitle());
-                assertEquals("tigris", check.getDefaultDecorator(Fragment.LAYOUT));
-                assertEquals("blue-gradient", check.getDefaultDecorator(Fragment.PORTLET));
-                assertEquals("skin-1", check.getDefaultSkin());
-                assertEquals("Default", check.getShortTitle());
-                assertNotNull(check.getMetadata());
-                assertEquals("[fr] Default Page", check.getTitle(Locale.FRENCH));
-                assertEquals("[ja] Default Page", check.getTitle(Locale.JAPANESE));
-                assertNotNull(check.getRootFragment());
-                assertEquals("blue-gradient", check.getRootFragment().getDecorator());
-                assertEquals("jetspeed-layouts::VelocityTwoColumns", check.getRootFragment().getName());
-                assertEquals("Root", check.getRootFragment().getShortTitle());
-                assertEquals("Root Fragment", check.getRootFragment().getTitle());
-                assertEquals("Normal", check.getRootFragment().getState());
-                assertEquals("50%,50%", check.getRootFragment().getLayoutSizes());
-                assertNotNull(check.getRootFragment().getProperties());
-                assertEquals("custom-prop-value1", check.getRootFragment().getProperty("custom-prop1"));
-                assertNotNull(check.getRootFragment().getFragments());
-                assertEquals(1, check.getRootFragment().getFragments().size());
-                assertEquals("security::LoginPortlet", ((Fragment)check.getRootFragment().getFragments().get(0)).getName());
-                assertEquals("Portlet", ((Fragment)check.getRootFragment().getFragments().get(0)).getShortTitle());
-                assertEquals("Portlet Fragment", ((Fragment)check.getRootFragment().getFragments().get(0)).getTitle());
-                assertEquals("Normal", ((Fragment)check.getRootFragment().getFragments().get(0)).getState());
-                assertEquals(88, ((Fragment)check.getRootFragment().getFragments().get(0)).getLayoutRow());
-                assertEquals(88, ((Fragment)check.getRootFragment().getFragments().get(0)).getIntProperty(Fragment.ROW_PROPERTY_NAME));
-                assertEquals(99, ((Fragment)check.getRootFragment().getFragments().get(0)).getLayoutColumn());
-                assertNotNull(check.getSecurityConstraints());
-                assertNotNull(check.getSecurityConstraints().getSecurityConstraintsRefs());
-                assertEquals(1, check.getSecurityConstraints().getSecurityConstraintsRefs().size());
-                assertEquals("manager-edit", (String)check.getSecurityConstraints().getSecurityConstraintsRefs().get(0));
-                assertNotNull(check.getSecurityConstraints().getSecurityConstraints());
-                assertEquals(1, check.getSecurityConstraints().getSecurityConstraints().size());
-                assertEquals("jetspeed", ((SecurityConstraint)check.getSecurityConstraints().getSecurityConstraints().get(0)).getUsers());
-            }
-            catch (PageNotFoundException e)
-            {
-                assertTrue("Page /default-page.psml NOT FOUND", false);
-            }
-            try
-            {
-                Folder check = pageManager.getFolder("/");
-                assertEquals("/", check.getPath());
-                assertEquals("/", check.getName());
-                assertEquals("Root Folder", check.getTitle());
-                assertEquals("default-page.psml", check.getDefaultPage());
-                assertEquals("Root", check.getShortTitle());
-                assertNotNull(check.getMetadata());
-                assertEquals("[fr] Root Folder", check.getTitle(Locale.FRENCH));
-                assertNotNull(check.getSecurityConstraints());
-                assertNotNull(check.getSecurityConstraints().getSecurityConstraintsRefs());
-                assertEquals(2, check.getSecurityConstraints().getSecurityConstraintsRefs().size());
-                assertEquals("public-edit", (String)check.getSecurityConstraints().getSecurityConstraintsRefs().get(1));
-                assertNotNull(check.getSecurityConstraints().getSecurityConstraints());
-                assertEquals(2, check.getSecurityConstraints().getSecurityConstraints().size());
-                assertEquals("user,admin", ((SecurityConstraint)check.getSecurityConstraints().getSecurityConstraints().get(0)).getUsers());
-                assertEquals("edit", ((SecurityConstraint)check.getSecurityConstraints().getSecurityConstraints().get(1)).getPermissions());
-            }
-            catch (FolderNotFoundException e)
-            {
-                assertTrue("Folder / NOT FOUND", false);
-            }
-            /*
-            try
-            {
-                Page check = pageManager.getPage(testAttributesPath + "/default-page.psml");
-                assertEquals(verifyTestAttributesPath + "/default-page.psml", check.getPath());
-            }
-            catch (PageNotFoundException e)
-            {
-                assertTrue("Page " + testAttributesPath + "/default-page.psml NOT FOUND", false);
-            }
-            try
-            {
-                Folder check = pageManager.getFolder(testAttributesPath);
-                assertEquals(verifyTestAttributesPath, check.getPath());
-            }
-            catch (FolderNotFoundException e)
-            {
-                assertTrue("Folder " + testAttributesPath + " NOT FOUND", false);
-            }
-            */
+            PageSecurity check = pageManager.getPageSecurity();
+            assertEquals("/page.security", check.getPath());
+            assertEquals("page.security", check.getName());
+            assertNotNull(check.getSecurityConstraintsDefs());
+            assertEquals(2, check.getSecurityConstraintsDefs().size());
+            assertEquals("admin-all", ((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(0)).getName());
+            assertNotNull(((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(0)).getSecurityConstraints());
+            assertEquals(2, ((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(0)).getSecurityConstraints().size());
+            assertEquals("view,edit", ((SecurityConstraint)((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(0)).getSecurityConstraints().get(0)).getPermissions());
+            assertEquals("public-view", ((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(1)).getName());
+            assertNotNull(((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(1)).getSecurityConstraints());
+            assertEquals(1, ((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(1)).getSecurityConstraints().size());
+            assertEquals("view", ((SecurityConstraint)((SecurityConstraintsDef)check.getSecurityConstraintsDefs().get(1)).getSecurityConstraints().get(0)).getPermissions());
+            assertNotNull(check.getGlobalSecurityConstraintsRefs());
+            assertEquals(2, check.getGlobalSecurityConstraintsRefs().size());
+            assertEquals("admin-all", (String)check.getGlobalSecurityConstraintsRefs().get(0));
+            assertEquals("public-view", (String)check.getGlobalSecurityConstraintsRefs().get(1));
         }
-        catch (Exception e)
+        catch (DocumentNotFoundException e)
         {
-            fail("testGets failed: "+e);
-            e.printStackTrace(System.out);
+            assertTrue("PageSecurity NOT FOUND", false);
+        }
+        try
+        {
+            Page check = pageManager.getPage("/default-page.psml");
+            assertEquals("/default-page.psml", check.getPath());
+            assertEquals("default-page.psml", check.getName());
+            assertEquals("Default Page", check.getTitle());
+            assertEquals("tigris", check.getDefaultDecorator(Fragment.LAYOUT));
+            assertEquals("blue-gradient", check.getDefaultDecorator(Fragment.PORTLET));
+            assertEquals("skin-1", check.getDefaultSkin());
+            assertEquals("Default", check.getShortTitle());
+            assertNotNull(check.getMetadata());
+            assertEquals("[fr] Default Page", check.getTitle(Locale.FRENCH));
+            assertEquals("[ja] Default Page", check.getTitle(Locale.JAPANESE));
+            assertNotNull(check.getRootFragment());
+            assertEquals("blue-gradient", check.getRootFragment().getDecorator());
+            assertEquals("jetspeed-layouts::VelocityTwoColumns", check.getRootFragment().getName());
+            assertEquals("Root", check.getRootFragment().getShortTitle());
+            assertEquals("Root Fragment", check.getRootFragment().getTitle());
+            assertEquals("Normal", check.getRootFragment().getState());
+            assertEquals("50%,50%", check.getRootFragment().getLayoutSizes());
+            assertNotNull(check.getRootFragment().getProperties());
+            assertEquals("custom-prop-value1", check.getRootFragment().getProperty("custom-prop1"));
+            assertNotNull(check.getRootFragment().getFragments());
+            assertEquals(1, check.getRootFragment().getFragments().size());
+            assertEquals("security::LoginPortlet", ((Fragment)check.getRootFragment().getFragments().get(0)).getName());
+            assertEquals("Portlet", ((Fragment)check.getRootFragment().getFragments().get(0)).getShortTitle());
+            assertEquals("Portlet Fragment", ((Fragment)check.getRootFragment().getFragments().get(0)).getTitle());
+            assertEquals("Normal", ((Fragment)check.getRootFragment().getFragments().get(0)).getState());
+            assertEquals(88, ((Fragment)check.getRootFragment().getFragments().get(0)).getLayoutRow());
+            assertEquals(88, ((Fragment)check.getRootFragment().getFragments().get(0)).getIntProperty(Fragment.ROW_PROPERTY_NAME));
+            assertEquals(99, ((Fragment)check.getRootFragment().getFragments().get(0)).getLayoutColumn());
+            assertNotNull(check.getSecurityConstraints());
+            assertNotNull(check.getSecurityConstraints().getSecurityConstraintsRefs());
+            assertEquals(1, check.getSecurityConstraints().getSecurityConstraintsRefs().size());
+            assertEquals("manager-edit", (String)check.getSecurityConstraints().getSecurityConstraintsRefs().get(0));
+            assertNotNull(check.getSecurityConstraints().getSecurityConstraints());
+            assertEquals(1, check.getSecurityConstraints().getSecurityConstraints().size());
+            assertEquals("jetspeed", ((SecurityConstraint)check.getSecurityConstraints().getSecurityConstraints().get(0)).getUsers());
+        }
+        catch (PageNotFoundException e)
+        {
+            assertTrue("Page /default-page.psml NOT FOUND", false);
+        }
+        try
+        {
+            Folder check = pageManager.getFolder("/");
+            assertEquals("/", check.getPath());
+            assertEquals("/", check.getName());
+            assertEquals("Root Folder", check.getTitle());
+            assertEquals("default-page.psml", check.getDefaultPage());
+            assertEquals("Root", check.getShortTitle());
+            assertNotNull(check.getMetadata());
+            assertEquals("[fr] Root Folder", check.getTitle(Locale.FRENCH));
+            assertNotNull(check.getSecurityConstraints());
+            assertNotNull(check.getSecurityConstraints().getSecurityConstraintsRefs());
+            assertEquals(2, check.getSecurityConstraints().getSecurityConstraintsRefs().size());
+            assertEquals("public-edit", (String)check.getSecurityConstraints().getSecurityConstraintsRefs().get(1));
+            assertNotNull(check.getSecurityConstraints().getSecurityConstraints());
+            assertEquals(2, check.getSecurityConstraints().getSecurityConstraints().size());
+            assertEquals("user,admin", ((SecurityConstraint)check.getSecurityConstraints().getSecurityConstraints().get(0)).getUsers());
+            assertEquals("edit", ((SecurityConstraint)check.getSecurityConstraints().getSecurityConstraints().get(1)).getPermissions());
+        }
+        catch (FolderNotFoundException e)
+        {
+            assertTrue("Folder / NOT FOUND", false);
+        }
+        
+        try
+        {
+            Page check = pageManager.getPage(deepPagePath);
+            assertEquals(deepPagePath, check.getPath());
+        }
+        catch (PageNotFoundException e)
+        {
+            assertTrue("Page " + deepPagePath + " NOT FOUND", false);
+        }
+        try
+        {
+            Folder check = pageManager.getFolder(deepFolderPath);
+            assertEquals(deepFolderPath, check.getPath());
+        }
+        catch (FolderNotFoundException e)
+        {
+            assertTrue("Folder " + deepFolderPath + " NOT FOUND", false);
         }
     }
 
-    public void testRemoves()
+    public void testRemoves() throws Exception
     {
+        // reset page manager cache
+        pageManager.reset();
+        
+        // remove root folder
         try
         {
-            // reset page manager cache
-            pageManager.reset();
-
-            // remove root folders
-            try
-            {
-                Folder remove = pageManager.getFolder("/");
-                assertEquals("/", remove.getPath());
-                pageManager.removeFolder(remove);
-            }
-            catch (FolderNotFoundException e)
-            {
-                assertTrue("Folder / NOT FOUND", false);
-            }
-            /*
-            try
-            {
-                Folder remove = pageManager.getFolder(testAttributesPath);
-                assertEquals(verifyTestAttributesPath, remove.getPath());
-                pageManager.removeFolder(remove);
-            }
-            catch (FolderNotFoundException e)
-            {
-                assertTrue("Folder " + testAttributesPath + " NOT FOUND", false);
-            }
-            */
-
-            // reset page manager cache
-            pageManager.reset();
-
-            // verify root folder removal
-            try
-            {
-                Folder check = pageManager.getFolder("/");
-                assertTrue("Folder / FOUND", false);
-            }
-            catch (FolderNotFoundException e)
-            {
-            }
-            /*
-            try
-            {
-                Folder check = pageManager.getFolder(testAttributesPath);
-                assertTrue("Folder " + testAttributesPath + " FOUND", false);
-            }
-            catch (FolderNotFoundException e)
-            {
-            }
-            */
+            Folder remove = pageManager.getFolder("/");
+            assertEquals("/", remove.getPath());
+            pageManager.removeFolder(remove);
+        }
+        catch (FolderNotFoundException e)
+        {
+            assertTrue("Folder / NOT FOUND", false);
+        }
+        
+        // reset page manager cache
+        pageManager.reset();
+        
+        // verify root folder deep removal
+        try
+        {
+            Folder check = pageManager.getFolder("/");
+            assertTrue("Folder / FOUND", false);
+        }
+        catch (FolderNotFoundException e)
+        {
+        }
+        try
+        {
+            PageSecurity check = pageManager.getPageSecurity();
+            assertTrue("PageSecurity FOUND", false);
+        }
+        catch (DocumentNotFoundException e)
+        {
+        }
+        try
+        {
+            Page check = pageManager.getPage("/default-page.psml");
+            assertTrue("Page /default-page.psml FOUND", false);
+        }
+        catch (PageNotFoundException e)
+        {
+        }
+        try
+        {
+            Folder check = pageManager.getFolder("/");
+            assertTrue("Folder / FOUND", false);
+        }
+        catch (FolderNotFoundException e)
+        {
+        }
+        try
+        {
+            Folder check = pageManager.getFolder(deepFolderPath);
+            assertTrue("Folder " + deepFolderPath + " FOUND", false);
+        }
+        catch (FolderNotFoundException e)
+        {
+        }
+        try
+        {
+            Page check = pageManager.getPage(deepPagePath);
+            assertTrue("Page " + deepPagePath + " FOUND", false);
         }
-        catch (Exception e)
+        catch (PageNotFoundException e)
         {
-            fail("testRemoves failed: "+e);
-            e.printStackTrace(System.out);
         }
     }
 }

Modified: portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml?rev=331939&r1=331938&r2=331939&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml (original)
+++ portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml Tue Nov  8 19:38:49 2005
@@ -24,20 +24,20 @@
     <table name="FOLDER">
         <column name="FOLDER_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="PARENT_ID" type="INTEGER"/>
-        <column name="PATH" required="true" size="160" type="VARCHAR"/>
+        <column name="PATH" required="true" size="240" type="VARCHAR"/>
         <column name="NAME" required="true" size="80" type="VARCHAR"/>
         <column name="TITLE" size="100" type="VARCHAR"/>
         <column name="SHORT_TITLE" size="40" type="VARCHAR"/>
         <column name="IS_HIDDEN" required="true" type="BOOLEANINT"/>
         <column name="DEFAULT_PAGE_NAME" size="80" type="VARCHAR"/>
-        <column name="SUBSITE" required="true" size="40" type="VARCHAR"/>
-        <column name="USER_PRINCIPAL" required="true" size="40" type="VARCHAR"/>
-        <column name="ROLE_PRINCIPAL" required="true" size="40" type="VARCHAR"/>
-        <column name="GROUP_PRINCIPAL" required="true" size="40" type="VARCHAR"/>
-        <column name="MEDIATYPE" required="true" size="15" type="VARCHAR"/>
-        <column name="LOCALE" required="true" size="20" type="VARCHAR"/>
-        <column name="EXT_ATTR_NAME" required="true" size="15" type="VARCHAR"/>
-        <column name="EXT_ATTR_VALUE" required="true" size="40" type="VARCHAR"/>
+        <column name="SUBSITE" size="40" type="VARCHAR"/>
+        <column name="USER_PRINCIPAL" size="40" type="VARCHAR"/>
+        <column name="ROLE_PRINCIPAL" size="40" type="VARCHAR"/>
+        <column name="GROUP_PRINCIPAL" size="40" type="VARCHAR"/>
+        <column name="MEDIATYPE" size="15" type="VARCHAR"/>
+        <column name="LOCALE" size="20" type="VARCHAR"/>
+        <column name="EXT_ATTR_NAME" size="15" type="VARCHAR"/>
+        <column name="EXT_ATTR_VALUE" size="40" type="VARCHAR"/>
         <column name="OWNER_PRINCIPAL" size="40" type="VARCHAR"/>
         <foreign-key foreignTable="FOLDER" onDelete="cascade">
             <reference foreign="FOLDER_ID" local="PARENT_ID"/>
@@ -70,8 +70,8 @@
         </unique>
     </table>
 
-    <table name="FOLDER_CNSTRNT">
-        <column name="CNSTRNT_ID" primaryKey="true" required="true" type="INTEGER"/>
+    <table name="FOLDER_CONSTRAINT">
+        <column name="CONSTRAINT_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="FOLDER_ID" type="INTEGER" required="true"/>
         <column name="APPLY_ORDER" type="INTEGER" required="true"/>
         <column name="USER_PRINCIPALS_ACL" size="120" type="VARCHAR"/>
@@ -81,20 +81,20 @@
         <foreign-key foreignTable="FOLDER" onDelete="cascade">
             <reference foreign="FOLDER_ID" local="FOLDER_ID"/>
         </foreign-key>
-        <index name="IX_FOLDER_CNSTRNT_1">
+        <index name="IX_FOLDER_CONSTRAINT_1">
             <index-column name="FOLDER_ID"/>
         </index>
     </table>
 
-    <table name="FOLDER_CNSTRNTS_REF">
-        <column name="CNSTRNTS_REF_ID" primaryKey="true" required="true" type="INTEGER"/>
+    <table name="FOLDER_CONSTRAINTS_REF">
+        <column name="CONSTRAINTS_REF_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="FOLDER_ID" type="INTEGER" required="true"/>
         <column name="APPLY_ORDER" type="INTEGER" required="true"/>
         <column name="NAME" size="40" type="VARCHAR" required="true"/>
         <foreign-key foreignTable="FOLDER" onDelete="cascade">
             <reference foreign="FOLDER_ID" local="FOLDER_ID"/>
         </foreign-key>
-        <index name="IX_FOLDER_CNSTRNTS_REF_1">
+        <index name="IX_FOLDER_CONSTRAINTS_REF_1">
             <index-column name="FOLDER_ID"/>
         </index>
     </table>
@@ -106,7 +106,7 @@
     <table name="PAGE">
         <column name="PAGE_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="PARENT_ID" type="INTEGER" required="true"/>
-        <column name="PATH" required="true" size="160" type="VARCHAR"/>
+        <column name="PATH" required="true" size="240" type="VARCHAR"/>
         <column name="NAME" required="true" size="80" type="VARCHAR"/>
         <column name="TITLE" size="100" type="VARCHAR"/>
         <column name="SHORT_TITLE" size="40" type="VARCHAR"/>
@@ -114,14 +114,14 @@
         <column name="SKIN" size="80" type="VARCHAR"/>
         <column name="DEFAULT_LAYOUT_DECORATOR" size="80" type="VARCHAR"/>
         <column name="DEFAULT_PORTLET_DECORATOR" size="80" type="VARCHAR"/>
-        <column name="SUBSITE" required="true" size="40" type="VARCHAR"/>
-        <column name="USER_PRINCIPAL" required="true" size="40" type="VARCHAR"/>
-        <column name="ROLE_PRINCIPAL" required="true" size="40" type="VARCHAR"/>
-        <column name="GROUP_PRINCIPAL" required="true" size="40" type="VARCHAR"/>
-        <column name="MEDIATYPE" required="true" size="15" type="VARCHAR"/>
-        <column name="LOCALE" required="true" size="20" type="VARCHAR"/>
-        <column name="EXT_ATTR_NAME" required="true" size="15" type="VARCHAR"/>
-        <column name="EXT_ATTR_VALUE" required="true" size="40" type="VARCHAR"/>
+        <column name="SUBSITE" size="40" type="VARCHAR"/>
+        <column name="USER_PRINCIPAL" size="40" type="VARCHAR"/>
+        <column name="ROLE_PRINCIPAL" size="40" type="VARCHAR"/>
+        <column name="GROUP_PRINCIPAL" size="40" type="VARCHAR"/>
+        <column name="MEDIATYPE" size="15" type="VARCHAR"/>
+        <column name="LOCALE" size="20" type="VARCHAR"/>
+        <column name="EXT_ATTR_NAME" size="15" type="VARCHAR"/>
+        <column name="EXT_ATTR_VALUE" size="40" type="VARCHAR"/>
         <column name="OWNER_PRINCIPAL" size="40" type="VARCHAR"/>
         <foreign-key foreignTable="FOLDER" onDelete="cascade">
             <reference foreign="FOLDER_ID" local="PARENT_ID"/>
@@ -154,8 +154,8 @@
         </unique>
     </table>
 
-    <table name="PAGE_CNSTRNT">
-        <column name="CNSTRNT_ID" primaryKey="true" required="true" type="INTEGER"/>
+    <table name="PAGE_CONSTRAINT">
+        <column name="CONSTRAINT_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="PAGE_ID" type="INTEGER" required="true"/>
         <column name="APPLY_ORDER" type="INTEGER" required="true"/>
         <column name="USER_PRINCIPALS_ACL" size="120" type="VARCHAR"/>
@@ -165,20 +165,20 @@
         <foreign-key foreignTable="PAGE" onDelete="cascade">
             <reference foreign="PAGE_ID" local="PAGE_ID"/>
         </foreign-key>
-        <index name="IX_PAGE_CNSTRNT_1">
+        <index name="IX_PAGE_CONSTRAINT_1">
             <index-column name="PAGE_ID"/>
         </index>
     </table>
 
-    <table name="PAGE_CNSTRNTS_REF">
-        <column name="CNSTRNTS_REF_ID" primaryKey="true" required="true" type="INTEGER"/>
+    <table name="PAGE_CONSTRAINTS_REF">
+        <column name="CONSTRAINTS_REF_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="PAGE_ID" type="INTEGER" required="true"/>
         <column name="APPLY_ORDER" type="INTEGER" required="true"/>
         <column name="NAME" size="40" type="VARCHAR" required="true"/>
         <foreign-key foreignTable="PAGE" onDelete="cascade">
             <reference foreign="PAGE_ID" local="PAGE_ID"/>
         </foreign-key>
-        <index name="IX_PAGE_CNSTRNTS_REF_1">
+        <index name="IX_PAGE_CONSTRAINTS_REF_1">
             <index-column name="PAGE_ID"/>
         </index>
     </table>
@@ -220,8 +220,8 @@
         </unique>
     </table>
 
-    <table name="FRAGMENT_CNSTRNT">
-        <column name="CNSTRNT_ID" primaryKey="true" required="true" type="INTEGER"/>
+    <table name="FRAGMENT_CONSTRAINT">
+        <column name="CONSTRAINT_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="FRAGMENT_ID" type="INTEGER" required="true"/>
         <column name="APPLY_ORDER" type="INTEGER" required="true"/>
         <column name="USER_PRINCIPALS_ACL" size="120" type="VARCHAR"/>
@@ -231,20 +231,20 @@
         <foreign-key foreignTable="FRAGMENT" onDelete="cascade">
             <reference foreign="FRAGMENT_ID" local="FRAGMENT_ID"/>
         </foreign-key>
-        <index name="IX_FRAGMENT_CNSTRNT_1">
+        <index name="IX_FRAGMENT_CONSTRAINT_1">
             <index-column name="FRAGMENT_ID"/>
         </index>
     </table>
 
-    <table name="FRAGMENT_CNSTRNTS_REF">
-        <column name="CNSTRNTS_REF_ID" primaryKey="true" required="true" type="INTEGER"/>
+    <table name="FRAGMENT_CONSTRAINTS_REF">
+        <column name="CONSTRAINTS_REF_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="FRAGMENT_ID" type="INTEGER" required="true"/>
         <column name="APPLY_ORDER" type="INTEGER" required="true"/>
         <column name="NAME" size="40" type="VARCHAR" required="true"/>
         <foreign-key foreignTable="FRAGMENT" onDelete="cascade">
             <reference foreign="FRAGMENT_ID" local="FRAGMENT_ID"/>
         </foreign-key>
-        <index name="IX_FRAGMENT_CNSTRNTS_REF_1">
+        <index name="IX_FRAGMENT_CONSTRAINTS_REF_1">
             <index-column name="FRAGMENT_ID"/>
         </index>
     </table>
@@ -253,57 +253,57 @@
        Page Security Definition
     -->
 
-    <table name="PAGE_SEC">
-        <column name="PAGE_SEC_ID" primaryKey="true" required="true" type="INTEGER"/>
+    <table name="PAGE_SECURITY">
+        <column name="PAGE_SECURITY_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="PARENT_ID" type="INTEGER" required="true"/>
-        <column name="PATH" required="true" size="160" type="VARCHAR"/>
+        <column name="PATH" required="true" size="240" type="VARCHAR"/>
         <column name="NAME" required="true" size="80" type="VARCHAR"/>
-        <column name="SUBSITE" required="true" size="40" type="VARCHAR"/>
-        <column name="USER_PRINCIPAL" required="true" size="40" type="VARCHAR"/>
-        <column name="ROLE_PRINCIPAL" required="true" size="40" type="VARCHAR"/>
-        <column name="GROUP_PRINCIPAL" required="true" size="40" type="VARCHAR"/>
-        <column name="MEDIATYPE" required="true" size="15" type="VARCHAR"/>
-        <column name="LOCALE" required="true" size="20" type="VARCHAR"/>
-        <column name="EXT_ATTR_NAME" required="true" size="15" type="VARCHAR"/>
-        <column name="EXT_ATTR_VALUE" required="true" size="40" type="VARCHAR"/>
+        <column name="SUBSITE" size="40" type="VARCHAR"/>
+        <column name="USER_PRINCIPAL" size="40" type="VARCHAR"/>
+        <column name="ROLE_PRINCIPAL" size="40" type="VARCHAR"/>
+        <column name="GROUP_PRINCIPAL" size="40" type="VARCHAR"/>
+        <column name="MEDIATYPE" size="15" type="VARCHAR"/>
+        <column name="LOCALE" size="20" type="VARCHAR"/>
+        <column name="EXT_ATTR_NAME" size="15" type="VARCHAR"/>
+        <column name="EXT_ATTR_VALUE" size="40" type="VARCHAR"/>
         <foreign-key foreignTable="FOLDER" onDelete="cascade">
             <reference foreign="FOLDER_ID" local="PARENT_ID"/>
         </foreign-key>
-        <unique name="UN_PAGE_SEC_1">
+        <unique name="UN_PAGE_SECURITY_1">
             <unique-column name="PARENT_ID"/>
         </unique>
-        <unique name="UN_PAGE_SEC_2">
+        <unique name="UN_PAGE_SECURITY_2">
             <unique-column name="PATH"/>
         </unique>
     </table>
     
-    <table name="PAGE_SEC_CNSTRNTS_DEF">
-        <column name="CNSTRNTS_DEF_ID" primaryKey="true" required="true" type="INTEGER"/>
-        <column name="PAGE_SEC_ID" type="INTEGER" required="true"/>
+    <table name="PAGE_SECURITY_CONSTRAINTS_DEF">
+        <column name="CONSTRAINTS_DEF_ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="PAGE_SECURITY_ID" type="INTEGER" required="true"/>
         <column name="NAME" required="true" size="40" type="VARCHAR"/>
         <column name="APPLY_ORDER" type="INTEGER" required="true"/>
         <column name="USER_PRINCIPALS_ACL" size="120" type="VARCHAR"/>
         <column name="ROLE_PRINCIPALS_ACL" size="120" type="VARCHAR"/>
         <column name="GROUP_PRINCIPALS_ACL" size="120" type="VARCHAR"/>
         <column name="PERMISSIONS_ACL" size="120" type="VARCHAR"/>
-        <foreign-key foreignTable="PAGE_SEC" onDelete="cascade">
-            <reference foreign="PAGE_SEC_ID" local="PAGE_SEC_ID"/>
+        <foreign-key foreignTable="PAGE_SECURITY" onDelete="cascade">
+            <reference foreign="PAGE_SECURITY_ID" local="PAGE_SECURITY_ID"/>
         </foreign-key>
-        <index name="IX_PAGE_SEC_CNSTRNTS_DEF_1">
-            <index-column name="PAGE_SEC_ID"/>
+        <index name="IX_PAGE_SEC_CONSTRAINTS_DEF_1">
+            <index-column name="PAGE_SECURITY_ID"/>
         </index>
     </table>
 
-    <table name="PAGE_SEC_CNSTRNTS_REF">
-        <column name="CNSTRNTS_REF_ID" primaryKey="true" required="true" type="INTEGER"/>
-        <column name="PAGE_SEC_ID" type="INTEGER" required="true"/>
+    <table name="PAGE_SECURITY_CONSTRAINTS_REF">
+        <column name="CONSTRAINTS_REF_ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="PAGE_SECURITY_ID" type="INTEGER" required="true"/>
         <column name="APPLY_ORDER" type="INTEGER" required="true"/>
         <column name="NAME" size="40" type="VARCHAR" required="true"/>
-        <foreign-key foreignTable="PAGE_SEC" onDelete="cascade">
-            <reference foreign="PAGE_SEC_ID" local="PAGE_SEC_ID"/>
+        <foreign-key foreignTable="PAGE_SECURITY" onDelete="cascade">
+            <reference foreign="PAGE_SECURITY_ID" local="PAGE_SECURITY_ID"/>
         </foreign-key>
-        <index name="IX_PAGE_SEC_CNSTRNTS_REF_1">
-            <index-column name="PAGE_SEC_ID"/>
+        <index name="IX_PAGE_SEC_CONSTRAINTS_REF_1">
+            <index-column name="PAGE_SECURITY_ID"/>
         </index>
     </table>
 

Modified: portals/jetspeed-2/trunk/etc/sql/drop.sql
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/sql/drop.sql?rev=331939&r1=331938&r2=331939&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/etc/sql/drop.sql (original)
+++ portals/jetspeed-2/trunk/etc/sql/drop.sql Tue Nov  8 19:38:49 2005
@@ -16,18 +16,18 @@
 DROP TABLE MEDIATYPE_TO_CAPABILITY;
 DROP TABLE MEDIATYPE_TO_MIMETYPE;
 
-DROP TABLE PAGE_SEC_CNSTRNTS_REF;
-DROP TABLE PAGE_SEC_CNSTRNTS_DEF;
-DROP TABLE PAGE_SEC;
-DROP TABLE FRAGMENT_CNSTRNTS_REF;
-DROP TABLE FRAGMENT_CNSTRNT;
+DROP TABLE PAGE_SECURITY_CONSTRAINTS_REF;
+DROP TABLE PAGE_SECURITY_CONSTRAINTS_DEF;
+DROP TABLE PAGE_SECURITY;
+DROP TABLE FRAGMENT_CONSTRAINTS_REF;
+DROP TABLE FRAGMENT_CONSTRAINT;
 DROP TABLE FRAGMENT;
-DROP TABLE PAGE_CNSTRNTS_REF;
-DROP TABLE PAGE_CNSTRNT;
+DROP TABLE PAGE_CONSTRAINTS_REF;
+DROP TABLE PAGE_CONSTRAINT;
 DROP TABLE PAGE_METADATA;
 DROP TABLE PAGE;
-DROP TABLE FOLDER_CNSTRNTS_REF;
-DROP TABLE FOLDER_CNSTRNT;
+DROP TABLE FOLDER_CONSTRAINTS_REF;
+DROP TABLE FOLDER_CONSTRAINT;
 DROP TABLE FOLDER_METADATA;
 DROP TABLE FOLDER;
 

Modified: portals/jetspeed-2/trunk/etc/sql/oracle/drop.sql
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/sql/oracle/drop.sql?rev=331939&r1=331938&r2=331939&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/etc/sql/oracle/drop.sql (original)
+++ portals/jetspeed-2/trunk/etc/sql/oracle/drop.sql Tue Nov  8 19:38:49 2005
@@ -21,18 +21,18 @@
 DROP TABLE MEDIATYPE_TO_CAPABILITY;
 DROP TABLE MEDIATYPE_TO_MIMETYPE;
 
-DROP TABLE PAGE_SEC_CNSTRNTS_REF;
-DROP TABLE PAGE_SEC_CNSTRNTS_DEF;
-DROP TABLE PAGE_SEC;
-DROP TABLE FRAGMENT_CNSTRNTS_REF;
-DROP TABLE FRAGMENT_CNSTRNT;
+DROP TABLE PAGE_SECURITY_CONSTRAINTS_REF;
+DROP TABLE PAGE_SECURITY_CONSTRAINTS_DEF;
+DROP TABLE PAGE_SECURITY;
+DROP TABLE FRAGMENT_CONSTRAINTS_REF;
+DROP TABLE FRAGMENT_CONSTRAINT;
 DROP TABLE FRAGMENT;
-DROP TABLE PAGE_CNSTRNTS_REF;
-DROP TABLE PAGE_CNSTRNT;
+DROP TABLE PAGE_CONSTRAINTS_REF;
+DROP TABLE PAGE_CONSTRAINT;
 DROP TABLE PAGE_METADATA;
 DROP TABLE PAGE;
-DROP TABLE FOLDER_CNSTRNTS_REF;
-DROP TABLE FOLDER_CNSTRNT;
+DROP TABLE FOLDER_CONSTRAINTS_REF;
+DROP TABLE FOLDER_CONSTRAINT;
 DROP TABLE FOLDER_METADATA;
 DROP TABLE FOLDER;
 

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java?rev=331939&r1=331938&r2=331939&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java Tue Nov  8 19:38:49 2005
@@ -68,16 +68,6 @@
     int RESERVED_FOLDER_OTHER = 9999;
     
     /**
-     * isRootFolder
-     *
-     * Tests whether this folder's path is a root folder based on the
-     * rules associated with the folder implementation;
-     *
-     * @return flag indicating whether folder path is a root path
-     */
-    boolean isRootFolder();
-
-    /**
      * getDocumentOrder
      *
      * @return list of ordered document names in folder



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