portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r388374 [2/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 Fri, 24 Mar 2006 05:03:44 GMT
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=388374&r1=388373&r2=388374&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 Mar 23 21:03:42 2006
@@ -18,6 +18,7 @@
 
 import java.io.FileNotFoundException;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -55,8 +56,10 @@
 import org.apache.jetspeed.om.preference.FragmentPreference;
 import org.apache.jetspeed.om.preference.impl.FragmentPreferenceImpl;
 import org.apache.jetspeed.page.AbstractPageManager;
+import org.apache.jetspeed.page.FolderNotUpdatedException;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.PageNotFoundException;
+import org.apache.jetspeed.page.document.DocumentException;
 import org.apache.jetspeed.page.document.DocumentHandlerFactory;
 import org.apache.jetspeed.page.document.DocumentNotFoundException;
 import org.apache.jetspeed.page.document.FailedToDeleteDocumentException;
@@ -64,6 +67,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.NodeSet;
 import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
 import org.apache.jetspeed.page.document.psml.NodeSetImpl;
 
@@ -220,11 +224,22 @@
         // update page
         handlerFactory.getDocumentHandler(Page.DOCUMENT_TYPE).updateDocument(page);
 
-        // update folder
-        if ((parentFolder != null) && !parentFolder.getAllNodes().contains(page))
+        // update parent folder
+        if (parentFolder != null)
         {
-            parentFolder.getAllNodes().add(page);
-            newPage = true;
+            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
@@ -331,11 +346,22 @@
         // update link
         handlerFactory.getDocumentHandler(Link.DOCUMENT_TYPE).updateDocument(link);
 
-        // update folder
-        if ((parentFolder != null) && !parentFolder.getAllNodes().contains(link))
+        // update parent folder
+        if (parentFolder != null)
         {
-            parentFolder.getAllNodes().add(link);
-            newLink = true;
+            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
@@ -437,11 +463,22 @@
         // update pageSecurity
         handlerFactory.getDocumentHandler(PageSecurity.DOCUMENT_TYPE).updateDocument(pageSecurity);
 
-        // update folder
-        if ((parentFolder != null) && !parentFolder.getAllNodes().contains(pageSecurity))
+        // update parent folder
+        if (parentFolder != null)
         {
-            parentFolder.getAllNodes().add(pageSecurity);
-            newPageSecurity = true;
+            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
@@ -494,6 +531,78 @@
         return folder;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getFolders(org.apache.jetspeed.om.folder.Folder)
+     */
+    public NodeSet getFolders(Folder folder) throws FolderNotFoundException, DocumentException
+    {
+        // delegate back to folder instance
+        return folder.getFolders();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getFolder(org.apache.jetspeed.om.folder.Folder,java.lang.String)
+     */
+    public Folder getFolder(Folder folder, String name) throws FolderNotFoundException, DocumentException
+    {
+        // delegate back to folder instance
+        return folder.getFolder(name);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getPages(org.apache.jetspeed.om.folder.Folder)
+     */
+    public NodeSet getPages(Folder folder) throws NodeException
+    {
+        // delegate back to folder instance
+        return folder.getPages();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getPage(org.apache.jetspeed.om.folder.Folder,java.lang.String)
+     */
+    public Page getPage(Folder folder, String name) throws PageNotFoundException, NodeException
+    {
+        // delegate back to folder instance
+        return folder.getPage(name);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getLinks(org.apache.jetspeed.om.folder.Folder)
+     */    
+    public NodeSet getLinks(Folder folder) throws NodeException
+    {
+        // delegate back to folder instance
+        return folder.getLinks();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getLink(org.apache.jetspeed.om.folder.Folder,java.lang.String)
+     */    
+    public Link getLink(Folder folder, String name) throws DocumentNotFoundException, NodeException
+    {
+        // delegate back to folder instance
+        return folder.getLink(name);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getPageSecurity(org.apache.jetspeed.om.folder.Folder)
+     */    
+    public PageSecurity getPageSecurity(Folder folder) throws DocumentNotFoundException,
NodeException
+    {
+        // delegate back to folder instance
+        return folder.getPageSecurity();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getAll(org.apache.jetspeed.om.folder.Folder)
+     */
+    public NodeSet getAll(Folder folder) throws FolderNotFoundException, DocumentException
+    {
+        // delegate back to folder instance
+        return folder.getAll();
+    }
+
     /**
      * <p>
      * updateFolder
@@ -503,6 +612,15 @@
      */
     public void updateFolder(Folder folder) throws JetspeedException
     {
+        // shallow update by default
+        updateFolder(folder, false);
+    }
+
+    /* (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
+    {
         // make sure path and related members are set
         if (folder.getPath() != null)
         {
@@ -549,10 +667,28 @@
         folderHandler.updateFolder(folder);
 
         // update parent folder
-        if ((parentFolder != null) && !parentFolder.getAllNodes().contains(folder))
+        if (parentFolder != null)
         {
-            parentFolder.getAllNodes().add(folder);
-            newFolder = true;
+            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
@@ -563,6 +699,61 @@
         else
         {
             notifyUpdatedNode(folder);
+        }
+    }
+
+    /**
+     * updateFolderNodes - recusively update all folder nodes
+     *
+     * @param folderImpl folder whose nodes are to be updated
+     * @param throws FolderNotUpdatedException
+     */
+    private void updateFolderNodes(FolderImpl folderImpl) throws FolderNotUpdatedException
+    {
+        try
+        {
+            // update folder documents
+            NodeSet nodes = folderImpl.getAllNodes();
+            Iterator nodesIter = nodes.iterator();
+            while (nodesIter.hasNext())
+            {
+                Node node = (Node) nodesIter.next();
+                if (node instanceof Page)
+                {
+                    updatePage((Page)node);
+                }
+                else if (node instanceof Link)
+                {
+                    updateLink((Link)node);
+                }
+                else if (node instanceof PageSecurity)
+                {
+                    updatePageSecurity((PageSecurity)node);
+                }
+            }
+
+            // update folders last: breadth first recursion
+            nodesIter = nodes.iterator();
+            while (nodesIter.hasNext())
+            {
+                Node node = (Node) nodesIter.next();
+                if (node instanceof Folder)
+                {
+                    updateFolder((Folder)node, true);
+                }
+            }
+        }
+        catch (FolderNotUpdatedException fnue)
+        {
+            throw fnue;
+        }
+        catch (SecurityException se)
+        {
+            throw se;
+        }
+        catch (Exception e)
+        {
+            throw new FolderNotUpdatedException("Folder " + folderImpl.getPath() + " not
updated.", e);
         }
     }
 

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java?rev=388374&r1=388373&r2=388374&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/PageManagerTestShared.java
Thu Mar 23 21:03:42 2006
@@ -356,6 +356,8 @@
                             test.assertNotNull(folder.getPageSecurity());
                             test.assertNotNull(folder.getPages());
                             test.assertEquals(2, folder.getPages().size());
+                            test.assertNotNull(pageManager.getPages(folder));
+                            test.assertEquals(2, pageManager.getPages(folder).size());
                             PageSecurity pageSecurity = pageManager.getPageSecurity();
                             Page page0 = pageManager.getPage("/default-page.psml");
                             test.assertNotNull(page0.getRootFragment());

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java?rev=388374&r1=388373&r2=388374&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
Thu Mar 23 21:03:42 2006
@@ -443,7 +443,28 @@
         }
 
         assertEquals(1, folder.getPages().size());
+        assertEquals(1, pageManager.getPages(folder).size());
         assertNotNull(folder.getPages().get(this.testPage004));
+
+        folder.setTitle("Updated Deep Title");
+        page.setTitle("Updated Deep Title");
+
+        try
+        {
+            pageManager.updateFolder(folder, true);
+        }
+        catch (Exception e)
+        {
+            String errmsg = "Exception in deep folder update: " + e.toString();
+            e.printStackTrace();
+            System.err.println(errmsg);
+            assertNotNull(errmsg, null);
+        }
+
+        folder = pageManager.getFolder(this.testFolder2);
+        assertTrue(folder.getTitle().equals("Updated Deep Title"));
+        page = pageManager.getPage(this.testPage004);
+        assertTrue(page.getTitle().equals("Updated Deep Title"));
     }
 
     public void testUpdateLink() throws Exception
@@ -478,6 +499,7 @@
         assertTrue(folder1.getDefaultDecorator(Fragment.PORTLET).equals("test-portlet"));
                 
         assertEquals(2, folder1.getFolders().size());
+        assertEquals(2, pageManager.getFolders(folder1).size());
         Iterator childItr = folder1.getFolders().iterator();
         // Test that the folders are naturally orderd
         Folder folder2 = (Folder) childItr.next();
@@ -488,6 +510,7 @@
         assertEquals("test001.psml", folder3.getDefaultPage());
         assertEquals(1, folder2.getPages().size());
         assertEquals(2, folder3.getPages().size());
+        assertEquals(2, pageManager.getPages(folder3).size());
 
         // test folder decoration inheritance
         Page page = (Page)folder3.getPages().get("test001.psml");
@@ -495,6 +518,8 @@
         assertTrue(page.getEffectiveDefaultDecorator(Fragment.PORTLET).equals("test-portlet"));
         
         // Check link order
+        assertEquals(6, folder3.getAll().size());
+        assertEquals(6, pageManager.getAll(folder3).size());
         Iterator linkItr = folder3.getAll().iterator();
         assertEquals("Jetspeed2Wiki.link", ((Link)linkItr.next()).getName());
         assertEquals("Jetspeed2.link", ((Link)linkItr.next()).getName());        
@@ -502,7 +527,6 @@
         assertEquals("apache.link", ((Link)linkItr.next()).getName());
         assertEquals("test001.psml", ((Page)linkItr.next()).getName());
         assertEquals("default-page.psml", ((Page)linkItr.next()).getName());
-        
 
         //Test FolderSet with both absolute and relative names
         assertNotNull(folder1.getFolders().get("/folder1/folder2"));
@@ -584,6 +608,7 @@
         assertNotNull(folder);
         assertNotNull(folder.getLinks());
         assertEquals(2,folder.getLinks().size());
+        assertEquals(2,pageManager.getLinks(folder).size());
         assertEquals("http://portals.apache.org", ((Document) folder.getLinks().get("/apache_portals.link")).getUrl());
     }
 

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=388374&r1=388373&r2=388374&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
Thu Mar 23 21:03:42 2006
@@ -361,6 +361,8 @@
         assertEquals(page.getParent().getId(), folder.getId());
         assertNotNull(folder.getPages());
         assertEquals(1, folder.getPages().size());
+        assertNotNull(pageManager.getPages(folder));
+        assertEquals(1, pageManager.getPages(folder).size());
 
         page = pageManager.newPage("/another-page.psml");
         assertEquals("Another Page", page.getTitle());
@@ -375,6 +377,7 @@
         assertNotNull(page.getParent());
         assertEquals(page.getParent().getId(), folder.getId());
         assertEquals(3, folder.getPages().size());
+        assertEquals(3, pageManager.getPages(folder).size());
 
         Link link = pageManager.newLink("/default.link");
         assertEquals("Default", link.getTitle());
@@ -405,6 +408,8 @@
         assertEquals(link.getParent().getId(), folder.getId());
         assertNotNull(folder.getLinks());
         assertEquals(1, folder.getLinks().size());
+        assertNotNull(pageManager.getLinks(folder));
+        assertEquals(1, pageManager.getLinks(folder).size());
 
         PageSecurity pageSecurity = pageManager.newPageSecurity();
         List constraintsDefs = new ArrayList(2);
@@ -489,7 +494,8 @@
             assertNotNull(deepFolder.getParent());
             assertNotNull(((Folder)deepFolder.getParent()).getFolders());
             assertEquals(1, ((Folder)deepFolder.getParent()).getFolders().size());
-
+            assertNotNull(pageManager.getFolders((Folder)deepFolder.getParent()));
+            assertEquals(1, pageManager.getFolders((Folder)deepFolder.getParent()).size());
             if (pathIndex < deepFolderPath.length())
             {
                 pathIndex = deepFolderPath.indexOf('/', pathIndex+1);
@@ -511,8 +517,12 @@
         // test folder nodesets
         assertNotNull(folder.getFolders());
         assertEquals(1, folder.getFolders().size());
+        assertNotNull(pageManager.getFolders(folder));
+        assertEquals(1, pageManager.getFolders(folder).size());
         assertNotNull(folder.getAll());
         assertEquals(6, folder.getAll().size());
+        assertNotNull(pageManager.getAll(folder));
+        assertEquals(6, pageManager.getAll(folder).size());
         Iterator all = folder.getAll().iterator();
         assertEquals("some-other-page.psml", ((Node)all.next()).getName());
         assertEquals("default-page.psml", ((Node)all.next()).getName());
@@ -882,12 +892,20 @@
         updateMenu.getMetadata().addField(Locale.JAPANESE, "short-title", "[ja] UPDATED");
         ((MenuOptionsDefinition)updateMenu.getMenuElements().get(2)).setProfile("UPDATED");
         pageManager.updateFolder(folder);
-
         assertNotNull(folder.getAll());
         assertEquals(6, folder.getAll().size());
         Iterator all = folder.getAll().iterator();
         assertEquals("default-page.psml", ((Node)all.next()).getName());
         assertEquals("some-other-page.psml", ((Node)all.next()).getName());
+
+        folder.setTitle("FOLDER-UPDATED-DEEP");
+        page.setTitle("FOLDER-UPDATED-DEEP");
+        link.setTitle("FOLDER-UPDATED-DEEP");
+        Folder deepFolder = pageManager.getFolder(deepFolderPath);
+        deepFolder.setTitle("FOLDER-UPDATED-DEEP");
+        Page deepPage = pageManager.getPage(deepPagePath);
+        deepPage.setTitle("FOLDER-UPDATED-DEEP");
+        pageManager.updateFolder(folder, true);
     }
 
     public void testRemoves() throws Exception
@@ -973,8 +991,8 @@
     {
         // verify listener functionality and operation counts
         assertEquals(22, newNodeCount);
-        assertEquals(4, updatedNodeCount);
-        assertEquals(1, removedNodeCount);
+        assertEquals(26, updatedNodeCount);
+        assertEquals(22, removedNodeCount);
 
         // last test has been run
         lastTestRun = true;

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java?rev=388374&r1=388373&r2=388374&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java
(original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java
Thu Mar 23 21:03:42 2006
@@ -41,6 +41,7 @@
 import org.apache.jetspeed.page.document.FailedToDeleteDocumentException;
 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;
 
 /**
@@ -240,22 +241,20 @@
      */
     public FragmentPreference newFragmentPreference();
 
-   /**
-    * 
-    * <p>
-    * getPage
-    * </p>
-    *
-    * Returns a PSML document for the given key
-    *
-    * @param locator The locator descriptor of the document to be retrieved.
-    * @throws PageNotFoundException if the page cannot be found
-    * @throws NodeException
-    */
+    /**
+     * <p>
+     * getPage
+     * </p>
+     *
+     * Returns a PSML document for the given key
+     *
+     * @param locator The locator descriptor of the document to be retrieved.
+     * @throws PageNotFoundException if the page cannot be found
+     * @throws NodeException
+     */
     public Page getPage(String id) throws PageNotFoundException, NodeException;
     
     /**
-     * 
      * <p>
      * ContentPage
      * </p>
@@ -269,50 +268,197 @@
      * @throws PageNotFoundException if the page cannot be found
      * @throws NodeException
      */
-     public ContentPage getContentPage(String path) throws PageNotFoundException, NodeException;
+    public ContentPage getContentPage(String path) throws PageNotFoundException, NodeException;
     
-   /**
-    * 
-    * <p>
-    * getLink
-    * </p>
-    *
-    * Returns a Link document for the given path
-    *
-    * @param name The path of the document to be retrieved.
-    * @throws PageNotFoundException if the page cannot be found
-    * @throws NodeException
-    */
+    /**
+     * <p>
+     * getLink
+     * </p>
+     *
+     * Returns a Link document for the given path
+     *
+     * @param name The path of the document to be retrieved.
+     * @throws PageNotFoundException if the page cannot be found
+     * @throws NodeException
+     */
     public Link getLink(String name) throws DocumentNotFoundException, UnsupportedDocumentTypeException,
FolderNotFoundException, NodeException;
 
-   /**
-    * 
-    * <p>
-    * getPageSecurity
-    * </p>
-    *
-    * Returns the PageSecurity document
-    *
-    * @throws PageNotFoundException if the page cannot be found
-    * @throws NodeException
-    */
+    /**
+     * <p>
+     * getPageSecurity
+     * </p>
+     *
+     * Returns the PageSecurity document
+     *
+     * @throws DocumentNotFoundException if the document cannot be found
+     * @throws FolderNotFoundException if a folder cannot be found
+     * @throws UnsupportedDocumentTypeException
+     * @throws NodeException
+     */
     public PageSecurity getPageSecurity() throws DocumentNotFoundException, UnsupportedDocumentTypeException,
FolderNotFoundException, NodeException;
     
     /**
-     * 
      * <p>
      * getFolder
      * </p>
+     *
      * Locates a folder for the given path.
+     *
      * @param folderPath
-     * @return <code>Folder</code> object represented by the <code>folderPath</code>
or
-     * <code>null</code> if no such folder exists.
-     * @throws DocumentException
+     * @return <code>Folder</code> object represented by the <code>folderPath</code>
      * @throws FolderNotFoundException
      * @throws NodeException
      * @throws InvalidFolderException
      */
-    Folder getFolder(String folderPath) throws FolderNotFoundException, InvalidFolderException,
NodeException;
+    public Folder getFolder(String folderPath) throws FolderNotFoundException, InvalidFolderException,
NodeException;
+
+    /**
+     * <p>
+     * getFolders
+     * </p>
+     *
+     * Locates folders within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getFolders(org.apache.jetspeed.om.folder.Folder)
+     *
+     * @param folder The parent folder.
+     * @return A <code>NodeSet</code> containing all sub-folders
+     *         directly under this folder.
+     * @throws FolderNotFoundException
+     * @throws DocumentException
+     */
+    public NodeSet getFolders(Folder folder) throws FolderNotFoundException, DocumentException;
+
+    /**
+     * <p>
+     * getFolder
+     * </p>
+     *
+     * Locates folders within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getFolder(org.apache.jetspeed.om.folder.Folder,java.lang.String)
+     *
+     * @param folder The parent folder.
+     * @param name The name of folder to retrieve.
+     * @return A Folder referenced by this folder.
+     * @throws FolderNotFoundException
+     * @throws DocumentException
+     */
+    public Folder getFolder(Folder folder, String name) throws FolderNotFoundException, DocumentException;
+
+    /**
+     * <p>
+     * getPages
+     * </p>
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getPages(org.apache.jetspeed.om.folder.Folder)
+     *
+     * @param folder The parent folder.
+     * @return A <code>NodeSet</code> of all the Pages referenced
+     *         by this Folder.
+     * @throws NodeException
+     */
+    public NodeSet getPages(Folder folder) throws NodeException;
+    
+    /**
+     * <p>
+     * getPage
+     * </p>
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getPage(org.apache.jetspeed.om.folder.Folder,java.lang.String)
+     *
+     * @param folder The parent folder.
+     * @param name The name of page to retrieve.
+     * @return A Page referenced by this folder.
+     * @throws PageNotFoundException if the Page requested could not be found.
+     * @throws NodeException
+     */
+    public Page getPage(Folder folder, String name) throws PageNotFoundException, NodeException;
+    
+    /**
+     * <p>
+     * getLinks
+     * </p>
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getLinks(org.apache.jetspeed.om.folder.Folder)
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @param folder The parent folder.
+     * @return NodeSet of all the Links referenced by this Folder.
+     * @throws NodeException
+     */    
+    public NodeSet getLinks(Folder folder) throws NodeException;
+    
+    /**
+     * <p>
+     * getLink
+     * </p>
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getLink(org.apache.jetspeed.om.folder.Folder,java.lang.String)
+     *
+     * @param folder The parent folder.
+     * @param name The name of page to retrieve.
+     * @return A Link referenced by this folder.
+     * @throws DocumentNotFoundException if the document requested could not be found.
+     * @throws NodeException
+     */    
+    public Link getLink(Folder folder, String name) throws DocumentNotFoundException, NodeException;
+    
+    /**
+     * <p>
+     * getPageSecurity
+     * </p>
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getPageSecurity(org.apache.jetspeed.om.folder.Folder)
+     *
+     * @param folder The parent folder.
+     * @return A PageSecurity referenced by this folder.
+     * @throws DocumentNotFoundException if the document requested could not be found.
+     * @throws NodeException
+     */    
+    public PageSecurity getPageSecurity(Folder folder) throws DocumentNotFoundException,
NodeException;
+
+    /**
+     * <p>
+     * getAll
+     * </p>
+     *
+     * Locates folders and documents within a specified parent folder.
+     * Returned folders and documents are filtered according to
+     * security constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getAll(org.apache.jetspeed.om.folder.Folder)
+     *
+     * @param folder The parent folder.
+     * @return A <code>NodeSet</code> containing all sub-folders
+     *         and documents directly under this folder.
+     * @throws FolderNotFoundException
+     * @throws DocumentException
+     */
+    public NodeSet getAll(Folder folder) throws FolderNotFoundException, DocumentException;
 
     /** Update a page in persistent storage
      *
@@ -326,11 +472,19 @@
      */
     public void removePage(Page page) throws JetspeedException, PageNotRemovedException;
 
-    /** Update a folder in persistent storage
+    /** Update a folder and all child folders
+     *  and documents in persistent storage
      *
      * @param folder The folder to be updated.
      */
     public void updateFolder(Folder folder) throws JetspeedException, FolderNotUpdatedException;
+
+    /** Update a folder in persistent storage
+     *
+     * @param folder The folder to be updated.
+     * @param deep Flag to control recursive deep updates.
+     */
+    public void updateFolder(Folder folder, boolean deep) throws JetspeedException, FolderNotUpdatedException;
 
     /** Remove a 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