svn commit: r1633859 - /portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.2.2-POST-RELEASE/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java

[email protected]
Newsgroups gmane.comp.jakarta.jetspeed.devel
Message-ID <[email protected]>
Author: taylor
Date: Thu Oct 23 16:03:02 2014
New Revision: 1633859

URL: http://svn.apache.org/r1633859
Log:
JS2-1295: fix bug when using Portlet Pipeline, to point portlet URLs (render, action, resource)  back to configured pipeline from jetspeed.properties (pipeline.default)

Modified:
    portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.2.2-POST-RELEASE/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java

Modified: portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.2.2-POST-RELEASE/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.2.2-POST-RELEASE/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java?rev=1633859&r1=1633858&r2=1633859&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.2.2-POST-RELEASE/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.2.2-POST-RELEASE/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java Thu Oct 23 16:03:02 2014
@@ -16,20 +16,23 @@
  */
 package org.apache.jetspeed.container.url.impl;
 
-import java.io.UnsupportedEncodingException;
-import java.util.Map;
-
-import javax.portlet.PortletMode;
-import javax.portlet.WindowState;
-import javax.servlet.http.HttpServletRequest;
-
+import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.PortalContext;
+import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.container.ContainerConstants;
+import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.state.NavigationalState;
 import org.apache.jetspeed.container.url.BasePortalURL;
 import org.apache.jetspeed.container.url.PortalURL;
+import org.apache.jetspeed.engine.JetspeedEngineConstants;
+import org.apache.jetspeed.pipeline.PipelineMapper;
 import org.apache.jetspeed.util.ArgUtil;
-import org.apache.jetspeed.container.PortletWindow;
+
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+import javax.servlet.http.HttpServletRequest;
+import java.io.UnsupportedEncodingException;
+import java.util.Map;
 
 /**
  * AbstractPortalURL delivers the base implemention for parsing Jetspeed Portal URLs and creating new Portlet URLs.
@@ -49,6 +52,9 @@ public abstract class AbstractPortalURL 
     protected BasePortalURL base = null;
     
     protected static Boolean relativeOnly;
+    protected static String pagePipeline;
+    protected static String portletPipeline;
+    protected static Object lock = new Object();
     protected String contextPath;
     protected String basePath;
     protected String path;
@@ -77,6 +83,14 @@ public abstract class AbstractPortalURL 
         {
             relativeOnly = new Boolean(portalContext.getConfiguration().getBoolean("portalurl.relative.only", false));
         }
+        if (pagePipeline == null) {
+            synchronized (lock) {
+                String pagePipelineName = portalContext.getConfiguration().getString(JetspeedEngineConstants.PIPELINE_DEFAULT, "/portal");
+                PipelineMapper pipelineMapper = (PipelineMapper)Jetspeed.getEngine().getComponentManager().getComponent("pipeline-mapper");
+                pagePipeline = pipelineMapper.getMappedPathByPipelineId(pagePipelineName);
+                portletPipeline = pipelineMapper.getMappedPathByPipelineId(PortalReservedParameters.PORTLET_PIPELINE);
+            }
+        }
     }
     
     
@@ -197,6 +211,11 @@ public abstract class AbstractPortalURL 
         {
             servletPath = "";
         }
+        else {
+            if (servletPath.startsWith(portletPipeline)) {
+                servletPath = pagePipeline;
+            }
+        }
         this.basePath = contextPath + servletPath;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.