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()));
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()));
// 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);
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(4,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));
// test aggregating SiteView
SiteView aggregateView = new SiteView(pageManager, "/_user/user,/_role/role0,/_group/group,/");
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(4, rootFolderProxy.getFolders().size());
assertEquals(4, rootFolderProxy.getPages().size());
assertEquals(2, rootFolderProxy.getLinks().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(2 + aggregateView.getStandardMenuNames().size(), rootPage0ProxyMenus.size());
Iterator menusIter = rootPage0ProxyMenus.iterator();
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());
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(2 + 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());
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());