portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r392042 [1/2] - 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/ compo...
Date Thu, 06 Apr 2006 19:13:04 GMT
Author: rwatler
Date: Thu Apr  6 12:13:00 2006
New Revision: 392042

URL: http://svn.apache.org/viewcvs?rev=392042&view=rev
Log:
- remove OJB proxies from DBPM mappings
- infuse PM transaction proxy into Folder OM implementations
- allow *NotFoundExceptions to continue current transaction in PM APIs, (not rollback)
- cleanup PM exceptions:
  - throw NodeException deriviatives for failures
  - throw NodeNotFoundException derivitives for informational exceptions
  - transactions rolled back on runtime exceptions or NodeExceptions, (not JetspeedException)


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/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/PageManagerUtils.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.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/impl/DatabasePageManagerCache.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/database-page-manager.xml
    portals/jetspeed-2/trunk/components/page-manager/src/test/secure-database-page-manager.xml
    portals/jetspeed-2/trunk/components/page-manager/src/test/secure-permissions-database-page-manager.xml
    portals/jetspeed-2/trunk/components/page-manager/src/test/tx-page-manager.xml
    portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java
    portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
    portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
    portals/jetspeed-2/trunk/etc/import/assembly/import-page-manager.xml
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotRemovedException.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotUpdatedException.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotRemovedException.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotUpdatedException.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageNotRemovedException.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageNotUpdatedException.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/NodeException.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/NodeNotFoundException.java
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/db-page-manager.xml

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=392042&r1=392041&r2=392042&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 Thu Apr  6 12:13:00 2006
@@ -45,7 +45,6 @@
           auto-retrieve="true"
           auto-delete="link"
           auto-update="link"
-          proxy="true"
           >
          <foreignkey field-ref="parentId"/>
       </reference-descriptor>
@@ -56,7 +55,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <inverse-foreignkey field-ref="folderId"/>
       </collection-descriptor>
@@ -176,7 +174,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="folderId"/>
@@ -188,7 +185,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="folderId"/>
@@ -200,7 +196,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="sortOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="folderId"/>
@@ -212,7 +207,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="name" sort="ASC"/>
          <inverse-foreignkey field-ref="folderId"/>
@@ -491,7 +485,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <inverse-foreignkey field-ref="menuId"/>
       </collection-descriptor>
@@ -502,7 +495,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="elementOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="parentId"/>
@@ -723,7 +715,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <inverse-foreignkey field-ref="menuId"/>
       </collection-descriptor>
@@ -798,7 +789,6 @@
           auto-retrieve="true"
           auto-delete="link"
           auto-update="link"
-          proxy="true"
           >
          <foreignkey field-ref="parentId"/>
       </reference-descriptor>
@@ -809,7 +799,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <inverse-foreignkey field-ref="pageId"/>
       </collection-descriptor>
@@ -820,7 +809,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <inverse-foreignkey field-ref="pageId"/>
       </collection-descriptor>
@@ -940,7 +928,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="pageId"/>
@@ -952,7 +939,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="pageId"/>
@@ -964,7 +950,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="name" sort="ASC"/>
          <inverse-foreignkey field-ref="pageId"/>
@@ -1212,7 +1197,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <inverse-foreignkey field-ref="menuId"/>
       </collection-descriptor>
@@ -1223,7 +1207,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="elementOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="parentId"/>
@@ -1444,7 +1427,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <inverse-foreignkey field-ref="menuId"/>
       </collection-descriptor>
@@ -1517,7 +1499,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="id" sort="ASC"/>
          <inverse-foreignkey field-ref="parentId"/>
@@ -1662,7 +1643,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="fragmentId"/>
@@ -1674,7 +1654,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="fragmentId"/>
@@ -1686,7 +1665,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="name" sort="ASC"/>
          <inverse-foreignkey field-ref="fragmentId"/>
@@ -1817,7 +1795,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <inverse-foreignkey field-ref="prefId"/>
       </collection-descriptor>
@@ -1884,7 +1861,6 @@
           auto-retrieve="true"
           auto-delete="link"
           auto-update="link"
-          proxy="true"
           >
          <foreignkey field-ref="parentId"/>
       </reference-descriptor>
@@ -1895,7 +1871,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <inverse-foreignkey field-ref="pageId"/>
       </collection-descriptor>
@@ -2015,7 +1990,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="pageId"/>
@@ -2027,7 +2001,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="pageId"/>
@@ -2190,7 +2163,6 @@
           auto-retrieve="true"
           auto-delete="link"
           auto-update="link"
-          proxy="true"
           >
          <foreignkey field-ref="parentId"/>
       </reference-descriptor>
@@ -2267,7 +2239,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="name" sort="ASC"/>
          <inverse-foreignkey field-ref="pageSecurityId"/>
@@ -2279,7 +2250,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="pageSecurityId"/>
@@ -2317,7 +2287,6 @@
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
-          proxy="true"
       >
          <orderby name="applyOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="constraintsDefId"/>

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=392042&r1=392041&r2=392042&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 Thu Apr  6 12:13:00 2006
@@ -44,6 +44,7 @@
 import org.apache.jetspeed.page.document.DocumentNotFoundException;
 import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.page.document.NodeException;
+import org.apache.jetspeed.page.document.NodeNotFoundException;
 import org.apache.jetspeed.page.document.NodeSet;
 import org.apache.jetspeed.page.document.impl.NodeImpl;
 import org.apache.jetspeed.page.document.impl.NodeSetImpl;
@@ -478,6 +479,9 @@
             catch (NodeException ne)
             {
             }
+            catch (NodeNotFoundException nnfe)
+            {
+            }
         }
         else if (pageSecurity != null)
         {
@@ -661,7 +665,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.folder.Folder#getFolders()
      */
-    public NodeSet getFolders() throws FolderNotFoundException, DocumentException
+    public NodeSet getFolders() throws DocumentException
     {
         // get folders collection
         if (!foldersCached)
@@ -813,7 +817,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.folder.Folder#getAll()
      */
-    public NodeSet getAll() throws FolderNotFoundException, DocumentException
+    public NodeSet getAll() throws DocumentException
     {
         // get all nodes collection
         if (!allCached)

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=392042&r1=392041&r2=392042&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 Thu Apr  6 12:13:00 2006
@@ -43,6 +43,7 @@
 import org.apache.jetspeed.page.document.FolderHandler;
 import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.page.document.NodeException;
+import org.apache.jetspeed.page.document.NodeNotFoundException;
 import org.apache.jetspeed.page.document.NodeSet;
 import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
 import org.apache.jetspeed.page.document.psml.AbstractNode;
@@ -192,10 +193,9 @@
      * 
      * @param checkAccess flag
      * @return folders node set
-     * @throws FolderNotFoundException
      * @throws DocumentException
      */
-    public NodeSet getFolders(boolean checkAccess) throws FolderNotFoundException, DocumentException
+    public NodeSet getFolders(boolean checkAccess) throws DocumentException
     {
         // get list of all folders
         NodeSet folders = getAllNodes().subset(FOLDER_TYPE);
@@ -213,7 +213,7 @@
      * 
      * @see org.apache.jetspeed.om.folder.Folder#getFolders()
      */
-    public NodeSet getFolders() throws FolderNotFoundException, DocumentException
+    public NodeSet getFolders() throws DocumentException
     {
         // by default enable access checks
         return getFolders(true);
@@ -446,7 +446,7 @@
      * 
      * @see org.apache.jetspeed.om.folder.Folder#getAll()
      */
-    public NodeSet getAll() throws FolderNotFoundException, DocumentException
+    public NodeSet getAll() throws DocumentException
     {
         // return secure set of all nodes: enforce access checks
         // on folders and documents while creating filtered nodes
@@ -499,9 +499,8 @@
      *
      * @return all nodes immediatley under this
      * @throws DocumentException
-     * @throws FolderNotFoundException
      */
-    public NodeSet getAllNodes() throws FolderNotFoundException, DocumentException
+    public NodeSet getAllNodes() throws DocumentException
     {
         if((allNodes == null) && (folderHandler != null))
         {            
@@ -520,52 +519,59 @@
             {
                 allNodes = new NodeSetImpl(getPath());
             }
-            
-            String[] nodeNames = folderHandler.listAll(getPath());
-            for (int i = 0; i < nodeNames.length; i++)
+
+            try
             {
-                if (!nodeNames[i].equals(FolderMetaDataImpl.DOCUMENT_TYPE))
+                String[] nodeNames = folderHandler.listAll(getPath());
+                for (int i = 0; i < nodeNames.length; i++)
                 {
-                    Node node = null;
-                    try
+                    if (!nodeNames[i].equals(FolderMetaDataImpl.DOCUMENT_TYPE))
                     {
-                        if (getPath().endsWith(PATH_SEPARATOR))
+                        Node node = null;
+                        try
                         {
-                            if(nodeNames[i].indexOf(".") > -1)
-                            {    
-                                node = getHandlerFactory().getDocumentHandlerForPath(nodeNames[i]).getDocument(getPath() + nodeNames[i]);
+                            if (getPath().endsWith(PATH_SEPARATOR))
+                            {
+                                if(nodeNames[i].indexOf(".") > -1)
+                                {    
+                                    node = getHandlerFactory().getDocumentHandlerForPath(nodeNames[i]).getDocument(getPath() + nodeNames[i]);
+                                }
+                                else
+                                {
+                                    node = folderHandler.getFolder(getPath() + nodeNames[i]);
+                                }
                             }
                             else
                             {
-                                node = folderHandler.getFolder(getPath() + nodeNames[i]);
+                                
+                                if(nodeNames[i].indexOf(".") > -1)
+                                {    
+                                    node = getHandlerFactory().getDocumentHandlerForPath(nodeNames[i]).getDocument(getPath() + PATH_SEPARATOR + nodeNames[i]);
+                                }
+                                else
+                                {
+                                    node = folderHandler.getFolder(getPath() + PATH_SEPARATOR + nodeNames[i]);
+                                }
                             }
+                            node.setParent(this);
+                            allNodes.add(node);
+                        }               
+                        catch (UnsupportedDocumentTypeException e)
+                        {
+                            // Skip unsupported documents
+                            log.info("getAllNodes() Skipping unsupported document: "+nodeNames[i]);
                         }
-                        else
+                        catch (Exception e)
                         {
-                            
-                            if(nodeNames[i].indexOf(".") > -1)
-                            {    
-                                node = getHandlerFactory().getDocumentHandlerForPath(nodeNames[i]).getDocument(getPath() + PATH_SEPARATOR + nodeNames[i]);
-                            }
-                            else
-                            {
-                                node = folderHandler.getFolder(getPath() + PATH_SEPARATOR + nodeNames[i]);
-                            }
+                            log.warn("getAllNodes() failed to create Node: "+nodeNames[i]+":"+e.toString(), e);
                         }
-                        node.setParent(this);
-                        allNodes.add(node);
-                    }               
-                    catch (UnsupportedDocumentTypeException e)
-                    {
-                        // Skip unsupported documents
-                        log.info("getAllNodes() Skipping unsupported document: "+nodeNames[i]);
-                    }
-                    catch (Exception e)
-                    {
-                        log.warn("getAllNodes() failed to create Node: "+nodeNames[i]+":"+e.toString(), e);
-                    }
-                }       
-            }            
+                    }       
+                }
+            }
+            catch (FolderNotFoundException fnfe)
+            {
+                log.error("getAllNodes() unexpected missing folder", fnfe);
+            }
         }
         
         return allNodes;
@@ -651,6 +657,9 @@
             }
         }
         catch (NodeException ne)
+        {
+        }
+        catch (NodeNotFoundException nnfe)
         {
         }
 

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java?rev=392042&r1=392041&r2=392042&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java Thu Apr  6 12:13:00 2006
@@ -26,7 +26,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.folder.Folder;
@@ -277,7 +276,7 @@
         {
             String message = "Failed to create page object for " + this.pageClass;
             log.error(message, e);
-            // throw new JetspeedException(message, e);
+            // throw new NodeException(message, e);
         }
         return fragment;        
     }
@@ -297,7 +296,7 @@
         {
             String message = "Failed to create page object for " + this.pageClass;
             log.error(message, e);
-            // throw new JetspeedException(message, e);
+            // throw new NodeException(message, e);
         }
         return fragment;        
     }
@@ -791,7 +790,7 @@
     }
         
     public Folder copyFolder(Folder source, String path)
-    throws JetspeedException, FolderNotUpdatedException
+    throws NodeException
     {
         // create the new folder and copy attributes
         Folder folder = newFolder(path);
@@ -835,7 +834,7 @@
     }
     
     public Page copyPage(Page source, String path)
-    throws JetspeedException, PageNotUpdatedException
+    throws NodeException
     {
         // create the new page and copy attributes
         Page page = newPage(path);
@@ -874,6 +873,7 @@
     }
 
     public Fragment copyFragment(Fragment source, String name)
+    throws NodeException
     {
         // create the new fragment and copy attributes
         Fragment copy = newFragment();
@@ -932,7 +932,7 @@
     }
     
     public Link copyLink(Link source, String path)
-    throws JetspeedException, LinkNotUpdatedException
+    throws NodeException
     {
         // create the new link and copy attributes
         Link link = newLink(path);
@@ -959,7 +959,7 @@
     }
 
     public PageSecurity copyPageSecurity(PageSecurity source) 
-    throws JetspeedException, FailedToUpdateDocumentException
+    throws NodeException
     {
         // create the new page security document and copy attributes
         PageSecurity copy = this.newPageSecurity();
@@ -1209,7 +1209,7 @@
      * @param dest destination folder
      */
     public void deepCopyFolder(Folder srcFolder, String destinationPath, String owner)
-    throws JetspeedException, PageNotUpdatedException
+    throws NodeException
     {
         PageManagerUtils.deepCopyFolder(this, srcFolder, destinationPath, owner);
     }
@@ -1298,7 +1298,7 @@
      * @param subject
      */
     public void createUserHomePagesFromRoles(Subject subject)
-    throws JetspeedException
+    throws NodeException
     {
         PageManagerUtils.createUserHomePagesFromRoles(this, subject);
     }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java?rev=392042&r1=392041&r2=392042&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java Thu Apr  6 12:13:00 2006
@@ -17,7 +17,6 @@
 
 import java.util.Map;
 
-import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.folder.InvalidFolderException;
@@ -74,8 +73,7 @@
      * @see org.apache.jetspeed.page.PageManager#getLink(java.lang.String)
      */
     public Link getLink(String name) throws DocumentNotFoundException,
-            UnsupportedDocumentTypeException, FolderNotFoundException,
-            NodeException
+            UnsupportedDocumentTypeException, NodeException
     {
         // TODO Auto-generated method stub
         return null;
@@ -85,8 +83,7 @@
      * @see org.apache.jetspeed.page.PageManager#getPageSecurity()
      */
     public PageSecurity getPageSecurity() throws DocumentNotFoundException,
-            UnsupportedDocumentTypeException, FolderNotFoundException,
-            NodeException
+            UnsupportedDocumentTypeException, NodeException
     {
         // TODO Auto-generated method stub
         return null;
@@ -105,7 +102,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getFolders(org.apache.jetspeed.om.folder.Folder)
      */
-    public NodeSet getFolders(Folder folder) throws FolderNotFoundException, DocumentException
+    public NodeSet getFolders(Folder folder) throws DocumentException
     {
         // TODO Auto-generated method stub
         return null;
@@ -168,7 +165,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getAll(org.apache.jetspeed.om.folder.Folder)
      */
-    public NodeSet getAll(Folder folder) throws FolderNotFoundException, DocumentException
+    public NodeSet getAll(Folder folder) throws DocumentException
     {
         // TODO Auto-generated method stub
         return null;
@@ -177,7 +174,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updatePage(org.apache.jetspeed.om.page.Page)
      */
-    public void updatePage(Page page) throws JetspeedException,
+    public void updatePage(Page page) throws NodeException,
             PageNotUpdatedException
     {
         // TODO Auto-generated method stub
@@ -187,7 +184,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#removePage(org.apache.jetspeed.om.page.Page)
      */
-    public void removePage(Page page) throws JetspeedException,
+    public void removePage(Page page) throws NodeException,
             PageNotRemovedException
     {
         // TODO Auto-generated method stub
@@ -197,7 +194,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updateFolder(org.apache.jetspeed.om.folder.Folder)
      */
-    public void updateFolder(Folder folder) throws JetspeedException,
+    public void updateFolder(Folder folder) throws NodeException,
             FolderNotUpdatedException
     {
         // TODO Auto-generated method stub
@@ -207,7 +204,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updateFolder(org.apache.jetspeed.om.folder.Folder,boolean)
      */
-    public void updateFolder(Folder folder, boolean deep) throws JetspeedException,
+    public void updateFolder(Folder folder, boolean deep) throws NodeException,
             FolderNotUpdatedException
     {
         // TODO Auto-generated method stub
@@ -217,7 +214,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#removeFolder(org.apache.jetspeed.om.folder.Folder)
      */
-    public void removeFolder(Folder folder) throws JetspeedException,
+    public void removeFolder(Folder folder) throws NodeException,
             FolderNotRemovedException
     {
         // TODO Auto-generated method stub
@@ -227,7 +224,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updateLink(org.apache.jetspeed.om.page.Link)
      */
-    public void updateLink(Link link) throws JetspeedException,
+    public void updateLink(Link link) throws NodeException,
             LinkNotUpdatedException
     {
         // TODO Auto-generated method stub
@@ -237,7 +234,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#removeLink(org.apache.jetspeed.om.page.Link)
      */
-    public void removeLink(Link link) throws JetspeedException,
+    public void removeLink(Link link) throws NodeException,
             LinkNotRemovedException
     {
         // TODO Auto-generated method stub
@@ -248,7 +245,7 @@
      * @see org.apache.jetspeed.page.PageManager#updatePageSecurity(org.apache.jetspeed.om.page.PageSecurity)
      */
     public void updatePageSecurity(PageSecurity pageSecurity) throws
-            JetspeedException, FailedToUpdateDocumentException
+            NodeException, FailedToUpdateDocumentException
     {
         // TODO Auto-generated method stub
 
@@ -258,15 +255,15 @@
      * @see org.apache.jetspeed.page.PageManager#removePageSecurity(org.apache.jetspeed.om.page.PageSecurity)
      */
     public void removePageSecurity(PageSecurity pageSecurity) throws
-            JetspeedException, FailedToDeleteDocumentException
+            NodeException, FailedToDeleteDocumentException
     {
         // TODO Auto-generated method stub
 
     }
     
     public int addPages(Page[] pages)
-    throws JetspeedException
+    throws NodeException
     {
-        throw new JetspeedException("not impl");
+        throw new NodeException("not impl");
     }
 }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/PageManagerUtils.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/PageManagerUtils.java?rev=392042&r1=392041&r2=392042&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/PageManagerUtils.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/PageManagerUtils.java Thu Apr  6 12:13:00 2006
@@ -22,12 +22,12 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.page.document.NodeException;
 import org.apache.jetspeed.security.RolePrincipal;
 import org.apache.jetspeed.security.SecurityHelper;
 import org.apache.jetspeed.security.UserPrincipal;
@@ -51,14 +51,14 @@
      * @param subject
      */
     public static void createUserHomePagesFromRoles(PageManager pageManager, Subject subject)
-    throws JetspeedException
+    throws NodeException
     {
         Principal principal = SecurityHelper.getBestPrincipal(subject, UserPrincipal.class); 
         if (principal == null)
         {
             String errorMessage = "Could not create user home for null principal";
             log.error(errorMessage);
-            throw new JetspeedException(errorMessage);
+            throw new NodeException(errorMessage);
         }
         try
         {
@@ -95,7 +95,7 @@
         {
             String errorMessage = "createUserHomePagesFromRoles failed: " + e.getMessage();
             log.error(errorMessage, e);
-            throw new JetspeedException(errorMessage, e);
+            throw new NodeException(errorMessage, e);
         }
     }
 
@@ -111,10 +111,10 @@
      * @param destinationPath
      * @param owner
      * @param uniqueName
-     * @throws JetspeedException
+     * @throws NodeException
      */
     public static void deepMergeFolder(PageManager pageManager, Folder srcFolder, String destinationPath, String owner, String uniqueName)
-    throws JetspeedException
+    throws NodeException
     {        
         Iterator pages = srcFolder.getPages().iterator();
         while (pages.hasNext())
@@ -210,7 +210,7 @@
      * @param dest destination folder
      */
     public static void deepCopyFolder(PageManager pageManager, Folder srcFolder, String destinationPath, String owner)
-    throws JetspeedException, PageNotUpdatedException
+    throws NodeException
     {
         boolean found = true;
         try
@@ -223,7 +223,7 @@
         }
         if (found)
         {
-            throw new JetspeedException("Destination already exists");
+            throw new NodeException("Destination already exists");
         }
         Folder dstFolder = pageManager.copyFolder(srcFolder, destinationPath);
         if (owner != null)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java?rev=392042&r1=392041&r2=392042&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java Thu Apr  6 12:13:00 2006
@@ -332,7 +332,7 @@
 
     }
 
-    protected Object unmarshallDocument( Class clazz, String path, String extension ) throws NodeNotFoundException,
+    protected Object unmarshallDocument( Class clazz, String path, String extension ) throws DocumentNotFoundException,
             DocumentException
     {
         Document document = null;
@@ -586,7 +586,7 @@
      * @return @throws
      *         DocumentNotFoundException
      */
-    public Document getDocument( String name, boolean fromCache ) throws NodeException
+    public Document getDocument( String name, boolean fromCache ) throws DocumentNotFoundException, NodeException
     {
         Document document = null;
         if (fromCache)

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=392042&r1=392041&r2=392042&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 Thu Apr  6 12:13:00 2006
@@ -26,7 +26,6 @@
 
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
-import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.folder.Folder;
@@ -85,7 +84,6 @@
 import org.apache.jetspeed.page.document.FailedToUpdateDocumentException;
 import org.apache.jetspeed.page.document.NodeException;
 import org.apache.jetspeed.page.document.NodeSet;
-import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
 import org.apache.jetspeed.page.document.impl.NodeImpl;
 import org.apache.ojb.broker.core.proxy.ProxyHelper;
 import org.apache.ojb.broker.query.Criteria;
@@ -139,7 +137,7 @@
 
     private int cacheExpiresSeconds;
 
-    private DatabasePageManagerCache cache;
+    private PageManager pageManagerProxy;
 
     public DatabasePageManager(String repositoryPath, int cacheSize, int cacheExpiresSeconds, boolean isPermissionsSecurity, boolean isConstraintsSecurity)
     {
@@ -181,6 +179,35 @@
         return cacheExpiresSeconds;
     }
 
+    /**
+     * getPageManagerProxy
+     *
+     * @return proxied page manager interface used to
+     *         inject into Folder instances to provide
+     *         transaction/interception
+     */
+    public PageManager getPageManagerProxy()
+    {
+        return pageManagerProxy;
+    }
+
+    /**
+     * setPageManagerProxy
+     *
+     * @param proxy proxied page manager interface used to
+     *              inject into Folder instances to provide
+     *              transaction/interception
+     */
+    public void setPageManagerProxy(PageManager proxy)
+    {
+        // set/reset page manager proxy and propagate to cache
+        if (pageManagerProxy != proxy)
+        {
+            pageManagerProxy = proxy;
+            DatabasePageManagerCache.setPageManagerProxy(proxy);
+        }
+    }
+
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getConstraintsEnabled()
      */
@@ -480,7 +507,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getLink(java.lang.String)
      */
-    public Link getLink(String path) throws DocumentNotFoundException, UnsupportedDocumentTypeException, FolderNotFoundException, NodeException
+    public Link getLink(String path) throws DocumentNotFoundException, NodeException
     {
         // construct link attributes from path
         path = NodeImpl.getCanonicalNodePath(path);
@@ -531,7 +558,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getPageSecurity()
      */
-    public PageSecurity getPageSecurity() throws DocumentNotFoundException, UnsupportedDocumentTypeException, FolderNotFoundException, NodeException
+    public PageSecurity getPageSecurity() throws DocumentNotFoundException, NodeException
     {
         // construct document attributes from path
         String path = Folder.PATH_SEPARATOR + PageSecurity.DOCUMENT_TYPE;
@@ -633,7 +660,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getFolders(org.apache.jetspeed.om.folder.Folder)
      */
-    public NodeSet getFolders(Folder folder) throws FolderNotFoundException, DocumentException
+    public NodeSet getFolders(Folder folder) throws DocumentException
     {
         FolderImpl folderImpl = (FolderImpl)folder;
 
@@ -846,7 +873,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getAll(org.apache.jetspeed.om.folder.Folder)
      */
-    public NodeSet getAll(Folder folder) throws FolderNotFoundException, DocumentException
+    public NodeSet getAll(Folder folder) throws DocumentException
     {
         FolderImpl folderImpl = (FolderImpl)folder;
 
@@ -902,7 +929,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updatePage(org.apache.jetspeed.om.page.Page)
      */
-    public void updatePage(Page page) throws JetspeedException, PageNotUpdatedException
+    public void updatePage(Page page) throws NodeException, PageNotUpdatedException
     {
         try
         {
@@ -978,7 +1005,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#removePage(org.apache.jetspeed.om.page.Page)
      */
-    public void removePage(Page page) throws JetspeedException, PageNotRemovedException
+    public void removePage(Page page) throws NodeException, PageNotRemovedException
     {
         try
         {
@@ -1025,7 +1052,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updateFolder(org.apache.jetspeed.om.folder.Folder)
      */
-    public void updateFolder(Folder folder) throws JetspeedException, FolderNotUpdatedException
+    public void updateFolder(Folder folder) throws NodeException, FolderNotUpdatedException
     {
         // shallow update by default
         updateFolder(folder, false);
@@ -1034,7 +1061,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updateFolder(org.apache.jetspeed.om.folder.Folder,boolean)
      */
-    public void updateFolder(Folder folder, boolean deep) throws JetspeedException, FolderNotUpdatedException
+    public void updateFolder(Folder folder, boolean deep) throws NodeException, FolderNotUpdatedException
     {
         try
         {
@@ -1207,7 +1234,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#removeFolder(org.apache.jetspeed.om.folder.Folder)
      */
-    public void removeFolder(Folder folder) throws JetspeedException, FolderNotRemovedException
+    public void removeFolder(Folder folder) throws NodeException, FolderNotRemovedException
     {
         try
         {
@@ -1328,7 +1355,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updateLink(org.apache.jetspeed.om.page.Link)
      */
-    public void updateLink(Link link) throws JetspeedException, LinkNotUpdatedException
+    public void updateLink(Link link) throws NodeException, LinkNotUpdatedException
     {
         try
         {
@@ -1400,7 +1427,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#removeLink(org.apache.jetspeed.om.page.Link)
      */
-    public void removeLink(Link link) throws JetspeedException, LinkNotRemovedException
+    public void removeLink(Link link) throws NodeException, LinkNotRemovedException
     {
         try
         {
@@ -1443,7 +1470,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updatePageSecurity(org.apache.jetspeed.om.page.PageSecurity)
      */
-    public void updatePageSecurity(PageSecurity pageSecurity) throws JetspeedException, FailedToUpdateDocumentException
+    public void updatePageSecurity(PageSecurity pageSecurity) throws NodeException, FailedToUpdateDocumentException
     {
         try
         {
@@ -1473,7 +1500,6 @@
                 // do not replace existing page security documents
                 try
                 {
-                    // test for page security document
                     parent.getPageSecurity();
                     throw new FailedToUpdateDocumentException("Parent folder page security exists: " + parentPath);
                 }
@@ -1532,7 +1558,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#removePageSecurity(org.apache.jetspeed.om.page.PageSecurity)
      */
-    public void removePageSecurity(PageSecurity pageSecurity) throws JetspeedException, FailedToDeleteDocumentException
+    public void removePageSecurity(PageSecurity pageSecurity) throws NodeException, FailedToDeleteDocumentException
     {
         try
         {
@@ -1579,7 +1605,7 @@
      * @see org.apache.jetspeed.page.PageManager#copyPage(org.apache.jetspeed.om.page.Page,java.lang.String)
      */
     public Page copyPage(Page source, String path)
-    throws JetspeedException, PageNotUpdatedException
+    throws NodeException, PageNotUpdatedException
     {
         return this.delegator.copyPage(source, path);
     }
@@ -1588,7 +1614,7 @@
      * @see org.apache.jetspeed.page.PageManager#copyLink(org.apache.jetspeed.om.page.Link,java.lang.String)
      */
     public Link copyLink(Link source, String path)
-    throws JetspeedException, LinkNotUpdatedException
+    throws NodeException, LinkNotUpdatedException
     {
         return this.delegator.copyLink(source, path);
     }
@@ -1597,7 +1623,7 @@
      * @see org.apache.jetspeed.page.PageManager#copyFolder(org.apache.jetspeed.om.folder.Folder,java.lang.String)
      */
     public Folder copyFolder(Folder source, String path)
-    throws JetspeedException, PageNotUpdatedException
+    throws NodeException, PageNotUpdatedException
     {
         return this.delegator.copyFolder(source, path);
     }
@@ -1606,7 +1632,7 @@
      * @see org.apache.jetspeed.page.PageManager#copyFragment(org.apache.jetspeed.om.page.Fragment,java.lang.String)
      */
     public Fragment copyFragment(Fragment source, String name)
-    throws JetspeedException, PageNotUpdatedException
+    throws NodeException, PageNotUpdatedException
     {
         return this.delegator.copyFragment(source, name);
     }
@@ -1615,7 +1641,7 @@
      * @see org.apache.jetspeed.page.PageManager#copyPageSecurity(org.apache.jetspeed.om.page.PageSecurity)
      */
     public PageSecurity copyPageSecurity(PageSecurity source) 
-    throws JetspeedException
+    throws NodeException
     {
         return this.delegator.copyPageSecurity(source);
     }
@@ -1722,7 +1748,7 @@
      * @see org.apache.jetspeed.page.PageManager#createUserHomePagesFromRoles(java.security.auth.Subject)
      */
     public void createUserHomePagesFromRoles(Subject subject)
-    throws JetspeedException
+    throws NodeException
     {
         PageManagerUtils.createUserHomePagesFromRoles(this, subject);
     }
@@ -1731,7 +1757,7 @@
      * @see org.apache.jetspeed.page.PageManager#deepCopyFolder(org.apache.jetspeed.om.folder.Folder,java.lang.String,java.lang.String)
      */
     public void deepCopyFolder(Folder srcFolder, String destinationPath, String owner)
-    throws JetspeedException, PageNotUpdatedException
+    throws NodeException, PageNotUpdatedException
     {
         PageManagerUtils.deepCopyFolder(this, srcFolder, destinationPath, owner);
     }
@@ -1740,7 +1766,7 @@
      * @see org.apache.jetspeed.page.PageManager#addPages(org.apache.jetspeed.om.page.Page[])
      */
     public int addPages(Page[] pages)
-    throws JetspeedException
+    throws NodeException
     {   
         if (pages.length > 0 && pages[0].getPath().equals("/tx__test1.psml"))
         {
@@ -1750,7 +1776,7 @@
             System.out.println("Adding second page");
             this.updatePage(pages[1]);
             System.out.println("About to throw ex");
-            throw new JetspeedException("Its gonna blow captain!");
+            throw new NodeException("Its gonna blow captain!");
         }
         for (int ix = 0; ix < pages.length; ix++)
         {

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java?rev=392042&r1=392041&r2=392042&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java Thu Apr  6 12:13:00 2006
@@ -68,6 +68,24 @@
     }
 
     /**
+     * setPageManagerProxy
+     *
+     * @param proxy proxied page manager interface used to
+     *              inject into Folder instances to provide
+     *              transaction/interception
+     */
+    public synchronized static void setPageManagerProxy(PageManager proxy)
+    {
+        // set/reset page manager proxy and clear cache to
+        // flush any objects referencing replaced page manager
+        if (pageManager != proxy)
+        {
+            pageManager = proxy;
+            cacheClear();
+        }
+    }
+
+    /**
      * cacheLookup
      *
      * Lookup node instances by unique path.

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java?rev=392042&r1=392041&r2=392042&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java Thu Apr  6 12:13:00 2006
@@ -28,7 +28,6 @@
 import org.apache.jetspeed.cache.file.FileCache;
 import org.apache.jetspeed.cache.file.FileCacheEntry;
 import org.apache.jetspeed.cache.file.FileCacheEventListener;
-import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.common.SecuredResource;
 import org.apache.jetspeed.om.folder.Folder;
@@ -167,11 +166,18 @@
      * @throws NodeException
      * @throws FolderNotFoundException
      */
-    public Page getPage(String path) throws PageNotFoundException, FolderNotFoundException, NodeException
+    public Page getPage(String path) throws PageNotFoundException, NodeException
     {
         // get page via folder, (access checked in Folder.getPage())
-        FolderImpl folder = getNodeFolder(path);
-        return folder.getPage(getNodeName(path));
+        try
+        {
+            FolderImpl folder = getNodeFolder(path);
+            return folder.getPage(getNodeName(path));
+        }
+        catch (FolderNotFoundException fnfe)
+        {
+            throw new PageNotFoundException(fnfe.getMessage());
+        }
     }
 
     /**
@@ -181,7 +187,7 @@
      * 
      * @see org.apache.jetspeed.services.page.PageManagerService#updatePage(org.apache.jetspeed.om.page.Page)
      */
-    public void updatePage(Page page) throws JetspeedException
+    public void updatePage(Page page) throws NodeException
     {
         // unwrap page to be registered
         if (page instanceof ContentPageImpl)
@@ -204,52 +210,59 @@
             return;
         }
 
-        // set parent
-        boolean newPage = false;
-        FolderImpl parentFolder = getNodeFolder(page.getPath());
-        if (page.getParent() == null)
-        {
-            page.setParent(parentFolder);
-            newPage = true;
-        }
-
-        // enable permissions/constraints
-        PageImpl pageImpl = (PageImpl)page;
-        pageImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
-        pageImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
-
-        // check for edit access
-        page.checkAccess(JetspeedActions.EDIT);
-
-        // update page
-        handlerFactory.getDocumentHandler(Page.DOCUMENT_TYPE).updateDocument(page);
-
-        // update parent folder
-        if (parentFolder != null)
+        try
         {
-            NodeSetImpl parentAllNodes = (NodeSetImpl)parentFolder.getAllNodes();
-            if (!parentAllNodes.contains(page))
+            // set parent
+            boolean newPage = false;
+            FolderImpl parentFolder = getNodeFolder(page.getPath());
+            if (page.getParent() == null)
             {
-                // add new page
-                parentAllNodes.add(page);
+                page.setParent(parentFolder);
                 newPage = true;
             }
-            else if (parentAllNodes.get(page.getPath()) != page)
+
+            // enable permissions/constraints
+            PageImpl pageImpl = (PageImpl)page;
+            pageImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
+            pageImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
+            
+            // check for edit access
+            page.checkAccess(JetspeedActions.EDIT);
+            
+            // update page
+            handlerFactory.getDocumentHandler(Page.DOCUMENT_TYPE).updateDocument(page);
+            
+            // update parent folder
+            if (parentFolder != null)
             {
-                // remove stale page and add updated page
-                parentAllNodes.remove(page);                
-                parentAllNodes.add(page);
+                NodeSetImpl parentAllNodes = (NodeSetImpl)parentFolder.getAllNodes();
+                if (!parentAllNodes.contains(page))
+                {
+                    // add new page
+                    parentAllNodes.add(page);
+                    newPage = true;
+                }
+                else if (parentAllNodes.get(page.getPath()) != page)
+                {
+                    // remove stale page and add updated page
+                    parentAllNodes.remove(page);                
+                    parentAllNodes.add(page);
+                }
+            }
+            
+            // notify page manager listeners
+            if (newPage)
+            {
+                notifyNewNode(page);
+            }
+            else
+            {
+                notifyUpdatedNode(page);
             }
         }
-
-        // notify page manager listeners
-        if (newPage)
-        {
-            notifyNewNode(page);
-        }
-        else
+        catch (FolderNotFoundException fnfe)
         {
-            notifyUpdatedNode(page);
+            throw new NodeException(fnfe.getMessage());
         }
     }
 
@@ -260,7 +273,7 @@
      * 
      * @see org.apache.jetspeed.services.page.PageManagerService#removePage(org.apache.jetspeed.om.page.Page)
      */
-    public void removePage(Page page) throws JetspeedException
+    public void removePage(Page page) throws NodeException
     {
         // unwrap page to be removed
         if (page instanceof ContentPageImpl)
@@ -271,15 +284,27 @@
         // check for edit access
         page.checkAccess(JetspeedActions.EDIT);
 
-        // remove page
-        handlerFactory.getDocumentHandler(Page.DOCUMENT_TYPE).removeDocument(page);
-
-        // update folder
-        FolderImpl folder = getNodeFolder(page.getPath());
-        ((NodeSetImpl)folder.getAllNodes()).remove(page);
+        try
+        {
+            FolderImpl folder = getNodeFolder(page.getPath());
 
-        // notify page manager listeners
-        notifyRemovedNode(page);
+            // remove page
+            handlerFactory.getDocumentHandler(Page.DOCUMENT_TYPE).removeDocument(page);
+            
+            // update folder
+            ((NodeSetImpl)folder.getAllNodes()).remove(page);
+            
+            // notify page manager listeners
+            notifyRemovedNode(page);
+        }
+        catch (FolderNotFoundException fnfe)
+        {
+            throw new NodeException(fnfe.getMessage());
+        }
+        catch (DocumentNotFoundException dnfe)
+        {
+            throw new NodeException(dnfe.getMessage());
+        }
     }
 
     /**
@@ -293,13 +318,19 @@
      * @throws DocumentNotFoundException
      * @throws UnsupportedDocumentTypeException
      * @throws NodeException
-     * @throws FolderNotFoundException
      */
-    public Link getLink(String path) throws DocumentNotFoundException, UnsupportedDocumentTypeException, FolderNotFoundException, NodeException
+    public Link getLink(String path) throws DocumentNotFoundException, UnsupportedDocumentTypeException, NodeException
     {
         // get link via folder, (access checked in Folder.getLink())
-        FolderImpl folder = getNodeFolder(path);
-        return folder.getLink(getNodeName(path));
+        try
+        {
+            FolderImpl folder = getNodeFolder(path);
+            return folder.getLink(getNodeName(path));
+        }
+        catch (FolderNotFoundException fnfe)
+        {
+            throw new DocumentNotFoundException(fnfe.getMessage());
+        }
     }
 
     /**
@@ -309,7 +340,7 @@
      * 
      * @see org.apache.jetspeed.services.page.PageManagerService#updateLink(org.apache.jetspeed.om.page.Link)
      */
-    public void updateLink(Link link) throws JetspeedException
+    public void updateLink(Link link) throws NodeException
     {
         // make sure path and related members are set
         if (link.getPath() != null)
@@ -326,52 +357,59 @@
             return;
         }
 
-        // set parent
-        boolean newLink = false;
-        FolderImpl parentFolder = getNodeFolder(link.getPath());
-        if (link.getParent() == null)
-        {
-            link.setParent(parentFolder);
-            newLink = true;
-        }
-
-        // enable permissions/constraints
-        LinkImpl linkImpl = (LinkImpl)link;
-        linkImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
-        linkImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
-
-        // check for edit access
-        link.checkAccess(JetspeedActions.EDIT);
-
-        // update link
-        handlerFactory.getDocumentHandler(Link.DOCUMENT_TYPE).updateDocument(link);
-
-        // update parent folder
-        if (parentFolder != null)
+        try
         {
-            NodeSetImpl parentAllNodes = (NodeSetImpl)parentFolder.getAllNodes();
-            if (!parentAllNodes.contains(link))
+            // set parent
+            boolean newLink = false;
+            FolderImpl parentFolder = getNodeFolder(link.getPath());
+            if (link.getParent() == null)
             {
-                // add new link
-                parentAllNodes.add(link);
+                link.setParent(parentFolder);
                 newLink = true;
             }
-            else if (parentAllNodes.get(link.getPath()) != link)
+            
+            // enable permissions/constraints
+            LinkImpl linkImpl = (LinkImpl)link;
+            linkImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
+            linkImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
+            
+            // check for edit access
+            link.checkAccess(JetspeedActions.EDIT);
+            
+            // update link
+            handlerFactory.getDocumentHandler(Link.DOCUMENT_TYPE).updateDocument(link);
+            
+            // update parent folder
+            if (parentFolder != null)
             {
-                // remove stale link and add updated link
-                parentAllNodes.remove(link);
-                parentAllNodes.add(link);
+                NodeSetImpl parentAllNodes = (NodeSetImpl)parentFolder.getAllNodes();
+                if (!parentAllNodes.contains(link))
+                {
+                    // add new link
+                    parentAllNodes.add(link);
+                    newLink = true;
+                }
+                else if (parentAllNodes.get(link.getPath()) != link)
+                {
+                    // remove stale link and add updated link
+                    parentAllNodes.remove(link);
+                    parentAllNodes.add(link);
+                }
+            }
+            
+            // notify page manager listeners
+            if (newLink)
+            {
+                notifyNewNode(link);
+            }
+            else
+            {
+                notifyUpdatedNode(link);
             }
         }
-
-        // notify page manager listeners
-        if (newLink)
-        {
-            notifyNewNode(link);
-        }
-        else
+        catch (FolderNotFoundException fnfe)
         {
-            notifyUpdatedNode(link);
+            throw new NodeException(fnfe.getMessage());
         }
     }
 
@@ -382,20 +420,32 @@
      * 
      * @see org.apache.jetspeed.services.page.PageManagerService#removeLink(org.apache.jetspeed.om.page.Link)
      */
-    public void removeLink(Link link) throws JetspeedException
+    public void removeLink(Link link) throws NodeException
     {
         // check for edit access
         link.checkAccess(JetspeedActions.EDIT);
 
-        // remove link
-        handlerFactory.getDocumentHandler(Link.DOCUMENT_TYPE).removeDocument(link);
-
-        // update folder
-        FolderImpl folder = getNodeFolder(link.getPath());
-        ((NodeSetImpl)folder.getAllNodes()).remove(link);
+        try
+        {
+            FolderImpl folder = getNodeFolder(link.getPath());
 
-        // notify page manager listeners
-        notifyRemovedNode(link);
+            // remove link
+            handlerFactory.getDocumentHandler(Link.DOCUMENT_TYPE).removeDocument(link);
+            
+            // update folder
+            ((NodeSetImpl)folder.getAllNodes()).remove(link);
+            
+            // notify page manager listeners
+            notifyRemovedNode(link);
+        }
+        catch (FolderNotFoundException fnfe)
+        {
+            throw new NodeException(fnfe.getMessage());
+        }
+        catch (DocumentNotFoundException dnfe)
+        {
+            throw new NodeException(dnfe.getMessage());
+        }
     }
 
     /**
@@ -408,19 +458,25 @@
      * @throws DocumentNotFoundException
      * @throws UnsupportedDocumentTypeException
      * @throws NodeException
-     * @throws FolderNotFoundException
      */
-    public PageSecurity getPageSecurity() throws DocumentNotFoundException, UnsupportedDocumentTypeException, FolderNotFoundException, NodeException
+    public PageSecurity getPageSecurity() throws DocumentNotFoundException, UnsupportedDocumentTypeException, NodeException
     {
         // get page security via folder, (always allow access)
-        FolderImpl folder = getNodeFolder(Folder.PATH_SEPARATOR);
-        return folder.getPageSecurity();
+        try
+        {
+            FolderImpl folder = getNodeFolder(Folder.PATH_SEPARATOR);
+            return folder.getPageSecurity();
+        }
+        catch (FolderNotFoundException fnfe)
+        {
+            throw new DocumentNotFoundException(fnfe.getMessage());
+        }
     }
 
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updatePageSecurity(org.apache.jetspeed.om.page.PageSecurity)
      */
-    public void updatePageSecurity(PageSecurity pageSecurity) throws JetspeedException, FailedToUpdateDocumentException
+    public void updatePageSecurity(PageSecurity pageSecurity) throws NodeException, FailedToUpdateDocumentException
     {
         // validate path... must exist in root folder and
         // make sure path and related members are set
@@ -443,72 +499,91 @@
             return;
         }
 
-        // set parent
-        boolean newPageSecurity = false;
-        FolderImpl parentFolder = getNodeFolder(Folder.PATH_SEPARATOR);
-        if (pageSecurity.getParent() == null)
-        {
-            pageSecurity.setParent(parentFolder);
-            newPageSecurity = true;
-        }
-
-        // enable permissions/constraints
-        PageSecurityImpl pageSecurityImpl = (PageSecurityImpl)pageSecurity;
-        pageSecurityImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
-        pageSecurityImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
-
-        // check for edit access
-        pageSecurity.checkAccess(JetspeedActions.EDIT);
-
-        // update pageSecurity
-        handlerFactory.getDocumentHandler(PageSecurity.DOCUMENT_TYPE).updateDocument(pageSecurity);
-
-        // update parent folder
-        if (parentFolder != null)
+        try
         {
-            NodeSetImpl parentAllNodes = (NodeSetImpl)parentFolder.getAllNodes();
-            if (!parentAllNodes.contains(pageSecurity))
+            // set parent
+            boolean newPageSecurity = false;
+            FolderImpl parentFolder = getNodeFolder(Folder.PATH_SEPARATOR);
+            if (pageSecurity.getParent() == null)
             {
-                // add new page security
-                parentAllNodes.add(pageSecurity);
+                pageSecurity.setParent(parentFolder);
                 newPageSecurity = true;
             }
-            else if (parentAllNodes.get(pageSecurity.getPath()) != pageSecurity)
+            
+            // enable permissions/constraints
+            PageSecurityImpl pageSecurityImpl = (PageSecurityImpl)pageSecurity;
+            pageSecurityImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
+            pageSecurityImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
+            
+            // check for edit access
+            pageSecurity.checkAccess(JetspeedActions.EDIT);
+            
+            // update pageSecurity
+            handlerFactory.getDocumentHandler(PageSecurity.DOCUMENT_TYPE).updateDocument(pageSecurity);
+            
+            // update parent folder
+            if (parentFolder != null)
             {
-                // remove stale page security and add updated page security
-                parentAllNodes.remove(pageSecurity);
-                parentAllNodes.add(pageSecurity);
+                NodeSetImpl parentAllNodes = (NodeSetImpl)parentFolder.getAllNodes();
+                if (!parentAllNodes.contains(pageSecurity))
+                {
+                    // add new page security
+                    parentAllNodes.add(pageSecurity);
+                    newPageSecurity = true;
+                }
+                else if (parentAllNodes.get(pageSecurity.getPath()) != pageSecurity)
+                {
+                    // remove stale page security and add updated page security
+                    parentAllNodes.remove(pageSecurity);
+                    parentAllNodes.add(pageSecurity);
+                }
+            }
+            
+            // notify page manager listeners
+            if (newPageSecurity)
+            {
+                notifyNewNode(pageSecurity);
+            }
+            else
+            {
+                notifyUpdatedNode(pageSecurity);
             }
         }
-
-        // notify page manager listeners
-        if (newPageSecurity)
-        {
-            notifyNewNode(pageSecurity);
-        }
-        else
+        catch (FolderNotFoundException fnfe)
         {
-            notifyUpdatedNode(pageSecurity);
+            throw new NodeException(fnfe.getMessage());
         }
     }
 
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#removePageSecurity(org.apache.jetspeed.om.page.PageSecurity)
      */
-    public void removePageSecurity(PageSecurity pageSecurity) throws JetspeedException, FailedToDeleteDocumentException
+    public void removePageSecurity(PageSecurity pageSecurity) throws NodeException, FailedToDeleteDocumentException
     {
         // check for edit access
         pageSecurity.checkAccess(JetspeedActions.EDIT);
 
-        // remove page security
-        handlerFactory.getDocumentHandler(PageSecurity.DOCUMENT_TYPE).removeDocument(pageSecurity);
-
-        // update folder
-        FolderImpl folder = getNodeFolder(Folder.PATH_SEPARATOR);
-        ((NodeSetImpl)folder.getAllNodes()).remove(pageSecurity);
+        try
+        {
+            FolderImpl folder = getNodeFolder(Folder.PATH_SEPARATOR);
 
-        // notify page manager listeners
-        notifyRemovedNode(pageSecurity);
+            // remove page security
+            handlerFactory.getDocumentHandler(PageSecurity.DOCUMENT_TYPE).removeDocument(pageSecurity);
+            
+            // update folder
+            ((NodeSetImpl)folder.getAllNodes()).remove(pageSecurity);
+            
+            // notify page manager listeners
+            notifyRemovedNode(pageSecurity);
+        }
+        catch (FolderNotFoundException fnfe)
+        {
+            throw new NodeException(fnfe.getMessage());
+        }
+        catch (DocumentNotFoundException dnfe)
+        {
+            throw new NodeException(dnfe.getMessage());
+        }
     }
 
     /**
@@ -534,7 +609,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getFolders(org.apache.jetspeed.om.folder.Folder)
      */
-    public NodeSet getFolders(Folder folder) throws FolderNotFoundException, DocumentException
+    public NodeSet getFolders(Folder folder) throws DocumentException
     {
         // delegate back to folder instance
         return folder.getFolders();
@@ -597,7 +672,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getAll(org.apache.jetspeed.om.folder.Folder)
      */
-    public NodeSet getAll(Folder folder) throws FolderNotFoundException, DocumentException
+    public NodeSet getAll(Folder folder) throws DocumentException
     {
         // delegate back to folder instance
         return folder.getAll();
@@ -610,7 +685,7 @@
      * 
      * @see org.apache.jetspeed.services.page.PageManagerService#updateFolder(org.apache.jetspeed.om.folder.Folder)
      */
-    public void updateFolder(Folder folder) throws JetspeedException
+    public void updateFolder(Folder folder) throws NodeException, FolderNotUpdatedException
     {
         // shallow update by default
         updateFolder(folder, false);
@@ -619,7 +694,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updateFolder(org.apache.jetspeed.om.folder.Folder,boolean)
      */
-    public void updateFolder(Folder folder, boolean deep) throws JetspeedException, FolderNotUpdatedException
+    public void updateFolder(Folder folder, boolean deep) throws NodeException, FolderNotUpdatedException
     {
         // make sure path and related members are set
         if (folder.getPath() != null)
@@ -636,69 +711,76 @@
             return;
         }
 
-        // set parent
-        boolean newFolder = false;
-        FolderImpl parentFolder = null;
-        if (!folder.getPath().equals(Folder.PATH_SEPARATOR))
+        try
         {
-            parentFolder = getNodeFolder(folder.getPath());
-            if (folder.getParent() == null)
+            // set parent
+            boolean newFolder = false;
+            FolderImpl parentFolder = null;
+            if (!folder.getPath().equals(Folder.PATH_SEPARATOR))
             {
-                folder.setParent(parentFolder);
-                newFolder = true;
+                parentFolder = getNodeFolder(folder.getPath());
+                if (folder.getParent() == null)
+                {
+                    folder.setParent(parentFolder);
+                    newFolder = true;
+                }
             }
-        }
-        else
-        {
-            folder.setParent(null);            
-        }
-
-        // enable permissions/constraints and configure
-        // folder handler before access is checked
-        FolderImpl folderImpl = (FolderImpl)folder;
-        folderImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
-        folderImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
-        folderImpl.setFolderHandler(folderHandler);
-
-        // check for edit access
-        folder.checkAccess(JetspeedActions.EDIT);
-
-        // update folder
-        folderHandler.updateFolder(folder);
-
-        // update parent folder
-        if (parentFolder != null)
-        {
-            NodeSetImpl parentAllNodes = (NodeSetImpl)parentFolder.getAllNodes();
-            if (!parentAllNodes.contains(folder))
+            else
             {
-                // add new folder
-                parentAllNodes.add(folder);
-                newFolder = true;
+                folder.setParent(null);            
             }
-            else if (parentAllNodes.get(folder.getPath()) != folder)
+            
+            // enable permissions/constraints and configure
+            // folder handler before access is checked
+            FolderImpl folderImpl = (FolderImpl)folder;
+            folderImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
+            folderImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
+            folderImpl.setFolderHandler(folderHandler);
+            
+            // check for edit access
+            folder.checkAccess(JetspeedActions.EDIT);
+            
+            // update folder
+            folderHandler.updateFolder(folder);
+            
+            // update parent folder
+            if (parentFolder != null)
             {
-                // remove stale folder and add updated folder
-                parentAllNodes.remove(folder);
-                parentAllNodes.add(folder);
+                NodeSetImpl parentAllNodes = (NodeSetImpl)parentFolder.getAllNodes();
+                if (!parentAllNodes.contains(folder))
+                {
+                    // add new folder
+                    parentAllNodes.add(folder);
+                    newFolder = true;
+                }
+                else if (parentAllNodes.get(folder.getPath()) != folder)
+                {
+                    // remove stale folder and add updated folder
+                    parentAllNodes.remove(folder);
+                    parentAllNodes.add(folder);
+                }
             }
+            
+            // update deep recursively if specified
+            if (deep)
+            {
+                // update recursively, (breadth first)
+                updateFolderNodes(folderImpl);
+            }
+            
+            // notify page manager listeners
+            if (newFolder)
+            {
+                notifyNewNode(folder);
+            }
+            else
+            {
+                notifyUpdatedNode(folder);
+            }            
         }
-        
-        // update deep recursively if specified
-        if (deep)
-        {
-            // update recursively, (breadth first)
-            updateFolderNodes(folderImpl);
-        }
-
-        // notify page manager listeners
-        if (newFolder)
-        {
-            notifyNewNode(folder);
-        }
-        else
+        catch (FolderNotFoundException fnfe)
         {
-            notifyUpdatedNode(folder);
+            throw new NodeException(fnfe.getMessage());
         }
     }
 
@@ -764,23 +846,35 @@
      * 
      * @see org.apache.jetspeed.services.page.PageManagerService#removeFolder(org.apache.jetspeed.om.folder.Folder)
      */
-    public void removeFolder(Folder folder) throws JetspeedException
+    public void removeFolder(Folder folder) throws NodeException
     {
         // check for edit access
         folder.checkAccess(JetspeedActions.EDIT);
 
-        // remove folder
-        folderHandler.removeFolder(folder);
+        try
+        {
+            FolderImpl parentFolder = null;
+            if (!folder.getPath().equals(Folder.PATH_SEPARATOR))
+            {
+                parentFolder = getNodeFolder(folder.getPath());
+            }
+
+            // remove folder
+            folderHandler.removeFolder(folder);
+
+            // update parent folder
+            if (parentFolder != null)
+            {
+                ((NodeSetImpl)parentFolder.getAllNodes()).remove(folder);
+            }
 
-        // update parent folder
-        if (!folder.getPath().equals(Folder.PATH_SEPARATOR))
+            // notify page manager listeners
+            notifyRemovedNode(folder);
+        }
+        catch (FolderNotFoundException fnfe)
         {
-            FolderImpl parentFolder = getNodeFolder(folder.getPath());
-            ((NodeSetImpl)parentFolder.getAllNodes()).remove(folder);
+            throw new NodeException(fnfe.getMessage());
         }
-
-        // notify page manager listeners
-        notifyRemovedNode(folder);
     }
 
     /* (non-Javadoc)
@@ -805,8 +899,9 @@
      * @return folder impl instance
      * @throws NodeException
      * @throws InvalidFolderException
+     * @throws FolderNotFoundException
      */
-    private FolderImpl getNodeFolder(String nodePath) throws NodeException, InvalidFolderException
+    private FolderImpl getNodeFolder(String nodePath) throws NodeException, InvalidFolderException, FolderNotFoundException
     {
         int folderIndex = nodePath.lastIndexOf(Folder.PATH_SEPARATOR);
         if (folderIndex > 0)
@@ -894,11 +989,11 @@
     }
     
     public int addPages(Page[] pages)
-    throws JetspeedException
+    throws NodeException
     {
         this.updatePage(pages[0]);
         this.updatePage(pages[1]);
-        throw new JetspeedException("Its gonna blow captain!");
+        throw new NodeException("Its gonna blow captain!");
     }
     
 }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml?rev=392042&r1=392041&r2=392042&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml Thu Apr  6 12:13:00 2006
@@ -45,14 +45,30 @@
         <property name="transactionAttributes">
             <props>
                 <prop key="*">PROPAGATION_SUPPORTS</prop>
-                <prop key="get*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>
-                <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>
-                <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>
-                <prop key="create*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>                                				
-                <prop key="deepCopyFolder*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>                                                               
+                <prop key="get*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="create*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="deepCopy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="add*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="folderExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="pageExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="linkExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="userFolderExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="userPageExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
             </props>
         </property>
     </bean>
 
+    <!-- Inject Page Manager Proxy into Page Manager -->
+    <bean id="injectPageManagerProxy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject"><ref bean="pageManagerImpl"/></property>
+        <property name="targetMethod"><value>setPageManagerProxy</value></property>
+        <property name="arguments">
+            <list>
+                <ref bean="pageManager"/>
+            </list>
+        </property>
+    </bean>
 
 </beans>

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/secure-database-page-manager.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/secure-database-page-manager.xml?rev=392042&r1=392041&r2=392042&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/secure-database-page-manager.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/secure-database-page-manager.xml Thu Apr  6 12:13:00 2006
@@ -45,14 +45,30 @@
         <property name="transactionAttributes">
             <props>
                 <prop key="*">PROPAGATION_SUPPORTS</prop>
-                <prop key="get*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>
-                <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>
-                <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>
-                <prop key="create*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>                                				
-                <prop key="deepCopyFolder*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>                                                               
+                <prop key="get*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="create*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="deepCopy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="add*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="folderExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="pageExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="linkExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="userFolderExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="userPageExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
             </props>
         </property>
     </bean>
 
+    <!-- Inject Page Manager Proxy into Page Manager -->
+    <bean id="injectPageManagerProxy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject"><ref bean="securePageManagerImpl"/></property>
+        <property name="targetMethod"><value>setPageManagerProxy</value></property>
+        <property name="arguments">
+            <list>
+                <ref bean="pageManager"/>
+            </list>
+        </property>
+    </bean>
 
 </beans>

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/secure-permissions-database-page-manager.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/secure-permissions-database-page-manager.xml?rev=392042&r1=392041&r2=392042&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/secure-permissions-database-page-manager.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/secure-permissions-database-page-manager.xml Thu Apr  6 12:13:00 2006
@@ -45,14 +45,30 @@
         <property name="transactionAttributes">
             <props>
                 <prop key="*">PROPAGATION_SUPPORTS</prop>
-                <prop key="get*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>
-                <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>
-                <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>
-                <prop key="create*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>                                				
-                <prop key="deepCopyFolder*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>                                                               
+                <prop key="get*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="create*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="deepCopy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="add*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="folderExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="pageExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="linkExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="userFolderExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+                <prop key="userPageExists">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
             </props>
         </property>
     </bean>
 
+    <!-- Inject Page Manager Proxy into Page Manager -->
+    <bean id="injectPageManagerProxy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject"><ref bean="securePermissionsPageManagerImpl"/></property>
+        <property name="targetMethod"><value>setPageManagerProxy</value></property>
+        <property name="arguments">
+            <list>
+                <ref bean="pageManager"/>
+            </list>
+        </property>
+    </bean>
 
 </beans>



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