portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r770686 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/ components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/ components/jetspeed-page-ma...
Date Fri, 01 May 2009 14:09:12 GMT
Author: vkumar
Date: Fri May  1 14:09:11 2009
New Revision: 770686

URL: http://svn.apache.org/viewvc?rev=770686&view=rev
Log:
Adding some further changes for JS-900

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/DelegatingPageManager.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/folder/Folder.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java?rev=770686&r1=770685&r2=770686&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
Fri May  1 14:09:11 2009
@@ -831,16 +831,26 @@
      */
     public NodeSet getAll() throws DocumentException
     {
+        return getAll(true);
+    }
+    
+    public NodeSet getAll(boolean secured) throws DocumentException
+    {
         // get all nodes collection
         if (!allCached)
         {
             // use PageManager to get and cache all nodes
             // collection for this folder
-            return getPageManager().getAll(this);
+            getPageManager().initFolder(this);
         }
 
+        NodeSet nodes = getAllNodeSet();
+        if (!secured)
+        {
+            return nodes;
+        }
         // return nodes with view access
-        return filterNodeSetByAccess(getAllNodeSet());
+        return filterNodeSetByAccess(nodes);
     }
     
     /* (non-Javadoc)
@@ -1112,14 +1122,5 @@
             pageManager = (PageManager)Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.page.PageManager");
         }        
         return pageManager;
-    }
-
-    public NodeSet getAll(boolean filtered) throws DocumentException
-    {
-        if (!filtered)
-        {
-            return getAllNodeSet();
-        }
-        return getAll();
     }     
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java?rev=770686&r1=770685&r2=770686&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
Fri May  1 14:09:11 2009
@@ -451,16 +451,17 @@
         return getPageSecurity(false);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jetspeed.om.folder.Folder#getAll()
-     */
-    public NodeSet getAll() throws DocumentException
+    public NodeSet getAll(boolean secured) throws DocumentException
     {
+              
         // return secure set of all nodes: enforce access checks
-        // on folders and documents while creating filtered nodes
+        // on folders and documents while creating filtered nodes        
         NodeSet nodes = getAllNodes();
+        if (!secured)
+        {
+            return nodes;
+        }
+        
         NodeSet filteredNodes = null;
         Iterator checkAccessIter = nodes.iterator();
         while (checkAccessIter.hasNext())
@@ -501,6 +502,16 @@
         }
         return nodes;
     }
+    
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.jetspeed.om.folder.Folder#getAll()
+     */
+    public NodeSet getAll() throws DocumentException
+    {
+        return getAll(true);
+    }
 
     /**
      * <p>
@@ -963,14 +974,5 @@
                     reservedType = RESERVED_FOLDER_OTHER;            
             }
         }
-    }
-
-    public NodeSet getAll(boolean filtered) throws DocumentException
-    {
-        if (!filtered)
-        {
-            return getAllNodes();
-        }
-        return getAll();
     }     
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/DelegatingPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/DelegatingPageManager.java?rev=770686&r1=770685&r2=770686&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/DelegatingPageManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/DelegatingPageManager.java
Fri May  1 14:09:11 2009
@@ -169,15 +169,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#getAll(org.apache.jetspeed.om.folder.Folder)
-     */
-    public NodeSet getAll(Folder folder) throws DocumentException
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#updatePage(org.apache.jetspeed.om.page.Page)
      */
     public void updatePage(Page page) throws NodeException,
@@ -272,4 +263,9 @@
     {
         throw new NodeException("not impl");
     }
+
+    public void initFolder(Folder folder) throws DocumentException
+    {
+        
+    }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java?rev=770686&r1=770685&r2=770686&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
Fri May  1 14:09:11 2009
@@ -866,7 +866,7 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getAll(org.apache.jetspeed.om.folder.Folder)
      */
-    public NodeSet getAll(Folder folder) throws DocumentException
+    public void initFolder(Folder folder) throws DocumentException
     {
         FolderImpl folderImpl = (FolderImpl)folder;
 
@@ -916,7 +916,6 @@
 
         // folder all nodes cache populated, get all from folder
         // to provide packaging as filtered node set
-        return folder.getAll();
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java?rev=770686&r1=770685&r2=770686&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
Fri May  1 14:09:11 2009
@@ -690,10 +690,9 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getAll(org.apache.jetspeed.om.folder.Folder)
      */
-    public NodeSet getAll(Folder folder) throws DocumentException
+    public void initFolder(Folder folder) throws DocumentException
     {
-        // delegate back to folder instance
-        return folder.getAll();
+        
     }
 
     /**

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java?rev=770686&r1=770685&r2=770686&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java
Fri May  1 14:09:11 2009
@@ -534,7 +534,7 @@
         
         // Check link order
         assertEquals(6, folder3.getAll().size());
-        assertEquals(6, pageManager.getAll(folder3).size());
+        assertEquals(6, folder3.getAll(false).size());
         Iterator linkItr = folder3.getAll().iterator();
         assertEquals("Jetspeed2Wiki.link", ((Link)linkItr.next()).getName());
         assertEquals("Jetspeed2.link", ((Link)linkItr.next()).getName());        

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java?rev=770686&r1=770685&r2=770686&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java
Fri May  1 14:09:11 2009
@@ -485,8 +485,8 @@
         assertEquals(1, pageManager.getFolders(folder).size());
         assertNotNull(folder.getAll());
         assertEquals(6, folder.getAll().size());
-        assertNotNull(pageManager.getAll(folder));
-        assertEquals(6, pageManager.getAll(folder).size());
+        assertNotNull(folder.getAll(false));
+        assertEquals(6, folder.getAll(false).size());
         Iterator all = folder.getAll().iterator();
         assertEquals("some-other-page.psml", ((Node)all.next()).getName());
         assertEquals("default-page.psml", ((Node)all.next()).getName());

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/folder/Folder.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/folder/Folder.java?rev=770686&r1=770685&r2=770686&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/folder/Folder.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/folder/Folder.java
Fri May  1 14:09:11 2009
@@ -260,7 +260,7 @@
      * this folder.
      * @throws DocumentException
      */
-    NodeSet getAll(boolean filtered) throws DocumentException;
+    NodeSet getAll(boolean secured) throws DocumentException;
 
     /**
      * getMenuDefinitions - get list of menu definitions

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java?rev=770686&r1=770685&r2=770686&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
Fri May  1 14:09:11 2009
@@ -457,7 +457,7 @@
      *         and documents directly under this folder.
      * @throws DocumentException
      */
-    public NodeSet getAll(Folder folder) throws DocumentException;
+    public void initFolder(Folder folder) throws DocumentException;
 
     /** Update a page in persistent storage
      *



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