portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r920191 [4/5] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/om/folder/proxy/ components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/om/page/proxy/ components/jetspeed-por...
Date Mon, 08 Mar 2010 03:54:18 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java?rev=920191&r1=920190&r2=920191&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java Mon Mar  8 03:54:17 2010
@@ -41,7 +41,8 @@
 import org.apache.jetspeed.page.document.NodeNotFoundException;
 import org.apache.jetspeed.page.document.proxy.NodeProxy;
 import org.apache.jetspeed.portalsite.impl.MenuImpl;
-import org.apache.jetspeed.portalsite.view.SiteView;
+import org.apache.jetspeed.portalsite.view.PhysicalSiteView;
+import org.apache.jetspeed.portalsite.view.SearchPathsSiteView;
 import org.apache.jetspeed.profiler.ProfileLocator;
 import org.apache.jetspeed.profiler.impl.JetspeedProfileLocator;
 
@@ -154,82 +155,82 @@
     public void testSiteView() throws Exception
     {
         // test degenerate SiteView
-        SiteView baseView = new SiteView(pageManager);
+        SearchPathsSiteView baseView = new SearchPathsSiteView(pageManager);
         assertEquals("/", baseView.getSearchPathsString());
-        Folder rootFolderProxy = baseView.getRootFolderProxy();
-        assertNotNull(rootFolderProxy);
-        assertEquals("/", rootFolderProxy.getName());
-        assertEquals("root", rootFolderProxy.getTitle());
-        assertEquals("/", extractFileSystemPathFromId(rootFolderProxy.getId()));
-        assertEquals(5, rootFolderProxy.getFolders().size());
-        Iterator foldersIter = rootFolderProxy.getFolders().iterator();
+        Folder rootFolderView = baseView.getRootFolderView();
+        assertNotNull(rootFolderView);
+        assertEquals("/", rootFolderView.getName());
+        assertEquals("root", rootFolderView.getTitle());
+        assertEquals("/", extractFileSystemPathFromId(rootFolderView.getId()));
+        assertEquals(5, rootFolderView.getFolders().size());
+        Iterator foldersIter = rootFolderView.getFolders().iterator();
         assertEquals("contentfolder", ((Folder)foldersIter.next()).getName());
         assertEquals("folder0", ((Folder)foldersIter.next()).getName());
         assertEquals("folder1", ((Folder)foldersIter.next()).getName());
         assertEquals("folder2", ((Folder)foldersIter.next()).getName());
         assertEquals("folder3", ((Folder)foldersIter.next()).getName());
-        assertEquals(4, rootFolderProxy.getPages().size());
-        Iterator pagesIter = rootFolderProxy.getPages().iterator();
+        assertEquals(4, rootFolderView.getPages().size());
+        Iterator pagesIter = rootFolderView.getPages().iterator();
         assertEquals("page2.psml", ((Page)pagesIter.next()).getName());
         assertEquals("page1.psml", ((Page)pagesIter.next()).getName());
         assertEquals("page0.psml", ((Page)pagesIter.next()).getName());
         assertEquals("hidden.psml", ((Page)pagesIter.next()).getName());
-        assertEquals(2, rootFolderProxy.getLinks().size());
-        Iterator linksIter = rootFolderProxy.getLinks().iterator();
+        assertEquals(2, rootFolderView.getLinks().size());
+        Iterator linksIter = rootFolderView.getLinks().iterator();
         assertEquals("link1.link", ((Link)linksIter.next()).getName());
         assertEquals("link0.link", ((Link)linksIter.next()).getName());
-        assertEquals(2, rootFolderProxy.getDynamicPages().size());
-        Iterator dynamicPagesIter = rootFolderProxy.getDynamicPages().iterator();
+        assertEquals(2, rootFolderView.getDynamicPages().size());
+        Iterator dynamicPagesIter = rootFolderView.getDynamicPages().iterator();
         assertEquals("contentpage.dpsml", ((DynamicPage)dynamicPagesIter.next()).getName());
         assertEquals("docpage.dpsml", ((DynamicPage)dynamicPagesIter.next()).getName());
-        Page rootPage0Proxy = rootFolderProxy.getPage("page0.psml");
-        assertNotNull(rootPage0Proxy);
-        assertEquals(rootFolderProxy, rootPage0Proxy.getParent());
-        assertEquals("page0.psml", rootPage0Proxy.getName());
-        assertEquals("/page0.psml", extractFileSystemPathFromId(rootPage0Proxy.getId()));
-        Page rootHiddenProxy = rootFolderProxy.getPage("hidden.psml");
-        assertNotNull(rootHiddenProxy);
-        assertEquals("hidden.psml", rootHiddenProxy.getName());
-        assertTrue(rootHiddenProxy.isHidden());
-        Link rootLink0Proxy = rootFolderProxy.getLink("link0.link");
-        assertNotNull(rootLink0Proxy);
-        assertEquals(rootFolderProxy, rootLink0Proxy.getParent());
-        assertEquals("link0.link", rootLink0Proxy.getName());
-        assertEquals("/link0.link", extractFileSystemPathFromId(rootLink0Proxy.getId()));
-        DynamicPage docPageProxy = rootFolderProxy.getDynamicPage("docpage.dpsml");        
-        assertNotNull(docPageProxy);
-        assertEquals(rootFolderProxy, docPageProxy.getParent());
-        assertEquals("docpage.dpsml", docPageProxy.getName());
-        assertEquals("/docpage.dpsml", extractFileSystemPathFromId(docPageProxy.getId()));
-        Folder rootFolder0Proxy = rootFolderProxy.getFolder("folder0");
-        assertNotNull(rootFolder0Proxy);
-        assertEquals(rootFolderProxy, rootFolder0Proxy.getParent());
-        assertEquals(1, rootFolder0Proxy.getPages().size());
-        assertEquals(null, rootFolder0Proxy.getLinks());
-        assertEquals("folder0", rootFolder0Proxy.getName());
-        assertEquals("/folder0", extractFileSystemPathFromId(rootFolder0Proxy.getId()));
-        Page folder0Page0Proxy = rootFolder0Proxy.getPage("page0.psml");
-        assertNotNull(folder0Page0Proxy);
-        assertEquals(rootFolder0Proxy, folder0Page0Proxy.getParent());
-        assertEquals("page0.psml", folder0Page0Proxy.getName());
-        assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(folder0Page0Proxy.getId()));
+        Page rootPage0View = rootFolderView.getPage("page0.psml");
+        assertNotNull(rootPage0View);
+        assertEquals(rootFolderView, rootPage0View.getParent());
+        assertEquals("page0.psml", rootPage0View.getName());
+        assertEquals("/page0.psml", extractFileSystemPathFromId(rootPage0View.getId()));
+        Page rootHiddenView = rootFolderView.getPage("hidden.psml");
+        assertNotNull(rootHiddenView);
+        assertEquals("hidden.psml", rootHiddenView.getName());
+        assertTrue(rootHiddenView.isHidden());
+        Link rootLink0View = rootFolderView.getLink("link0.link");
+        assertNotNull(rootLink0View);
+        assertEquals(rootFolderView, rootLink0View.getParent());
+        assertEquals("link0.link", rootLink0View.getName());
+        assertEquals("/link0.link", extractFileSystemPathFromId(rootLink0View.getId()));
+        DynamicPage docPageView = rootFolderView.getDynamicPage("docpage.dpsml");        
+        assertNotNull(docPageView);
+        assertEquals(rootFolderView, docPageView.getParent());
+        assertEquals("docpage.dpsml", docPageView.getName());
+        assertEquals("/docpage.dpsml", extractFileSystemPathFromId(docPageView.getId()));
+        Folder rootFolder0View = rootFolderView.getFolder("folder0");
+        assertNotNull(rootFolder0View);
+        assertEquals(rootFolderView, rootFolder0View.getParent());
+        assertEquals(1, rootFolder0View.getPages().size());
+        assertNull(rootFolder0View.getLinks());
+        assertEquals("folder0", rootFolder0View.getName());
+        assertEquals("/folder0", extractFileSystemPathFromId(rootFolder0View.getId()));
+        Page folder0Page0View = rootFolder0View.getPage("page0.psml");
+        assertNotNull(folder0Page0View);
+        assertEquals(rootFolder0View, folder0Page0View.getParent());
+        assertEquals("page0.psml", folder0Page0View.getName());
+        assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(folder0Page0View.getId()));
 
         // test SiteView access by path
-        Folder rootFolderProxyByPath = (Folder)baseView.getNodeProxy("/", null, false, false);
-        assertNotNull(rootFolderProxyByPath);
-        assertEquals(rootFolderProxy, rootFolderProxyByPath);
-        Folder rootFolder0ProxyByPath = (Folder)baseView.getNodeProxy("/folder0/", null, false, false);
-        assertNotNull(rootFolder0ProxyByPath);
-        assertEquals(rootFolder0Proxy, rootFolder0ProxyByPath);
-        Page folder0Page0ProxyByPath = (Page)baseView.getNodeProxy("/folder0/page0.psml", null, false, false);
-        assertNotNull(folder0Page0ProxyByPath);
-        assertEquals(folder0Page0Proxy, folder0Page0ProxyByPath);
-        folder0Page0ProxyByPath = (Page)baseView.getNodeProxy("page0.psml", rootFolder0Proxy, false, false);
-        assertNotNull(folder0Page0ProxyByPath);
-        assertEquals(folder0Page0Proxy, folder0Page0ProxyByPath);
+        Folder rootFolderViewByPath = (Folder)baseView.getNodeView("/", null, false, false);
+        assertNotNull(rootFolderViewByPath);
+        assertEquals(rootFolderView, rootFolderViewByPath);
+        Folder rootFolder0ViewByPath = (Folder)baseView.getNodeView("/folder0/", null, false, false);
+        assertNotNull(rootFolder0ViewByPath);
+        assertEquals(rootFolder0View, rootFolder0ViewByPath);
+        Page folder0Page0ViewByPath = (Page)baseView.getNodeView("/folder0/page0.psml", null, false, false);
+        assertNotNull(folder0Page0ViewByPath);
+        assertEquals(folder0Page0View, folder0Page0ViewByPath);
+        folder0Page0ViewByPath = (Page)baseView.getNodeView("page0.psml", rootFolder0View, false, false);
+        assertNotNull(folder0Page0ViewByPath);
+        assertEquals(folder0Page0View, folder0Page0ViewByPath);
         try
         {
-            baseView.getNodeProxy("/folderX/page0.psml", null, false, false);
+            baseView.getNodeView("/folderX/page0.psml", null, false, false);
             fail("/folderX/page0.psml should not be found");
         }
         catch (NodeNotFoundException nnfe)
@@ -237,143 +238,143 @@
         }
         try
         {
-            baseView.getNodeProxy("/folder0/pageX.psml", null, false, false);
+            baseView.getNodeView("/folder0/pageX.psml", null, false, false);
             fail("/folder0/pageX.psml should not be found");
         }
         catch (NodeNotFoundException nnfe)
         {
         }
-        List rootPageProxiesByPath = baseView.getNodeProxies("/page?.psml", null, false, false);
-        assertNotNull(rootPageProxiesByPath);
-        assertEquals(3,rootPageProxiesByPath.size());
-        assertTrue(rootPageProxiesByPath.contains(rootPage0Proxy));
-        List rootFolderProxiesByPath = baseView.getNodeProxies("/*/", null, false, false);
-        assertNotNull(rootFolderProxiesByPath);
-        assertEquals(5,rootFolderProxiesByPath.size());
-        assertTrue(rootFolderProxiesByPath.contains(rootFolder0Proxy));
-        List folderPageProxiesByPath = baseView.getNodeProxies("*/p*[0-9].psml", rootFolderProxy, false, false);
-        assertNotNull(folderPageProxiesByPath);
-        assertEquals(2,folderPageProxiesByPath.size());
-        assertTrue(folderPageProxiesByPath.contains(folder0Page0Proxy));
+        List rootPageViewsByPath = baseView.getNodeViews("/page?.psml", null, false, false);
+        assertNotNull(rootPageViewsByPath);
+        assertEquals(3,rootPageViewsByPath.size());
+        assertTrue(rootPageViewsByPath.contains(rootPage0View));
+        List rootFolderViewsByPath = baseView.getNodeViews("/*/", null, false, false);
+        assertNotNull(rootFolderViewsByPath);
+        assertEquals(5,rootFolderViewsByPath.size());
+        assertTrue(rootFolderViewsByPath.contains(rootFolder0View));
+        List folderPageViewsByPath = baseView.getNodeViews("*/p*[0-9].psml", rootFolderView, false, false);
+        assertNotNull(folderPageViewsByPath);
+        assertEquals(2,folderPageViewsByPath.size());
+        assertTrue(folderPageViewsByPath.contains(folder0Page0View));
 
         // test aggregating SiteView
-        SiteView aggregateView = new SiteView(pageManager, "/_user/user,/_role/role0,/_group/group,/", false);
+        SearchPathsSiteView aggregateView = new SearchPathsSiteView(pageManager, "/_user/user,/_role/role0,/_group/group,/", false);
         assertEquals("/_user/user,/_role/role0,/_group/group,/", aggregateView.getSearchPathsString());
-        rootFolderProxy = aggregateView.getRootFolderProxy();
-        assertNotNull(rootFolderProxy);
-        assertEquals("/", rootFolderProxy.getName());
-        assertEquals("user root", rootFolderProxy.getTitle());
-        assertEquals("/_user/user", extractFileSystemPathFromId(rootFolderProxy.getId()));
-        assertEquals(5, rootFolderProxy.getFolders().size());
-        assertEquals(4, rootFolderProxy.getPages().size());
-        assertEquals(2, rootFolderProxy.getLinks().size());
-        assertEquals(2, rootFolderProxy.getDynamicPages().size());
-        rootPage0Proxy = rootFolderProxy.getPage("page0.psml");
-        assertNotNull(rootPage0Proxy);
-        assertEquals(rootFolderProxy, rootPage0Proxy.getParent());
-        assertEquals("page0.psml", rootPage0Proxy.getName());
-        assertEquals("/page0.psml", extractFileSystemPathFromId(rootPage0Proxy.getId()));
-        List rootPage0ProxyMenus = rootPage0Proxy.getMenuDefinitions();
-        assertNotNull(rootPage0ProxyMenus);
-        assertEquals(5 + aggregateView.getStandardMenuNames().size(), rootPage0ProxyMenus.size());
-        Iterator menusIter = rootPage0ProxyMenus.iterator();
-        MenuDefinition rootPage0ProxyTemplateTestMenu = (MenuDefinition)menusIter.next();
-        assertEquals("template-test", rootPage0ProxyTemplateTestMenu.getName());
-        assertEquals("/page2.psml", rootPage0ProxyTemplateTestMenu.getOptions());
-        MenuDefinition rootPage0ProxyTopMenu = (MenuDefinition)menusIter.next();
-        assertEquals("top", rootPage0ProxyTopMenu.getName());
-        assertEquals("/", rootPage0ProxyTopMenu.getOptions());
-        assertEquals(2, rootPage0ProxyTopMenu.getDepth());
-        assertEquals("dhtml-pull-down", rootPage0ProxyTopMenu.getSkin());
-        MenuDefinition rootPage0ProxyBreadCrumbMenu = (MenuDefinition)menusIter.next();
-        assertEquals("bread-crumbs", rootPage0ProxyBreadCrumbMenu.getName());
-        assertEquals("./", rootPage0ProxyBreadCrumbMenu.getOptions());
-        assertEquals(true, rootPage0ProxyBreadCrumbMenu.isPaths());
-        MenuDefinition rootPage0ProxyCurrentPageTestMenu = (MenuDefinition)menusIter.next();
-        assertEquals("current-page-test", rootPage0ProxyCurrentPageTestMenu.getName());
-        MenuDefinition rootPage0ProxyCurrentPathTestMenu = (MenuDefinition)menusIter.next();
-        assertEquals("current-path-test", rootPage0ProxyCurrentPathTestMenu.getName());        
+        rootFolderView = aggregateView.getRootFolderView();
+        assertNotNull(rootFolderView);
+        assertEquals("/", rootFolderView.getName());
+        assertEquals("user root", rootFolderView.getTitle());
+        assertEquals("/_user/user", extractFileSystemPathFromId(rootFolderView.getId()));
+        assertEquals(5, rootFolderView.getFolders().size());
+        assertEquals(4, rootFolderView.getPages().size());
+        assertEquals(2, rootFolderView.getLinks().size());
+        assertEquals(2, rootFolderView.getDynamicPages().size());
+        rootPage0View = rootFolderView.getPage("page0.psml");
+        assertNotNull(rootPage0View);
+        assertEquals(rootFolderView, rootPage0View.getParent());
+        assertEquals("page0.psml", rootPage0View.getName());
+        assertEquals("/page0.psml", extractFileSystemPathFromId(rootPage0View.getId()));
+        List rootPage0ViewMenus = rootPage0View.getMenuDefinitions();
+        assertNotNull(rootPage0ViewMenus);
+        assertEquals(5 + aggregateView.getStandardMenuNames().size(), rootPage0ViewMenus.size());
+        Iterator menusIter = rootPage0ViewMenus.iterator();
+        MenuDefinition rootPage0ViewTemplateTestMenu = (MenuDefinition)menusIter.next();
+        assertEquals("template-test", rootPage0ViewTemplateTestMenu.getName());
+        assertEquals("/page2.psml", rootPage0ViewTemplateTestMenu.getOptions());
+        MenuDefinition rootPage0ViewTopMenu = (MenuDefinition)menusIter.next();
+        assertEquals("top", rootPage0ViewTopMenu.getName());
+        assertEquals("/", rootPage0ViewTopMenu.getOptions());
+        assertEquals(2, rootPage0ViewTopMenu.getDepth());
+        assertEquals("dhtml-pull-down", rootPage0ViewTopMenu.getSkin());
+        MenuDefinition rootPage0ViewBreadCrumbMenu = (MenuDefinition)menusIter.next();
+        assertEquals("bread-crumbs", rootPage0ViewBreadCrumbMenu.getName());
+        assertEquals("./", rootPage0ViewBreadCrumbMenu.getOptions());
+        assertEquals(true, rootPage0ViewBreadCrumbMenu.isPaths());
+        MenuDefinition rootPage0ViewCurrentPageTestMenu = (MenuDefinition)menusIter.next();
+        assertEquals("current-page-test", rootPage0ViewCurrentPageTestMenu.getName());
+        MenuDefinition rootPage0ViewCurrentPathTestMenu = (MenuDefinition)menusIter.next();
+        assertEquals("current-path-test", rootPage0ViewCurrentPathTestMenu.getName());        
         for (int i = 0; (i < aggregateView.getStandardMenuNames().size()); i++)
         {
             assertTrue(aggregateView.getStandardMenuNames().contains(((MenuDefinition)menusIter.next()).getName()));
         }
-        Page rootPage2Proxy = rootFolderProxy.getPage("page2.psml");
-        assertNotNull(rootPage2Proxy);
-        assertEquals(rootFolderProxy, rootPage2Proxy.getParent());
-        assertEquals("page2.psml", rootPage2Proxy.getName());
-        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(rootPage2Proxy.getId()));
-        List rootPage2ProxyMenus = rootPage2Proxy.getMenuDefinitions();
-        assertNotNull(rootPage2ProxyMenus);
-        assertEquals(5 + aggregateView.getStandardMenuNames().size(), rootPage2ProxyMenus.size());
-        menusIter = rootPage2ProxyMenus.iterator();
-        MenuDefinition rootPage2ProxyTopMenu = (MenuDefinition)menusIter.next();
-        assertEquals("top", rootPage2ProxyTopMenu.getName());
-        assertEquals("/", rootPage2ProxyTopMenu.getOptions());
-        assertEquals(1, rootPage2ProxyTopMenu.getDepth());
-        MenuDefinition rootPage2ProxyBreadCrumbMenu = (MenuDefinition)menusIter.next();
-        assertEquals("bread-crumbs", rootPage2ProxyBreadCrumbMenu.getName());
-        MenuDefinition rootPage2ProxyTemplateTestMenu = (MenuDefinition)menusIter.next();
-        assertEquals("template-test", rootPage2ProxyTemplateTestMenu.getName());
-        assertEquals("/page0.psml", rootPage2ProxyTemplateTestMenu.getOptions());
-        MenuDefinition rootPage2ProxyCurrentPageTestMenu = (MenuDefinition)menusIter.next();
-        assertEquals("current-page-test", rootPage0ProxyCurrentPageTestMenu.getName());
-        MenuDefinition rootPage2ProxyCurrentPathTestMenu = (MenuDefinition)menusIter.next();
-        assertEquals("current-path-test", rootPage0ProxyCurrentPathTestMenu.getName());        
+        Page rootPage2View = rootFolderView.getPage("page2.psml");
+        assertNotNull(rootPage2View);
+        assertEquals(rootFolderView, rootPage2View.getParent());
+        assertEquals("page2.psml", rootPage2View.getName());
+        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(rootPage2View.getId()));
+        List rootPage2ViewMenus = rootPage2View.getMenuDefinitions();
+        assertNotNull(rootPage2ViewMenus);
+        assertEquals(5 + aggregateView.getStandardMenuNames().size(), rootPage2ViewMenus.size());
+        menusIter = rootPage2ViewMenus.iterator();
+        MenuDefinition rootPage2ViewTopMenu = (MenuDefinition)menusIter.next();
+        assertEquals("top", rootPage2ViewTopMenu.getName());
+        assertEquals("/", rootPage2ViewTopMenu.getOptions());
+        assertEquals(1, rootPage2ViewTopMenu.getDepth());
+        MenuDefinition rootPage2ViewBreadCrumbMenu = (MenuDefinition)menusIter.next();
+        assertEquals("bread-crumbs", rootPage2ViewBreadCrumbMenu.getName());
+        MenuDefinition rootPage2ViewTemplateTestMenu = (MenuDefinition)menusIter.next();
+        assertEquals("template-test", rootPage2ViewTemplateTestMenu.getName());
+        assertEquals("/page0.psml", rootPage2ViewTemplateTestMenu.getOptions());
+        MenuDefinition rootPage2ViewCurrentPageTestMenu = (MenuDefinition)menusIter.next();
+        assertEquals("current-page-test", rootPage0ViewCurrentPageTestMenu.getName());
+        MenuDefinition rootPage2ViewCurrentPathTestMenu = (MenuDefinition)menusIter.next();
+        assertEquals("current-path-test", rootPage0ViewCurrentPathTestMenu.getName());        
         for (int i = 0; (i < aggregateView.getStandardMenuNames().size()); i++)
         {
             assertTrue(aggregateView.getStandardMenuNames().contains(((MenuDefinition)menusIter.next()).getName()));
         }
-        rootLink0Proxy = rootFolderProxy.getLink("link0.link");
-        assertNotNull(rootLink0Proxy);
-        assertEquals(rootFolderProxy, rootLink0Proxy.getParent());
-        assertEquals("link0.link", rootLink0Proxy.getName());
-        assertEquals("/_group/group/link0.link", extractFileSystemPathFromId(rootLink0Proxy.getId()));
-        rootFolder0Proxy = rootFolderProxy.getFolder("folder0");
-        assertNotNull(rootFolder0Proxy);
-        assertEquals(rootFolderProxy, rootFolder0Proxy.getParent());
-        assertEquals(1, rootFolder0Proxy.getPages().size());
-        assertEquals(null, rootFolder0Proxy.getLinks());
-        assertEquals(null, rootFolder0Proxy.getFolders());
-        assertEquals("folder0", rootFolder0Proxy.getName());
-        assertEquals("folder0", rootFolder0Proxy.getTitle());
-        assertEquals("/folder0", extractFileSystemPathFromId(rootFolder0Proxy.getId()));
-        folder0Page0Proxy = rootFolder0Proxy.getPage("page0.psml");
-        assertNotNull(folder0Page0Proxy);
-        assertEquals(rootFolder0Proxy, folder0Page0Proxy.getParent());
-        assertEquals("page0.psml", folder0Page0Proxy.getName());
-        assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(folder0Page0Proxy.getId()));
-        Folder rootFolder1Proxy = rootFolderProxy.getFolder("folder1");
-        assertNotNull(rootFolder1Proxy);
-        assertEquals(rootFolderProxy, rootFolder1Proxy.getParent());
-        assertEquals(2, rootFolder1Proxy.getPages().size());
-        assertEquals(null, rootFolder1Proxy.getLinks());
-        assertEquals(null, rootFolder1Proxy.getFolders());
-        assertEquals("folder1", rootFolder1Proxy.getName());
-        assertEquals("group folder1", rootFolder1Proxy.getTitle());
-        assertEquals("/_user/user/folder1", extractFileSystemPathFromId(rootFolder1Proxy.getId()));
+        rootLink0View = rootFolderView.getLink("link0.link");
+        assertNotNull(rootLink0View);
+        assertEquals(rootFolderView, rootLink0View.getParent());
+        assertEquals("link0.link", rootLink0View.getName());
+        assertEquals("/_group/group/link0.link", extractFileSystemPathFromId(rootLink0View.getId()));
+        rootFolder0View = rootFolderView.getFolder("folder0");
+        assertNotNull(rootFolder0View);
+        assertEquals(rootFolderView, rootFolder0View.getParent());
+        assertEquals(1, rootFolder0View.getPages().size());
+        assertNull(rootFolder0View.getLinks());
+        assertNull(rootFolder0View.getFolders());
+        assertEquals("folder0", rootFolder0View.getName());
+        assertEquals("folder0", rootFolder0View.getTitle());
+        assertEquals("/folder0", extractFileSystemPathFromId(rootFolder0View.getId()));
+        folder0Page0View = rootFolder0View.getPage("page0.psml");
+        assertNotNull(folder0Page0View);
+        assertEquals(rootFolder0View, folder0Page0View.getParent());
+        assertEquals("page0.psml", folder0Page0View.getName());
+        assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(folder0Page0View.getId()));
+        Folder rootFolder1View = rootFolderView.getFolder("folder1");
+        assertNotNull(rootFolder1View);
+        assertEquals(rootFolderView, rootFolder1View.getParent());
+        assertEquals(2, rootFolder1View.getPages().size());
+        assertNull(rootFolder1View.getLinks());
+        assertNull(rootFolder1View.getFolders());
+        assertEquals("folder1", rootFolder1View.getName());
+        assertEquals("group folder1", rootFolder1View.getTitle());
+        assertEquals("/_user/user/folder1", extractFileSystemPathFromId(rootFolder1View.getId()));
 
         // test degenerate aggregating SiteView
-        aggregateView = new SiteView(pageManager, "/__subsite-root", false);
+        aggregateView = new SearchPathsSiteView(pageManager, "/__subsite-root", false);
         assertEquals("/__subsite-root", aggregateView.getSearchPathsString());
-        rootFolderProxy = aggregateView.getRootFolderProxy();
-        assertNotNull(rootFolderProxy);
-        assertEquals("/", rootFolderProxy.getName());
-        assertEquals("subsite root", rootFolderProxy.getTitle());
-        assertEquals("/__subsite-root", extractFileSystemPathFromId(rootFolderProxy.getId()));
-        assertEquals(null, rootFolderProxy.getFolders());
-        assertEquals(1, rootFolderProxy.getPages().size());
-        assertEquals(1, rootFolderProxy.getLinks().size());
+        rootFolderView = aggregateView.getRootFolderView();
+        assertNotNull(rootFolderView);
+        assertEquals("/", rootFolderView.getName());
+        assertEquals("subsite root", rootFolderView.getTitle());
+        assertEquals("/__subsite-root", extractFileSystemPathFromId(rootFolderView.getId()));
+        assertNull(rootFolderView.getFolders());
+        assertEquals(1, rootFolderView.getPages().size());
+        assertEquals(1, rootFolderView.getLinks().size());
 
         // test SiteView construction using profile locators
         JetspeedProfileLocator locator = new JetspeedProfileLocator();
         locator.init(null, "/");
-        SiteView profileView = new SiteView(pageManager, locator, false);
+        SearchPathsSiteView profileView = new SearchPathsSiteView(pageManager, locator, false);
         assertEquals("/", profileView.getSearchPathsString());
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
         locator.add("user", true, false, "user");
         locator.add("page", false, false, "default-page");
-        profileView = new SiteView(pageManager, locator, false);
+        profileView = new SearchPathsSiteView(pageManager, locator, false);
         assertEquals("/_user/user,/", profileView.getSearchPathsString());
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
@@ -382,14 +383,14 @@
         locator.add("mediatype", true, false, "html");
         locator.add("language", true, false, "en");
         locator.add("country", true, false, "US");
-        profileView = new SiteView(pageManager, locator, false);
+        profileView = new SearchPathsSiteView(pageManager, locator, false);
         assertEquals("/_user/user/_mediatype/html,/_user/user,/", profileView.getSearchPathsString());
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
         locator.add("page", false, false, "default-page");
         locator.add("role", true, false, "role0");
         locator.add("role", true, false, "role1");
-        profileView = new SiteView(pageManager, locator, false);
+        profileView = new SearchPathsSiteView(pageManager, locator, false);
         assertEquals("/_role/role0,/_role/role1,/", profileView.getSearchPathsString());
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
@@ -399,7 +400,7 @@
         locator.add("navigation", false, true, "/");
         locator.add("group", true, false, "group");
         locator.add("page", false, false, "default-page");
-        profileView = new SiteView(pageManager, locator, false);
+        profileView = new SearchPathsSiteView(pageManager, locator, false);
         assertEquals("/_user/user,/_role/role0,/_group/group,/", profileView.getSearchPathsString());
 
         locator = new JetspeedProfileLocator();
@@ -407,13 +408,13 @@
         locator.add("hostname", true, false, "dash");
         locator.add("user", true, false, "joe");
         locator.add("page", false, false, "home");
-        profileView = new SiteView(pageManager, locator, false);
+        profileView = new SearchPathsSiteView(pageManager, locator, false);
         assertEquals("/_hostname/dash/_user/joe,/_hostname/dash,/", profileView.getSearchPathsString());
         
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
         locator.add("navigation", false, true, "subsite-root");
-        profileView = new SiteView(pageManager, locator, false);
+        profileView = new SearchPathsSiteView(pageManager, locator, false);
         assertEquals("/__subsite-root", profileView.getSearchPathsString());
         Map locators = new HashMap();
         locator = new JetspeedProfileLocator();
@@ -427,30 +428,109 @@
         locator.add("navigation", false, true, "/");
         locator.add("group", true, false, "group");
         locators.put("alternate-locator-name", locator);
-        profileView = new SiteView(pageManager, locators, false);
+        profileView = new SearchPathsSiteView(pageManager, locators, false);
         assertEquals("/_role/role0,/_role/role1,/_user/user,/_group/group,/", profileView.getSearchPathsString());
-        rootFolderProxy = profileView.getRootFolderProxy();
-        assertNotNull(rootFolderProxy);
-        assertEquals("/", rootFolderProxy.getName());
-        assertEquals("user root", rootFolderProxy.getTitle());
-        assertEquals("/_role/role0", extractFileSystemPathFromId(rootFolderProxy.getId()));
-        assertEquals(ProfileLocator.PAGE_LOCATOR, extractLocatorNameFromProxy(rootFolderProxy));
-        rootPage2Proxy = rootFolderProxy.getPage("page2.psml");
-        assertNotNull(rootPage2Proxy);
-        assertEquals("page2.psml", rootPage2Proxy.getName());
-        assertEquals("/_role/role0/page2.psml", extractFileSystemPathFromId(rootPage2Proxy.getId()));
-        assertEquals(ProfileLocator.PAGE_LOCATOR, extractLocatorNameFromProxy(rootPage2Proxy));
-        rootFolder1Proxy = rootFolderProxy.getFolder("folder1");
-        assertNotNull(rootFolder1Proxy);
-        assertEquals("folder1", rootFolder1Proxy.getName());
-        assertEquals("group folder1", rootFolder1Proxy.getTitle());
-        assertEquals("/_user/user/folder1", extractFileSystemPathFromId(rootFolder1Proxy.getId()));
-        assertEquals("alternate-locator-name", extractLocatorNameFromProxy(rootFolder1Proxy));
-        Page folder1Page1Proxy = rootFolder1Proxy.getPage("page1.psml");
-        assertNotNull(folder1Page1Proxy);
-        assertEquals("page1.psml", folder1Page1Proxy.getName());
-        assertEquals("/_group/group/folder1/page1.psml", extractFileSystemPathFromId(folder1Page1Proxy.getId()));
-        assertEquals("alternate-locator-name", extractLocatorNameFromProxy(folder1Page1Proxy));
+        rootFolderView = profileView.getRootFolderView();
+        assertNotNull(rootFolderView);
+        assertEquals("/", rootFolderView.getName());
+        assertEquals("user root", rootFolderView.getTitle());
+        assertEquals("/_role/role0", extractFileSystemPathFromId(rootFolderView.getId()));
+        assertEquals(ProfileLocator.PAGE_LOCATOR, extractLocatorNameFromView(rootFolderView));
+        rootPage2View = rootFolderView.getPage("page2.psml");
+        assertNotNull(rootPage2View);
+        assertEquals("page2.psml", rootPage2View.getName());
+        assertEquals("/_role/role0/page2.psml", extractFileSystemPathFromId(rootPage2View.getId()));
+        assertEquals(ProfileLocator.PAGE_LOCATOR, extractLocatorNameFromView(rootPage2View));
+        rootFolder1View = rootFolderView.getFolder("folder1");
+        assertNotNull(rootFolder1View);
+        assertEquals("folder1", rootFolder1View.getName());
+        assertEquals("group folder1", rootFolder1View.getTitle());
+        assertEquals("/_user/user/folder1", extractFileSystemPathFromId(rootFolder1View.getId()));
+        assertEquals("alternate-locator-name", extractLocatorNameFromView(rootFolder1View));
+        Page folder1Page1View = rootFolder1View.getPage("page1.psml");
+        assertNotNull(folder1Page1View);
+        assertEquals("page1.psml", folder1Page1View.getName());
+        assertEquals("/_group/group/folder1/page1.psml", extractFileSystemPathFromId(folder1Page1View.getId()));
+        assertEquals("alternate-locator-name", extractLocatorNameFromView(folder1Page1View));
+        
+        // test physical SiteView
+        PhysicalSiteView basePhysicalView = new PhysicalSiteView(pageManager);
+        rootFolderView = basePhysicalView.getRootFolderView();
+        assertNotNull(rootFolderView);
+        assertEquals("/", rootFolderView.getName());
+        assertEquals("root", rootFolderView.getTitle());
+        assertEquals("/", extractFileSystemPathFromId(rootFolderView.getId()));
+        assertEquals(10, rootFolderView.getFolders().size());
+        foldersIter = rootFolderView.getFolders().iterator();
+        assertEquals("__subsite-root", ((Folder)foldersIter.next()).getName());
+        assertEquals("_group", ((Folder)foldersIter.next()).getName());
+        assertEquals("_hostname", ((Folder)foldersIter.next()).getName());
+        assertEquals("_role", ((Folder)foldersIter.next()).getName());
+        assertEquals("_user", ((Folder)foldersIter.next()).getName());
+        assertEquals("contentfolder", ((Folder)foldersIter.next()).getName());
+        assertEquals("folder0", ((Folder)foldersIter.next()).getName());
+        assertEquals("folder1", ((Folder)foldersIter.next()).getName());
+        assertEquals("folder2", ((Folder)foldersIter.next()).getName());
+        assertEquals("folder3", ((Folder)foldersIter.next()).getName());
+        assertEquals(4, rootFolderView.getPages().size());
+        pagesIter = rootFolderView.getPages().iterator();
+        assertEquals("page2.psml", ((Page)pagesIter.next()).getName());
+        assertEquals("page1.psml", ((Page)pagesIter.next()).getName());
+        assertEquals("page0.psml", ((Page)pagesIter.next()).getName());
+        assertEquals("hidden.psml", ((Page)pagesIter.next()).getName());
+        assertEquals(2, rootFolderView.getLinks().size());
+        linksIter = rootFolderView.getLinks().iterator();
+        assertEquals("link1.link", ((Link)linksIter.next()).getName());
+        assertEquals("link0.link", ((Link)linksIter.next()).getName());
+        assertEquals(2, rootFolderView.getDynamicPages().size());
+        dynamicPagesIter = rootFolderView.getDynamicPages().iterator();
+        assertEquals("contentpage.dpsml", ((DynamicPage)dynamicPagesIter.next()).getName());
+        assertEquals("docpage.dpsml", ((DynamicPage)dynamicPagesIter.next()).getName());
+        rootPage0View = rootFolderView.getPage("page0.psml");
+        assertNotNull(rootPage0View);
+        assertEquals(rootFolderView, rootPage0View.getParent());
+        assertEquals("page0.psml", rootPage0View.getName());
+        assertEquals("/page0.psml", extractFileSystemPathFromId(rootPage0View.getId()));
+        rootHiddenView = rootFolderView.getPage("hidden.psml");
+        assertNotNull(rootHiddenView);
+        assertEquals("hidden.psml", rootHiddenView.getName());
+        assertTrue(rootHiddenView.isHidden());
+        rootLink0View = rootFolderView.getLink("link0.link");
+        assertNotNull(rootLink0View);
+        assertEquals(rootFolderView, rootLink0View.getParent());
+        assertEquals("link0.link", rootLink0View.getName());
+        assertEquals("/link0.link", extractFileSystemPathFromId(rootLink0View.getId()));
+        docPageView = rootFolderView.getDynamicPage("docpage.dpsml");        
+        assertNotNull(docPageView);
+        assertEquals(rootFolderView, docPageView.getParent());
+        assertEquals("docpage.dpsml", docPageView.getName());
+        assertEquals("/docpage.dpsml", extractFileSystemPathFromId(docPageView.getId()));
+        rootFolder0View = rootFolderView.getFolder("folder0");
+        assertNotNull(rootFolder0View);
+        assertEquals(rootFolderView, rootFolder0View.getParent());
+        assertEquals(1, rootFolder0View.getPages().size());
+        assertEquals(0, rootFolder0View.getLinks().size());
+        assertEquals("folder0", rootFolder0View.getName());
+        assertEquals("/folder0", extractFileSystemPathFromId(rootFolder0View.getId()));
+        folder0Page0View = rootFolder0View.getPage("page0.psml");
+        assertNotNull(folder0Page0View);
+        assertEquals(rootFolder0View, folder0Page0View.getParent());
+        assertEquals("page0.psml", folder0Page0View.getName());
+        assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(folder0Page0View.getId()));
+        Folder rootUserView = rootFolderView.getFolder("_user");
+        assertNotNull(rootUserView);
+        assertEquals(rootFolderView, rootUserView.getParent());
+        Folder rootUserUserView = rootUserView.getFolder("user");
+        assertNotNull(rootUserUserView);
+        assertEquals(rootUserView, rootUserUserView.getParent());
+        assertEquals(2, rootUserUserView.getFolders().size());
+        assertNotNull(rootUserUserView.getFolder("folder1"));
+        assertNotNull(rootUserUserView.getFolder("_mediatype"));
+        assertEquals(1, rootUserUserView.getPages().size());
+        assertNotNull(rootUserUserView.getPage("page2.psml"));
+        assertEquals(0, rootUserUserView.getLinks().size());
+        assertEquals(1, rootUserUserView.getFragmentDefinitions().size());
+        assertNotNull(rootUserUserView.getFragmentDefinition("definition1.fpsml"));
     }
 
     /**
@@ -466,7 +546,7 @@
         locator.add("hostname", true, false, "dash");
         locator.add("user", true, false, "joe");
         locator.add("page", false, false, "home");
-        SiteView profileView = new SiteView(pageManager, locator, false);
+        SearchPathsSiteView profileView = new SearchPathsSiteView(pageManager, locator, false);
         assertEquals("/_hostname/dash/_user/joe,/_hostname/dash,/", profileView.getSearchPathsString());
         
         locator = new JetspeedProfileLocator();
@@ -477,7 +557,7 @@
         locator.add("hostname", true, false, "dash");
         locator.add("role", true, false, "user");
         locator.add("page", false, false, "home");
-        profileView = new SiteView(pageManager, locator, false);
+        profileView = new SearchPathsSiteView(pageManager, locator, false);
         assertEquals("/_hostname/dash/_user/joe,/_hostname/dash/_role/user,/_hostname/dash,/", profileView.getSearchPathsString());
   
         locator = new JetspeedProfileLocator();
@@ -489,7 +569,7 @@
         locator.add("hostname", true, false, "localhost");
         locator.add("role", true, false, "somerole");
         locator.add("path", false, false, "home");
-        profileView = new SiteView(pageManager, locator, false);
+        profileView = new SearchPathsSiteView(pageManager, locator, false);
         assertEquals("/__subsite-root/_hostname/localhost/_user/sublocal,/__subsite-root/_hostname/localhost/_role/somerole,/__subsite-root/_hostname/localhost,/__subsite-root", profileView.getSearchPathsString());                       
     }
     
@@ -498,9 +578,11 @@
      *
      * @throws Exception
      */
-    public void testPotalSiteSetup() throws Exception
+    public void testPortalSiteSetup() throws Exception
     {
         assertNotNull(portalSite);
+        
+        // search path site setup
         PortalSiteSessionContext sessionContext = portalSite.newSessionContext();
         assertNotNull(sessionContext);
         JetspeedProfileLocator locator = new JetspeedProfileLocator();
@@ -515,61 +597,128 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        BaseConcretePageElement requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof Page);
-        assertEquals("page2.psml", requestPageProxy.getName());
-        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
-        PageTemplate requestPageTemplateProxy = requestContext.getPageTemplate();
-        assertNotNull(requestPageTemplateProxy);
-        assertEquals("template.tpsml", requestPageTemplateProxy.getName());
-        assertEquals("/template.tpsml", extractFileSystemPathFromId(requestPageTemplateProxy.getId()));
-        Map requestFragmentDefinitionProxies = requestContext.getFragmentDefinitions();
-        assertNotNull(requestFragmentDefinitionProxies);
-        assertEquals(2, requestFragmentDefinitionProxies.size());
-        FragmentDefinition requestFragmentDefinitionProxy0 = (FragmentDefinition)requestFragmentDefinitionProxies.get("fake-fragment-definition-0");
-        assertNotNull(requestFragmentDefinitionProxy0);
-        assertEquals("definition0.fpsml", requestFragmentDefinitionProxy0.getName());
-        assertEquals("/definition0.fpsml", extractFileSystemPathFromId(requestFragmentDefinitionProxy0.getId()));
-        FragmentDefinition requestFragmentDefinitionProxy1 = (FragmentDefinition)requestFragmentDefinitionProxies.get("fake-fragment-definition-1");
-        assertNotNull(requestFragmentDefinitionProxy1);
-        assertEquals("definition1.fpsml", requestFragmentDefinitionProxy1.getName());
-        assertEquals("/_user/user/definition1.fpsml", extractFileSystemPathFromId(requestFragmentDefinitionProxy1.getId()));        
-        Folder requestFolderProxy = requestContext.getFolder();
-        assertNotNull(requestFolderProxy);
-        assertEquals("/", requestFolderProxy.getName());
-        assertEquals("/_user/user", extractFileSystemPathFromId(requestFolderProxy.getId()));
-        NodeSet requestSiblingPageProxies = requestContext.getSiblingPages();
-        assertNotNull(requestSiblingPageProxies);
-        assertEquals(3, requestSiblingPageProxies.size());
-        assertNotNull(requestSiblingPageProxies.get("page0.psml"));
-        assertEquals("/page0.psml", extractFileSystemPathFromId(requestSiblingPageProxies.get("page0.psml").getId()));
-        assertNotNull(requestSiblingPageProxies.get("page1.psml"));
-        assertEquals("/page1.psml", extractFileSystemPathFromId(requestSiblingPageProxies.get("page1.psml").getId()));
-        assertNotNull(requestSiblingPageProxies.get("page2.psml"));
-        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestSiblingPageProxies.get("page2.psml").getId()));
-        Folder requestParentFolderProxy = requestContext.getParentFolder();
-        assertNull(requestParentFolderProxy);
-        NodeSet requestSiblingFolderProxies = requestContext.getSiblingFolders();
-        assertNotNull(requestSiblingFolderProxies);
-        assertEquals(4, requestSiblingFolderProxies.size());
-        assertNotNull(requestSiblingFolderProxies.get("folder0"));
-        assertEquals("/folder0", extractFileSystemPathFromId(requestSiblingFolderProxies.get("folder0").getId()));
-        assertNotNull(requestSiblingFolderProxies.get("folder1"));
-        assertEquals("/_user/user/folder1", extractFileSystemPathFromId(requestSiblingFolderProxies.get("folder1").getId()));
-        assertNotNull(requestSiblingFolderProxies.get("folder2"));
-        assertEquals("/folder2", extractFileSystemPathFromId(requestSiblingFolderProxies.get("folder2").getId()));
-        Folder requestRootFolderProxy = requestContext.getRootFolder();
-        assertNotNull(requestRootFolderProxy);
-        assertEquals("/", requestRootFolderProxy.getName());
-        assertEquals("/_user/user", extractFileSystemPathFromId(requestRootFolderProxy.getId()));
-        NodeSet requestRootLinkProxies = requestContext.getRootLinks();
-        assertNotNull(requestRootLinkProxies);
-        assertEquals(2, requestRootLinkProxies.size());
-        assertNotNull(requestRootLinkProxies.get("link0.link"));
-        assertEquals("/_group/group/link0.link", extractFileSystemPathFromId(requestRootLinkProxies.get("link0.link").getId()));
-        assertNotNull(requestRootLinkProxies.get("link1.link"));
-        assertEquals("/link1.link", extractFileSystemPathFromId(requestRootLinkProxies.get("link1.link").getId()));
+        BaseConcretePageElement requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page2.psml", requestPageView.getName());
+        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageView.getId()));
+        PageTemplate requestPageTemplateView = requestContext.getPageTemplate();
+        assertNotNull(requestPageTemplateView);
+        assertEquals("template.tpsml", requestPageTemplateView.getName());
+        assertEquals("/template.tpsml", extractFileSystemPathFromId(requestPageTemplateView.getId()));
+        Map requestFragmentDefinitionViews = requestContext.getFragmentDefinitions();
+        assertNotNull(requestFragmentDefinitionViews);
+        assertEquals(2, requestFragmentDefinitionViews.size());
+        FragmentDefinition requestFragmentDefinitionView0 = (FragmentDefinition)requestFragmentDefinitionViews.get("fake-fragment-definition-0");
+        assertNotNull(requestFragmentDefinitionView0);
+        assertEquals("definition0.fpsml", requestFragmentDefinitionView0.getName());
+        assertEquals("/definition0.fpsml", extractFileSystemPathFromId(requestFragmentDefinitionView0.getId()));
+        FragmentDefinition requestFragmentDefinitionView1 = (FragmentDefinition)requestFragmentDefinitionViews.get("fake-fragment-definition-1");
+        assertNotNull(requestFragmentDefinitionView1);
+        assertEquals("definition1.fpsml", requestFragmentDefinitionView1.getName());
+        assertEquals("/_user/user/definition1.fpsml", extractFileSystemPathFromId(requestFragmentDefinitionView1.getId()));        
+        Folder requestFolderView = requestContext.getFolder();
+        assertNotNull(requestFolderView);
+        assertEquals("/", requestFolderView.getName());
+        assertEquals("/_user/user", extractFileSystemPathFromId(requestFolderView.getId()));
+        NodeSet requestSiblingPageViews = requestContext.getSiblingPages();
+        assertNotNull(requestSiblingPageViews);
+        assertEquals(3, requestSiblingPageViews.size());
+        assertNotNull(requestSiblingPageViews.get("page0.psml"));
+        assertEquals("/page0.psml", extractFileSystemPathFromId(requestSiblingPageViews.get("page0.psml").getId()));
+        assertNotNull(requestSiblingPageViews.get("page1.psml"));
+        assertEquals("/page1.psml", extractFileSystemPathFromId(requestSiblingPageViews.get("page1.psml").getId()));
+        assertNotNull(requestSiblingPageViews.get("page2.psml"));
+        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestSiblingPageViews.get("page2.psml").getId()));
+        Folder requestParentFolderView = requestContext.getParentFolder();
+        assertNull(requestParentFolderView);
+        NodeSet requestSiblingFolderViews = requestContext.getSiblingFolders();
+        assertNotNull(requestSiblingFolderViews);
+        assertEquals(3, requestSiblingFolderViews.size());
+        assertNotNull(requestSiblingFolderViews.get("folder0"));
+        assertEquals("/folder0", extractFileSystemPathFromId(requestSiblingFolderViews.get("folder0").getId()));
+        assertNotNull(requestSiblingFolderViews.get("folder1"));
+        assertEquals("/_user/user/folder1", extractFileSystemPathFromId(requestSiblingFolderViews.get("folder1").getId()));
+        assertNotNull(requestSiblingFolderViews.get("folder2"));
+        assertEquals("/folder2", extractFileSystemPathFromId(requestSiblingFolderViews.get("folder2").getId()));
+        Folder requestRootFolderView = requestContext.getRootFolder();
+        assertNotNull(requestRootFolderView);
+        assertEquals("/", requestRootFolderView.getName());
+        assertEquals("/_user/user", extractFileSystemPathFromId(requestRootFolderView.getId()));
+        NodeSet requestRootLinkViews = requestContext.getRootLinks();
+        assertNotNull(requestRootLinkViews);
+        assertEquals(2, requestRootLinkViews.size());
+        assertNotNull(requestRootLinkViews.get("link0.link"));
+        assertEquals("/_group/group/link0.link", extractFileSystemPathFromId(requestRootLinkViews.get("link0.link").getId()));
+        assertNotNull(requestRootLinkViews.get("link1.link"));
+        assertEquals("/link1.link", extractFileSystemPathFromId(requestRootLinkViews.get("link1.link").getId()));
+
+        // physical site setup
+        sessionContext = portalSite.newSessionContext();
+        assertNotNull(sessionContext);
+        requestContext = sessionContext.newRequestContext("/", null);
+        assertNotNull(requestContext);
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page0.psml", requestPageView.getName());
+        assertEquals("/page0.psml", extractFileSystemPathFromId(requestPageView.getId()));
+        requestPageTemplateView = requestContext.getPageTemplate();
+        assertNotNull(requestPageTemplateView);
+        assertEquals("template.tpsml", requestPageTemplateView.getName());
+        assertEquals("/template.tpsml", extractFileSystemPathFromId(requestPageTemplateView.getId()));
+        requestFragmentDefinitionViews = requestContext.getFragmentDefinitions();
+        assertNotNull(requestFragmentDefinitionViews);
+        assertEquals(1, requestFragmentDefinitionViews.size());
+        requestFragmentDefinitionView0 = (FragmentDefinition)requestFragmentDefinitionViews.get("fake-fragment-definition-0");
+        assertNotNull(requestFragmentDefinitionView0);
+        assertEquals("definition0.fpsml", requestFragmentDefinitionView0.getName());
+        assertEquals("/definition0.fpsml", extractFileSystemPathFromId(requestFragmentDefinitionView0.getId()));
+        requestFolderView = requestContext.getFolder();
+        assertNotNull(requestFolderView);
+        assertEquals("/", requestFolderView.getName());
+        assertEquals("/", extractFileSystemPathFromId(requestFolderView.getId()));
+        requestSiblingPageViews = requestContext.getSiblingPages();
+        assertNotNull(requestSiblingPageViews);
+        assertEquals(3, requestSiblingPageViews.size());
+        assertNotNull(requestSiblingPageViews.get("page0.psml"));
+        assertEquals("/page0.psml", extractFileSystemPathFromId(requestSiblingPageViews.get("page0.psml").getId()));
+        assertNotNull(requestSiblingPageViews.get("page1.psml"));
+        assertEquals("/page1.psml", extractFileSystemPathFromId(requestSiblingPageViews.get("page1.psml").getId()));
+        assertNotNull(requestSiblingPageViews.get("page2.psml"));
+        assertEquals("/page2.psml", extractFileSystemPathFromId(requestSiblingPageViews.get("page2.psml").getId()));
+        requestParentFolderView = requestContext.getParentFolder();
+        assertNull(requestParentFolderView);
+        requestSiblingFolderViews = requestContext.getSiblingFolders();
+        assertNotNull(requestSiblingFolderViews);
+        assertEquals(8, requestSiblingFolderViews.size());
+        assertNotNull(requestSiblingFolderViews.get("__subsite-root"));
+        assertEquals("/__subsite-root", extractFileSystemPathFromId(requestSiblingFolderViews.get("__subsite-root").getId()));
+        assertNotNull(requestSiblingFolderViews.get("_group"));
+        assertEquals("/_group", extractFileSystemPathFromId(requestSiblingFolderViews.get("_group").getId()));
+        assertNotNull(requestSiblingFolderViews.get("_hostname"));
+        assertEquals("/_hostname", extractFileSystemPathFromId(requestSiblingFolderViews.get("_hostname").getId()));
+        assertNotNull(requestSiblingFolderViews.get("_role"));
+        assertEquals("/_role", extractFileSystemPathFromId(requestSiblingFolderViews.get("_role").getId()));
+        assertNotNull(requestSiblingFolderViews.get("_user"));
+        assertEquals("/_user", extractFileSystemPathFromId(requestSiblingFolderViews.get("_user").getId()));
+        assertNotNull(requestSiblingFolderViews.get("folder0"));
+        assertEquals("/folder0", extractFileSystemPathFromId(requestSiblingFolderViews.get("folder0").getId()));
+        assertNotNull(requestSiblingFolderViews.get("folder1"));
+        assertEquals("/folder1", extractFileSystemPathFromId(requestSiblingFolderViews.get("folder1").getId()));
+        assertNotNull(requestSiblingFolderViews.get("folder2"));
+        assertEquals("/folder2", extractFileSystemPathFromId(requestSiblingFolderViews.get("folder2").getId()));
+        requestRootFolderView = requestContext.getRootFolder();
+        assertNotNull(requestRootFolderView);
+        assertEquals("/", requestRootFolderView.getName());
+        assertEquals("/", extractFileSystemPathFromId(requestRootFolderView.getId()));
+        requestRootLinkViews = requestContext.getRootLinks();
+        assertNotNull(requestRootLinkViews);
+        assertEquals(2, requestRootLinkViews.size());
+        assertNotNull(requestRootLinkViews.get("link0.link"));
+        assertEquals("/link0.link", extractFileSystemPathFromId(requestRootLinkViews.get("link0.link").getId()));
+        assertNotNull(requestRootLinkViews.get("link1.link"));
+        assertEquals("/link1.link", extractFileSystemPathFromId(requestRootLinkViews.get("link1.link").getId()));
     }
 
     /**
@@ -580,6 +729,8 @@
     public void testPotalSiteRequests() throws Exception
     {
         assertNotNull(portalSite);
+
+        // search path site requests
         PortalSiteSessionContext sessionContext = portalSite.newSessionContext();
         assertNotNull(sessionContext);
         JetspeedProfileLocator locator = new JetspeedProfileLocator();
@@ -590,11 +741,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        BaseConcretePageElement requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof Page);
-        assertEquals("page2.psml", requestPageProxy.getName());
-        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        BaseConcretePageElement requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page2.psml", requestPageView.getName());
+        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageView.getId()));
 
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
@@ -604,11 +755,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof Page);
-        assertEquals("page2.psml", requestPageProxy.getName());
-        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page2.psml", requestPageView.getName());
+        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageView.getId()));
 
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
@@ -618,11 +769,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof Page);
-        assertEquals("page1.psml", requestPageProxy.getName());
-        assertEquals("/page1.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page1.psml", requestPageView.getName());
+        assertEquals("/page1.psml", extractFileSystemPathFromId(requestPageView.getId()));
 
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
@@ -632,11 +783,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof Page);
-        assertEquals("page0.psml", requestPageProxy.getName());
-        assertEquals("/_user/user/folder1/page0.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page0.psml", requestPageView.getName());
+        assertEquals("/_user/user/folder1/page0.psml", extractFileSystemPathFromId(requestPageView.getId()));
 
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
@@ -646,11 +797,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof Page);
-        assertEquals("page0.psml", requestPageProxy.getName());
-        assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page0.psml", requestPageView.getName());
+        assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(requestPageView.getId()));
 
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
@@ -659,11 +810,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof Page);
-        assertEquals("page1.psml", requestPageProxy.getName());
-        assertEquals("/folder3/default-folder1/page1.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page1.psml", requestPageView.getName());
+        assertEquals("/folder3/default-folder1/page1.psml", extractFileSystemPathFromId(requestPageView.getId()));
 
         sessionContext = portalSite.newSessionContext();
         assertNotNull(sessionContext);
@@ -674,11 +825,32 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, true, true, true);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof Page);
-        assertEquals("page2.psml", requestPageProxy.getName());
-        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page2.psml", requestPageView.getName());
+        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageView.getId()));
+
+        // physical site requests
+        sessionContext = portalSite.newSessionContext();
+        assertNotNull(sessionContext);
+        requestContext = sessionContext.newRequestContext("/", null);
+        assertNotNull(requestContext);
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page0.psml", requestPageView.getName());
+        assertEquals("/page0.psml", extractFileSystemPathFromId(requestPageView.getId()));
+
+        sessionContext = portalSite.newSessionContext();
+        assertNotNull(sessionContext);
+        requestContext = sessionContext.newRequestContext("/_user/user/page2.psml", null);
+        assertNotNull(requestContext);
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page2.psml", requestPageView.getName());
+        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageView.getId()));
     }
 
     /**
@@ -1329,6 +1501,197 @@
                 fail("Unexpected menu element type/title: "+element.getElementType()+"/"+element.getTitle());
             }            
         }
+
+        // physical site menus
+        sessionContext = portalSite.newSessionContext();
+        assertNotNull(sessionContext);
+        requestContext = sessionContext.newRequestContext("/", null);
+        assertNotNull(requestContext);
+        customMenuNames = requestContext.getCustomMenuNames();
+        assertNotNull(customMenuNames);
+        assertEquals(4, customMenuNames.size());
+        assertTrue(customMenuNames.contains("bread-crumbs"));
+        assertTrue(customMenuNames.contains("template-test"));
+        assertTrue(customMenuNames.contains("current-page-test"));
+        assertTrue(customMenuNames.contains("current-path-test"));
+        breadCrumbsMenu = requestContext.getMenu("bread-crumbs");
+        assertNotNull(breadCrumbsMenu);
+        assertEquals("bread-crumbs", breadCrumbsMenu.getName());
+        assertEquals("/", breadCrumbsMenu.getUrl());
+        assertFalse(breadCrumbsMenu.isEmpty());
+        breadCrumbsElements = breadCrumbsMenu.getElements();
+        assertNotNull(breadCrumbsElements);
+        assertEquals(1, breadCrumbsElements.size());
+        assertTrue(breadCrumbsElements.get(0) instanceof MenuOption);
+        assertEquals("/", ((MenuOption)breadCrumbsElements.get(0)).getUrl());
+        assertEquals(MenuOption.FOLDER_OPTION_TYPE, ((MenuOption)breadCrumbsElements.get(0)).getType());
+        assertTrue(((MenuImpl)breadCrumbsMenu).isElementRelative());
+        templateTestMenu = requestContext.getMenu("template-test");
+        assertNotNull(templateTestMenu);
+        assertEquals("template-test", templateTestMenu.getName());
+        assertFalse(templateTestMenu.isEmpty());
+        templateTestElements = templateTestMenu.getElements();
+        assertNotNull(templateTestElements);
+        assertEquals(1, templateTestElements.size());
+        assertTrue(templateTestElements.get(0) instanceof MenuOption);
+        assertEquals("/page2.psml", ((MenuOption)templateTestElements.get(0)).getUrl());
+        currentPageTestMenu = requestContext.getMenu("current-page-test");
+        assertEquals("current-page-test", currentPageTestMenu.getName());
+        assertFalse(currentPageTestMenu.isEmpty());
+        currentPageTestElements = currentPageTestMenu.getElements();
+        assertNotNull(currentPageTestElements);
+        assertEquals(1, currentPageTestElements.size());
+        assertTrue(currentPageTestElements.get(0) instanceof MenuOption);
+        assertEquals("/page0.psml", ((MenuOption)currentPageTestElements.get(0)).getUrl());
+        assertTrue(currentPageTestMenu.isSelected(requestContext));
+        assertTrue(((MenuOption)currentPageTestElements.get(0)).isSelected(requestContext));
+        currentPathTestMenu = requestContext.getMenu("current-path-test");
+        assertEquals("current-path-test", currentPathTestMenu.getName());
+        assertTrue(currentPathTestMenu.isEmpty());
+        currentPathTestElements = currentPathTestMenu.getElements();
+        assertNull(currentPathTestElements);
+        navigationsMenu = requestContext.getMenu("navigations");
+        assertNotNull(navigationsMenu);
+        assertFalse(navigationsMenu.isEmpty());
+        navigationsElements = navigationsMenu.getElements();
+        assertNotNull(navigationsElements);
+        assertEquals(11, navigationsElements.size());
+        menuElementsIter = navigationsElements.iterator();
+        while (menuElementsIter.hasNext())
+        {
+            MenuElement element = (MenuElement)menuElementsIter.next();
+            if (element.getElementType().equals(MenuElement.SEPARATOR_ELEMENT_TYPE) &&
+                (element instanceof MenuSeparator) &&
+                ((MenuSeparator)element).getText().equals("Folders"))
+            {
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("subsite root"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals(MenuOption.FOLDER_OPTION_TYPE, ((MenuOption)element).getType());
+                assertTrue(element.getNode() instanceof Folder);
+                assertEquals("/__subsite-root", element.getNode().getPath());
+                assertTrue(element.getManagedNode() instanceof Folder);
+                assertEquals("/__subsite-root", element.getManagedNode().getPath());
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("Group"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals(MenuOption.FOLDER_OPTION_TYPE, ((MenuOption)element).getType());
+                assertTrue(element.getNode() instanceof Folder);
+                assertEquals("/_group", element.getNode().getPath());
+                assertTrue(element.getManagedNode() instanceof Folder);
+                assertEquals("/_group", element.getManagedNode().getPath());
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("Hostname"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals(MenuOption.FOLDER_OPTION_TYPE, ((MenuOption)element).getType());
+                assertTrue(element.getNode() instanceof Folder);
+                assertEquals("/_hostname", element.getNode().getPath());
+                assertTrue(element.getManagedNode() instanceof Folder);
+                assertEquals("/_hostname", element.getManagedNode().getPath());
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("Role"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals(MenuOption.FOLDER_OPTION_TYPE, ((MenuOption)element).getType());
+                assertTrue(element.getNode() instanceof Folder);
+                assertEquals("/_role", element.getNode().getPath());
+                assertTrue(element.getManagedNode() instanceof Folder);
+                assertEquals("/_role", element.getManagedNode().getPath());
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("User"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals(MenuOption.FOLDER_OPTION_TYPE, ((MenuOption)element).getType());
+                assertTrue(element.getNode() instanceof Folder);
+                assertEquals("/_user", element.getNode().getPath());
+                assertTrue(element.getManagedNode() instanceof Folder);
+                assertEquals("/_user", element.getManagedNode().getPath());
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("folder0"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals(MenuOption.FOLDER_OPTION_TYPE, ((MenuOption)element).getType());
+                assertTrue(element.getNode() instanceof Folder);
+                assertEquals("/folder0", element.getNode().getPath());
+                assertTrue(element.getManagedNode() instanceof Folder);
+                assertEquals("/folder0", element.getManagedNode().getPath());
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("folder1"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals(MenuOption.FOLDER_OPTION_TYPE, ((MenuOption)element).getType());
+                assertTrue(element.getNode() instanceof Folder);
+                assertEquals("/folder1", element.getNode().getPath());
+                assertTrue(element.getManagedNode() instanceof Folder);
+                assertEquals("/folder1", element.getManagedNode().getPath());
+            }
+            else if (element.getElementType().equals(MenuElement.SEPARATOR_ELEMENT_TYPE) &&
+                     (element instanceof MenuSeparator) &&
+                     ((MenuSeparator)element).getText().equals("Additional Links"))
+            {
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("/link1.link"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals(MenuOption.LINK_OPTION_TYPE, ((MenuOption)element).getType());
+                assertTrue(element.getNode() instanceof Link);
+                assertEquals("/link1.link", element.getNode().getPath());
+                assertTrue(element.getManagedNode() instanceof Link);
+                assertEquals("/link1.link", element.getManagedNode().getPath());
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("/link0.link"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals(MenuOption.LINK_OPTION_TYPE, ((MenuOption)element).getType());
+                assertTrue(element.getNode() instanceof Link);
+                assertEquals("/link0.link", element.getNode().getPath());
+                assertTrue(element.getManagedNode() instanceof Link);
+                assertEquals("/link0.link", element.getManagedNode().getPath());
+            }
+            else
+            {
+                fail("Unexpected menu element type/title: "+element.getElementType()+"/"+element.getTitle());
+            }
+        }
+        assertEquals("left-navigations", navigationsMenu.getSkin());
+        assertTrue(((MenuImpl)navigationsMenu).isElementRelative());
+        pagesMenu = requestContext.getMenu("pages");
+        assertNotNull(pagesMenu);
+        assertFalse(pagesMenu.isEmpty());
+        pagesElements = pagesMenu.getElements();
+        assertNotNull(pagesElements);
+        assertEquals(3, pagesElements.size());
+        menuElementsIter = pagesElements.iterator();
+        while (menuElementsIter.hasNext())
+        {
+            MenuElement element = (MenuElement)menuElementsIter.next();
+            if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("/page2.psml"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals("/page2.psml", ((MenuOption)element).getUrl());
+                assertEquals(MenuOption.PAGE_OPTION_TYPE, ((MenuOption)element).getType());
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("/page1.psml"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals("/page1.psml", ((MenuOption)element).getUrl());
+            }
+            else if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("/page0.psml"))
+            {
+                assertTrue(element instanceof MenuOption);
+                assertEquals("/page0.psml", ((MenuOption)element).getUrl());
+                assertEquals("tabs", element.getSkin());
+            }
+            else
+            {
+                fail("Unexpected menu element type/title: "+element.getElementType()+"/"+element.getTitle());
+            }
+        }
+        assertEquals("tabs", pagesMenu.getSkin());
+        assertTrue(((MenuImpl)pagesMenu).isElementRelative());
     }
 
     /**
@@ -1464,6 +1827,50 @@
             }
         }
         assertFalse(hiddenElement);
+
+        // physical site menus
+        sessionContext = portalSite.newSessionContext();
+        assertNotNull(sessionContext);
+
+        // first request at /: hidden page suppressed
+        requestContext = sessionContext.newRequestContext("/", null);
+        assertNotNull(requestContext);
+        pagesMenu = requestContext.getMenu("pages");
+        assertNotNull(pagesMenu);
+        assertFalse(pagesMenu.isEmpty());
+        pagesElements = pagesMenu.getElements();
+        assertNotNull(pagesElements);
+        menuElementsIter = pagesElements.iterator();
+        hiddenElement = false;
+        while (menuElementsIter.hasNext())
+        {
+            MenuElement element = (MenuElement)menuElementsIter.next();
+            if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("/hidden.psml"))
+            {
+                hiddenElement = true;
+            }
+        }
+        assertFalse(hiddenElement);
+    
+        // second request at /hidden.psml: hidden page visible
+        requestContext = sessionContext.newRequestContext("/hidden.psml", null);
+        assertNotNull(requestContext);
+        pagesMenu = requestContext.getMenu("pages");
+        assertNotNull(pagesMenu);
+        assertFalse(pagesMenu.isEmpty());
+        pagesElements = pagesMenu.getElements();
+        assertNotNull(pagesElements);
+        menuElementsIter = pagesElements.iterator();
+        hiddenElement = false;
+        while (menuElementsIter.hasNext())
+        {
+            MenuElement element = (MenuElement)menuElementsIter.next();
+            if (element.getElementType().equals(MenuElement.OPTION_ELEMENT_TYPE) && element.getTitle().equals("/hidden.psml"))
+            {
+                hiddenElement = true;
+            }
+        }
+        assertTrue(hiddenElement);
     }
 
     /**
@@ -1475,6 +1882,8 @@
     public void testPotalSiteContentRequests() throws Exception
     {
         assertNotNull(portalSite);
+
+        // search path site view
         PortalSiteSessionContext sessionContext = portalSite.newSessionContext();
         assertNotNull(sessionContext);
         JetspeedProfileLocator locator = new JetspeedProfileLocator();
@@ -1484,11 +1893,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        BaseConcretePageElement requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof DynamicPage);
-        assertEquals("docpage.dpsml", requestPageProxy.getName());
-        assertEquals("/docpage.dpsml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        BaseConcretePageElement requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof DynamicPage);
+        assertEquals("docpage.dpsml", requestPageView.getName());
+        assertEquals("/docpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
         assertNotNull(requestContext.getPageContentPath());
         assertEquals("/document", requestContext.getPageContentPath());
 
@@ -1499,11 +1908,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof DynamicPage);
-        assertEquals("docpage.dpsml", requestPageProxy.getName());
-        assertEquals("/contentfolder/docpage.dpsml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof DynamicPage);
+        assertEquals("docpage.dpsml", requestPageView.getName());
+        assertEquals("/contentfolder/docpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
         assertNotNull(requestContext.getPageContentPath());
         assertEquals("/contentfolder/document", requestContext.getPageContentPath());
 
@@ -1514,11 +1923,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof DynamicPage);
-        assertEquals("contentpage.dpsml", requestPageProxy.getName());
-        assertEquals("/contentpage.dpsml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof DynamicPage);
+        assertEquals("contentpage.dpsml", requestPageView.getName());
+        assertEquals("/contentpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
         assertNotNull(requestContext.getPageContentPath());
         assertEquals("/contentfolder/document", requestContext.getPageContentPath());
 
@@ -1529,11 +1938,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof DynamicPage);
-        assertEquals("docpage.dpsml", requestPageProxy.getName());
-        assertEquals("/docpage.dpsml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof DynamicPage);
+        assertEquals("docpage.dpsml", requestPageView.getName());
+        assertEquals("/docpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
         assertNotNull(requestContext.getPageContentPath());
         assertEquals("/preview/document", requestContext.getPageContentPath());
 
@@ -1544,11 +1953,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof DynamicPage);
-        assertEquals("docpage.dpsml", requestPageProxy.getName());
-        assertEquals("/contentfolder/pub/docpage.dpsml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof DynamicPage);
+        assertEquals("docpage.dpsml", requestPageView.getName());
+        assertEquals("/contentfolder/pub/docpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
         assertNotNull(requestContext.getPageContentPath());
         assertEquals("/preview/contentfolder/draft/document", requestContext.getPageContentPath());
 
@@ -1559,11 +1968,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof DynamicPage);
-        assertEquals("contentpage.dpsml", requestPageProxy.getName());
-        assertEquals("/contentpage.dpsml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof DynamicPage);
+        assertEquals("contentpage.dpsml", requestPageView.getName());
+        assertEquals("/contentpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
         assertNotNull(requestContext.getPageContentPath());
         assertEquals("/document", requestContext.getPageContentPath());
 
@@ -1574,11 +1983,11 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof Page);
-        assertEquals("page0.psml", requestPageProxy.getName());
-        assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page0.psml", requestPageView.getName());
+        assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(requestPageView.getId()));
         assertNotNull(requestContext.getPageContentPath());
         assertEquals("/preview/folder0/page0", requestContext.getPageContentPath());
 
@@ -1589,13 +1998,46 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        requestPageProxy = requestContext.getPage();
-        assertNotNull(requestPageProxy);
-        assertTrue(requestPageProxy instanceof Page);
-        assertEquals("page2.psml", requestPageProxy.getName());
-        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof Page);
+        assertEquals("page2.psml", requestPageView.getName());
+        assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageView.getId()));
         assertNotNull(requestContext.getPageContentPath());
         assertEquals("/page2", requestContext.getPageContentPath());
+
+        // physical site view
+        sessionContext = portalSite.newSessionContext();
+        assertNotNull(sessionContext);
+        requestContext = sessionContext.newRequestContext("/document.doc", null);
+        assertNotNull(requestContext);
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof DynamicPage);
+        assertEquals("docpage.dpsml", requestPageView.getName());
+        assertEquals("/docpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
+        assertNotNull(requestContext.getPageContentPath());
+        assertEquals("/document", requestContext.getPageContentPath());
+
+        requestContext = sessionContext.newRequestContext("/preview/contentfolder/draft/document.doc", "test.domain.com");
+        assertNotNull(requestContext);
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof DynamicPage);
+        assertEquals("docpage.dpsml", requestPageView.getName());
+        assertEquals("/contentfolder/pub/docpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
+        assertNotNull(requestContext.getPageContentPath());
+        assertEquals("/preview/contentfolder/draft/document", requestContext.getPageContentPath());
+
+        requestContext = sessionContext.newRequestContext("/document.psml", null);
+        assertNotNull(requestContext);
+        requestPageView = requestContext.getPage();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof DynamicPage);
+        assertEquals("contentpage.dpsml", requestPageView.getName());
+        assertEquals("/contentpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
+        assertNotNull(requestContext.getPageContentPath());
+        assertEquals("/document", requestContext.getPageContentPath());
     }
 
     /**
@@ -1614,13 +2056,20 @@
     }
 
     /**
-     * extractLocatorNameFromProxy - utility to access profile locator name from proxy
+     * extractLocatorNameFromView - utility to access profile locator name from view
      *
-     * @param proxy site view node proxy
+     * @param proxy site view node view
      * @return locator name
      */
-    private String extractLocatorNameFromProxy(Object proxy) throws Exception
+    private String extractLocatorNameFromView(Object view) throws Exception
     {
-        return ((NodeProxy)Proxy.getInvocationHandler(proxy)).getLocatorName();
+        try
+        {
+            return ((NodeProxy)Proxy.getInvocationHandler(view)).getLocatorName();
+        }
+        catch (IllegalArgumentException iae)
+        {
+            return null;
+        }
     }
 }

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/folder.metadata
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/folder.metadata?rev=920191&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/folder.metadata (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/folder.metadata Mon Mar  8 03:54:17 2010
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<folder hidden="true"
+    xmlns="http://portals.apache.org/jetspeed"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/folder-metadata.xsd">
+
+  <title>content</title>  
+  <short-title>content</short-title>  
+
+</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