You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by cd...@apache.org on 2006/10/27 14:56:51 UTC
svn commit: r468363 - in /portals/pluto/branches/1.1-286-COMPATIBILITY:
pluto-container/src/main/java/org/apache/pluto/
pluto-container/src/main/java/org/apache/pluto/core/
pluto-container/src/main/java/org/apache/pluto/internal/impl/
pluto-container/s...
Author: cdoremus
Date: Fri Oct 27 05:56:50 2006
New Revision: 468363
URL: http://svn.apache.org/viewvc?view=rev&rev=468363
Log:
Patch to implement resource serving lifecycle contributed in PLUTO-263 issue. Thank you, Torsten.
Added:
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/NullPortlet.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceRequestImpl.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceResponseImpl.java
Modified:
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/Constants.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/PortletContainer.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletInvoker.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletServlet.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletResponseImpl.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/PortletURLProvider.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLImpl.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/Constants.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/Constants.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/Constants.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/Constants.java Fri Oct 27 05:56:50 2006
@@ -85,5 +85,12 @@
*/
public final static Integer METHOD_NOOP = new Integer(5);
+ /**
+ * The unique method identifier for resource Serving requests. Resource requests are
+ * requested through a call to the {@link PortletContainer#doServeResource(PortletWindow,
+ * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
+ * method.
+ */
+ public final static Integer METHOD_RESOURCE = new Integer(7);
}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/PortletContainer.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/PortletContainer.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/PortletContainer.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/PortletContainer.java Fri Oct 27 05:56:50 2006
@@ -84,6 +84,21 @@
HttpServletResponse response)
throws PortletException, IOException, PortletContainerException;
+ /**
+ * Indicates that a portlet resource Serving occured in the current request and calls
+ * the processServeResource method of this portlet.
+ * @param internalPortletWindow the portlet Window
+ * @param request the servlet request
+ * @param response the servlet response
+ * @throws PortletException if one portlet has trouble fulfilling
+ * the request
+ * @throws PortletContainerException if the portlet container implementation
+ * has trouble fulfilling the request
+ */
+ public void doServeResource(PortletWindow internalPortletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws PortletException, IOException, PortletContainerException;
/**
* Indicates that a portlet action occured in the current request and calls
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/NullPortlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/NullPortlet.java?view=auto&rev=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/NullPortlet.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/NullPortlet.java Fri Oct 27 05:56:50 2006
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.pluto.core;
+
+/**
+ * Implements the Null Object Pattern
+ *
+ * @author <a href="mailto:chrisra@cs.uni-jena.de">Christian Raschka</a>
+ *
+ */
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceServingPortlet;
+
+public class NullPortlet implements EventPortlet, ResourceServingPortlet,
+ Portlet {
+
+ public void processEvent(EventRequest arg0, EventResponse arg1)
+ throws PortletException, IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void serveResource(ResourceRequest arg0, ResourceResponse arg1)
+ throws PortletException, IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void destroy() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void init(PortletConfig arg0) throws PortletException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void processAction(ActionRequest arg0, ActionResponse arg1)
+ throws PortletException, IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void render(RenderRequest arg0, RenderResponse arg1)
+ throws PortletException, IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java Fri Oct 27 05:56:50 2006
@@ -34,6 +34,8 @@
import org.apache.pluto.internal.impl.PortletWindowImpl;
import org.apache.pluto.internal.impl.RenderRequestImpl;
import org.apache.pluto.internal.impl.RenderResponseImpl;
+import org.apache.pluto.internal.impl.ResourceRequestImpl;
+import org.apache.pluto.internal.impl.ResourceResponseImpl;
import org.apache.pluto.spi.PortletURLProvider;
import org.apache.pluto.OptionalContainerServices;
import org.apache.pluto.PortletContainer;
@@ -164,6 +166,40 @@
}
/**
+ * Indicates that a portlet resource Serving occured in the current request and calls
+ * the processServeResource method of this portlet.
+ * @param internalPortletWindow the portlet Window
+ * @param request the servlet request
+ * @param response the servlet response
+ * @throws PortletException if one portlet has trouble fulfilling
+ * the request
+ * @throws PortletContainerException if the portlet container implementation
+ * has trouble fulfilling the request
+ */
+ public void doServeResource(PortletWindow portletWindow,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws PortletException, IOException, PortletContainerException {
+
+ ensureInitialized();
+
+ InternalPortletWindow internalPortletWindow =
+ new PortletWindowImpl(servletContext, portletWindow);
+ debugWithName("Resource request received for portlet: "
+ + portletWindow.getPortletName());
+
+ ResourceRequestImpl renderRequest = new ResourceRequestImpl(
+ this, internalPortletWindow, request);
+ ResourceResponseImpl renderResponse = new ResourceResponseImpl(
+ this, internalPortletWindow, request, response);
+
+ PortletInvoker invoker = new PortletInvoker(internalPortletWindow);
+ invoker.resource(renderRequest, renderResponse);
+ debugWithName("Portlet resource for: "
+ + portletWindow.getPortletName());
+ }
+
+ /**
* Process action for the portlet associated with the given portlet window.
* @param portletWindow the portlet window.
* @param request the servlet request.
@@ -254,7 +290,7 @@
public void doLoad(PortletWindow portletWindow,
HttpServletRequest request,
HttpServletResponse response)
- throws PortletException, IOException, PortletContainerException {
+ throws PortletException, IOException, PortletContainerException {
ensureInitialized();
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletInvoker.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletInvoker.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletInvoker.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletInvoker.java Fri Oct 27 05:56:50 2006
@@ -33,6 +33,8 @@
import org.apache.pluto.internal.impl.PortletResponseImpl;
import org.apache.pluto.internal.impl.RenderRequestImpl;
import org.apache.pluto.internal.impl.RenderResponseImpl;
+import org.apache.pluto.internal.impl.ResourceRequestImpl;
+import org.apache.pluto.internal.impl.ResourceResponseImpl;
import org.apache.pluto.util.StringManager;
/**
@@ -92,6 +94,26 @@
invoke(request, response, Constants.METHOD_ACTION);
}
+
+ /**
+ * Invoke the portlet with an resource request.
+ *
+ * @param request resource request used for the invocation.
+ * @param response resource response used for the invocation.
+ * @throws PortletException if a error occurs within the portlet.
+ * @throws IOException if an IO error occurs writing the response.
+ *
+ * @see PortletServlet
+ * @see javax.portlet.Portlet#processresource(javax.portlet.ResourceRequest, javax.portlet.ActionResponse)
+ */
+ public void resource(ResourceRequestImpl request, ResourceResponseImpl response)
+ throws PortletException, IOException {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Performing Resource Invocation");
+ }
+ invoke(request, response, Constants.METHOD_RESOURCE);
+ }
+
/**
* Invoke the portlet with a render request.
*
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletServlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletServlet.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletServlet.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/core/PortletServlet.java Fri Oct 27 05:56:50 2006
@@ -28,9 +28,13 @@
import org.apache.pluto.internal.impl.PortletConfigImpl;
import org.apache.pluto.internal.impl.RenderRequestImpl;
import org.apache.pluto.internal.impl.RenderResponseImpl;
+import org.apache.pluto.internal.impl.ResourceRequestImpl;
+import org.apache.pluto.internal.impl.ResourceResponseImpl;
+import javax.portlet.EventPortlet;
import javax.portlet.Portlet;
import javax.portlet.PortletException;
+import javax.portlet.ResourceServingPortlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -58,6 +62,12 @@
/** The portlet instance wrapped by this servlet. */
private Portlet portlet = null;
+ /** The Event Portlet instance (the same object as portlet) wrapped by this servlet. */
+ private EventPortlet eventPortlet = null;
+
+ /** The resource serving portlet instance wrapped by this servlet. */
+ private ResourceServingPortlet resourceServingPortlet = null;
+
/** The internal portlet context instance. */
private InternalPortletContext portletContext = null;
@@ -118,6 +128,8 @@
Class clazz = loader.loadClass((portletDD.getPortletClass()));
portlet = (Portlet) clazz.newInstance();
portlet.init(portletConfig);
+ initializeEventPortlet();
+ initializeResourceServingPortlet();
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
throw new ServletException(ex);
@@ -204,6 +216,15 @@
portlet.render(renderRequest, renderResponse);
}
+
+ //The requested method is RESOURCE: call ResourceServingPortlet.serveResource(..)
+ else if (methodId == Constants.METHOD_RESOURCE) {
+ ResourceRequestImpl resourceRequest =
+ (ResourceRequestImpl) portletRequest;
+ ResourceResponseImpl resourceResponse =
+ (ResourceResponseImpl) portletResponse;
+ resourceServingPortlet.serveResource(resourceRequest, resourceResponse);
+ }
// The requested method is ACTION: call Portlet.processAction(..)
else if (methodId == Constants.METHOD_ACTION) {
@@ -249,4 +270,21 @@
}
}
}
+ private void initializeEventPortlet() {
+ if (portlet instanceof EventPortlet) {
+ eventPortlet = (EventPortlet) portlet;
+ }
+ else{
+ eventPortlet = new NullPortlet();
+ }
+ }
+
+ private void initializeResourceServingPortlet() {
+ if (portlet instanceof ResourceServingPortlet) {
+ resourceServingPortlet = (ResourceServingPortlet) portlet;
+ }
+ else{
+ resourceServingPortlet = new NullPortlet();
+ }
+ }
}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletResponseImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletResponseImpl.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletResponseImpl.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletResponseImpl.java Fri Oct 27 05:56:50 2006
@@ -222,8 +222,6 @@
}
public ResourceURL createResourceURL(){
- //FIXME: Add right parameters
-
return new ResourceURLImpl(getContainer(),
getInternalPortletWindow(),
getHttpServletRequest(),
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceRequestImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceRequestImpl.java?view=auto&rev=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceRequestImpl.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceRequestImpl.java Fri Oct 27 05:56:50 2006
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.pluto.internal.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.portlet.PortletPreferences;
+import javax.portlet.ResourceRequest;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.Constants;
+import org.apache.pluto.PortletContainer;
+import org.apache.pluto.internal.InternalActionRequest;
+import org.apache.pluto.internal.InternalPortletWindow;
+
+public class ResourceRequestImpl extends PortletRequestImpl
+implements ResourceRequest, InternalActionRequest {
+
+ /** Logger. */
+ private static final Log LOG = LogFactory.getLog(ResourceRequestImpl.class);
+
+
+ // Private Member Variables ------------------------------------------------
+
+ /** FIXME: The portlet preferences. */
+ private PortletPreferences portletPreferences = null;
+
+
+ // Constructor -------------------------------------------------------------
+
+ public ResourceRequestImpl(PortletContainer container,
+ InternalPortletWindow internalPortletWindow,
+ HttpServletRequest servletRequest) {
+ super(container, internalPortletWindow, servletRequest);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Created action request for: " + internalPortletWindow);
+ }
+ }
+
+ // ResourceRequest impl ------------------------------------------------------
+
+ /* (non-Javadoc)
+ * FIXME: should we set the bodyAccessed flag?
+ * @see org.apache.pluto.core.InternalActionResponse#getPortletInputStream()
+ */
+ public InputStream getPortletInputStream() throws IOException {
+ HttpServletRequest servletRequest = (HttpServletRequest) getRequest();
+ if (servletRequest.getMethod().equals("POST")) {
+ String contentType = servletRequest.getContentType();
+ if (contentType == null ||
+ contentType.equals("application/x-www-form-urlencoded")) {
+ throw new IllegalStateException(
+ "User request HTTP POST data is of type "
+ + "application/x-www-form-urlencoded. "
+ + "This data has been already processed "
+ + "by the portal/portlet-container and is available "
+ + "as request parameters.");
+ }
+ }
+ return servletRequest.getInputStream();
+ }
+
+ // PortletRequestImpl impl -------------------------------------------------
+
+ /**
+ * FIXME:
+ */
+ public PortletPreferences getPreferences() {
+ if (portletPreferences == null) {
+ portletPreferences = new PortletPreferencesImpl(
+ getPortletContainer(),
+ getInternalPortletWindow(),
+ this,
+ Constants.METHOD_ACTION);
+ }
+ return portletPreferences;
+ }
+
+ public String getETag() {
+ // TODO Auto-generated method stub
+// return null;
+ throw new UnsupportedOperationException("This method needs to be implemented");
+ }
+
+}
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceResponseImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceResponseImpl.java?view=auto&rev=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceResponseImpl.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceResponseImpl.java Fri Oct 27 05:56:50 2006
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.pluto.internal.impl;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.portlet.CacheControl;
+import javax.portlet.PortalContext;
+import javax.portlet.ResourceResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.pluto.PortletContainer;
+import org.apache.pluto.internal.InternalActionResponse;
+import org.apache.pluto.internal.InternalPortletWindow;
+import org.apache.pluto.spi.PortalCallbackService;
+
+public class ResourceResponseImpl extends StateAwareResponseImpl
+implements ResourceResponse, InternalActionResponse {
+
+ /**
+ * Is it still allowed to invoke the method sendRedirect() ?
+ */
+
+
+ private PortalCallbackService callback;
+ private PortalContext context;
+
+
+ public ResourceResponseImpl(PortletContainer container,
+ InternalPortletWindow internalPortletWindow,
+ HttpServletRequest servletRequest,
+ HttpServletResponse servletResponse) {
+ super(container, internalPortletWindow, servletRequest,
+ servletResponse);
+ context = container.getRequiredContainerServices().getPortalContext();
+ callback = container.getRequiredContainerServices().getPortalCallbackService();
+ }
+
+
+ public CacheControl getCacheControl() {
+ // TODO Auto-generated method stub
+// return null;
+ throw new UnsupportedOperationException("This method needs to be implemented");
+ }
+
+
+ public String getContentType() {
+ // TODO Auto-generated method stub
+// return null;
+ throw new UnsupportedOperationException("This method needs to be implemented");
+ }
+
+
+ public OutputStream getPortletOutputStream() throws IOException {
+ // TODO Auto-generated method stub
+// return null;
+ throw new UnsupportedOperationException("This method needs to be implemented");
+ }
+
+
+ public void setTitle(String arg0) {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException("This method needs to be implemented");
+ }
+
+}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/PortletURLProvider.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/PortletURLProvider.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/PortletURLProvider.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/PortletURLProvider.java Fri Oct 27 05:56:50 2006
@@ -58,7 +58,7 @@
* request.
* @since 2.0
*/
- public void setResourceServing(boolean action);
+ public void setResourceServing(boolean resource);
/**
* By calling this method the URL is defined as a secure URL.
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLImpl.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLImpl.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLImpl.java Fri Oct 27 05:56:50 2006
@@ -232,6 +232,7 @@
portalURL.windowStates = new HashMap(windowStates);
portalURL.renderPath = renderPath;
portalURL.actionWindow = actionWindow;
+ portalURL.resourceWindow = resourceWindow;
return portalURL;
}
}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java Fri Oct 27 05:56:50 2006
@@ -54,6 +54,7 @@
private static final String DELIM = "_";
private static final String PORTLET_ID = "pd";
private static final String ACTION = "ac";
+ private static final String RESOURCE = "rs";
private static final String RENDER_PARAM = "rp";
private static final String WINDOW_STATE = "ws";
private static final String PORTLET_MODE = "pm";
@@ -137,6 +138,10 @@
//Fix for PLUTO-243
renderPath.append('/').append(token);
}
+// Resource window definition: portalURL.setResourceWindow().
+ else if (token.startsWith(PREFIX + RESOURCE)) {
+ portalURL.setResourceWindow(decodeControlParameter(token)[0]);
+ }
// Action window definition: portalURL.setActionWindow().
else if (token.startsWith(PREFIX + ACTION)) {
portalURL.setActionWindow(decodeControlParameter(token)[0]);
@@ -186,7 +191,12 @@
if (portalURL.getRenderPath() != null) {
buffer.append("/").append(portalURL.getRenderPath());
}
-
+ //Append the resource window definition, if it exists.
+ if (portalURL.getResourceWindow() != null){
+ buffer.append("/");
+ buffer.append(PREFIX).append(RESOURCE)
+ .append(encodeCharacters(portalURL.getResourceWindow()));
+ }
// Append the action window definition, if it exists.
if (portalURL.getActionWindow() != null) {
buffer.append("/");
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java Fri Oct 27 05:56:50 2006
@@ -104,8 +104,19 @@
PortalURL portalURL = portalRequestContext.getRequestedPortalURL();
String actionWindowId = portalURL.getActionWindow();
- PortletWindowConfig actionWindowConfig = getDriverConfiguration()
- .getPortletWindowConfig(actionWindowId);
+ String resourceWindowId = portalURL.getResourceWindow();
+
+ PortletWindowConfig resourceWindowConfig = null;
+ PortletWindowConfig actionWindowConfig = null;
+ if (resourceWindowId != null){
+ resourceWindowConfig = getDriverConfiguration()
+ .getPortletWindowConfig(resourceWindowId);
+ }
+ else{
+ actionWindowConfig = getDriverConfiguration()
+ .getPortletWindowConfig(actionWindowId);
+
+ }
// Action window config will only exist if there is an action request.
if (actionWindowConfig != null) {
@@ -126,7 +137,24 @@
LOG.debug("Action request processed.\n\n");
}
}
-
+ if (resourceWindowConfig != null) {
+ PortletWindowImpl portletWindow = new PortletWindowImpl(
+ resourceWindowConfig, portalURL);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Processing resource Serving request for window: "
+ + portletWindow.getId().getStringId());
+ }
+ try {
+ container.doServeResource(portletWindow, request, response);
+ } catch (PortletContainerException ex) {
+ throw new ServletException(ex);
+ } catch (PortletException ex) {
+ throw new ServletException(ex);
+ }
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Action request processed.\n\n");
+ }
+ }
// Otherwise (actionWindowConfig == null), handle the render request.
else {
if (LOG.isDebugEnabled()) {
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java?view=diff&rev=468363&r1=468362&r2=468363
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java Fri Oct 27 05:56:50 2006
@@ -63,5 +63,7 @@
Object clone();
+ String getResourceWindow();
+
void setResourceWindow(String window);
}