locators.put(ProfileLocator.PAGE_LOCATOR, locator);
PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, "user");
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
BaseConcretePageElement requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
assertNotNull(requestPageView);
assertTrue(requestPageView instanceof DynamicPage);
assertEquals("docpage.dpsml", requestPageView.getName());
assertEquals("/docpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
assertNotNull(requestContext.getPageContentPath());
assertEquals("/document", requestContext.getPageContentPath());
locator = new JetspeedProfileLocator();
locator.init(null, "/contentfolder/document.doc");
locator.add("user", true, false, "user");
locators = new HashMap();
locators.put(ProfileLocator.PAGE_LOCATOR, locator);
requestContext = sessionContext.newRequestContext(locators, "user");
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
assertNotNull(requestPageView);
assertTrue(requestPageView instanceof DynamicPage);
assertEquals("matchdocpage.dpsml", requestPageView.getName());
assertEquals("/contentfolder/matchdocpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
assertNotNull(requestContext.getPageContentPath());
assertEquals("/contentfolder/document", requestContext.getPageContentPath());
locator = new JetspeedProfileLocator();
locator.init(null, "/contentfolder/folder/document.doc");
locator.add("user", true, false, "user");
locators = new HashMap();
locators.put(ProfileLocator.PAGE_LOCATOR, locator);
requestContext = sessionContext.newRequestContext(locators, "user");
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
assertNotNull(requestPageView);
assertTrue(requestPageView instanceof DynamicPage);
assertEquals("docpage.dpsml", requestPageView.getName());
assertEquals("/contentfolder/docpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
assertNotNull(requestContext.getPageContentPath());
assertEquals("/contentfolder/folder/document", requestContext.getPageContentPath());
locator = new JetspeedProfileLocator();
locator.init(null, "/contentfolder/document.txt");
locator.add("user", true, false, "user");
locators = new HashMap();
locators.put(ProfileLocator.PAGE_LOCATOR, locator);
requestContext = sessionContext.newRequestContext(locators, "user");
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
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());
locator = new JetspeedProfileLocator();
locator.init(null, "/preview/document.doc");
locator.add("user", true, false, "user");
locators = new HashMap();
locators.put(ProfileLocator.PAGE_LOCATOR, locator);
requestContext = sessionContext.newRequestContext(locators, "user");
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
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());
locator = new JetspeedProfileLocator();
locator.init(null, "/preview/contentfolder/draft/document.doc", "test.domain.com");
locator.add("user", true, false, "user");
locators = new HashMap();
locators.put(ProfileLocator.PAGE_LOCATOR, locator);
requestContext = sessionContext.newRequestContext(locators, "user");
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
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());
locator = new JetspeedProfileLocator();
locator.init(null, "/document.psml");
locator.add("user", true, false, "user");
locators = new HashMap();
locators.put(ProfileLocator.PAGE_LOCATOR, locator);
requestContext = sessionContext.newRequestContext(locators, "user");
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
assertNotNull(requestPageView);
assertTrue(requestPageView instanceof DynamicPage);
assertEquals("contentpage.dpsml", requestPageView.getName());
assertEquals("/contentpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
assertNotNull(requestContext.getPageContentPath());
assertEquals("/document", requestContext.getPageContentPath());
locator = new JetspeedProfileLocator();
locator.init(null, "/preview/folder0/page0.doc");
locator.add("user", true, false, "user");
locators = new HashMap();
locators.put(ProfileLocator.PAGE_LOCATOR, locator);
requestContext = sessionContext.newRequestContext(locators, "user");
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
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());
locator = new JetspeedProfileLocator();
locator.init(null, "/page2.doc");
locator.add("user", true, false, "user");
locators = new HashMap();
locators.put(ProfileLocator.PAGE_LOCATOR, locator);
requestContext = sessionContext.newRequestContext(locators, "user");
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
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, null);
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
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", null);
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
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, null);
assertNotNull(requestContext);
assertTrue(requestContext.isConcretePage());
assertTrue(requestContext.isContentPage());
requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
assertNotNull(requestPageView);
assertTrue(requestPageView instanceof DynamicPage);
assertEquals("contentpage.dpsml", requestPageView.getName());
assertEquals("/contentpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
assertNotNull(requestContext.getPageContentPath());
assertEquals("/document", requestContext.getPageContentPath());
}