portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r220176 - /portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
Date Thu, 21 Jul 2005 20:05:20 GMT
Author: rwatler
Date: Thu Jul 21 13:05:19 2005
New Revision: 220176

URL: http://svn.apache.org/viewcvs?rev=220176&view=rev
Log:
refine request path modification from profile locators

Modified:
    portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java

Modified: portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java?rev=220176&r1=220175&r2=220176&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
Thu Jul 21 13:05:19 2005
@@ -203,11 +203,12 @@
      */
     private String getRequestPathFromLocator(ProfileLocator locator)
     {
-        // use profile iterator to process the initial
-        // full set of profile locator properties searching
-        // for the first non control/navigation property
-        // that will force the request path if non-null;
-        // otherwise default to locator request path
+        // use profile iterator to process the initial full
+        // set of profile locator properties searching for
+        // the first non control/navigation, (i.e. page/path),
+        // property that will force the request path if
+        // non-null; otherwise default to locator request path
+        String requestPath = locator.getRequestPath();
         Iterator locatorIter = locator.iterator();
         if (locatorIter.hasNext())
         {
@@ -216,18 +217,19 @@
             {
                 if (!properties[i].isControl() && !properties[i].isNavigation())
                 {
-                    // request path property; append to or replace
+                    // request page/path property; append to or replace
                     // using locator specified path
                     String path = properties[i].getValue();
                     if (path != null)
                     {
+                        // specified page/path to be appended to request path if
+                        // relative; otherwise specified page/path to replace
+                        // request path
                         if (!path.startsWith(Folder.PATH_SEPARATOR))
                         {
-                            // specified path to be appended to request path
-
                             // strip page from request path if required
-                            // and append path to base request path
-                            String basePath = locator.getRequestPath();
+                            // and append page/path to base request path
+                            String basePath = requestPath;
                             if (basePath == null)
                             {
                                 basePath = Folder.PATH_SEPARATOR;
@@ -248,38 +250,41 @@
                             {
                                 path += Page.DOCUMENT_TYPE;
                             }
+                        }
 
-                            // log modified page request
-                            if (log.isDebugEnabled() && !path.equals(locator.getRequestPath()))
+                        // detect profile locator request path modification
+                        if (!path.equals(requestPath))
+                        {
+                            // if modified request path ends with default page,
+                            // strip default page from path to allow folder level
+                            // defaulting to take place: locator should not force
+                            // selection of default page when selection of the
+                            // folder is implied by use in locator page/path
+                            if (path.endsWith(Folder.PATH_SEPARATOR + Folder.FALLBACK_DEFAULT_PAGE))
                             {
-                                log.debug("Request page modified by profile locator: request
path=" + path);
+                                path = path.substring(0, path.length() - Folder.FALLBACK_DEFAULT_PAGE.length());
                             }
-                            return path;
-                        }
-                        else
-                        {
-                            // specified path to replace request path
-
+                            
                             // log modified page request
-                            if (log.isDebugEnabled() && !path.equals(locator.getRequestPath()))
+                            if (log.isDebugEnabled() && !path.equals(requestPath))
                             {
                                 log.debug("Request page modified by profile locator: request
path=" + path);
                             }
-                            return path;
                         }
+                        return path;
                     }
                     else
                     {
                         // interpret null path as using default
                         // locator request path
-                        return locator.getRequestPath();
+                        return requestPath;
                     }
                 }
             }
         }
 
         // return locator request path
-        return locator.getRequestPath();
+        return requestPath;
     }
 
     /**



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