portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r929033 [5/5] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-page-layout/ components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/layout/impl/ components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/i...
Date Tue, 30 Mar 2010 08:14:55 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/AbstractSiteView.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/AbstractSiteView.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/AbstractSiteView.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/AbstractSiteView.java Tue Mar 30 08:14:54 2010
@@ -166,13 +166,14 @@ public abstract class AbstractSiteView
      * @param path single node path
      * @param currentNode current folder or page for relative paths or null
      * @param menuPath menu definition path or null
+     * @param onlyConcrete node required to be concrete folder, page, or link
      * @param onlyViewable node required to be viewable
      * @param onlyVisible node required to be visible, (or current)
      * @return folder, page, or link node view
      * @throws NodeNotFoundException if not found
      * @throws SecurityException if view access not granted
      */
-    public Node getNodeView(String path, Node currentNode, String menuPath, boolean onlyViewable, boolean onlyVisible) throws NodeNotFoundException
+    public Node getNodeView(String path, Node currentNode, String menuPath, boolean onlyConcrete, boolean onlyViewable, boolean onlyVisible) throws NodeNotFoundException
     {
         // determine current folder and page
         String currentPath = path;
@@ -285,7 +286,7 @@ public abstract class AbstractSiteView
                     if (children != null)
                     {
                         Node node = children.get(currentPath);
-                        if (((node instanceof Folder) || (node instanceof Page) || (node instanceof Link)) &&
+                        if ((node != null) && (!onlyConcrete || isConcreteNode(node)) &&
                             (!onlyVisible || isVisible(node, currentPage)) &&
                             (!onlyViewable || isViewable(node, onlyVisible)))
                         {
@@ -335,11 +336,12 @@ public abstract class AbstractSiteView
      * @param regexpPath regular expression node path
      * @param currentNode current folder or page for relative paths or null
      * @param menuPath menu definition path or null
+     * @param onlyConcrete node required to be concrete folder, page, or link
      * @param onlyViewable nodes required to be viewable flag
      * @param onlyVisible node required to be visible, (or current)
      * @return list of folder, page, or link node views
      */
-    public List getNodeViews(String regexpPath, Node currentNode, String menuPath, boolean onlyViewable, boolean onlyVisible)
+    public List getNodeViews(String regexpPath, Node currentNode, String menuPath, boolean onlyConcrete, boolean onlyViewable, boolean onlyVisible)
     {
         // determine current folder and page
         String currentRegexpPath = regexpPath;
@@ -466,7 +468,7 @@ public abstract class AbstractSiteView
                                         while (subfoldersIter.hasNext())
                                         {
                                             currentFolder = (Folder)subfoldersIter.next();
-                                            List subfolderViews = getNodeViews(currentRegexpPath, currentFolder, menuPath, onlyViewable, onlyVisible);
+                                            List subfolderViews = getNodeViews(currentRegexpPath, currentFolder, menuPath, onlyConcrete, onlyViewable, onlyVisible);
                                             if ((subfolderViews != null) && !subfolderViews.isEmpty())
                                             {
                                                 if (views == null)
@@ -548,7 +550,7 @@ public abstract class AbstractSiteView
                                 while (childrenIter.hasNext())
                                 {
                                     Node child = (Node)childrenIter.next(); 
-                                    if (((child instanceof Folder) || (child instanceof Page) || (child instanceof Link)) &&
+                                    if ((!onlyConcrete || isConcreteNode(child)) &&
                                         (!onlyVisible || isVisible(child, currentPage)) &&
                                         (!onlyViewable || isViewable(child, onlyVisible)))
                                     {
@@ -568,7 +570,7 @@ public abstract class AbstractSiteView
                             // node view; return null if not found or not
                             // viewable and visibility is required
                             Node child = children.get(currentRegexpPath);
-                            if (((child instanceof Folder) || (child instanceof Page) || (child instanceof Link)) &&
+                            if ((child != null) && (!onlyConcrete || isConcreteNode(child)) &&
                                 (!onlyVisible || isVisible(child, currentPage)) &&
                                 (!onlyViewable || isViewable(child, onlyVisible)))
                             {
@@ -784,6 +786,18 @@ public abstract class AbstractSiteView
     }
 
     /**
+     * isConcreteNode - tests for concrete view node type
+     *
+     * @param node test node view
+     * @return view node type flag
+     */
+    private static boolean isConcreteNode(Node node)
+    {
+        // concrete nodes include folder, pages, and links
+        return ((node instanceof Folder) || (node instanceof Page) || (node instanceof Link));
+    }
+
+    /**
      * isVisible - tests for node visibility in view
      *
      * @param node test node view

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=929033&r1=929032&r2=929033&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 Tue Mar 30 08:14:54 2010
@@ -30,6 +30,7 @@ import junit.framework.TestSuite;
 import org.apache.jetspeed.components.test.AbstractSpringTestCase;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.MenuDefinition;
+import org.apache.jetspeed.om.page.BaseFragmentsElement;
 import org.apache.jetspeed.om.page.DynamicPage;
 import org.apache.jetspeed.om.page.FragmentDefinition;
 import org.apache.jetspeed.om.page.Link;
@@ -217,21 +218,21 @@ public class TestPortalSite extends Abst
         assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(folder0Page0View.getId()));
 
         // test SiteView access by path
-        Folder rootFolderViewByPath = (Folder)baseView.getNodeView("/", null, null, false, false);
+        Folder rootFolderViewByPath = (Folder)baseView.getNodeView("/", null, null, true, false, false);
         assertNotNull(rootFolderViewByPath);
         assertEquals(rootFolderView, rootFolderViewByPath);
-        Folder rootFolder0ViewByPath = (Folder)baseView.getNodeView("/folder0/", null, null, false, false);
+        Folder rootFolder0ViewByPath = (Folder)baseView.getNodeView("/folder0/", null, null, true, false, false);
         assertNotNull(rootFolder0ViewByPath);
         assertEquals(rootFolder0View, rootFolder0ViewByPath);
-        Page folder0Page0ViewByPath = (Page)baseView.getNodeView("/folder0/page0.psml", null, null, false, false);
+        Page folder0Page0ViewByPath = (Page)baseView.getNodeView("/folder0/page0.psml", null, null, true, false, false);
         assertNotNull(folder0Page0ViewByPath);
         assertEquals(folder0Page0View, folder0Page0ViewByPath);
-        folder0Page0ViewByPath = (Page)baseView.getNodeView("page0.psml", rootFolder0View, null, false, false);
+        folder0Page0ViewByPath = (Page)baseView.getNodeView("page0.psml", rootFolder0View, null, true, false, false);
         assertNotNull(folder0Page0ViewByPath);
         assertEquals(folder0Page0View, folder0Page0ViewByPath);
         try
         {
-            baseView.getNodeView("/folderX/page0.psml", null, null, false, false);
+            baseView.getNodeView("/folderX/page0.psml", null, null, true, false, false);
             fail("/folderX/page0.psml should not be found");
         }
         catch (NodeNotFoundException nnfe)
@@ -239,21 +240,21 @@ public class TestPortalSite extends Abst
         }
         try
         {
-            baseView.getNodeView("/folder0/pageX.psml", null, null, false, false);
+            baseView.getNodeView("/folder0/pageX.psml", null, null, true, false, false);
             fail("/folder0/pageX.psml should not be found");
         }
         catch (NodeNotFoundException nnfe)
         {
         }
-        List rootPageViewsByPath = baseView.getNodeViews("/page?.psml", null, null, false, false);
+        List rootPageViewsByPath = baseView.getNodeViews("/page?.psml", null, null, true, false, false);
         assertNotNull(rootPageViewsByPath);
         assertEquals(3,rootPageViewsByPath.size());
         assertTrue(rootPageViewsByPath.contains(rootPage0View));
-        List rootFolderViewsByPath = baseView.getNodeViews("/*/", null, null, false, false);
+        List rootFolderViewsByPath = baseView.getNodeViews("/*/", null, null, true, false, false);
         assertNotNull(rootFolderViewsByPath);
         assertEquals(6,rootFolderViewsByPath.size());
         assertTrue(rootFolderViewsByPath.contains(rootFolder0View));
-        List folderPageViewsByPath = baseView.getNodeViews("*/p*[0-9].psml", rootFolderView, null, false, false);
+        List folderPageViewsByPath = baseView.getNodeViews("*/p*[0-9].psml", rootFolderView, null, true, false, false);
         assertNotNull(folderPageViewsByPath);
         assertEquals(2,folderPageViewsByPath.size());
         assertTrue(folderPageViewsByPath.contains(folder0Page0View));
@@ -632,7 +633,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        BaseConcretePageElement requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        BaseConcretePageElement requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page2.psml", requestPageView.getName());
@@ -697,7 +700,9 @@ public class TestPortalSite extends Abst
         assertNotNull(sessionContext);
         requestContext = sessionContext.newRequestContext("/", null, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page0.psml", requestPageView.getName());
@@ -784,7 +789,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        BaseConcretePageElement requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        BaseConcretePageElement requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page2.psml", requestPageView.getName());
@@ -798,7 +805,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page2.psml", requestPageView.getName());
@@ -812,7 +821,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page1.psml", requestPageView.getName());
@@ -826,7 +837,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page0.psml", requestPageView.getName());
@@ -840,7 +853,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page0.psml", requestPageView.getName());
@@ -853,7 +868,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, null);
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page1.psml", requestPageView.getName());
@@ -866,9 +883,11 @@ public class TestPortalSite extends Abst
         locator.add("user", true, false, "admin");
         locators = new HashMap();
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        requestContext = sessionContext.newRequestContext(locators, "admin", true, true, true);
+        requestContext = sessionContext.newRequestContext(locators, "admin", true, true, true, false);
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page2.psml", requestPageView.getName());
@@ -879,7 +898,9 @@ public class TestPortalSite extends Abst
         assertNotNull(sessionContext);
         requestContext = sessionContext.newRequestContext("/", null, null);
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page0.psml", requestPageView.getName());
@@ -889,7 +910,9 @@ public class TestPortalSite extends Abst
         assertNotNull(sessionContext);
         requestContext = sessionContext.newRequestContext("/_user/user/page2.psml", null, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page2.psml", requestPageView.getName());
@@ -2208,7 +2231,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        BaseConcretePageElement requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        BaseConcretePageElement requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof DynamicPage);
         assertEquals("docpage.dpsml", requestPageView.getName());
@@ -2223,7 +2248,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof DynamicPage);
         assertEquals("matchdocpage.dpsml", requestPageView.getName());
@@ -2238,7 +2265,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof DynamicPage);
         assertEquals("docpage.dpsml", requestPageView.getName());
@@ -2253,7 +2282,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof DynamicPage);
         assertEquals("contentpage.dpsml", requestPageView.getName());
@@ -2268,7 +2299,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof DynamicPage);
         assertEquals("docpage.dpsml", requestPageView.getName());
@@ -2283,7 +2316,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof DynamicPage);
         assertEquals("docpage.dpsml", requestPageView.getName());
@@ -2298,7 +2333,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof DynamicPage);
         assertEquals("contentpage.dpsml", requestPageView.getName());
@@ -2313,7 +2350,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page0.psml", requestPageView.getName());
@@ -2328,7 +2367,9 @@ public class TestPortalSite extends Abst
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof Page);
         assertEquals("page2.psml", requestPageView.getName());
@@ -2341,7 +2382,9 @@ public class TestPortalSite extends Abst
         assertNotNull(sessionContext);
         requestContext = sessionContext.newRequestContext("/document.doc", null, null);
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof DynamicPage);
         assertEquals("docpage.dpsml", requestPageView.getName());
@@ -2351,7 +2394,9 @@ public class TestPortalSite extends Abst
 
         requestContext = sessionContext.newRequestContext("/preview/contentfolder/draft/document.doc", "test.domain.com", null);
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof DynamicPage);
         assertEquals("docpage.dpsml", requestPageView.getName());
@@ -2361,7 +2406,9 @@ public class TestPortalSite extends Abst
 
         requestContext = sessionContext.newRequestContext("/document.psml", null, null);
         assertNotNull(requestContext);
-        requestPageView = requestContext.getPage();
+        assertTrue(requestContext.isConcretePage());
+        assertTrue(requestContext.isContentPage());
+        requestPageView = (BaseConcretePageElement)requestContext.getPageOrTemplate();
         assertNotNull(requestPageView);
         assertTrue(requestPageView instanceof DynamicPage);
         assertEquals("contentpage.dpsml", requestPageView.getName());
@@ -2371,6 +2418,35 @@ public class TestPortalSite extends Abst
     }
 
     /**
+     * testPortalSiteTemplateRequests - Test PortalSite template request mappings
+     *
+     * @throws Exception
+     */
+    public void testPotalSiteTemplateRequests() throws Exception
+    {
+        assertNotNull(portalSite);
+
+        // search path site view
+        PortalSiteSessionContext sessionContext = portalSite.newSessionContext();
+        assertNotNull(sessionContext);
+        JetspeedProfileLocator locator = new JetspeedProfileLocator();
+        locator.init(null, "/contentpage.dpsml");
+        locator.add("admin", true, false, "admin");
+        Map locators = new HashMap();
+        locators.put(ProfileLocator.PAGE_LOCATOR, locator);
+        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, "admin", true, true, true, true);
+        assertNotNull(requestContext);
+        assertFalse(requestContext.isConcretePage());
+        assertFalse(requestContext.isContentPage());
+        BaseFragmentsElement requestPageView = requestContext.getPageOrTemplate();
+        assertNotNull(requestPageView);
+        assertTrue(requestPageView instanceof DynamicPage);
+        assertEquals("contentpage.dpsml", requestPageView.getName());
+        assertEquals("/contentpage.dpsml", extractFileSystemPathFromId(requestPageView.getId()));
+        assertNull(requestContext.getPageContentPath());
+    }
+
+    /**
      * extractFileSystemPathFromId - utility to convert proxy ids to file system paths
      *
      * @param id proxy node id

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPageAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPageAction.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPageAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPageAction.java Tue Mar 30 08:14:54 2010
@@ -127,9 +127,9 @@ public class GetPageAction 
                 return success;
             }
             
-            String profiledPath = siteRequestContext.getPage().getPath();
+            String profiledPath = siteRequestContext.getPageOrTemplate().getPath();
             resultMap.put( PROFILED_PATH, profiledPath );
-            putSecurityInformation( resultMap, page.getPage() ); //TODO: REVIEW: RANDY 
+            putSecurityInformation( resultMap, page.getPageOrTemplate() ); //TODO: REVIEW: RANDY 
      
             PageActionAccess pageActionAccess = (PageActionAccess)requestContext.getAttribute( PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE );
             Boolean userIsAnonymous = Boolean.TRUE;

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java Tue Mar 30 08:14:54 2010
@@ -24,8 +24,8 @@ import org.apache.jetspeed.ajax.AjaxActi
 import org.apache.jetspeed.ajax.AjaxBuilder;
 import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
 import org.apache.jetspeed.om.folder.Folder;
-import org.apache.jetspeed.om.page.BaseConcretePageElement;
 import org.apache.jetspeed.om.page.BaseFragmentElement;
+import org.apache.jetspeed.om.page.BaseFragmentsElement;
 import org.apache.jetspeed.om.page.DynamicPage;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.Page;
@@ -94,11 +94,11 @@ public class UpdatePageAction 
                 return success;
             }           
             int count = 0;
-            BaseConcretePageElement page = null;            
+            BaseFragmentsElement page = null;            
             String path = getActionParameter(requestContext, "path");
             if (path == null)
             {
-                page = requestContext.getPage().getPage();
+                page = requestContext.getPage().getPageOrTemplate();
             }
             else
             {
@@ -298,7 +298,7 @@ public class UpdatePageAction 
         return success;
     }
     
-    protected int updatePortletDecorator(RequestContext requestContext, Map resultMap, BaseConcretePageElement page, String fragmentId, String portletDecorator)
+    protected int updatePortletDecorator(RequestContext requestContext, Map resultMap, BaseFragmentsElement page, String fragmentId, String portletDecorator)
     {
     	int count = 0;
     	BaseFragmentElement fragment = page.getFragmentById(fragmentId);
@@ -310,7 +310,7 @@ public class UpdatePageAction 
     	return count;
     }
     
-    protected int updateFragment(RequestContext requestContext, Map resultMap, BaseConcretePageElement page, String fragmentId, String layout)
+    protected int updateFragment(RequestContext requestContext, Map resultMap, BaseFragmentsElement page, String fragmentId, String layout)
     {
         int count = 0;
         String sizes = getActionParameter(requestContext, SIZES);
@@ -344,7 +344,7 @@ public class UpdatePageAction 
         return count;
     }
 
-    protected int addFragment(RequestContext requestContext, Map resultMap, BaseConcretePageElement page, String parentFragmentId, String layout)
+    protected int addFragment(RequestContext requestContext, Map resultMap, BaseFragmentsElement page, String parentFragmentId, String layout)
     {
         int count = 0;
         String sizes = getActionParameter(requestContext, SIZES);
@@ -367,7 +367,7 @@ public class UpdatePageAction 
         return count;
     }
 
-    protected int removeFragment(RequestContext requestContext, Map resultMap, BaseConcretePageElement page, String fragmentId)
+    protected int removeFragment(RequestContext requestContext, Map resultMap, BaseFragmentsElement page, String fragmentId)
     {
         int count = 0;
         BaseFragmentElement fragment = page.getFragmentById(fragmentId);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/AbstractPageValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/AbstractPageValveImpl.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/AbstractPageValveImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/AbstractPageValveImpl.java Tue Mar 30 08:14:54 2010
@@ -19,6 +19,7 @@ package org.apache.jetspeed.pipeline.val
 import java.io.IOException;
 import java.security.Principal;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.security.auth.Subject;
@@ -29,6 +30,7 @@ import org.apache.jetspeed.decoration.Pa
 import org.apache.jetspeed.layout.PageLayoutComponent;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.BaseConcretePageElement;
+import org.apache.jetspeed.om.page.BaseFragmentsElement;
 import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.om.page.PageTemplate;
 import org.apache.jetspeed.page.document.NodeNotFoundException;
@@ -41,6 +43,7 @@ import org.apache.jetspeed.portalsite.Po
 import org.apache.jetspeed.profiler.ProfilerException;
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.security.SubjectHelper;
+import org.apache.jetspeed.security.Role;
 import org.apache.jetspeed.security.User;
 
 import org.slf4j.Logger;
@@ -256,10 +259,10 @@ public abstract class AbstractPageValveI
         // here is the raw selected page as returned by the
         // page manager component; accessing the managed page here
         // selects the current page for the request
-        BaseConcretePageElement managedPage = requestContext.getManagedPage();
+        BaseFragmentsElement managedPageOrTemplate = requestContext.getManagedPageOrTemplate();
         PageTemplate managedPageTemplate = requestContext.getManagedPageTemplate();
         Map managedFragmentDefinitions = requestContext.getManagedFragmentDefinitions();
-        ContentPage contentPage = pageLayoutComponent.newContentPage(managedPage, managedPageTemplate, managedFragmentDefinitions);
+        ContentPage contentPage = pageLayoutComponent.newContentPage(managedPageOrTemplate, managedPageTemplate, managedFragmentDefinitions);
         request.setPage(contentPage);
         request.setProfileLocators(requestContext.getLocators());
         

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/PageValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/PageValveImpl.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/PageValveImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/PageValveImpl.java Tue Mar 30 08:14:54 2010
@@ -106,7 +106,7 @@ public class PageValveImpl extends Abstr
         // select the page or build menus: that is done when the
         // request context is accessed subsequently
         String requestServerName = ((request.getRequest() != null) ? request.getRequest().getServerName() : null);
-        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(requestPath, requestServerName, requestUserPrincipal.getName(), requestFallback, useHistory);
+        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(requestPath, requestServerName, requestUserPrincipal.getName(), requestFallback, useHistory, true);
 
         // save request context and set request page from portal
         // site request context

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java Tue Mar 30 08:14:54 2010
@@ -156,9 +156,9 @@ public class ProfilerValveImpl extends A
             // menus: that is done when the request context is
             // accessed subsequently
             String pipeline = request.getPipeline().getName();
-            boolean forceReservedFoldersVisibleInView = (pipeline.equals(PortalReservedParameters.CONFIG_PIPELINE_NAME) ||
-                                                         pipeline.equals(PortalReservedParameters.DESKTOP_CONFIG_PIPELINE_NAME));        
-            PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, requestUserPrincipal.getName(), requestFallback, useHistory, forceReservedFoldersVisibleInView);
+            boolean forceReservedFoldersVisible = (pipeline.equals(PortalReservedParameters.CONFIG_PIPELINE_NAME) ||
+                                                   pipeline.equals(PortalReservedParameters.DESKTOP_CONFIG_PIPELINE_NAME));
+            PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, requestUserPrincipal.getName(), requestFallback, useHistory, forceReservedFoldersVisible, true);
 
             // save request context and set request page from portal
             // site request context

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java Tue Mar 30 08:14:54 2010
@@ -40,10 +40,10 @@ import org.apache.jetspeed.container.Con
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.url.PortalURL;
 import org.apache.jetspeed.layout.PageLayoutComponent;
+import org.apache.jetspeed.om.page.BaseFragmentsElement;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.om.page.Fragment;
-import org.apache.jetspeed.om.page.BaseConcretePageElement;
 import org.apache.jetspeed.om.page.PageTemplate;
 import org.apache.jetspeed.om.page.impl.ContentFragmentImpl;
 import org.apache.jetspeed.om.portlet.Language;
@@ -585,10 +585,10 @@ public class JetspeedRequestContext impl
             PortalSiteSessionContext sessionContext = (PortalSiteSessionContext)getSessionAttribute(ProfilerValveImpl.PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY);
             String userPrincipal = ((getUserPrincipal() != null) ? getUserPrincipal().getName() : null);
             PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, userPrincipal, true, true);
-            BaseConcretePageElement managedPage = requestContext.getManagedPage();
+            BaseFragmentsElement managedPageOrTemplate = requestContext.getManagedPageOrTemplate();
             PageTemplate managedPageTemplate = requestContext.getManagedPageTemplate();
             Map managedFragmentDefinitions = requestContext.getManagedFragmentDefinitions();
-            ContentPage cpage = pageLayoutComponent.newContentPage(managedPage, managedPageTemplate, managedFragmentDefinitions);
+            ContentPage cpage = pageLayoutComponent.newContentPage(managedPageOrTemplate, managedPageTemplate, managedFragmentDefinitions);
             //System.out.println("page is " + cpage.getPath());
             this.setPage(realPage);            
             this.setPath(pathSave);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java Tue Mar 30 08:14:54 2010
@@ -190,7 +190,7 @@ public class PageLayoutService
             
             if (col == -1 && minRowsColumn)
             {
-                layoutFragment = getParentFragment(pageLayoutComponent.getUnlockedRootFragment(contentPage), addedContentFragmentId);
+                layoutFragment = getParentFragment(contentPage.getNonTemplateRootFragment(), addedContentFragmentId);
                 col = getMinRowsColumnIndex(layoutFragment);
             }
             
@@ -201,7 +201,7 @@ public class PageLayoutService
             
             if (layoutFragment == null)
             {
-                layoutFragment = getParentFragment(pageLayoutComponent.getUnlockedRootFragment(contentPage), addedContentFragmentId);
+                layoutFragment = getParentFragment(contentPage.getNonTemplateRootFragment(), addedContentFragmentId);
             }
             
             PortletPlacementContext ppc = new PortletPlacementContextImpl(contentPage, portletRegistry, layoutFragment);
@@ -244,7 +244,7 @@ public class PageLayoutService
             throw new WebApplicationException(new IllegalArgumentException("Fragment not found with the specified id: " + fragmentId));
         }
         
-        ContentFragment layoutFragment = getParentFragment(pageLayoutComponent.getUnlockedRootFragment(contentPage), fragmentId);
+        ContentFragment layoutFragment = getParentFragment(contentPage.getNonTemplateRootFragment(), fragmentId);
         
         if (layoutFragment == null)
         {
@@ -321,7 +321,7 @@ public class PageLayoutService
             }
             else
             {
-                layoutFragment = getParentFragment(pageLayoutComponent.getUnlockedRootFragment(contentPage), fragmentId );
+                layoutFragment = getParentFragment(contentPage.getNonTemplateRootFragment(), fragmentId );
                 
                 if (layoutFragment == null)
                 {
@@ -392,7 +392,7 @@ public class PageLayoutService
                     }
                     else
                     {
-                        layoutFragment = getParentFragment(pageLayoutComponent.getUnlockedRootFragment(contentPage), fragmentId);
+                        layoutFragment = getParentFragment(contentPage.getNonTemplateRootFragment(), fragmentId);
                         
                         if (layoutFragment == null)
                         {
@@ -439,7 +439,7 @@ public class PageLayoutService
                 if (layoutFragmentId != null && layoutFragmentId.equals("detach"))
                 {
                     // first time detach, reallocate column and move it to the back
-                    ContentFragment layoutFragment = getParentFragment(pageLayoutComponent.getUnlockedRootFragment(contentPage), fragmentId);                    
+                    ContentFragment layoutFragment = getParentFragment(contentPage.getNonTemplateRootFragment(), fragmentId);                    
                     if (layoutFragment == null)
                     {
                         throw new WebApplicationException(new IllegalArgumentException("Layout fragment not found for the fragment: " + fragmentId));

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java Tue Mar 30 08:14:54 2010
@@ -79,7 +79,7 @@ public class Jetui
         {
             RequestDispatcher dispatcher = request.getRequest().getRequestDispatcher(layoutTemplate);
             request.setAttribute("jetui", this);
-            ContentFragment rootFragment = pageLayoutComponent.getUnlockedRootFragment(request.getPage());
+            ContentFragment rootFragment = request.getPage().getNonTemplateRootFragment();
             if (maximized == null)
             {
                 String jetspeedLayout = rootFragment.getName();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/assembly/page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/assembly/page-manager.xml?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/assembly/page-manager.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/assembly/page-manager.xml Tue Mar 30 08:14:54 2010
@@ -182,6 +182,9 @@ limitations under the License.
     <constructor-arg index="0">
       <ref bean="org.apache.jetspeed.page.PageManager" />
     </constructor-arg>
+    <constructor-arg index="1">
+      <value>jetspeed-layouts::VelocityOneColumn</value>
+    </constructor-arg>
   </bean>
     
 </beans>

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PageLayoutComponent.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PageLayoutComponent.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PageLayoutComponent.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PageLayoutComponent.java Tue Mar 30 08:14:54 2010
@@ -19,9 +19,9 @@ package org.apache.jetspeed.layout;
 import java.util.Map;
 
 import org.apache.jetspeed.om.common.SecurityConstraints;
+import org.apache.jetspeed.om.page.BaseFragmentsElement;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.ContentPage;
-import org.apache.jetspeed.om.page.BaseConcretePageElement;
 import org.apache.jetspeed.om.page.PageTemplate;
 
 /**
@@ -73,6 +73,38 @@ public interface PageLayoutComponent
     ContentFragment addFragmentAtRowColumn(ContentPage contentPage, ContentFragment contentFragment, int row, int column);                        
     
     /**
+     * Add fragment reference to fragment with specified row and
+     * column returning associated content fragment.
+     * 
+     * @param contentFragment content fragment context
+     * @param id fragment definition id
+     * @param row fragment row position
+     * @param column fragment column position
+     * @return new content fragment added to fragment
+     */
+    ContentFragment addFragmentReference(ContentFragment contentFragment, String id, int row, int column);
+
+    /**
+     * Add fragment reference to fragment returning associated
+     * content fragment.
+     * 
+     * @param contentFragment content fragment context
+     * @param id fragment definition id
+     * @return new content fragment added to fragment
+     */
+    ContentFragment addFragmentReference(ContentFragment contentFragment, String id);
+    
+    /**
+     * Add fragment reference to page returning associated content
+     * fragment.
+     * 
+     * @param contentPage content page context
+     * @param id fragment definition id
+     * @return new content fragment added to page
+     */
+    ContentFragment addFragmentReference(ContentPage contentPage, String id);
+
+    /**
      * Add portlet to fragment with specified row and column returning
      * associated content fragment.
      * 
@@ -155,16 +187,16 @@ public interface PageLayoutComponent
     void moveFragment(ContentPage contentPage, String fragmentId, String fromFragmentId, String toFragmentId);
 
     /**
-     * Construct a new content page hierarchy from PSML page, page
-     * templates, and fragment definitions.
+     * Construct a new content page hierarchy from PSML page or template,
+     * page templates, and fragment definitions.
      * 
-     * @param page PSML page to construct content page from
+     * @param pageOrTemplate PSML page or template to construct content page from
      * @param pageTemplate PSML page template to merge into content page
      * @param fragmentDefinitions PSML fragment definitions referenced
      *                            by page and/or page template
      * @return new content page
      */
-    ContentPage newContentPage(BaseConcretePageElement page, PageTemplate pageTemplate, Map fragmentDefinitions);
+    ContentPage newContentPage(BaseFragmentsElement pageOrTemplate, PageTemplate pageTemplate, Map fragmentDefinitions);
     
     /**
      * Create a new sibling folder with specified configuration and
@@ -203,6 +235,49 @@ public interface PageLayoutComponent
     void newSiblingPage(ContentPage contentPage, String pageName, String layoutName, String pageTitle, String pageShortTitle);
     
     /**
+     * Create new sibling dynamic page with specified configuration. 
+     * Both title and short title parameters default to page name if
+     * not specified. The layout fragment name is cloned from this
+     * content page if not specified. Default decorators are cloned
+     * from this content page.
+     * 
+     * @param contentPage content page context
+     * @param pageName unique new dynamic page name
+     * @param contentType dynamic page content type
+     * @param layoutName root level layout fragment name or null 
+     * @param pageTitle new page title or null
+     * @param pageShortTitle new page short title or null
+     */
+    void newSiblingDynamicPage(ContentPage contentPage, String pageName, String contentType, String layoutName, String pageTitle, String pageShortTitle);
+    
+    /**
+     * Create new sibling page template with specified configuration.
+     * The layout fragment name is cloned from this content page if
+     * not specified. Default decorators are cloned from this content
+     * page.
+     * 
+     * @param contentPage content page context
+     * @param templateName unique new page template name
+     * @param layoutName root level layout fragment name or null 
+     * @param templateTitle new page title or null
+     * @param templateShortTitle new page short title or null
+     */
+    void newSiblingPageTemplate(ContentPage contentPage, String templateName, String layoutName, String templateTitle, String templateShortTitle);
+    
+    /**
+     * Create new sibling fragment definition with specified
+     * configuration.
+     * 
+     * @param contentPage content page context
+     * @param definitionName unique new fragment definition name
+     * @param defId unique new fragment definition id or null
+     * @param portletName root level portlet fragment name or null 
+     * @param definitionTitle new page title or null
+     * @param definitionShortTitle new page short title or null
+     */
+    void newSiblingFragmentDefinition(ContentPage contentPage, String definitionName, String defId, String portletName, String definitionTitle, String definitionShortTitle);
+    
+    /**
      * Remove fragment from page by id.
      * 
      * @param contentPage content page context
@@ -226,6 +301,15 @@ public interface PageLayoutComponent
     void removeFolder(ContentPage contentPage);
     
     /**
+     * Update dynamic page content type and inheritable flag.
+     *  
+     * @param contentPage content page context
+     * @param contentType dynamic page content type
+     * @param contentType dynamic page content type
+     */
+    void updateContent(ContentPage contentPage, String contentType, Boolean inheritable);
+
+    /**
      * Update global fragment portlet decorator.
      *  
      * @param contentFragment content fragment context
@@ -327,6 +411,14 @@ public interface PageLayoutComponent
     void updateProperty(ContentFragment contentFragment, String propName, String propValue, String scope, String scopeValue);
     
     /**
+     * Update fragment reference reference id.
+     * 
+     * @param contentFragment content fragment context
+     * @param refId referenced fragment definition id
+     */
+    void updateRefId(ContentFragment contentFragment, String refId);
+    
+    /**
      * Update global fragment row and column layout position.
      * 
      * @param contentFragment content fragment context
@@ -382,12 +474,4 @@ public interface PageLayoutComponent
      * @param shortTitle page short title
      */
     void updateTitles(ContentPage contentPage, String title, String shortTitle);
-    
-    /**
-     * Returns the root fragment which is not locked and not merged from a page template
-     * 
-     * @param contentPage content page context
-     * @return content fragment context
-     */
-    ContentFragment getUnlockedRootFragment(ContentPage contentPage);    
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java Tue Mar 30 08:14:54 2010
@@ -406,10 +406,29 @@ public interface ContentFragment
      * @return ContentFragment list
      */
     List getFragments();
+
+    /************** Fragment Reference **************/
     
+    /**
+     * Returns the id of the referenced fragment element.
+     *
+     * @return the referenced fragment id.
+     */
+    String getRefId();
+
     /************** ContentFragment **************/
 
     /**
+     * A fragment of type PAGE is a place holder for a page fragment.
+     */
+    String PAGE = "page";
+
+    /**
+     * A fragment of type REFERENCE is a place holder for a fragment reference.
+     */
+    String REFERENCE = "reference";
+    
+    /**
      * Returns the unique fragment id of this element. This id is guaranteed to be
      * unique per fragment within the portal and is suitable to be used as a key.
      * Note that multiple content fragments can have the same fragment id since
@@ -500,9 +519,17 @@ public interface ContentFragment
     PageLayoutComponent getPageLayoutComponent();
     
     /**
+     * Return template flag indicating whether this fragment
+     * was originally merged from a page template
+     * 
+     * @return template flag
+     */
+    boolean isTemplate();
+    
+    /**
      * Return is locked flag indicating whether this fragment
      * was originally merged from a page template or fragment
-     * definition.
+     * definition or is transient.
      * 
      * @return locked flag
      */
@@ -614,6 +641,13 @@ public interface ContentFragment
     void updateProperty(String propName, String propValue, String scope, String scopeValue);
     
     /**
+     * Update fragment reference reference id.
+     * 
+     * @param refId referenced fragment definition id
+     */
+    void updateRefId(String refId);
+
+    /**
      * Update fragment row and column layout positions. The default, (Global),
      * scope values are updated.
      * 

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentPage.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentPage.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentPage.java Tue Mar 30 08:14:54 2010
@@ -153,13 +153,15 @@ public interface ContentPage
 
     /**
      * Returns a ContentFragment represented by the fragment id argument.
+     * 
      * @param id unique id of the ContentFragment we want to retrieve.
      * @return
      */
     ContentFragment getFragmentById(String id);
 
     /**
-     * Returns a ContentFragment represented by the underlying PSML Fragment fragment id argument.
+     * Returns a ContentFragment represented by the underlying PSML Fragment fragment.
+     * 
      * @param id unique id of the ContentFragment we want to retrieve.
      * @return
      */
@@ -167,6 +169,7 @@ public interface ContentPage
 
     /**
      * Returns a list of ContentFragment fragments represented by the name argument.
+     * 
      * @param name name of the ContentFragments we want to retrieve.
      * @return list of ContentFragment
      */
@@ -184,15 +187,42 @@ public interface ContentPage
      */
     String getEffectiveDefaultDecorator(String fragmentType);
 
+    /************** DynamicPage **************/
+    
+    /**
+     * Get the content type name that applies to this page.
+     *
+     * @return the page type name
+     */
+    String getContentType();    
+
+    /**
+     * Get inheritable flag that indicates whether this dynamic
+     * page can be inherited for child content pages.
+     *
+     * @return inheritable flag
+     */
+    boolean isInheritable();
+
+    /************** FragmentDefinition **************/
+    
+    /**
+     * Returns the id of the defined root fragment element.
+     *
+     * @return the defined root fragment id
+     */
+    String getDefId();    
+
     /************** ContentPage **************/
 
     /**
-     * Access underlying concrete persistent page or null
+     * Access underlying concrete persistent page, template,
+     * or null
      * if page is transient or constructed dynamically.
      * 
      * @return persistent page or null
      */
-    BaseConcretePageElement getPage();
+    BaseFragmentsElement getPageOrTemplate();
     
     /**
      * Access underlying concrete persistent page template or
@@ -225,6 +255,32 @@ public interface ContentPage
      */
     void overrideDefaultDecorator(String decoratorName, String fragmentType);
     
+    /**
+     * Returns a ContentFragment represented by the underlying PSML Fragment fragment.
+     * 
+     * @param id unique id of the content fragment we want to retrieve.
+     * @param nonTemplate return only non-template matching fragments
+     * @return first matching content fragment
+     */
+    ContentFragment getFragmentByFragmentId(String id, boolean nonTemplate);
+
+    /**
+     * Returns a list of ContentFragment fragments represented by the name argument.
+     * 
+     * @param name name of the content fragments we want to retrieve.
+     * @param nonTemplate return only non-template matching fragments
+     * @return list of matching content fragments
+     */
+    List getFragmentsByName(String name, boolean nonTemplate);
+    
+    /**
+     * Returns the root layout fragment which is not merged
+     * from a page template.
+     * 
+     * @return root non-template layout content fragment
+     */
+    ContentFragment getNonTemplateRootFragment();    
+
     /************** PageLayoutComponent Operations **************/
 
     /**
@@ -237,6 +293,15 @@ public interface ContentPage
     ContentFragment addFragmentAtRowColumn(ContentFragment fragment, int row, int column);                        
     
     /**
+     * Add fragment reference to page returning associated content
+     * fragment.
+     * 
+     * @param id fragment definition id
+     * @return new content fragment added to page
+     */
+    ContentFragment addFragmentReference(String id);
+
+    /**
      * Add portlet to page returning associated content fragment.
      * 
      * @param type portlet type
@@ -318,6 +383,46 @@ public interface ContentPage
      * @param pageShortTitle new page short title or null
      */
     void newSiblingPage(String pageName, String layoutName, String pageTitle, String pageShortTitle);
+
+    /**
+     * Create new sibling dynamic page with specified configuration. 
+     * Both title and short title parameters default to page name if
+     * not specified. The layout fragment name is cloned from this
+     * content page if not specified. Default decorators are cloned
+     * from this content page.
+     * 
+     * @param pageName unique new dynamic page name
+     * @param contentType dynamic page content type
+     * @param layoutName root level layout fragment name or null 
+     * @param pageTitle new page title or null
+     * @param pageShortTitle new page short title or null
+     */
+    void newSiblingDynamicPage(String pageName, String contentType, String layoutName, String pageTitle, String pageShortTitle);
+    
+    /**
+     * Create new sibling page template with specified configuration.
+     * The layout fragment name is cloned from this content page if
+     * not specified. Default decorators are cloned from this content
+     * page.
+     * 
+     * @param templateName unique new page template name
+     * @param layoutName root level layout fragment name or null 
+     * @param templateTitle new page title or null
+     * @param templateShortTitle new page short title or null
+     */
+    void newSiblingPageTemplate(String templateName, String layoutName, String templateTitle, String templateShortTitle);
+    
+    /**
+     * Create new sibling fragment definition with specified
+     * configuration.
+     * 
+     * @param definitionName unique new fragment definition name
+     * @param defId unique new fragment definition id or null
+     * @param portletName root level portlet fragment name or null 
+     * @param definitionTitle new page title or null
+     * @param definitionShortTitle new page short title or null
+     */
+    void newSiblingFragmentDefinition(String definitionName, String defId, String portletName, String definitionTitle, String definitionShortTitle);
     
     /**
      * Remove fragment from page by id.
@@ -338,6 +443,14 @@ public interface ContentPage
     void removeFolder();
     
     /**
+     * Update dynamic page content type and inheritable flag.
+     *  
+     * @param contentType dynamic page content type
+     * @param contentType dynamic page content type
+     */
+    void updateContent(String contentType, Boolean inheritable);
+
+    /**
      * Update page default decorator.
      *  
      * @param decoratorName decorator name

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/DynamicPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/DynamicPage.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/DynamicPage.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/DynamicPage.java Tue Mar 30 08:14:54 2010
@@ -34,7 +34,7 @@ public interface DynamicPage extends Bas
     /**
      * Get the content type name that applies to this page.
      *
-     * @return the page type name name
+     * @return the page type name
      */
     String getContentType();
 

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentDefinition.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentDefinition.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentDefinition.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentDefinition.java Tue Mar 30 08:14:54 2010
@@ -30,7 +30,7 @@ public interface FragmentDefinition exte
     /**
      * Returns the id of the defined root fragment element.
      *
-     * @return the defined root fragment id.
+     * @return the defined root fragment id
      */
     String getDefId();
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteContentTypeMapper.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteContentTypeMapper.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteContentTypeMapper.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteContentTypeMapper.java Tue Mar 30 08:14:54 2010
@@ -26,6 +26,7 @@ package org.apache.jetspeed.portalsite;
 public interface PortalSiteContentTypeMapper
 {
     public static final String PAGE_SYSTEM_TYPE = "portal-page";
+    public static final String TEMPLATE_SYSTEM_TYPE = "portal-template";
     public static final String FOLDER_SYSTEM_TYPE = "portal-folder";
     
     /**

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteRequestContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteRequestContext.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteRequestContext.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteRequestContext.java Tue Mar 30 08:14:54 2010
@@ -20,7 +20,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.jetspeed.om.folder.Folder;
-import org.apache.jetspeed.om.page.BaseConcretePageElement;
+import org.apache.jetspeed.om.page.BaseFragmentsElement;
 import org.apache.jetspeed.om.page.PageTemplate;
 import org.apache.jetspeed.page.document.NodeNotFoundException;
 import org.apache.jetspeed.page.document.NodeSet;
@@ -48,14 +48,14 @@ public interface PortalSiteRequestContex
     Map getLocators();
 
     /**
-     * getManagedPage - get request profiled concrete page instance
-     *                  as managed by the page manager
+     * getManagedPageOrTemplate - get request profiled concrete page or template
+     *                            instance as managed by the page manager
      *  
-     * @return page
+     * @return page or template
      * @throws NodeNotFoundException if page not found
      * @throws SecurityException if page view access not granted
      */
-    BaseConcretePageElement getManagedPage() throws NodeNotFoundException;
+    BaseFragmentsElement getManagedPageOrTemplate() throws NodeNotFoundException;
 
     /**
      * getManagedPageTemplate - get request profiled concrete page 
@@ -83,20 +83,30 @@ public interface PortalSiteRequestContex
      * isContentPage - returns flag indicating request page is honoring
      *                 a content request
      *
-     * @return page template
+     * @return content page flag
      * @throws NodeNotFoundException if page not found
      * @throws SecurityException if page view access not granted
      */
     boolean isContentPage() throws NodeNotFoundException;
 
     /**
-     * getPage - get request profiled page view
+     * isConcretePage - returns flag indicating request page is honoring
+     *                  a concrete page or content page request
+     *
+     * @return concrete page flag
+     * @throws NodeNotFoundException if page not found
+     * @throws SecurityException if page view access not granted
+     */
+    boolean isConcretePage() throws NodeNotFoundException;
+
+    /**
+     * getPageOrTemplate - get request profiled page or template view
      *  
      * @return page view
      * @throws NodeNotFoundException if page not found
      * @throws SecurityException if page view access not granted
      */
-    BaseConcretePageElement getPage() throws NodeNotFoundException;
+    BaseFragmentsElement getPageOrTemplate() throws NodeNotFoundException;
 
     /**
      * getPageContentPath - get content path associated with request page

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteSessionContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteSessionContext.java?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteSessionContext.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteSessionContext.java Tue Mar 30 08:14:54 2010
@@ -72,9 +72,10 @@ public interface PortalSiteSessionContex
      * @param useHistory flag indicating whether to use visited page
      *                   history to select default page per site folder
      * @param forceReservedVisible force reserved/hidden folders visible in site view
+     * @param forceTemplatesAccessible force templates accessible to requests in site view
      * @return new request context instance
      */
-    PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceReservedVisible);
+    PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceReservedVisible, boolean forceTemplatesAccessible);
 
     /**
      * newRequestContext - create a new request context instance without profiling
@@ -116,6 +117,22 @@ public interface PortalSiteSessionContex
     PortalSiteRequestContext newRequestContext(String requestPath, String requestServerName, String requestUserPrincipal, boolean requestFallback, boolean useHistory);
 
     /**
+     * newRequestContext - create a new request context instance without profiling
+     *                     support
+     *
+     * @param requestPath request path
+     * @param requestServerName request server name
+     * @param requestUserPrincipal request user principal
+     * @param requestFallback flag specifying whether to fallback to root folder
+     *                        if locators do not select a page or access is forbidden
+     * @param useHistory flag indicating whether to use visited page
+     *                   history to select default page per site folder
+     * @param forceTemplatesAccessible force templates accessible to requests in site view
+     * @return new request context instance
+     */
+    PortalSiteRequestContext newRequestContext(String requestPath, String requestServerName, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceTemplatesAccessible);
+
+    /**
      * getPageManager - return PageManager component instance
      *
      * @return PageManager instance

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml?rev=929033&r1=929032&r2=929033&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml Tue Mar 30 08:14:54 2010
@@ -440,6 +440,9 @@
     <constructor-arg index="0">
       <ref bean="org.apache.jetspeed.page.PageManager" />
     </constructor-arg>
+    <constructor-arg index="1">
+      <value>jetspeed-layouts::VelocityOneColumn</value>
+    </constructor-arg>
   </bean>
 
 </beans>



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