portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r891420 [2/2] - in /portals/jetspeed-2/portal/trunk: applications/jetspeed/src/main/webapp/WEB-INF/pages/ components/jetspeed-locator/src/main/java/org/apache/jetspeed/profiler/impl/ components/jetspeed-page-layout/src/main/java/org/apache/...
Date Wed, 16 Dec 2009 20:38:23 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java?rev=891420&r1=891419&r2=891420&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java Wed Dec 16 20:38:20 2009
@@ -32,8 +32,10 @@
 import javax.servlet.http.HttpSessionEvent;
 
 import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.page.DynamicPage;
 import org.apache.jetspeed.om.page.FragmentDefinition;
+import org.apache.jetspeed.om.page.BaseConcretePageElement;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageTemplate;
 import org.apache.jetspeed.page.PageManager;
@@ -42,6 +44,7 @@
 import org.apache.jetspeed.page.document.NodeException;
 import org.apache.jetspeed.page.document.NodeNotFoundException;
 import org.apache.jetspeed.page.document.NodeSet;
+import org.apache.jetspeed.portalsite.PortalSiteContentTypeMapper;
 import org.apache.jetspeed.portalsite.PortalSiteRequestContext;
 import org.apache.jetspeed.portalsite.PortalSiteSessionContext;
 import org.apache.jetspeed.portalsite.view.SiteView;
@@ -89,6 +92,11 @@
     private transient PageManager pageManager;
 
     /**
+     * contentTypeMapper - PortalSiteContentTypeMapper component
+     */
+    private transient PortalSiteContentTypeMapper contentTypeMapper;
+
+    /**
      * profileLocators - map of session profile locators by locator names
      */
     private transient Map profileLocators;
@@ -140,10 +148,12 @@
      * PortalSiteSessionContextImpl - constructor
      *
      * @param pageManager PageManager component instance
+     * @param contentTypeMapper PortalSiteContentTypeMapper component instance
      */
-    public PortalSiteSessionContextImpl(PageManager pageManager)
+    public PortalSiteSessionContextImpl(PageManager pageManager, PortalSiteContentTypeMapper contentTypeMapper)
     {
         this.pageManager = pageManager;
+        this.contentTypeMapper = contentTypeMapper;
     }
 
     /**
@@ -214,13 +224,14 @@
      * @throws NodeNotFoundException if not found
      * @throws SecurityException if view access not granted
      */
-    public Page selectRequestPage(Map requestProfileLocators, boolean requestFallback, boolean useHistory, boolean forceReservedVisible) throws NodeNotFoundException
+    public BaseConcretePageElement selectRequestPage(Map requestProfileLocators, boolean requestFallback, boolean useHistory, boolean forceReservedVisible) throws NodeNotFoundException
     {
         // validate and update session profile locators if modified
         if (updateSessionProfileLocators(requestProfileLocators, forceReservedVisible))
         {
-            // extract page request path from the locators
+            // extract page request path and server from the locators
             String requestPath = Folder.PATH_SEPARATOR;
+            String requestServerName = null;
             ProfileLocator locator = (ProfileLocator)requestProfileLocators.get(ProfileLocator.PAGE_LOCATOR);
             if (locator != null)
             {
@@ -237,6 +248,62 @@
                 locator = (ProfileLocator)requestProfileLocators.values().iterator().next();
                 requestPath = locator.getRequestPath();
             }
+            requestServerName = locator.getRequestServerName();
+            if (log.isDebugEnabled())
+            {
+                log.debug("Select request page: requestPath="+requestPath+", requestServerName: "+requestServerName);
+            }
+
+            // determine content mapping for request path if content type
+            // mapper configured for context
+            if (contentTypeMapper != null)
+            {
+                // test for system page or folder request mappings; if system
+                // types matched, continue below with native portal resolution
+                // of request
+                String systemType = contentTypeMapper.mapSystemType(requestPath);
+                if (systemType == null)
+                {
+                    // test for content type mappings; if no content type matched
+                    // request, continue with native portal resolution of request
+                    String contentType = contentTypeMapper.mapContentType(requestPath);
+                    if (contentType != null)
+                    {
+                        // log mapping
+                        if (log.isDebugEnabled())
+                        {
+                            log.debug("Content request: requestPath="+requestPath+", mapped to content type: "+contentType);
+                        }
+
+                        // support request path mapping of content requests
+                        String mappedRequestPath = contentTypeMapper.mapRequestPath(requestServerName, contentType, requestPath);
+                        if (mappedRequestPath != null)
+                        {
+                            // log mapping
+                            if (log.isDebugEnabled())
+                            {
+                                log.debug("Mapped content request: serverName="+requestServerName+", contentType="+contentType+", requestPath="+requestPath+", mapped to: "+mappedRequestPath);
+                            }
+                            requestPath = mappedRequestPath;
+                        }
+
+                        // attempt to match content request against dynamic pages
+                        // using profile locators and site view; start at root
+                        // folder until path no longer matches and search from
+                        // there back up toward the root for dynamic pages by
+                        // content type; fallback to wildcard content type
+                        return selectContentRequestPage(requestPath, contentType);
+                    }
+                }
+                else
+                {
+                    // log mapping
+                    if (log.isDebugEnabled())
+                    {
+                        log.debug("System request: requestPath="+requestPath+", mapped to system type: "+systemType);
+                    }                    
+                }
+            }
             
             // attempt to select request page or folder using
             // profile locators and site view; if fallback
@@ -405,10 +472,10 @@
                             // log modified page request
                             if (log.isDebugEnabled() && !path.equals(requestPath))
                             {
-                                log.debug("Request page modified by profile locator: request path=" + path);
+                                log.debug("Request path modified by profile locator: request path=" + path + ", original request path=" + requestPath);
                             }
+                            return path;
                         }
-                        return path;
                     }
                 }
             }
@@ -680,6 +747,130 @@
     }
     
     /**
+     * selectContentRequestPage - select dynamic page proxy for request for
+     *                            specified content request path and content
+     *                            type given profile locators and site view
+     *                            associated with this context
+     *
+     * @param requestPath request path
+     * @param contentType content type
+     * @return selected dynamic page proxy for request
+     * @throws NodeNotFoundException if not found
+     * @throws SecurityException if view access not granted
+     */
+    private DynamicPage selectContentRequestPage(String requestPath, String contentType) throws NodeNotFoundException
+    {
+        // save access exceptions
+        SecurityException accessException = null;
+
+        // valid SiteView required from session profile locators
+        SiteView view = getSiteView();
+        if (view != null)
+        {
+            // default request to root folder if not specified
+            if (requestPath == null)
+            {
+                requestPath = Folder.PATH_SEPARATOR;
+            }
+            
+            // log content page request
+            if (log.isDebugEnabled())
+            {
+                log.debug("Request content page: request path=" + requestPath);
+            }
+            
+            // search for deepest matching content request path
+            // that matches request path; start with root folder in view
+            Folder contentRequestFolder = (Folder)view.getNodeProxy(Folder.PATH_SEPARATOR, null, false, false);
+            String contentRequestPath = contentRequestFolder.getPath();
+            String contentRequestFile = null;
+            for (;;)
+            {
+                // find next path name
+                int startOfPathNameIndex = (contentRequestPath.equals(Folder.PATH_SEPARATOR) ? 1 : contentRequestPath.length()+1);
+                int endOfPathNameIndex = requestPath.indexOf(Folder.PATH_SEPARATOR, startOfPathNameIndex);
+                if ((endOfPathNameIndex == -1) || (endOfPathNameIndex == startOfPathNameIndex))
+                {
+                    break;
+                }
+                // find folder in view
+                try
+                {
+                    String pathFolderName = requestPath.substring(startOfPathNameIndex, endOfPathNameIndex);
+                    contentRequestFolder = contentRequestFolder.getFolder(pathFolderName);
+                    contentRequestPath = contentRequestFolder.getPath();
+                }
+                catch (Exception e)
+                {
+                    break;
+                }
+            }
+            
+            // select matching dynamic pages in folders from deepest
+            // to root folders in content request path
+            while (contentRequestFolder != null)
+            {
+                // select dynamic page by content type or wildcard match
+                try
+                {
+                    NodeSet dynamicPages = contentRequestFolder.getDynamicPages();
+                    if ((dynamicPages != null) && !dynamicPages.isEmpty())
+                    {
+                        // select matching page
+                        DynamicPage wildcardMatchingPage = null;
+                        Iterator dynamicPagesIter = dynamicPages.iterator();
+                        while (dynamicPagesIter.hasNext())
+                        {
+                            DynamicPage dynamicPage = (DynamicPage)dynamicPagesIter.next();
+                            if ((dynamicPage.getContentType() == null) || dynamicPage.getContentType().equals(DynamicPage.WILDCARD_CONTENT_TYPE))
+                            {
+                                wildcardMatchingPage = dynamicPage;
+                            }
+                            else if (dynamicPage.getContentType().equals(contentType))
+                            {
+                                // log selected dynamic page
+                                if (log.isDebugEnabled())
+                                {
+                                    log.debug("Selected "+contentType+" content dynamic page, path=" + view.getManagedDynamicPage(dynamicPage).getPath());
+                                }
+                                return dynamicPage;
+                            }
+                        }
+                        // select wildcard matching page
+                        if (wildcardMatchingPage != null)
+                        {
+                            // log selected dynamic page
+                            if (log.isDebugEnabled())
+                            {
+                                log.debug("Selected "+contentType+" content dynamic page with wildcard, path=" + view.getManagedDynamicPage(wildcardMatchingPage).getPath());
+                            }
+                            return wildcardMatchingPage;
+                        }
+                    }
+                }
+                catch (NodeException ne)
+                {
+                    break;
+                }
+                catch (SecurityException se)
+                {
+                    accessException = se;
+                }
+
+                // continue search with parent folder
+                contentRequestFolder = (Folder)contentRequestFolder.getParent();
+            }
+        }
+            
+        // no dynamic page matched or accessible
+        if (accessException != null)
+        {
+            throw accessException;
+        }
+        throw new NodeNotFoundException("No dynamic page matched " + requestPath + " request in site view.");
+    }
+
+    /**
      * getRequestRootFolder - select root folder proxy for given profile locators
      *
      * @param requestProfileLocators map of profile locators for request
@@ -938,6 +1129,16 @@
     }
 
     /**
+     * getContentTypeMapper - return PortalSiteContentTypeMapper component instance
+     *
+     * @return PortalSiteContentTypeMapper instance
+     */
+    public PortalSiteContentTypeMapper getContentTypeMapper()
+    {
+        return contentTypeMapper;
+    }
+    
+    /**
      * isValid - return flag indicating whether this context instance
      *           is valid or if it is stale after being persisted and
      *           reloaded as session state
@@ -1000,16 +1201,25 @@
     }
 
     /**
-     * getManagedPage - get concrete page instance from page proxy
+     * getManagedConcretePage - get concrete page or dynamic page instance
+     *                          from page proxy
      *  
      * @param page page proxy
      * @return managed page
      */
-    public Page getManagedPage(Page page)
+    public BaseConcretePageElement getManagedPage(BaseConcretePageElement page)
     {
-        // return managed page in site view
+        // return managed page or dynamic page in site view
         SiteView view = getSiteView();
-        return ((view != null) ? view.getManagedPage(page) : null);            
+        if (page instanceof Page)
+        {
+            return ((view != null) ? view.getManagedPage((Page)page) : null);
+        }
+        else if (page instanceof DynamicPage)
+        {
+            return ((view != null) ? view.getManagedDynamicPage((DynamicPage)page) : null);
+        }
+        return null;
     }
 
     /**

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/RequestPathMapping.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/RequestPathMapping.java?rev=891420&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/RequestPathMapping.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/RequestPathMapping.java Wed Dec 16 20:38:20 2009
@@ -0,0 +1,92 @@
+package org.apache.jetspeed.portalsite.impl;
+
+import java.util.regex.Matcher;
+
+import org.apache.jetspeed.om.page.DynamicPage;
+
+/**
+ * This class specifies a request mapping definition for use
+ * by the portal-site content type mapper component.
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public class RequestPathMapping extends AbstractPatternMapping
+{
+    private String serverName;
+    private String contentType;
+    private String mappedPath;
+    
+    /**
+     * Construct request path mapping for any server name and
+     * content type.
+     * 
+     * @param pattern request path find pattern
+     * @param mappedPath resulting request path
+     */
+    public RequestPathMapping(String pattern, String mappedPath)
+    {
+        this(null, pattern, mappedPath);
+    }
+
+    /**
+     * Construct request path mapping for specified content type and
+     * any server name.
+     * 
+     * @param contentType request content path
+     * @param pattern request path find pattern
+     * @param mappedPath resulting request path
+     */
+    public RequestPathMapping(String contentType, String pattern, String mappedPath)
+    {
+        this(null, contentType, pattern, mappedPath);
+    }
+
+    /**
+     * Construct request path mapping for specified content type and
+     * server name or server domain name. Server domain names must
+     * start with a '.' character.
+     * 
+     * @param serverName request server name or server domain name
+     * @param contentType request content path
+     * @param pattern request path find pattern
+     * @param mappedPath resulting request path
+     */
+    public RequestPathMapping(String serverName, String contentType, String pattern, String mappedPath)
+    {
+        super(pattern);
+        this.serverName = serverName;
+        this.contentType = contentType;
+        this.mappedPath = mappedPath;
+    }
+    
+    /**
+     * Match request path pattern against request path, replacing
+     * all subsequence expressions in the mapped path.
+     * 
+     * @param requestServerName request server name to match
+     * @param requestContentType request content type to match
+     * @param requestPath request path to map
+     * @return mapped request path or null if pattern not found
+     */
+    public String map(String requestServerName, String requestContentType, String requestPath)
+    {
+        // match server name or server domain name if specified
+        if ((serverName != null) && (requestServerName != null) && !serverName.equals(requestServerName) && (!serverName.startsWith(".") || !requestServerName.endsWith(serverName)))
+        {
+            return null;
+        }
+        // match content type if specified
+        if ((contentType != null) && !contentType.equals(DynamicPage.WILDCARD_CONTENT_TYPE) && (requestContentType != null) && !contentType.equals(requestContentType))
+        {
+            return null;
+        }
+        // find/replace pattern in request path
+        Matcher patternMatcher = getPatternMatcher(requestPath);
+        if (patternMatcher.find())
+        {
+            return patternMatcher.replaceAll(mappedPath);
+        }
+        return null;
+    }
+}

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SiteView.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SiteView.java?rev=891420&r1=891419&r2=891420&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SiteView.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SiteView.java Wed Dec 16 20:38:20 2009
@@ -1127,8 +1127,12 @@
      */
     private static boolean isProxyViewable(Node nodeProxy, boolean onlyVisible)
     {
-        // pages and links are always considered viewable;
-        // folders must be tested for viewable and visibile
+        // pages and links are always considered viewable
+        if ((nodeProxy instanceof Page) || (nodeProxy instanceof Link))
+        {
+            return true;
+        }
+        // folders must be tested for viewable and visible
         // child nodes
         if (nodeProxy instanceof Folder)
         {
@@ -1156,7 +1160,8 @@
             }
             return false;
         }
-        return true;
+        // templates, fragments, and dynamic page are not visible
+        return false;
     }
 
     /**

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/java/JETSPEED-INF/spring/test-spring.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/java/JETSPEED-INF/spring/test-spring.xml?rev=891420&r1=891419&r2=891420&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/java/JETSPEED-INF/spring/test-spring.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/java/JETSPEED-INF/spring/test-spring.xml Wed Dec 16 20:38:20 2009
@@ -167,10 +167,37 @@
   </bean>
     
   <!-- PortalSite -->
+  <bean id="org.apache.jetspeed.portalsite.PortalSiteContentTypeMapper" 
+       name="portalSiteContentTypeMapper"
+       class="org.apache.jetspeed.portalsite.impl.PortalSiteContentTypeMapperImpl">         
+       <constructor-arg index="0">
+           <list>
+               <bean class="org.apache.jetspeed.portalsite.impl.ContentTypeMapping">
+                   <constructor-arg index="0"><value>\w[.](\w+)&#36;</value></constructor-arg> <!-- use &#36; for '$' -->
+                   <constructor-arg index="1"><value>&#36;1-type</value></constructor-arg> <!-- use &#36; for '$' -->
+               </bean>
+           </list>
+       </constructor-arg>
+       <constructor-arg index="1">
+           <list>
+               <bean class="org.apache.jetspeed.portalsite.impl.RequestPathMapping">
+                   <constructor-arg index="0"><value>/preview/</value></constructor-arg>
+                   <constructor-arg index="1"><value>/</value></constructor-arg>
+               </bean>
+               <bean class="org.apache.jetspeed.portalsite.impl.RequestPathMapping">
+                   <constructor-arg index="0"><value>.domain.com</value></constructor-arg>
+                   <constructor-arg index="1"><value>doc-type</value></constructor-arg>
+                   <constructor-arg index="2"><value>/(?:draft|scratch)/</value></constructor-arg>
+                   <constructor-arg index="3"><value>/pub/</value></constructor-arg>
+               </bean>
+           </list>
+       </constructor-arg>
+  </bean>
   <bean id="org.apache.jetspeed.portalsite.PortalSite" 
        name="portalSite"
        class="org.apache.jetspeed.portalsite.impl.PortalSiteImpl">         
        <constructor-arg index="0"><ref bean="pageManager"/></constructor-arg>
+       <constructor-arg index="1"><ref bean="portalSiteContentTypeMapper"/></constructor-arg>
   </bean>
     
 </beans>

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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -30,8 +30,10 @@
 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.DynamicPage;
 import org.apache.jetspeed.om.page.FragmentDefinition;
 import org.apache.jetspeed.om.page.Link;
+import org.apache.jetspeed.om.page.BaseConcretePageElement;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageTemplate;
 import org.apache.jetspeed.page.PageManager;
@@ -139,44 +141,11 @@
         Link rootLink0 = pageManager.getLink("/link0.link");        
         assertNotNull(rootLink0);
         assertEquals(rootFolder.getLink("link0.link"), rootLink0);        
+        DynamicPage docPage = pageManager.getDynamicPage("/docpage.dpsml");        
+        assertNotNull(docPage);
+        assertEquals(rootFolder.getDynamicPage("docpage.dpsml"), docPage);        
     }
 
-    public void testRelativeNavigations() throws Exception
-    {
-        JetspeedProfileLocator locator = new JetspeedProfileLocator();
-
-        locator.init(null, "/");
-        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);
-        assertEquals("/_hostname/dash/_user/joe,/_hostname/dash,/", profileView.getSearchPathsString());
-        
-        locator = new JetspeedProfileLocator();
-        locator.init(null, "/");
-        locator.add("hostname", true, false, "dash");
-        locator.add("user", true, false, "joe");
-        locator.add("navigation", false, true, "/");
-        locator.add("hostname", true, false, "dash");
-        locator.add("role", true, false, "user");
-        locator.add("page", false, false, "home");
-        profileView = new SiteView(pageManager, locator, false);
-        assertEquals("/_hostname/dash/_user/joe,/_hostname/dash/_role/user,/_hostname/dash,/", profileView.getSearchPathsString());
-  
-        locator = new JetspeedProfileLocator();
-        //locator.init(null, "/__subsite-root");
-        locator.init(null, "/");        
-        locator.add("navigation", false, true, "subsite-root");
-        locator.add("hostname", true, false, "localhost");
-        locator.add("user", true, false, "sublocal");
-        locator.add("navigation", false, true, "subsite-root");
-        locator.add("hostname", true, false, "localhost");
-        locator.add("role", true, false, "somerole");
-        locator.add("path", false, false, "home");
-        profileView = new SiteView(pageManager, locator, false);
-        assertEquals("/__subsite-root/_hostname/localhost/_user/sublocal,/__subsite-root/_hostname/localhost/_role/somerole,/__subsite-root/_hostname/localhost,/__subsite-root", profileView.getSearchPathsString());                       
-    }
-    
     /**
      * testSiteView - Test SiteView operation
      *
@@ -192,8 +161,9 @@
         assertEquals("/", rootFolderProxy.getName());
         assertEquals("root", rootFolderProxy.getTitle());
         assertEquals("/", extractFileSystemPathFromId(rootFolderProxy.getId()));
-        assertEquals(4, rootFolderProxy.getFolders().size());
+        assertEquals(5, rootFolderProxy.getFolders().size());
         Iterator foldersIter = rootFolderProxy.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());
@@ -208,6 +178,10 @@
         Iterator linksIter = rootFolderProxy.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("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());
@@ -222,6 +196,11 @@
         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());
@@ -270,7 +249,7 @@
         assertTrue(rootPageProxiesByPath.contains(rootPage0Proxy));
         List rootFolderProxiesByPath = baseView.getNodeProxies("/*/", null, false, false);
         assertNotNull(rootFolderProxiesByPath);
-        assertEquals(4,rootFolderProxiesByPath.size());
+        assertEquals(5,rootFolderProxiesByPath.size());
         assertTrue(rootFolderProxiesByPath.contains(rootFolder0Proxy));
         List folderPageProxiesByPath = baseView.getNodeProxies("*/p*[0-9].psml", rootFolderProxy, false, false);
         assertNotNull(folderPageProxiesByPath);
@@ -285,9 +264,10 @@
         assertEquals("/", rootFolderProxy.getName());
         assertEquals("user root", rootFolderProxy.getTitle());
         assertEquals("/_user/user", extractFileSystemPathFromId(rootFolderProxy.getId()));
-        assertEquals(4, rootFolderProxy.getFolders().size());
+        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());
@@ -466,6 +446,46 @@
     }
 
     /**
+     * testRelativeNavigations - Test SiteView search patch for navigation paths
+     *
+     * @throws Exception
+     */
+    public void testRelativeNavigations() throws Exception
+    {
+        JetspeedProfileLocator locator = new JetspeedProfileLocator();
+
+        locator.init(null, "/");
+        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);
+        assertEquals("/_hostname/dash/_user/joe,/_hostname/dash,/", profileView.getSearchPathsString());
+        
+        locator = new JetspeedProfileLocator();
+        locator.init(null, "/");
+        locator.add("hostname", true, false, "dash");
+        locator.add("user", true, false, "joe");
+        locator.add("navigation", false, true, "/");
+        locator.add("hostname", true, false, "dash");
+        locator.add("role", true, false, "user");
+        locator.add("page", false, false, "home");
+        profileView = new SiteView(pageManager, locator, false);
+        assertEquals("/_hostname/dash/_user/joe,/_hostname/dash/_role/user,/_hostname/dash,/", profileView.getSearchPathsString());
+  
+        locator = new JetspeedProfileLocator();
+        locator.init(null, "/");        
+        locator.add("navigation", false, true, "subsite-root");
+        locator.add("hostname", true, false, "localhost");
+        locator.add("user", true, false, "sublocal");
+        locator.add("navigation", false, true, "subsite-root");
+        locator.add("hostname", true, false, "localhost");
+        locator.add("role", true, false, "somerole");
+        locator.add("path", false, false, "home");
+        profileView = new SiteView(pageManager, locator, false);
+        assertEquals("/__subsite-root/_hostname/localhost/_user/sublocal,/__subsite-root/_hostname/localhost/_role/somerole,/__subsite-root/_hostname/localhost,/__subsite-root", profileView.getSearchPathsString());                       
+    }
+    
+    /**
      * testPortalSiteSetup - Test PortalSite test configuration
      *
      * @throws Exception
@@ -487,8 +507,9 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        Page requestPageProxy = requestContext.getPage();
+        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();
@@ -523,7 +544,7 @@
         assertNull(requestParentFolderProxy);
         NodeSet requestSiblingFolderProxies = requestContext.getSiblingFolders();
         assertNotNull(requestSiblingFolderProxies);
-        assertEquals(3, requestSiblingFolderProxies.size());
+        assertEquals(4, requestSiblingFolderProxies.size());
         assertNotNull(requestSiblingFolderProxies.get("folder0"));
         assertEquals("/folder0", extractFileSystemPathFromId(requestSiblingFolderProxies.get("folder0").getId()));
         assertNotNull(requestSiblingFolderProxies.get("folder1"));
@@ -561,8 +582,9 @@
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
         PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators);
         assertNotNull(requestContext);
-        Page requestPageProxy = requestContext.getPage();
+        BaseConcretePageElement requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
+        assertTrue(requestPageProxy instanceof Page);
         assertEquals("page2.psml", requestPageProxy.getName());
         assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
 
@@ -576,6 +598,7 @@
         assertNotNull(requestContext);
         requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
+        assertTrue(requestPageProxy instanceof Page);
         assertEquals("page2.psml", requestPageProxy.getName());
         assertEquals("/_user/user/page2.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
 
@@ -589,6 +612,7 @@
         assertNotNull(requestContext);
         requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
+        assertTrue(requestPageProxy instanceof Page);
         assertEquals("page1.psml", requestPageProxy.getName());
         assertEquals("/page1.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
 
@@ -602,6 +626,7 @@
         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()));
 
@@ -615,6 +640,7 @@
         assertNotNull(requestContext);
         requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
+        assertTrue(requestPageProxy instanceof Page);
         assertEquals("page0.psml", requestPageProxy.getName());
         assertEquals("/folder0/page0.psml", extractFileSystemPathFromId(requestPageProxy.getId()));
 
@@ -626,6 +652,7 @@
         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()));
     }
@@ -1335,6 +1362,83 @@
     }
 
     /**
+     * testPortalSiteContentRequests - Test PortalSite content request mapping and
+     *                                 dynamic page resolution
+     *
+     * @throws Exception
+     */
+    public void testPotalSiteContentRequests() throws Exception
+    {
+        assertNotNull(portalSite);
+        PortalSiteSessionContext sessionContext = portalSite.newSessionContext();
+        assertNotNull(sessionContext);
+        JetspeedProfileLocator locator = new JetspeedProfileLocator();
+        locator.init(null, "/document.doc");
+        locator.add("user", true, false, "user");
+        Map locators = new HashMap();
+        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()));
+
+        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);
+        assertNotNull(requestContext);
+        requestPageProxy = requestContext.getPage();
+        assertNotNull(requestPageProxy);
+        assertTrue(requestPageProxy instanceof DynamicPage);
+        assertEquals("docpage.dpsml", requestPageProxy.getName());
+        assertEquals("/contentfolder/docpage.dpsml", extractFileSystemPathFromId(requestPageProxy.getId()));
+
+        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);
+        assertNotNull(requestContext);
+        requestPageProxy = requestContext.getPage();
+        assertNotNull(requestPageProxy);
+        assertTrue(requestPageProxy instanceof DynamicPage);
+        assertEquals("contentpage.dpsml", requestPageProxy.getName());
+        assertEquals("/contentpage.dpsml", extractFileSystemPathFromId(requestPageProxy.getId()));
+
+        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);
+        assertNotNull(requestContext);
+        requestPageProxy = requestContext.getPage();
+        assertNotNull(requestPageProxy);
+        assertTrue(requestPageProxy instanceof DynamicPage);
+        assertEquals("docpage.dpsml", requestPageProxy.getName());
+        assertEquals("/docpage.dpsml", extractFileSystemPathFromId(requestPageProxy.getId()));
+
+        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);
+        assertNotNull(requestContext);
+        requestPageProxy = requestContext.getPage();
+        assertNotNull(requestPageProxy);
+        assertTrue(requestPageProxy instanceof DynamicPage);
+        assertEquals("docpage.dpsml", requestPageProxy.getName());
+        assertEquals("/contentfolder/pub/docpage.dpsml", extractFileSystemPathFromId(requestPageProxy.getId()));
+    }
+
+    /**
      * extractFileSystemPathFromId - utility to convert proxy ids to file system paths
      *
      * @param id proxy node id

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/docpage.dpsml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/docpage.dpsml?rev=891420&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/docpage.dpsml (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/docpage.dpsml Wed Dec 16 20:38:20 2009
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<dynamic-page id="docpage" content-type="doc-type"
+    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/psml.xsd">
+
+  <title>/contentfolder/docpage.dpsml</title>
+  <fragment id="fake" name="fake" type="fake"/>
+</dynamic-page>

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/pub/docpage.dpsml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/pub/docpage.dpsml?rev=891420&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/pub/docpage.dpsml (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentfolder/pub/docpage.dpsml Wed Dec 16 20:38:20 2009
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<dynamic-page id="docpage" content-type="doc-type"
+    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/psml.xsd">
+
+  <title>/contentfolder/pub/docpage.dpsml</title>
+  <fragment id="fake" name="fake" type="fake"/>
+</dynamic-page>

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentpage.dpsml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentpage.dpsml?rev=891420&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentpage.dpsml (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/contentpage.dpsml Wed Dec 16 20:38:20 2009
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<dynamic-page id="contentpage" content-type="*"
+    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/psml.xsd">
+
+  <title>/contentpage.dpsml</title>
+  <fragment id="fake" name="fake" type="fake"/>
+</dynamic-page>

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/docpage.dpsml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/docpage.dpsml?rev=891420&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/docpage.dpsml (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/webapp/WEB-INF/pages/docpage.dpsml Wed Dec 16 20:38:20 2009
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<dynamic-page id="docpage" content-type="doc-type"
+    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/psml.xsd">
+
+  <title>/docpage.dpsml</title>
+  <fragment id="fake" name="fake" type="fake"/>
+</dynamic-page>

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java?rev=891420&r1=891419&r2=891420&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java Wed Dec 16 20:38:20 2009
@@ -245,13 +245,13 @@
 
     public String getPageBasePath()
     {
-        if ( null == path || (1 == path.length() && '/' == path.charAt(0)) )
+        if (null == path || (1 == path.length() && '/' == path.charAt(0)))
         {
             return basePath;
         }
-        else if ( -1 != path.indexOf('/') && !path.endsWith("/") )
+        else if (-1 != path.indexOf('/'))
         {
-            return basePath + path.substring(0, path.lastIndexOf('/') );
+            return basePath + path.substring(0, path.lastIndexOf('/'));
         }
         else
         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/PathInfoEncodingPortalURL.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/PathInfoEncodingPortalURL.java?rev=891420&r1=891419&r2=891420&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/PathInfoEncodingPortalURL.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/PathInfoEncodingPortalURL.java Wed Dec 16 20:38:20 2009
@@ -82,6 +82,10 @@
                     buffer.append(token);
                 }
             }
+            if (pathInfo.endsWith("/"))
+            {
+                buffer.append("/");                
+            }
             if ( buffer.length() > 0 )
             {
                 path = buffer.toString();

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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -24,7 +24,9 @@
 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.DynamicPage;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.page.PageManager;
@@ -92,7 +94,7 @@
                 return success;
             }           
             int count = 0;
-            Page page = null;            
+            BaseConcretePageElement page = null;            
             String path = getActionParameter(requestContext, "path");
             if (path == null)
             {
@@ -102,11 +104,24 @@
             {
                 if (!method.equals("add"))
                 {
-                    page = pageManager.getPage(path);
+                    if (path.endsWith(Page.DOCUMENT_TYPE))
+                    {
+                        page = pageManager.getPage(path);
+                    }
+                    else if (path.endsWith(DynamicPage.DOCUMENT_TYPE))
+                    {
+                        page = pageManager.getDynamicPage(path);
+                    }
+                    else
+                    {
+                        success = false;
+                        resultMap.put(REASON, "Can't lookup page by document type: " + path);                
+                        return success;                        
+                    }
                 }
                 else
                 {
-                    if (pageManager.pageExists(path))
+                    if (pageManager.pageExists(path) || pageManager.dynamicPageExists(path))
                     {
                         success = false;
                         resultMap.put(REASON, "Can't create: Page already exists: " + path);                
@@ -170,22 +185,46 @@
             {            	
             	String destination = getActionParameter(requestContext, "destination");
             	String name = getActionParameter(requestContext, RESOURCE_NAME);
-            	destination = destination + Folder.PATH_SEPARATOR + name;           	
-            	Page newPage = pageManager.copyPage(page,destination);
-            	pageManager.updatePage(newPage);
+            	destination = destination + Folder.PATH_SEPARATOR + name;
+            	if (page instanceof Page)
+            	{
+            	    Page newPage = pageManager.copyPage((Page)page,destination);
+            	    pageManager.updatePage(newPage);
+            	}
+            	else if (page instanceof DynamicPage)
+            	{
+                    DynamicPage newPage = pageManager.copyDynamicPage((DynamicPage)page,destination);
+                    pageManager.updateDynamicPage(newPage);            	    
+            	}
             }
             else if (method.equals("move"))
             {            	
             	String destination = getActionParameter(requestContext, "destination");
             	String name = getActionParameter(requestContext, RESOURCE_NAME);            	
             	destination = destination + Folder.PATH_SEPARATOR + name;
-            	Page newPage = pageManager.copyPage(page, destination, true);
-            	pageManager.updatePage(newPage);
-            	pageManager.removePage(page);
+                if (page instanceof Page)
+                {
+                    Page newPage = pageManager.copyPage((Page)page, destination, true);
+                    pageManager.updatePage(newPage);
+                    pageManager.removePage((Page)page);
+                }
+                else if (page instanceof DynamicPage)
+                {
+                    DynamicPage newPage = pageManager.copyDynamicPage((DynamicPage)page, destination, true);
+                    pageManager.updateDynamicPage(newPage);
+                    pageManager.removeDynamicPage((DynamicPage)page);
+                }
             } 
             else if (method.equals("remove"))
             {
-                pageManager.removePage(page);
+                if (page instanceof Page)
+                {
+                    pageManager.removePage((Page)page);
+                }
+                else if (page instanceof DynamicPage)
+                {
+                    pageManager.removeDynamicPage((DynamicPage)page);
+                }
             }
             else if (method.equals("update-fragment"))
             {
@@ -238,7 +277,14 @@
             }
             if (count > 0)
             {
-                pageManager.updatePage(page);                
+                if (page instanceof Page)
+                {
+                    pageManager.updatePage((Page)page);
+                }
+                else
+                {
+                    pageManager.updateDynamicPage((DynamicPage)page);                    
+                }
             }                        
             resultMap.put("count", Integer.toString(count));
             resultMap.put(STATUS, status);
@@ -252,7 +298,7 @@
         return success;
     }
     
-    protected int updatePortletDecorator(RequestContext requestContext, Map resultMap, Page page, String fragmentId, String portletDecorator)
+    protected int updatePortletDecorator(RequestContext requestContext, Map resultMap, BaseConcretePageElement page, String fragmentId, String portletDecorator)
     {
     	int count = 0;
     	BaseFragmentElement fragment = page.getFragmentById(fragmentId);
@@ -264,7 +310,7 @@
     	return count;
     }
     
-    protected int updateFragment(RequestContext requestContext, Map resultMap, Page page, String fragmentId, String layout)
+    protected int updateFragment(RequestContext requestContext, Map resultMap, BaseConcretePageElement page, String fragmentId, String layout)
     {
         int count = 0;
         String sizes = getActionParameter(requestContext, SIZES);
@@ -298,7 +344,7 @@
         return count;
     }
 
-    protected int addFragment(RequestContext requestContext, Map resultMap, Page page, String parentFragmentId, String layout)
+    protected int addFragment(RequestContext requestContext, Map resultMap, BaseConcretePageElement page, String parentFragmentId, String layout)
     {
         int count = 0;
         String sizes = getActionParameter(requestContext, SIZES);
@@ -321,7 +367,7 @@
         return count;
     }
 
-    protected int removeFragment(RequestContext requestContext, Map resultMap, Page page, String fragmentId)
+    protected int removeFragment(RequestContext requestContext, Map resultMap, BaseConcretePageElement 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/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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -28,6 +28,7 @@
 import org.apache.jetspeed.decoration.PageActionAccess;
 import org.apache.jetspeed.layout.PageLayoutComponent;
 import org.apache.jetspeed.om.page.ContentPage;
+import org.apache.jetspeed.om.page.BaseConcretePageElement;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageTemplate;
 import org.apache.jetspeed.page.document.NodeNotFoundException;
@@ -164,6 +165,14 @@
     {
         try
         {
+            // save original request in the event it is modified below
+            // and some down stream content portlet needs it set
+            request.setAttribute(PortalReservedParameters.PATH_ATTRIBUTE, request.getPath());
+            if (log.isDebugEnabled())
+            {
+                log.debug("Request path: "+request.getPath());
+            }
+            
             // get profiler locators for request subject/principal using the profiler
             Subject subject = request.getSubject();
             if (subject == null)
@@ -255,14 +264,19 @@
                 // as returned by the PageManager component; accessing
                 // the managed page here selects the current page for the
                 // request
-                Page managedPage = requestContext.getManagedPage();
+                BaseConcretePageElement managedPage = requestContext.getManagedPage();
                 PageTemplate managedPageTemplate = requestContext.getManagedPageTemplate();
                 Map managedFragmentDefinitions = requestContext.getManagedFragmentDefinitions();
                 ContentPage contentPage = pageLayoutComponent.newContentPage(managedPage, managedPageTemplate, managedFragmentDefinitions);
                 request.setPage(contentPage);
                 request.setProfileLocators(requestContext.getLocators());
                 
-                request.setAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE,getPageActionAccess(request));                
+                request.setAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE,getPageActionAccess(request));
+
+                if (log.isDebugEnabled())
+                {
+                    log.debug("Page path: "+contentPage.getPath());
+                }
             }
 
             // continue

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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -43,7 +43,7 @@
 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.Page;
+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;
@@ -584,7 +584,7 @@
             }               
             PortalSiteSessionContext sessionContext = (PortalSiteSessionContext)getSessionAttribute(ProfilerValveImpl.PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY);
             PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, true, true);
-            Page managedPage = requestContext.getManagedPage();
+            BaseConcretePageElement managedPage = requestContext.getManagedPage();
             PageTemplate managedPageTemplate = requestContext.getManagedPageTemplate();
             Map managedFragmentDefinitions = requestContext.getManagedFragmentDefinitions();
             ContentPage cpage = pageLayoutComponent.newContentPage(managedPage, managedPageTemplate, managedFragmentDefinitions);

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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -141,10 +141,23 @@
   </bean>
 
   <!-- PortalSite -->
+  <bean id="org.apache.jetspeed.portalsite.PortalSiteContentTypeMapper" 
+       name="portalSiteContentTypeMapper"
+       class="org.apache.jetspeed.portalsite.impl.PortalSiteContentTypeMapperImpl">         
+       <constructor-arg index="0">
+           <list>
+               <bean class="org.apache.jetspeed.portalsite.impl.ContentTypeMapping">
+                   <constructor-arg index="0"><value>\w[.](\w+)&#36;</value></constructor-arg> <!-- use &#36; for '$' -->
+                   <constructor-arg index="1"><value>&#36;1</value></constructor-arg> <!-- use &#36; for '$' -->
+               </bean>
+           </list>
+       </constructor-arg>
+  </bean>
   <bean id="org.apache.jetspeed.portalsite.PortalSite" 
        name="portalSite"
        class="org.apache.jetspeed.portalsite.impl.PortalSiteImpl">         
        <constructor-arg index="0"><ref bean="pageManager"/></constructor-arg>
+       <constructor-arg index="1"><ref bean="portalSiteContentTypeMapper"/></constructor-arg>
   </bean>
 
     <bean id="IdGenerator" class="org.apache.jetspeed.idgenerator.JetspeedIdGenerator" init-method="start" destroy-method="stop">

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java?rev=891420&r1=891419&r2=891420&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java Wed Dec 16 20:38:20 2009
@@ -733,7 +733,7 @@
         {
             ProfileLocator locator = (ProfileLocator) beanFactory.getBean(
                     this.locatorBean, ProfileLocator.class);
-            locator.init(this, context.getPath());
+            locator.init(this, context.getPath(), ((context.getRequest() != null) ? context.getRequest().getServerName() : null));
             return locator;
         } catch (Exception e)
         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/PathSessionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/PathSessionResolver.java?rev=891420&r1=891419&r2=891420&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/PathSessionResolver.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/PathSessionResolver.java Wed Dec 16 20:38:20 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.jetspeed.profiler.rules.impl;
 
-import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.profiler.rules.RuleCriterion;
 import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
@@ -45,8 +44,6 @@
         else
         {
             path = context.getPath();
-            if (path != null)
-                path = mapPath(context, path);            
         }
         
         if ((path == null) || path.equals("/"))
@@ -61,37 +58,6 @@
         return path;            
     }
     
-    private String mapPath(RequestContext context, String originalPath)
-    {
-        String path = originalPath;
-        if (path.endsWith(".psml"))
-        {
-            return originalPath;
-        }
-        for (int ix=0; ix < REGEX_MAP.length; ix++)
-        {
-            if (path.matches(REGEX_MAP[ix][0]))
-            {
-                path = REGEX_MAP[ix][1];
-                context.setPath(path);
-                context.setAttribute(PortalReservedParameters.PATH_ATTRIBUTE, originalPath);                
-                break;
-            }            
-        }
-        return path;
-    }
-    
-    // TODO: configure this information externally and live
-    static String[][] REGEX_MAP =
-    {     
-        {".*\\.(...|....)", "/Public/content.psml"}
-//        {".*\\.html", "/Public/content.psml"},       
-//        {".*\\.pdf", "/Public/content.psml"},        
-//        {"/_content.*", "/Public/content.psml"}
-//        {"/data/*", "/Public/content2.psml"},
-    };
-     
-
     /* (non-Javadoc)
      * @see org.apache.jetspeed.profiler.rules.RuleCriterionResolver#isControl()
      */

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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -20,7 +20,7 @@
 
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.ContentPage;
-import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.om.page.BaseConcretePageElement;
 import org.apache.jetspeed.om.page.PageTemplate;
 
 /**
@@ -136,7 +136,7 @@
      *                            by page and/or page template
      * @return new content page
      */
-    ContentPage newContentPage(Page page, PageTemplate pageTemplate, Map fragmentDefinitions);
+    ContentPage newContentPage(BaseConcretePageElement page, PageTemplate pageTemplate, Map fragmentDefinitions);
     
     /**
      * Create a new sibling folder with specified configuration and

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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -192,7 +192,7 @@
      * 
      * @return persistent page or null
      */
-    Page getPage();
+    BaseConcretePageElement getPage();
     
     /**
      * Access underlying concrete persistent page template or

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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -28,18 +28,20 @@
 public interface DynamicPage extends BaseConcretePageElement, Serializable
 {
     String DOCUMENT_TYPE = ".dpsml";
+    
+    String WILDCARD_CONTENT_TYPE = "*";
 
     /**
-     * Get the page type name that applies to this page.
+     * Get the content type name that applies to this page.
      *
      * @return the page type name name
      */
-    String getPageType();
+    String getContentType();
 
     /**
-     * Set the page type name for this page.
+     * Set the content type name for this page.
      *
-     * @param pageType the name of the page type for the page
+     * @param contentType the name of the content type for the page
      */
-    void setPageType(String pageType);
+    void setContentType(String contentType);
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSite.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSite.java?rev=891420&r1=891419&r2=891420&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSite.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSite.java Wed Dec 16 20:38:20 2009
@@ -39,4 +39,11 @@
      * @return PageManager instance
      */
     PageManager getPageManager();
+
+    /**
+     * getContentTypeMapper - return PortalSiteContentTypeMapper component instance
+     *
+     * @return PortalSiteContentTypeMapper instance
+     */
+    PortalSiteContentTypeMapper getContentTypeMapper();
 }

Added: 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=891420&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteContentTypeMapper.java (added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteContentTypeMapper.java Wed Dec 16 20:38:20 2009
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+package org.apache.jetspeed.portalsite;
+
+/**
+ * This interface defines the content type mapper component
+ * for use with the portal-site component.
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public interface PortalSiteContentTypeMapper
+{
+    public static final String PAGE_SYSTEM_TYPE = "portal-page";
+    public static final String FOLDER_SYSTEM_TYPE = "portal-folder";
+    
+    /**
+     * mapSystemType - map request to system type; implementation should
+     *                 return null if type is not known.
+     *
+     * @param requestPath raw portal request path
+     * @return mapped system type string or null
+     */
+    String mapSystemType(String requestPath);
+
+    /**
+     * mapContentType - map request to content type used to select dynamic
+     *                  pages; implementation should return null to handle
+     *                  request as page and folder lookup.
+     *
+     * @param requestPath raw portal request path
+     * @return mapped content type string or null
+     */
+    String mapContentType(String requestPath);
+
+    /**
+     * mapRequestPath - map content request path given previously mapped content
+     *                  type; implementation should return null to indicate no
+     *                  mapping is available.
+     *
+     * @param serverName request server name
+     * @param contentType mapped content type
+     * @param requestPath raw portal request path
+     * @return mapped request path or null
+     */
+    String mapRequestPath(String serverName, String contentType, String requestPath);
+}

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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -20,7 +20,7 @@
 import java.util.Set;
 
 import org.apache.jetspeed.om.folder.Folder;
-import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.om.page.BaseConcretePageElement;
 import org.apache.jetspeed.om.page.PageTemplate;
 import org.apache.jetspeed.page.document.NodeNotFoundException;
 import org.apache.jetspeed.page.document.NodeSet;
@@ -55,7 +55,7 @@
      * @throws NodeNotFoundException if page not found
      * @throws SecurityException if page view access not granted
      */
-    Page getManagedPage() throws NodeNotFoundException;
+    BaseConcretePageElement getManagedPage() throws NodeNotFoundException;
 
     /**
      * getManagedPageTemplate - get request profiled concrete page 
@@ -86,7 +86,7 @@
      * @throws NodeNotFoundException if page not found
      * @throws SecurityException if page view access not granted
      */
-    Page getPage() throws NodeNotFoundException;
+    BaseConcretePageElement getPage() throws NodeNotFoundException;
 
     /**
      * getPageTemplate - get page template proxy for request profiled 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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -80,6 +80,13 @@
     PageManager getPageManager();
 
     /**
+     * getContentTypeMapper - return PortalSiteContentTypeMapper component instance
+     *
+     * @return PortalSiteContentTypeMapper instance
+     */
+    PortalSiteContentTypeMapper getContentTypeMapper();
+
+    /**
      * isValid - return flag indicating whether this context instance
      *           is valid or if it is stale after being persisted and
      *           reloaded as session state

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/ProfileLocator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/ProfileLocator.java?rev=891420&r1=891419&r2=891420&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/ProfileLocator.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/ProfileLocator.java Wed Dec 16 20:38:20 2009
@@ -55,6 +55,15 @@
     void init(Profiler profiler, String requestPath);
 
     /**
+     * Initialize this page context.
+     *
+     * @param profiler The profiler initializing this locator.
+     * @param requestPath The request path used to create this locator.
+     * @param requestServerName The request server name used to create this locator.
+     */
+    void init(Profiler profiler, String requestPath, String requestServerName);
+
+    /**
      * Get an iterator over the locator's properties.
      * Elements are returned as @link ProfileLocatorProperty array. 
      *  
@@ -164,4 +173,12 @@
      * @return The request path.
      */
     String getRequestPath();
+    
+    /**
+     * <p>Retain the request server name to support additional page location mapping
+     * not part of the profiler rule criterion.</p>
+     * 
+     * @return The request server name.
+     */
+    String getRequestServerName();
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/ddl-schema/phase2-schema.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/ddl-schema/phase2-schema.xml?rev=891420&r1=891419&r2=891420&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/ddl-schema/phase2-schema.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/ddl-schema/phase2-schema.xml Wed Dec 16 20:38:20 2009
@@ -186,7 +186,7 @@
         <column name="CLASS_NAME" required="true" size="100" type="VARCHAR"/>
         <column name="PARENT_ID" type="INTEGER" required="true"/>
         <column name="PATH" required="true" size="240" type="VARCHAR"/>
-        <column name="PAGE_TYPE" size="40" type="VARCHAR"/>
+        <column name="CONTENT_TYPE" size="40" type="VARCHAR"/>
         <column name="NAME" required="true" size="80" type="VARCHAR"/>
         <column name="VERSION" size="40" type="VARCHAR"/>
         <column name="TITLE" size="100" type="VARCHAR"/>

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=891420&r1=891419&r2=891420&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 Wed Dec 16 20:38:20 2009
@@ -379,12 +379,39 @@
   </bean>
 
   <!-- PortalSite -->
+  <bean id="org.apache.jetspeed.portalsite.PortalSiteContentTypeMapper" name="portalSiteContentTypeMapper"
+    class="org.apache.jetspeed.portalsite.impl.PortalSiteContentTypeMapperImpl">         
+    <meta key="j2:cat" value="default" />
+    <constructor-arg index="0">
+      <list>
+        <bean class="org.apache.jetspeed.portalsite.impl.ContentTypeMapping">
+          <constructor-arg index="0">
+            <value>^/content/.*\w[.](\w+)&#36;</value> <!-- use &#36; for '$' -->
+          </constructor-arg>
+          <constructor-arg index="1">
+            <value>&#36;1</value> <!-- use &#36; for '$' -->
+          </constructor-arg>
+        </bean>
+        <bean class="org.apache.jetspeed.portalsite.impl.ContentTypeMapping">
+          <constructor-arg index="0">
+            <value>^/content/</value>
+          </constructor-arg>
+          <constructor-arg index="1">
+            <value>html</value>
+          </constructor-arg>
+        </bean>
+      </list>
+    </constructor-arg>
+  </bean>
   <bean id="org.apache.jetspeed.portalsite.PortalSite" name="portalSite"
     class="org.apache.jetspeed.portalsite.impl.PortalSiteImpl">
     <meta key="j2:cat" value="default" />
     <constructor-arg index="0">
       <ref bean="org.apache.jetspeed.page.PageManager" />
     </constructor-arg>
+    <constructor-arg index="1">
+      <ref bean="org.apache.jetspeed.portalsite.PortalSiteContentTypeMapper"/>
+    </constructor-arg>
   </bean>
 
   <!-- PageSerializer, source: xmlPageManager, dest: dbPageMmanager -->



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