portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r583467 - in /portals/jetspeed-2/trunk: components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/pipelines.xml
Date Wed, 10 Oct 2007 13:23:12 GMT
Author: ate
Date: Wed Oct 10 06:23:10 2007
New Revision: 583467

URL: http://svn.apache.org/viewvc?rev=583467&view=rev
Log:
JS2-279: Preliminary Portlet API 2.0 ResourceURL support allowing full response control like
for cookies and compressed output streams
- adding resourceURL handling for /desktop
  See: https://issues.apache.org/jira/browse/JS2-729#action_12533731

Modified:
    portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
    portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/pipelines.xml

Modified: portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java?rev=583467&r1=583466&r2=583467&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
(original)
+++ portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
Wed Oct 10 06:23:10 2007
@@ -25,6 +25,7 @@
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.jetspeed.PortalContext;
+import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.container.state.NavigationalState;
 import org.apache.jetspeed.container.url.BasePortalURL;
 import org.apache.jetspeed.desktop.JetspeedDesktop;
@@ -156,6 +157,11 @@
     
     protected String createPortletURL(String encodedNavState, boolean secure, PortletWindow
window, boolean action)
     {   
+        return createPortletURL(encodedNavState, secure, window, action, false);
+    }
+    
+    protected String createPortletURL(String encodedNavState, boolean secure, PortletWindow
window, boolean action, boolean resource)
+    {   
         StringBuffer buffer = new StringBuffer("");
         buffer.append(getBaseURL(secure));
         if (action)
@@ -177,13 +183,22 @@
         {
             buffer.append(getPath());
         }
-        PortletEntity pe = window.getPortletEntity();
-        buffer.append( "?entity=" ).append( pe.getId() );
         
-        PortletDefinition portlet = pe.getPortletDefinition();
-        MutablePortletApplication app = (MutablePortletApplication)portlet.getPortletApplicationDefinition();
-        String uniqueName = app.getName() + "::" + portlet.getName();
-        buffer.append( "&portlet=" ).append( uniqueName );
+        if ( !resource )
+        {
+            PortletEntity pe = window.getPortletEntity();
+            buffer.append( "?entity=" ).append( pe.getId() );
+            
+            PortletDefinition portlet = pe.getPortletDefinition();
+            MutablePortletApplication app = (MutablePortletApplication)portlet.getPortletApplicationDefinition();
+            String uniqueName = app.getName() + "::" + portlet.getName();
+            buffer.append( "&portlet=" ).append( uniqueName );
+            
+        }
+        else
+        {
+            buffer.append("?encoder=desktop");
+        }
 
         return buffer.toString();
     }        
@@ -192,7 +207,8 @@
     {
         try
         {
-            return createPortletURL(this.getNavigationalState().encode(window,parameters,mode,state,action),
secure, window, action);
+            boolean resource = !action && parameters.containsKey(PortalReservedParameters.PORTLET_RESOURCE_URL_REQUEST_PARAMETER);
+            return createPortletURL(this.getNavigationalState().encode(window,parameters,mode,state,action),
secure, window, action, resource);
         }
         catch (UnsupportedEncodingException e)
         {

Modified: portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/pipelines.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/pipelines.xml?rev=583467&r1=583466&r2=583467&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/pipelines.xml
(original)
+++ portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/assembly/pipelines.xml
Wed Oct 10 06:23:10 2007
@@ -454,6 +454,7 @@
         <ref bean="localizationValve"/>
         <ref bean="profilerValve"/>                        
         <ref bean="containerValve"/>
+        <ref bean="resourceValve"/>
         <ref bean="portletValveTitleInHeader"/>    
     </list>
     </constructor-arg>



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