portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r924022 [1/2] - in /portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE: applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/ components/por...
Date Tue, 16 Mar 2010 22:03:51 GMT
Author: rwatler
Date: Tue Mar 16 22:03:50 2010
New Revision: 924022

URL: http://svn.apache.org/viewvc?rev=924022&view=rev
Log:
Portal Site Enhancements to support subsite user registration and PSML access
-----------------------------------------------------------------------------
- implement portal site site view method to return fully qualified PageManager PSML path
  to user folder
- implement portal site site view method to return fully qualified PageManager PSML path
  to portal root base folder
- remove current user principal access code, (Subject, SubjectHelper, etc.), from portal
  site component to allow standalone PortalSiteSessionContext and PortalSiteRequestContext
  instances used to register new portal users in subsite   
- implement new portal admin registerUser API variant that accepts a locale and hostname
  to compute user home folder paths instead of hardcoded subsite paths


Modified:
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteRequestContextImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteViewSearchPath.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/test/org/apache/jetspeed/portalsite/TestPortalSite.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/test/org/apache/jetspeed/administration/TestPortalAdministrationImpl.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalAdministration.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/portalsite/PortalSiteRequestContext.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/portalsite/PortalSiteSessionContext.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/src/webapp/WEB-INF/assembly/administration.xml

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java Tue Mar 16 22:03:50 2010
@@ -1,9 +1,9 @@
 /*
- * 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
+ * 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
@@ -721,7 +721,8 @@ public class UserRegistrationPortlet ext
                         (String) userInfo.get("password"), prefRoles,
                         prefGroups, userAttributes, // note use of only
                                                         // PLT.D values here.
-                        profileRules, template, subsiteRootFolder); 
+                        profileRules, template, subsiteRootFolder,
+                        actionRequest.getLocale(), actionRequest.getServerName());
                 
                 String urlGUID = ForgottenPasswordPortlet.makeGUID(
                         (String) userInfo.get("user.name"), (String) userInfo

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteRequestContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteRequestContextImpl.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteRequestContextImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteRequestContextImpl.java Tue Mar 16 22:03:50 2010
@@ -57,6 +57,11 @@ public class PortalSiteRequestContextImp
     private Map requestProfileLocators;
 
     /**
+     * requestUserPrincipal - request user principal name
+     */
+    private String requestUserPrincipal;
+
+    /**
      * requestFallback - flag indicating whether request should fallback to root folder
      *                   if locators do not select a page or access is forbidden
      */
@@ -124,16 +129,18 @@ public class PortalSiteRequestContextImp
      *
      * @param sessionContext session context
      * @param requestProfileLocators request profile locators
+     * @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
      */
-    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators,
+    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators, String requestUserPrincipal,
                                         boolean requestFallback, boolean useHistory)
     {
         this.sessionContext = sessionContext;
         this.requestProfileLocators = requestProfileLocators;
+        this.requestUserPrincipal = requestUserPrincipal;
         this.requestFallback = requestFallback;
         this.useHistory = useHistory;
     }
@@ -143,13 +150,14 @@ public class PortalSiteRequestContextImp
      *
      * @param sessionContext session context
      * @param requestProfileLocators request profile locators
+     * @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
      */
-    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators,
+    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators, String requestUserPrincipal,
                                         boolean requestFallback)
     {
-        this(sessionContext, requestProfileLocators, requestFallback, true);
+        this(sessionContext, requestProfileLocators, requestUserPrincipal, requestFallback, true);
     }
 
     /**
@@ -157,10 +165,11 @@ public class PortalSiteRequestContextImp
      *
      * @param sessionContext session context
      * @param requestProfileLocators request profile locators
+     * @param requestUserPrincipal request user principal
      */
-    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators)
+    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators, String requestUserPrincipal)
     {
-        this(sessionContext, requestProfileLocators, true, true);
+        this(sessionContext, requestProfileLocators, requestUserPrincipal, true, true);
     }
 
     /**
@@ -210,7 +219,7 @@ public class PortalSiteRequestContextImp
         // cached in this context
         if (requestPage == null)
         {
-            requestPage = sessionContext.selectRequestPage(requestProfileLocators, requestFallback, useHistory);            
+            requestPage = sessionContext.selectRequestPage(requestProfileLocators, requestUserPrincipal, requestFallback, useHistory);            
         }
         return requestPage;
     }
@@ -341,7 +350,7 @@ public class PortalSiteRequestContextImp
         // cached in this context
         if (requestRootFolder == null)
         {
-            requestRootFolder = sessionContext.getRequestRootFolder(requestProfileLocators);
+            requestRootFolder = sessionContext.getRequestRootFolder(requestProfileLocators, requestUserPrincipal);
         }
         return requestRootFolder;
     }
@@ -529,6 +538,26 @@ public class PortalSiteRequestContextImp
         }
         return null;
     }
+    
+    /**
+     * getUserFolderPath - return primary concrete root user folder path
+     *
+     * @return user folder path or null
+     */
+    public String getUserFolderPath()
+    {
+        return sessionContext.getUserFolderPath(requestProfileLocators, requestUserPrincipal);
+    }
+     
+    /**
+     * getBaseFolderPath - return primary concrete root base folder path
+     *
+     * @return base folder path or null
+     */
+    public String getBaseFolderPath()
+    {
+        return sessionContext.getBaseFolderPath(requestProfileLocators, requestUserPrincipal);
+    }
 
     /**
      * filterHiddenNodes - utility to filter hidden node proxies out of node sets

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java Tue Mar 16 22:03:50 2010
@@ -148,45 +148,49 @@ public class PortalSiteSessionContextImp
      * newRequestContext - create a new request context instance with fallback and history
      *
      * @param requestProfileLocators request profile locators
+     * @param requestUserPrincipal request user principal
      * @return new request context instance
      */
-    public PortalSiteRequestContext newRequestContext(Map requestProfileLocators)
+    public PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal)
     {
-        return new PortalSiteRequestContextImpl(this, requestProfileLocators, true, true);
+        return new PortalSiteRequestContextImpl(this, requestProfileLocators, requestUserPrincipal, true, true);
     }
 
     /**
      * newRequestContext - create a new request context instance with history
      *
      * @param requestProfileLocators request profile locators
+     * @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
      * @return new request context instance
      */
-    public PortalSiteRequestContext newRequestContext(Map requestProfileLocators, boolean requestFallback)
+    public PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback)
     {
-        return new PortalSiteRequestContextImpl(this, requestProfileLocators, requestFallback, true);
+        return new PortalSiteRequestContextImpl(this, requestProfileLocators, requestUserPrincipal, requestFallback, true);
     }
 
     /**
      * newRequestContext - create a new request context instance
      *
      * @param requestProfileLocators request profile locators
+     * @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
      * @return new request context instance
      */
-    public PortalSiteRequestContext newRequestContext(Map requestProfileLocators, boolean requestFallback, boolean useHistory)
+    public PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory)
     {
-        return new PortalSiteRequestContextImpl(this, requestProfileLocators, requestFallback, useHistory);
+        return new PortalSiteRequestContextImpl(this, requestProfileLocators, requestUserPrincipal, requestFallback, useHistory);
     }
 
     /**
      * selectRequestPage - select page proxy for request given profile locators
      *
      * @param requestProfileLocators map of profile locators for request
+     * @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
@@ -195,10 +199,10 @@ public class PortalSiteSessionContextImp
      * @throws NodeNotFoundException if not found
      * @throws SecurityException if view access not granted
      */
-    public Page selectRequestPage(Map requestProfileLocators, boolean requestFallback, boolean useHistory) throws NodeNotFoundException
+    public Page selectRequestPage(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory) throws NodeNotFoundException
     {
         // validate and update session profile locators if modified
-        if (updateSessionProfileLocators(requestProfileLocators))
+        if (updateSessionProfileLocators(requestProfileLocators, requestUserPrincipal))
         {
             // extract page request path from the locators
             String requestPath = Folder.PATH_SEPARATOR;
@@ -664,14 +668,15 @@ public class PortalSiteSessionContextImp
      * getRequestRootFolder - select root folder proxy for given profile locators
      *
      * @param requestProfileLocators map of profile locators for request
+     * @param requestUserPrincipal request user principal
      * @return root folder proxy for request
      * @throws NodeNotFoundException if not found
      * @throws SecurityException if view access not granted
      */
-    public Folder getRequestRootFolder(Map requestProfileLocators) throws NodeNotFoundException
+    public Folder getRequestRootFolder(Map requestProfileLocators, String requestUserPrincipal) throws NodeNotFoundException
     {
         // validate and update session profile locators if modified
-        if (updateSessionProfileLocators(requestProfileLocators))
+        if (updateSessionProfileLocators(requestProfileLocators, requestUserPrincipal))
         {
             // valid site view required from session profile locators
             SiteView view = getSiteView();
@@ -691,37 +696,14 @@ public class PortalSiteSessionContextImp
      *                                session profile locators
      *
      * @param requestProfileLocators map of profile locators for request
+     * @param requestUserPrincipal request user principal
      * @return profile locators validation flag
      */
-    private boolean updateSessionProfileLocators(Map requestProfileLocators)
+    private boolean updateSessionProfileLocators(Map requestProfileLocators, String requestUserPrincipal)
     {
         // request profile locators are required
         if ((requestProfileLocators != null) && !requestProfileLocators.isEmpty())
         {
-            // get current user principal; ignore derivative
-            // changes in role and group principals
-            String currentUserPrincipal = null;
-            Subject subject = JSSubject.getSubject(AccessController.getContext());
-            if (subject != null)
-            {
-                Iterator principals = subject.getPrincipals().iterator();
-                while (principals.hasNext())
-                {
-                    Principal principal = (Principal) principals.next();
-                    if (principal instanceof UserPrincipal)
-                    {
-                        if (currentUserPrincipal == null)
-                        {
-                            currentUserPrincipal = principal.getName();
-                        }
-                        else
-                        {
-                            currentUserPrincipal += "|" + principal.getName();
-                        }
-                    }
-                }
-            }
-
             // detect stale session, modification of user
             // principal, or changed profile locators for
             // this session context
@@ -730,8 +712,8 @@ public class PortalSiteSessionContextImp
             boolean updated = false;
             synchronized (this)
             {
-                userUpdate = (((userPrincipal == null) && (currentUserPrincipal != null)) ||
-                              ((userPrincipal != null) && !userPrincipal.equals(currentUserPrincipal)));
+                userUpdate = (((userPrincipal == null) && (requestUserPrincipal != null)) ||
+                              ((userPrincipal != null) && !userPrincipal.equals(requestUserPrincipal)));
                 locatorsUpdate = ((profileLocators == null) ||
                                   !locatorsEquals(profileLocators, requestProfileLocators));
                 if (stale || userUpdate || locatorsUpdate)
@@ -741,7 +723,7 @@ public class PortalSiteSessionContextImp
                     // and stale flag
                     clearSessionProfileLocators();
                     profileLocators = requestProfileLocators;
-                    userPrincipal = currentUserPrincipal;
+                    userPrincipal = requestUserPrincipal;
                     updated = true;
                 }
                 locatorsLastUpdateCheck = System.currentTimeMillis();
@@ -775,7 +757,7 @@ public class PortalSiteSessionContextImp
                 {
                     debug.append("Updated stale");
                 }
-                debug.append(" context: user=" + currentUserPrincipal + ", profileLocators=(");
+                debug.append(" context: user=" + requestUserPrincipal + ", profileLocators=(");
                 if (requestProfileLocators != null)
                 {
                     boolean firstEntry = true;
@@ -990,6 +972,44 @@ public class PortalSiteSessionContextImp
     }
 
     /**
+     * getUserFolderPath - return primary concrete root user folder path
+     *
+     * @param requestProfileLocators map of profile locators for request
+     * @param requestUserPrincipal request user principal
+     * @return user folder path or null
+     */
+    public String getUserFolderPath(Map requestProfileLocators, String requestUserPrincipal)
+    {
+        // validate and update session profile locators if modified
+        if (updateSessionProfileLocators(requestProfileLocators, requestUserPrincipal))
+        {
+            // return user folder path in site view
+            SiteView view = getSiteView();
+            return ((view != null) ? view.getUserFolderPath() : null);
+        }
+        return null;
+    }
+
+    /**
+     * getBaseFolderPath - return primary concrete root base folder path
+     *
+     * @param requestProfileLocators map of profile locators for request
+     * @param requestUserPrincipal request user principal
+     * @return base folder path or null
+     */
+    public String getBaseFolderPath(Map requestProfileLocators, String requestUserPrincipal)
+    {
+        // validate and update session profile locators if modified
+        if (updateSessionProfileLocators(requestProfileLocators, requestUserPrincipal))
+        {
+            // return base folder path in site view
+            SiteView view = getSiteView();
+            return ((view != null) ? view.getBaseFolderPath() : null);
+        }
+        return null;
+    }
+
+    /**
      * getMenuDefinitionLocatorCache - get menu definition locators cache
      *                                 for absolute menus
      *

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java Tue Mar 16 22:03:50 2010
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -118,6 +119,16 @@ public class SiteView
     private Folder rootFolderProxy;
 
     /**
+     * userSearchPath - primary user search path
+     */
+    private SiteViewSearchPath userSearchPath;
+
+    /**
+     * baseSearchPath - base search path
+     */
+    private SiteViewSearchPath baseSearchPath;
+
+    /**
      * SiteView - validating constructor
      *
      * @param pageManager PageManager component instance
@@ -131,10 +142,12 @@ public class SiteView
         {
             // validate search path format and existence
             this.searchPaths = new ArrayList(searchPaths.size());
+            List allSearchPaths = new ArrayList(searchPaths.size());
             StringBuffer searchPathsStringBuffer = new StringBuffer();
             Iterator pathsIter = searchPaths.iterator();
             while (pathsIter.hasNext())
             {
+                // construct search paths if necessary
                 Object pathObject = pathsIter.next();
                 if (!(pathObject instanceof SiteViewSearchPath))
                 {
@@ -145,6 +158,9 @@ public class SiteView
                     }
                 }
                 SiteViewSearchPath searchPath = (SiteViewSearchPath)pathObject;
+                allSearchPaths.add(searchPath);
+
+                // validate and filter final search paths
                 if (this.searchPaths.indexOf(searchPath) == -1)
                 {
                     try
@@ -182,20 +198,103 @@ public class SiteView
             // save search paths as string
             if (this.searchPaths.isEmpty())
             {
-                this.searchPaths.add(new SiteViewSearchPath(ProfileLocator.PAGE_LOCATOR, Folder.PATH_SEPARATOR));
+                this.searchPaths.add(new SiteViewSearchPath(ProfileLocator.PAGE_LOCATOR));
                 this.searchPathsString = Folder.PATH_SEPARATOR;
             }
             else
             {
                 this.searchPathsString = searchPathsStringBuffer.toString();
             }
+
+            // find primary user search path, (may not exist: search against all paths) 
+            Iterator searchPathsIter = allSearchPaths.iterator();
+            while (searchPathsIter.hasNext())
+            {
+                SiteViewSearchPath searchPath = (SiteViewSearchPath)searchPathsIter.next();
+                if (searchPath.isUserPath())
+                {
+                    this.userSearchPath = searchPath;
+                    break;
+                }
+            }
+
+            // find base search path, (may not exist: search against all paths)
+            if (allSearchPaths.size() == 1)
+            {
+                // single non-principal search path is the base
+                // search path
+                SiteViewSearchPath searchPath = (SiteViewSearchPath)allSearchPaths.get(0);
+                if (!searchPath.isPrincipalPath())
+                {
+                    this.baseSearchPath = searchPath;
+                }
+            }
+            else
+            {
+                // scan for the search path that are common to all
+                // more specific search paths starting at the least
+                // specific search path
+                ListIterator baseSearchPathsIter = allSearchPaths.listIterator(allSearchPaths.size());
+                while (baseSearchPathsIter.hasPrevious())
+                {
+                    SiteViewSearchPath searchPath = (SiteViewSearchPath)baseSearchPathsIter.previous();
+                    int scanSearchPathsIndex = baseSearchPathsIter.previousIndex();
+                    if (scanSearchPathsIndex == -1)
+                    {
+                        // most specific non-principal search path is the
+                        // base path since all less specific search paths are
+                        // part of the current search path
+                        if (!searchPath.isPrincipalPath())
+                        {
+                            this.baseSearchPath = searchPath;
+                        }
+                        break;
+                    }
+                    else if (!searchPath.isPrincipalPath() && ((this.baseSearchPath == null) || (searchPath.getPathDepth() > this.baseSearchPath.getPathDepth())))
+                    {
+                        // scan more specific search paths to test whether the
+                        // current search path is common to all
+                        boolean isCommonSearchPath = true;
+                        ListIterator scanBaseSearchPathsIter = allSearchPaths.listIterator(scanSearchPathsIndex+1);
+                        while (scanBaseSearchPathsIter.hasPrevious())
+                        {
+                            SiteViewSearchPath scanSearchPath = (SiteViewSearchPath)scanBaseSearchPathsIter.previous();
+                            if (!scanSearchPath.toString().startsWith(searchPath.toString()))
+                            {
+                                isCommonSearchPath = false;
+                                break;
+                            }
+                        }
+                        // if all more specific search paths are start with
+                        // the current search path, the current search path is
+                        // a base search path candidate: continue scan for a
+                        // more specific common search path; otherwise, the
+                        // last base search path is the most common possible: done 
+                        if (isCommonSearchPath)
+                        {
+                            this.baseSearchPath = searchPath;
+                            continue;
+                        }
+                        else
+                        {
+                            break;
+                        }
+                    }
+                    else
+                    {
+                        // longest non-principal common base search path found: done
+                        break;
+                    }
+                }
+            }
         }
         else
         {
             // root search path with no aggregation
             this.searchPaths = new ArrayList(1);
-            this.searchPaths.add(new SiteViewSearchPath(ProfileLocator.PAGE_LOCATOR, Folder.PATH_SEPARATOR));
+            this.searchPaths.add(new SiteViewSearchPath(ProfileLocator.PAGE_LOCATOR));
             this.searchPathsString = Folder.PATH_SEPARATOR;
+            this.baseSearchPath = (SiteViewSearchPath)this.searchPaths.get(0);
         }
     }
 
@@ -330,6 +429,84 @@ public class SiteView
     }
     
     /**
+     * StringBuffer implementation for constructing search paths.
+     */
+    private static class PathStringBuffer
+    {
+        private StringBuffer stringBuffer;
+        private boolean userPath;
+        private boolean principalPath;
+        private int pathDepth;
+        
+        public PathStringBuffer()
+        {
+            this.stringBuffer = new StringBuffer();            
+        }
+        
+        public PathStringBuffer(String s)
+        {
+            this.stringBuffer = new StringBuffer(s);
+        }
+
+        public PathStringBuffer append(String s)
+        {
+            stringBuffer.append(s);
+            return this;
+        }
+
+        public PathStringBuffer append(char c)
+        {
+            stringBuffer.append(c);
+            return this;
+        }
+
+        public int length()
+        {
+            return stringBuffer.length();
+        }
+
+        public void setLength(int length)
+        {
+            stringBuffer.setLength(length);
+        }
+
+        public String toString()
+        {
+            return stringBuffer.toString();
+        }
+
+        public boolean isUserPath()
+        {
+            return userPath;
+        }
+
+        public void setUserPath(boolean userPath)
+        {
+            this.userPath = userPath;
+        }
+
+        public boolean isPrincipalPath()
+        {
+            return principalPath;
+        }
+
+        public void setPrincipalPath(boolean principalPath)
+        {
+            this.principalPath = principalPath;
+        }
+
+        public int getPathDepth()
+        {
+            return pathDepth;
+        }
+
+        public void setPathDepth(int pathDepth)
+        {
+            this.pathDepth = pathDepth;
+        }
+    }
+
+    /**
      * mergeSearchPathList - append search paths from profile locator
      *
      * @param locatorName name of profile locator
@@ -357,7 +534,7 @@ public class SiteView
             // initialize path construction variables
             String pathRoot = Folder.PATH_SEPARATOR;
             List paths = new ArrayList(8);
-            paths.add(new StringBuffer(pathRoot));
+            paths.add(new PathStringBuffer(pathRoot));
             int pathDepth = 0;
             int lastPathsCount = 0;
             String lastPropertyName = null;
@@ -384,6 +561,7 @@ public class SiteView
                         // and contains proper path prefix for each subsite
                         // path folder name
                         pathRoot = properties[i].getValue();
+                        int pathRootDepth = 0;
                         if (!pathRoot.startsWith(Folder.PATH_SEPARATOR))
                         {
                             pathRoot = Folder.PATH_SEPARATOR + pathRoot; 
@@ -401,15 +579,20 @@ public class SiteView
                                 {
                                     pathRoot = pathRoot.substring(0, folderIndex) + Folder.RESERVED_SUBSITE_FOLDER_PREFIX + pathRoot.substring(folderIndex);
                                 }
+                                
                                 folderIndex = pathRoot.indexOf(Folder.PATH_SEPARATOR, folderIndex) + 1;
                             }
                             while ((folderIndex != -1) && (folderIndex != pathRoot.length()));
                         }
+
+                        // construct prefix path root
+                        PathStringBuffer path = new PathStringBuffer(pathRoot);
+                        path.setPathDepth(pathRootDepth);
                         
                         // reset locator paths using new prefix
                         pathDepth = 0;
                         paths.clear();
-                        paths.add(new StringBuffer(pathRoot));
+                        paths.add(path);
                         lastPathsCount = 0;
                         lastPropertyName = null;
                         lastPropertyValueLength = 0;
@@ -435,6 +618,12 @@ public class SiteView
                         // value case as provided by profiler
                         String propertyName = properties[i].getName().toLowerCase();
                         String propertyValue = properties[i].getValue();
+                        // classify principal paths
+                        String prefixedPropertyName = Folder.RESERVED_FOLDER_PREFIX+propertyName;
+                        boolean userPath = prefixedPropertyName.equals(Folder.RESERVED_USER_FOLDER_NAME);
+                        boolean rolePath = (!userPath && prefixedPropertyName.equals(Folder.RESERVED_ROLE_FOLDER_NAME));
+                        boolean groupPath = (!userPath && !rolePath && prefixedPropertyName.equals(Folder.RESERVED_GROUP_FOLDER_NAME));
+                        boolean principalPath = (userPath || rolePath || groupPath);
                         // detect duplicate control names which indicates multiple
                         // values: must duplicate locator paths for each value; different
                         // control values are simply appended to all locator paths
@@ -447,11 +636,14 @@ public class SiteView
                             Iterator pathsIter = paths.iterator();
                             for (int count = 0; (pathsIter.hasNext() && (count < lastPathsCount)); count++)
                             {
-                                StringBuffer path = (StringBuffer) pathsIter.next();
-                                StringBuffer multipleValuePath = new StringBuffer(path.toString());
+                                PathStringBuffer path = (PathStringBuffer) pathsIter.next();
+                                PathStringBuffer multipleValuePath = new PathStringBuffer(path.toString());
                                 multipleValuePath.setLength(multipleValuePath.length() - lastPropertyValueLength - 1);
                                 multipleValuePath.append(propertyValue);
                                 multipleValuePath.append(Folder.PATH_SEPARATOR_CHAR);
+                                multipleValuePath.setUserPath(userPath);
+                                multipleValuePath.setPrincipalPath(path.isPrincipalPath() || principalPath);
+                                multipleValuePath.setPathDepth(path.getPathDepth()+1);
                                 multipleValuePaths.add(multipleValuePath);
                             }
                             paths.addAll(multipleValuePaths);
@@ -467,12 +659,15 @@ public class SiteView
                             Iterator pathsIter = paths.iterator();
                             while (pathsIter.hasNext())
                             {
-                                StringBuffer path = (StringBuffer) pathsIter.next();
+                                PathStringBuffer path = (PathStringBuffer) pathsIter.next();
                                 path.append(Folder.RESERVED_FOLDER_PREFIX);
                                 path.append(propertyName);
                                 path.append(Folder.PATH_SEPARATOR_CHAR);
                                 path.append(propertyValue);
                                 path.append(Folder.PATH_SEPARATOR_CHAR);
+                                path.setUserPath(userPath);
+                                path.setPrincipalPath(path.isPrincipalPath() || principalPath);
+                                path.setPathDepth(path.getPathDepth()+1);
                             }
                             
                             // reset last locator property vars
@@ -520,7 +715,7 @@ public class SiteView
             }
             if ((pathDepth == 1) && !navigatedPathRoot)
             {
-                locatorSearchPaths.add(addLocatorSearchPathsAt++, new StringBuffer(pathRoot));
+                locatorSearchPaths.add(addLocatorSearchPathsAt++, new PathStringBuffer(pathRoot));
             }
 
             // reset locator search path ordering since navigated root
@@ -543,7 +738,8 @@ public class SiteView
                 Iterator locatorSearchPathsIter = locatorSearchPaths.iterator();
                 while (locatorSearchPathsIter.hasNext())
                 {
-                    SiteViewSearchPath searchPath = new SiteViewSearchPath(locatorName, locatorSearchPathsIter.next().toString());
+                    PathStringBuffer searchPathBuffer = (PathStringBuffer)locatorSearchPathsIter.next();
+                    SiteViewSearchPath searchPath = new SiteViewSearchPath(locatorName, searchPathBuffer.toString(), searchPathBuffer.isUserPath(), searchPathBuffer.isPrincipalPath(), searchPathBuffer.getPathDepth());
                     // test search path uniqueness
                     int existsAt = searchPaths.indexOf(searchPath);
                     if (existsAt != -1)
@@ -1235,4 +1431,24 @@ public class SiteView
         }
         return null;
     }
+
+    /**
+     * getUserFolderPath - return primary concrete root user folder path
+     *
+     * @return user folder path or null
+     */
+    public String getUserFolderPath()
+    {
+        return ((userSearchPath != null) ? userSearchPath.toString() : null);
+    }
+
+    /**
+     * getBaseFolderPath - return primary concrete root base folder path
+     *
+     * @return base folder path or null
+     */
+    public String getBaseFolderPath()
+    {
+        return ((baseSearchPath != null) ? baseSearchPath.toString() : null);        
+    }
 }

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteViewSearchPath.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteViewSearchPath.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteViewSearchPath.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteViewSearchPath.java Tue Mar 16 22:03:50 2010
@@ -29,6 +29,8 @@ import org.apache.jetspeed.om.folder.Fol
  */
 public class SiteViewSearchPath
 {
+    private static final String USER_PATH_PATTERN = ".*"+Folder.USER_FOLDER+"[^"+Folder.PATH_SEPARATOR+"]+";
+    
     /**
      * locatorName - profile locator name
      */
@@ -38,6 +40,31 @@ public class SiteViewSearchPath
      * searchPath - search path
      */
     private String searchPath;
+    
+    /**
+     * userPath - user path flag
+     */
+    private boolean userPath;
+
+    /**
+     * principalPath - principal path flag
+     */
+    private boolean principalPath;
+
+    /**
+     * pathDepth - path depth
+     */
+    private int pathDepth;
+
+    /**
+     * SiteViewSearchPath - root path constructor
+     *
+     * @param locatorName profile locator name
+     */
+    public SiteViewSearchPath(String locatorName)
+    {
+        this(locatorName, Folder.PATH_SEPARATOR, false, false, 0);
+    }
 
     /**
      * SiteViewSearchPath - validating constructor that strips any trailing
@@ -48,6 +75,55 @@ public class SiteViewSearchPath
      */
     public SiteViewSearchPath(String locatorName, String searchPath)
     {
+        this(locatorName, searchPath, searchPath.matches(USER_PATH_PATTERN), principalSearchPath(searchPath), searchPathDepth(searchPath));
+    }
+
+    /**
+     * searchPathDepth - compute search path depth
+     *
+     * @param searchPath search path
+     */
+    private static int searchPathDepth(String searchPath)
+    {
+        // count control/reserved folder names in path
+        int depth = 0;
+        int length = searchPath.length();
+        int prefixLength = Folder.RESERVED_FOLDER_PREFIX.length();
+        int index = searchPath.indexOf(Folder.PATH_SEPARATOR_CHAR);
+        while (index != -1)
+        {
+            if (searchPath.regionMatches(index+1, Folder.RESERVED_FOLDER_PREFIX, 0, prefixLength))
+            {
+                depth++;
+            }
+            index = searchPath.indexOf(Folder.PATH_SEPARATOR_CHAR, index+1);
+        }
+        return depth;
+    }
+
+    /**
+     * principalSearchPath - compute principal search path flag
+     *
+     * @param principal search path flag
+     */
+    private static boolean principalSearchPath(String searchPath)
+    {
+        // test reserved principal folder names in path
+        return ((searchPath.indexOf(Folder.USER_FOLDER) != -1) || (searchPath.indexOf(Folder.ROLE_FOLDER) != -1) || (searchPath.indexOf(Folder.GROUP_FOLDER) != -1));
+    }
+
+    /**
+     * SiteViewSearchPath - validating constructor that strips any trailing
+     *                      folder separator from search path
+     *
+     * @param locatorName profile locator name
+     * @param searchPath search path
+     * @param userPath user path flag
+     * @param principalPath principal path flag
+     * @param pathDepth path depth
+     */
+    public SiteViewSearchPath(String locatorName, String searchPath, boolean userPath, boolean principalPath, int pathDepth)
+    {
         this.locatorName = locatorName;
         if (searchPath.endsWith(Folder.PATH_SEPARATOR) && !searchPath.equals(Folder.PATH_SEPARATOR))
         {
@@ -57,6 +133,9 @@ public class SiteViewSearchPath
         {
             this.searchPath = searchPath;
         }
+        this.userPath = userPath;
+        this.principalPath = principalPath;
+        this.pathDepth = pathDepth;
     }
 
     /**
@@ -102,4 +181,34 @@ public class SiteViewSearchPath
     {
         return locatorName;
     }
+    
+    /**
+     * isUserPath - return user path flag
+     *
+     * @return user path flag
+     */
+    public boolean isUserPath()
+    {
+        return userPath;
+    }
+
+    /**
+     * isPrincipalPath - return principal path flag
+     *
+     * @return principal path flag
+     */
+    public boolean isPrincipalPath()
+    {
+        return principalPath;
+    }
+
+    /**
+     * getPathDepth - return path depth
+     *
+     * @return path depth
+     */
+    public int getPathDepth()
+    {
+        return pathDepth;
+    }
 }

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/test/org/apache/jetspeed/portalsite/TestPortalSite.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/test/org/apache/jetspeed/portalsite/TestPortalSite.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/test/org/apache/jetspeed/portalsite/TestPortalSite.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal-site/src/test/org/apache/jetspeed/portalsite/TestPortalSite.java Tue Mar 16 22:03:50 2010
@@ -136,14 +136,25 @@ public class TestPortalSite extends Abst
     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);
         assertEquals("/_hostname/dash/_user/joe,/_hostname/dash,/", profileView.getSearchPathsString());
-        
+        assertEquals("/_hostname/dash/_user/joe", profileView.getUserFolderPath());
+        assertEquals("/_hostname/dash", profileView.getBaseFolderPath());
+
+        locator = new JetspeedProfileLocator();
+        locator.init(null, "/");
+        locator.add("hostname", true, false, "new-host");
+        locator.add("user", true, false, "new-user");
+        locator.add("page", false, false, "home");
+        profileView = new SiteView(pageManager, locator);
+        assertEquals("/", profileView.getSearchPathsString());
+        assertEquals("/_hostname/new-host/_user/new-user", profileView.getUserFolderPath());
+        assertEquals("/_hostname/new-host", profileView.getBaseFolderPath());
+       
         locator = new JetspeedProfileLocator();
         locator.init(null, "/");
         locator.add("hostname", true, false, "dash");
@@ -154,6 +165,8 @@ public class TestPortalSite extends Abst
         locator.add("page", false, false, "home");
         profileView = new SiteView(pageManager, locator);
         assertEquals("/_hostname/dash/_user/joe,/_hostname/dash/_role/user,/_hostname/dash,/", profileView.getSearchPathsString());
+        assertEquals("/_hostname/dash/_user/joe", profileView.getUserFolderPath());
+        assertEquals("/_hostname/dash", profileView.getBaseFolderPath());
   
         locator = new JetspeedProfileLocator();
         //locator.init(null, "/__subsite-root");
@@ -167,6 +180,8 @@ public class TestPortalSite extends Abst
         locator.add("path", false, false, "home");
         profileView = new SiteView(pageManager, locator);
         assertEquals("/__subsite-root/_hostname/localhost/_user/sublocal,/__subsite-root/_hostname/localhost/_role/somerole,/__subsite-root/_hostname/localhost,/__subsite-root", profileView.getSearchPathsString());                       
+        assertEquals("/__subsite-root/_hostname/localhost/_user/sublocal", profileView.getUserFolderPath());
+        assertEquals("/__subsite-root/_hostname/localhost", profileView.getBaseFolderPath());
     }
     
     /**
@@ -333,7 +348,9 @@ public class TestPortalSite extends Abst
         assertEquals("folder1", rootFolder1Proxy.getName());
         assertEquals("group folder1", rootFolder1Proxy.getTitle());
         assertEquals("/_user/user/folder1", extractFileSystemPathFromId(rootFolder1Proxy.getId()));
-
+        assertEquals("/_user/user", aggregateView.getUserFolderPath());
+        assertEquals("/", aggregateView.getBaseFolderPath());
+         
         // test degenerate aggregating SiteView
         aggregateView = new SiteView(pageManager, "/__subsite-root");
         assertEquals("/__subsite-root", aggregateView.getSearchPathsString());
@@ -433,6 +450,8 @@ public class TestPortalSite extends Abst
         assertEquals("page1.psml", folder1Page1Proxy.getName());
         assertEquals("/_group/group/folder1/page1.psml", extractFileSystemPathFromId(folder1Page1Proxy.getId()));
         assertEquals("alternate-locator-name", extractLocatorNameFromProxy(folder1Page1Proxy));
+        assertEquals("/_user/user", profileView.getUserFolderPath());
+        assertEquals("/", profileView.getBaseFolderPath());
     }
 
     /**
@@ -455,7 +474,7 @@ public class TestPortalSite extends Abst
         locator.add("group", true, false, "group");
         Map locators = new HashMap();
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators);
+        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         Page requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
@@ -496,6 +515,8 @@ public class TestPortalSite extends Abst
         assertEquals("/_group/group/link0.link", extractFileSystemPathFromId(requestRootLinkProxies.get("link0.link").getId()));
         assertNotNull(requestRootLinkProxies.get("link1.link"));
         assertEquals("/link1.link", extractFileSystemPathFromId(requestRootLinkProxies.get("link1.link").getId()));
+        assertEquals("/_user/user", requestContext.getUserFolderPath());
+        assertEquals("/", requestContext.getBaseFolderPath());
     }
 
     /**
@@ -514,7 +535,7 @@ public class TestPortalSite extends Abst
         locator.add("user", true, false, "user");
         Map locators = new HashMap();
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators);
+        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         Page requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
@@ -527,7 +548,7 @@ public class TestPortalSite extends Abst
         locator.add("user", true, false, "user");
         locators = new HashMap();
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        requestContext = sessionContext.newRequestContext(locators);
+        requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
@@ -540,7 +561,7 @@ public class TestPortalSite extends Abst
         locator.add("user", true, false, "user");
         locators = new HashMap();
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        requestContext = sessionContext.newRequestContext(locators);
+        requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
@@ -553,7 +574,7 @@ public class TestPortalSite extends Abst
         locator.add("user", true, false, "user");
         locators = new HashMap();
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        requestContext = sessionContext.newRequestContext(locators);
+        requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
@@ -566,7 +587,7 @@ public class TestPortalSite extends Abst
         locator.add("user", true, false, "user");
         locators = new HashMap();
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        requestContext = sessionContext.newRequestContext(locators);
+        requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
@@ -577,7 +598,7 @@ public class TestPortalSite extends Abst
         locator.init(null, "/");
         locator.add("page", false, false, "/folder3/default-folder0/");
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        requestContext = sessionContext.newRequestContext(locators);
+        requestContext = sessionContext.newRequestContext(locators, null);
         assertNotNull(requestContext);
         requestPageProxy = requestContext.getPage();
         assertNotNull(requestPageProxy);
@@ -611,7 +632,7 @@ public class TestPortalSite extends Abst
         locator.init(null, "/");
         locator.add("group", true, false, "group");
         locators.put("group", locator);
-        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators);
+        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         Set customMenuNames = requestContext.getCustomMenuNames();
         assertNotNull(customMenuNames);
@@ -734,7 +755,7 @@ public class TestPortalSite extends Abst
         locator.init(null, "/folder0");
         locator.add("group", true, false, "group");
         locators.put("group", locator);
-        requestContext = sessionContext.newRequestContext(locators);
+        requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         Menu topMenu2 = requestContext.getMenu("top");
         assertNotNull(topMenu2);
@@ -776,7 +797,7 @@ public class TestPortalSite extends Abst
         locator.init(null, "/page1.psml");
         locator.add("group", true, false, "group");
         locators.put("group", locator);
-        requestContext = sessionContext.newRequestContext(locators);
+        requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         assertNull(requestContext.getMenu("no-such-menu"));
         Menu topMenu3 = requestContext.getMenu("top");
@@ -893,7 +914,7 @@ public class TestPortalSite extends Abst
         locator.init(null, "/folder1");
         locator.add("group", true, false, "group");
         locators.put("group", locator);
-        requestContext = sessionContext.newRequestContext(locators);
+        requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         Menu backMenu2 = requestContext.getMenu("back");
         assertNotNull(backMenu2);
@@ -1134,7 +1155,7 @@ public class TestPortalSite extends Abst
         locator.add("user", true, false, "user");
         Map locators = new HashMap();
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators);
+        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         Menu topMenu = requestContext.getMenu("top");
         assertNotNull(topMenu);
@@ -1175,7 +1196,7 @@ public class TestPortalSite extends Abst
         locator.add("user", true, false, "user");
         locators = new HashMap();
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        requestContext = sessionContext.newRequestContext(locators);
+        requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         topMenu = requestContext.getMenu("top");
         assertNotNull(topMenu);
@@ -1216,7 +1237,7 @@ public class TestPortalSite extends Abst
         locator.add("user", true, false, "user");
         locators = new HashMap();
         locators.put(ProfileLocator.PAGE_LOCATOR, locator);
-        requestContext = sessionContext.newRequestContext(locators);
+        requestContext = sessionContext.newRequestContext(locators, "user");
         assertNotNull(requestContext);
         topMenu = requestContext.getMenu("top");
         assertNotNull(topMenu);

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java Tue Mar 16 22:03:50 2010
@@ -1,9 +1,9 @@
 /*
- * 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
+ * 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
@@ -24,6 +24,7 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.prefs.Preferences;
 
@@ -37,11 +38,17 @@ import org.apache.commons.logging.LogFac
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.exception.JetspeedException;
+import org.apache.jetspeed.mockobjects.MockHttpServletRequest;
+import org.apache.jetspeed.mockobjects.request.MockRequestContext;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.folder.InvalidFolderException;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.document.NodeException;
+import org.apache.jetspeed.portalsite.PortalSite;
+import org.apache.jetspeed.portalsite.PortalSiteRequestContext;
+import org.apache.jetspeed.portalsite.PortalSiteSessionContext;
+import org.apache.jetspeed.profiler.ProfileLocator;
 import org.apache.jetspeed.prefs.PreferencesProvider;
 import org.apache.jetspeed.prefs.om.Node;
 import org.apache.jetspeed.profiler.Profiler;
@@ -85,6 +92,7 @@ public class PortalAdministrationImpl im
     protected PageManager pageManager;
     private PreferencesProvider preferences;    
     protected Profiler profiler;
+    protected PortalSite portalSite;
     protected JavaMailSender mailSender;
     protected VelocityEngine velocityEngine;
     protected AdminUtil adminUtil;
@@ -106,6 +114,7 @@ public class PortalAdministrationImpl im
                                      PageManager pageManager,
                                      PreferencesProvider preferences,
                                      Profiler profiler,
+                                     PortalSite portalSite,
                                      JavaMailSender mailSender,
                                      VelocityEngine velocityEngine)
     {
@@ -115,6 +124,7 @@ public class PortalAdministrationImpl im
         this.pageManager = pageManager;
         this.preferences = preferences;
         this.profiler = profiler;
+        this.portalSite = portalSite;
         this.mailSender = mailSender;
         this.velocityEngine = velocityEngine;
         this.adminUtil = new AdminUtil();
@@ -145,12 +155,18 @@ public class PortalAdministrationImpl im
         
     }
     
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.administration.PortalAdministration#registerUser(java.lang.String, java.lang.String)
+     */
     public void registerUser(String userName, String password)
-    throws RegistrationException
+        throws RegistrationException
     {
         registerUser(userName, password, (List)null, null, null, null, null);
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.administration.PortalAdministration#registerUser(java.lang.String, java.lang.String, java.util.List, java.util.List, java.util.Map, java.util.Map, java.lang.String)
+     */
     public void registerUser(
             String userName, 
             String password, 
@@ -159,14 +175,14 @@ public class PortalAdministrationImpl im
             Map userInfo, 
             Map rules, 
             String folderTemplate)
-    throws RegistrationException    
+        throws RegistrationException    
     {
         registerUser(userName, password, roles, groups, userInfo, rules, folderTemplate, null);
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.administration.PortalAdministration#registerUser(java.lang.String, java.lang.String, java.util.Map, java.awt.List, java.awt.List, java.lang.String)
-     */    
+     * @see org.apache.jetspeed.administration.PortalAdministration#registerUser(java.lang.String, java.lang.String, java.util.List, java.util.List, java.util.Map, java.util.Map, java.lang.String, java.lang.String)
+     */
     public void registerUser(
             String userName, 
             String password, 
@@ -176,7 +192,26 @@ public class PortalAdministrationImpl im
             Map rules, 
             String folderTemplate,
             String subsite)
-    throws RegistrationException    
+        throws RegistrationException    
+    {
+        registerUser(userName, password, roles, groups, userInfo, rules, folderTemplate, subsite, null, null);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.administration.PortalAdministration#registerUser(java.lang.String, java.lang.String, java.util.List, java.util.List, java.util.Map, java.util.Map, java.lang.String, java.lang.String, java.util.Locale, java.lang.String)
+     */
+    public void registerUser(
+            String userName, 
+            String password, 
+            List roles, 
+            List groups, 
+            Map userInfo, 
+            Map rules, 
+            String folderTemplate,
+            String subsite,
+            Locale locale,
+            String serverName)
+        throws RegistrationException    
     {
         try 
         {
@@ -248,27 +283,55 @@ public class PortalAdministrationImpl im
                     }
                 }
             }
-            
+
+            // get template folders
             if (folderTemplate == null)
             {
                 folderTemplate = this.folderTemplate; 
             }
-            
-            if (subsite == null)
+            String userFolderPath = null;
+            if ((subsite == null) && (serverName != null))
             {
-                subsite = Folder.USER_FOLDER + userName;
+                // setup profiler and portal site to determine template
+                // folders paths generate mock request for new user to profile
+                RequestContext request = new MockRequestContext("/");
+                request.setSubject(user.getSubject());
+                request.setLocale((locale != null) ? locale : Locale.getDefault());
+                MockHttpServletRequest servletRequest = new MockHttpServletRequest();
+                servletRequest.setServerName(serverName);
+                
+                // get profile locators map for new user request
+                Principal principal = SecurityHelper.getBestPrincipal(user.getSubject(), UserPrincipal.class);
+                Map locators = profiler.getProfileLocators(request, principal);
+                if (locators.size() == 0)
+                {
+                    locators = profiler.getDefaultProfileLocators(request);                
+                }
+                if (locators.size() == 0)
+                {
+                    locators.put(ProfileLocator.PAGE_LOCATOR, profiler.getProfile(request, ProfileLocator.PAGE_LOCATOR));
+                }
+                
+                // get user folder path from profiler site component
+                // using the profile locators for new user request
+                PortalSiteSessionContext sessionContext = portalSite.newSessionContext();
+                PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, userName);
+                userFolderPath = requestContext.getUserFolderPath();
+            }
+            else if (subsite != null)
+            {
+                userFolderPath = subsite + Folder.USER_FOLDER + userName;
             }
             else
             {
-                subsite  = subsite + Folder.USER_FOLDER +  userName;
-            }            
-            
+                userFolderPath = Folder.USER_FOLDER + userName;
+            }
             
             // This next chunk of code is the fancy way to force the creation of the user
             // template pages to be created with subject equal to the new user
             // otherwise it would be created as guest, and guest does not have enough privs.
             final String innerFolderTemplate = folderTemplate;
-            final String innerSubsite = subsite;
+            final String innerUserFolderPath = userFolderPath;
             final PageManager innerPageManager = pageManager;
             final String innerUserName = userName;
             final User innerUser = user;
@@ -279,10 +342,10 @@ public class PortalAdministrationImpl im
                     {
                          try
                         {
-                             if (innerSubsite != null)
+                             if (innerUserFolderPath != null)
                              {
                                  Preferences attributes = innerUser.getUserAttributes();
-                                 attributes.put(User.USER_INFO_SUBSITE, innerSubsite);                                    
+                                 attributes.put(User.USER_INFO_SUBSITE, innerUserFolderPath);                                    
                              }                                         
                              // create user's home folder                        
                              // deep copy from the default folder template tree, creating a deep-copy of the template
@@ -290,8 +353,8 @@ public class PortalAdministrationImpl im
                             Folder source = innerPageManager.getFolder(innerFolderTemplate);
                             
                             
-                            innerPageManager.deepCopyFolder(source, innerSubsite, innerUserName);
-                            Folder newFolder = pageManager.getFolder(innerSubsite);                            
+                            innerPageManager.deepCopyFolder(source, innerUserFolderPath, innerUserName);
+                            Folder newFolder = pageManager.getFolder(innerUserFolderPath);                            
                             newFolder.setTitle("Home Folder");
                             newFolder.setShortTitle("Home");
                              

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java Tue Mar 16 22:03:50 2010
@@ -222,7 +222,7 @@ public class ProfilerValveImpl extends A
                 // request context here does not select the page or build
                 // menus: that is done when the request context is
                 // accessed subsequently
-                PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, requestFallback, useHistory);
+                PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, principal.getName(), requestFallback, useHistory);
                 request.setAttribute(PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY, requestContext);
 
                 // additionally save request context under legacy key

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java Tue Mar 16 22:03:50 2010
@@ -664,7 +664,8 @@ public class JetspeedRequestContext impl
                 locators.put(ProfileLocator.PAGE_LOCATOR, locator);
             }               
             PortalSiteSessionContext sessionContext = (PortalSiteSessionContext)getSessionAttribute(ProfilerValveImpl.PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY);
-            PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, true, true);
+            String userPrincipal = ((getUserPrincipal() != null) ? getUserPrincipal().getName() : null);
+            PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, userPrincipal, true, true);
             ContentPage cpage = new ContentPageImpl(requestContext.getManagedPage());
             //System.out.println("page is " + cpage.getPath());
             this.setPage(realPage);            

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/test/org/apache/jetspeed/administration/TestPortalAdministrationImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/test/org/apache/jetspeed/administration/TestPortalAdministrationImpl.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/test/org/apache/jetspeed/administration/TestPortalAdministrationImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/portal/src/test/org/apache/jetspeed/administration/TestPortalAdministrationImpl.java Tue Mar 16 22:03:50 2010
@@ -1,19 +1,19 @@
-/*
-* 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.
-*/
+/*
+* 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.administration;
 
 import java.util.ArrayList;
@@ -55,7 +55,7 @@ public class TestPortalAdministrationImp
 
     public void testPasswordGen() throws Exception
     {
-        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null,null);
+        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null,null,null);
         String newPassword = pai.generatePassword();
         assertNotNull("new password was NULL!!!",newPassword);
         assertTrue("password is not long enough",(newPassword.length() > 4) );
@@ -63,7 +63,7 @@ public class TestPortalAdministrationImp
     }
     
     public void xtestSendEmail() throws Exception {
-        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null,null);
+        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null,null,null);
         pai.sendEmail("chris@bluesunrise.com","this is a unittest","chris@bluesunrise.com","this is the content of the message");
         
     }
@@ -71,7 +71,7 @@ public class TestPortalAdministrationImp
     // this needs too much init to test easily right now
     public void xtestRegUser() throws Exception
     {
-        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null,null);
+        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null,null,null);
         String user = "user"+(Math.abs(new Date().getTime()));
         String password = "password";
         List emptyList = new ArrayList();

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalAdministration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalAdministration.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalAdministration.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalAdministration.java Tue Mar 16 22:03:50 2010
@@ -1,9 +1,9 @@
 /*
- * 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
+ * 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
@@ -17,6 +17,7 @@
 package org.apache.jetspeed.administration;
 
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.portlet.PortletConfig;
@@ -52,8 +53,25 @@ public interface PortalAdministration
      * @param folderTemplate The full PSML path name of a folder to be deep
      *               copied as the new user's set of folders, pages, links
      * @param subsite The subsite folder to place the new user in
+     * @param locale Optional locale used to compute new user folder path
+     *               if subsite not specified
+     * @param serverName Server name used to compute new user folder path
+     *                   if subsite not specified
      * @since 2.1.2              
      */
+    public void registerUser(
+            String userName, 
+            String password, 
+            List roles, 
+            List groups, 
+            Map userInfo, 
+            Map rules, 
+            String folderTemplate,
+            String subsite,
+            Locale locale,
+            String serverName)
+        throws RegistrationException;
+
     void registerUser(String userName, 
                       String password, 
                       List roles, 
@@ -72,7 +90,7 @@ public interface PortalAdministration
             Map rules,
             String template)
         throws RegistrationException;
- 
+
     /**
      * Register a new user using all default values
      * 

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/portalsite/PortalSiteRequestContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/portalsite/PortalSiteRequestContext.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/portalsite/PortalSiteRequestContext.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/portalsite/PortalSiteRequestContext.java Tue Mar 16 22:03:50 2010
@@ -152,4 +152,18 @@ public interface PortalSiteRequestContex
      * @throws SecurityException if page view access not granted
      */
     Menu getMenu(String name) throws NodeNotFoundException;
+    
+    /**
+     * getUserFolderPath - return primary concrete root user folder path
+     *
+     * @return user folder path or null
+     */
+    String getUserFolderPath();
+
+    /**
+     * getBaseFolderPath - return primary concrete root base folder path
+     *
+     * @return base folder path or null
+     */
+    String getBaseFolderPath();
 }

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/portalsite/PortalSiteSessionContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/portalsite/PortalSiteSessionContext.java?rev=924022&r1=924021&r2=924022&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/portalsite/PortalSiteSessionContext.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/portalsite/PortalSiteSessionContext.java Tue Mar 16 22:03:50 2010
@@ -33,31 +33,34 @@ public interface PortalSiteSessionContex
      * newRequestContext - create a new request context instance with fallback and history
      *
      * @param requestProfileLocators request profile locators
+     * @param requestUserPrincipal request user principal
      * @return new request context instance
      */
-    PortalSiteRequestContext newRequestContext(Map requestProfileLocators);
+    PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal);
 
     /**
      * newRequestContext - create a new request context instance with history
      *
      * @param requestProfileLocators request profile locators
+     * @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
      * @return new request context instance
      */
-    PortalSiteRequestContext newRequestContext(Map requestProfileLocators, boolean requestFallback);
+    PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback);
 
     /**
      * newRequestContext - create a new request context instance
      *
      * @param requestProfileLocators request profile locators
+     * @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
      * @return new request context instance
      */
-    PortalSiteRequestContext newRequestContext(Map requestProfileLocators, boolean requestFallback, boolean useHistory);
+    PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory);
 
     /**
      * getPageManager - return PageManager component instance



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