portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1633858 - in /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed: aggregator/impl/PortletAggregatorImpl.java container/url/impl/AbstractPortalURL.java
Date Thu, 23 Oct 2014 16:02:26 GMT
Author: taylor
Date: Thu Oct 23 16:02:26 2014
New Revision: 1633858

URL: http://svn.apache.org/r1633858
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/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java?rev=1633858&r1=1633857&r2=1633858&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
Thu Oct 23 16:02:26 2014
@@ -103,8 +103,8 @@ public class PortletAggregatorImpl imple
             window = context.getInstantlyCreatedPortletWindow(entity, name);
         }
         
-        PortletMode requetedPortletMode = getRequestedPortletMode(context);
-        WindowState requetedWindowState = getRequestedWindowState(context);
+        PortletMode requestedPortletMode = getRequestedPortletMode(context);
+        WindowState requestedWindowState = getRequestedWindowState(context);
         
         NavigationalState navState = context.getPortalURL().getNavigationalState();
         
@@ -112,14 +112,14 @@ public class PortletAggregatorImpl imple
         {
             MutableNavigationalState mutableNavState = (MutableNavigationalState) navState;
             
-            if (!requetedPortletMode.equals(navState.getMode(window)))
+            if (!requestedPortletMode.equals(navState.getMode(window)))
             {
-                mutableNavState.setMode(window, requetedPortletMode);
+                mutableNavState.setMode(window, requestedPortletMode);
             }
             
-            if (!requetedWindowState.equals(navState.getState(window)))
+            if (!requestedWindowState.equals(navState.getState(window)))
             {
-                mutableNavState.setState(window, requetedWindowState);
+                mutableNavState.setState(window, requestedWindowState);
             }
         }
         

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java?rev=1633858&r1=1633857&r2=1633858&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java
Thu Oct 23 16:02:26 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.
@@ -42,13 +45,16 @@ import org.apache.jetspeed.container.Por
 public abstract class AbstractPortalURL implements PortalURL
 {
     public static final String DEFAULT_NAV_STATE_PARAMETER = "_ns";
-    
+
     protected static String navStateParameter;
     
     protected NavigationalState navState;
     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;
@@ -56,7 +62,6 @@ public abstract class AbstractPortalURL 
     protected String secureBaseURL;
     protected String nonSecureBaseURL;
     protected String characterEncoding = "UTF-8";
-    
 
     public AbstractPortalURL(NavigationalState navState, PortalContext portalContext, BasePortalURL
base)
     {
@@ -77,9 +82,16 @@ 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 = Jetspeed.getEngine().getComponentManager().lookupComponent("pipeline-mapper");
+                pagePipeline = pipelineMapper.getMappedPathByPipelineId(pagePipelineName);
+                portletPipeline = pipelineMapper.getMappedPathByPipelineId(PortalReservedParameters.PORTLET_PIPELINE);
+            }
+        }
     }
     
-    
     public AbstractPortalURL(String characterEncoding, NavigationalState navState, PortalContext
portalContext)
     {
         this(navState, portalContext);
@@ -197,6 +209,11 @@ public abstract class AbstractPortalURL 
         {
             servletPath = "";
         }
+        else {
+            if (servletPath.startsWith(portletPipeline)) {
+                servletPath = pagePipeline;
+            }
+        }
         this.basePath = contextPath + servletPath;
     }
 



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