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/11/03 21:50:02 UTC
svn commit: r470984 - in /portals/pluto/branches/1.1-286-COMPATIBILITY:
pluto-container/ 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/ pluto...
Author: cdoremus
Date: Fri Nov 3 12:50:01 2006
New Revision: 470984
URL: http://svn.apache.org/viewvc?view=rev&rev=470984
Log:
Applied patch in PLUTO-267. Thanks Christian!
Added:
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/EventContainer.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/InternalEventRequest.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/EventRequestImpl.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/EventProvider.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java
Modified:
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/pom.xml
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/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/StateAwareResponseImpl.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/PortalCallbackService.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/pom.xml
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortalCallbackServiceImpl.java
portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletURLProviderImpl.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/pom.xml
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/core/PortalRequestContext.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/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/pom.xml?view=diff&rev=470984&r1=470983&r2=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/pom.xml (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/pom.xml Fri Nov 3 12:50:01 2006
@@ -1,122 +1,131 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright 2005-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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.apache.pluto</groupId>
- <artifactId>pluto</artifactId>
- <version>1.1.0-286-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.pluto</groupId>
- <artifactId>pluto-container</artifactId>
- <packaging>jar</packaging>
- <name>Pluto Portlet Container</name>
- <description>The pluto portlet container.</description>
-
-
- <dependencies>
-
- <!-- Pluto Support Libraries =========================================== -->
- <dependency>
- <groupId>org.apache.pluto</groupId>
- <artifactId>pluto-descriptor-api</artifactId>
- <version>${pom.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.pluto</groupId>
- <artifactId>pluto-descriptor-impl</artifactId>
- <version>${pom.version}</version>
- <scope>runtime</scope>
- </dependency>
-
- <!-- Other Support Libraries =========================================== -->
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${commons-logging.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Specification Libraries =========================================== -->
- <dependency>
- <groupId>javax.portlet</groupId>
- <artifactId>portlet-api</artifactId>
- <version>${portlet-api.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>${servlet-api.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- Testing Libraries ================================================= -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jmock</groupId>
- <artifactId>jmock</artifactId>
- <version>${jmock.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <!-- Assembly Plugin: Create Distributions =========================== -->
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptor>src/assemble/bin.xml</descriptor>
- </configuration>
- </plugin>
- <!-- Surefire Plugin: Exec Tests ===================================== -->
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/*Test.java</include>
- </includes>
- <excludes>
- <exclude>**/PlutoTestCase.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <configuration>
- <resourcesDirectory>${basedir}/../pluto-site/src/site/resources</resourcesDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
-
-
-
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005-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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.apache.pluto</groupId>
+ <artifactId>pluto</artifactId>
+ <version>1.1.0-286-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.pluto</groupId>
+ <artifactId>pluto-container</artifactId>
+ <packaging>jar</packaging>
+ <name>Pluto Portlet Container</name>
+ <description>The pluto portlet container.</description>
+
+
+ <dependencies>
+
+ <!-- Pluto Support Libraries =========================================== -->
+ <dependency>
+ <groupId>org.apache.pluto</groupId>
+ <artifactId>pluto-descriptor-api</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.pluto</groupId>
+ <artifactId>pluto-descriptor-impl</artifactId>
+ <version>${pom.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Other Support Libraries =========================================== -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${commons-logging.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- Specification Libraries =========================================== -->
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>${portlet-api.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${servlet-api.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Testing Libraries ================================================= -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jmock</groupId>
+ <artifactId>jmock</artifactId>
+ <version>${jmock.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- Assembly Plugin: Create Distributions =========================== -->
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptor>src/assemble/bin.xml</descriptor>
+ </configuration>
+ </plugin>
+ <!-- Surefire Plugin: Exec Tests ===================================== -->
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/PlutoTestCase.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <resourcesDirectory>${basedir}/../pluto-site/src/site/resources</resourcesDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <!-- best lock down version of the plugin too -->
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
+
+
+
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=470984&r1=470983&r2=470984
==============================================================================
--- 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 Nov 3 12:50:01 2006
@@ -92,5 +92,19 @@
* method.
*/
public final static Integer METHOD_RESOURCE = new Integer(7);
+
+ /**
+ * The unique method identifier for render requests. Render requests are
+ * requested through a call to the {@link PortletContainer#doEvent(org.apache.pluto.PortletWindow,
+ * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}
+ * method.
+ */
+ public final static Integer METHOD_EVENT = new Integer(9);
+
+ /**
+ * The key used to bind the <code>PortletEvent</code> to the underlying
+ * <code>HttpServletRequest</code>.
+ */
+ public final static String PORTLET_EVENT = "javax.portlet.event";
}
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/EventContainer.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/EventContainer.java?view=auto&rev=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/EventContainer.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/EventContainer.java Fri Nov 3 12:50:01 2006
@@ -0,0 +1,28 @@
+/*
+ * 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;
+
+import java.io.IOException;
+
+import javax.portlet.PortletException;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public interface EventContainer {
+ public ServletContext getServletContext();
+ public void fireEvent(HttpServletRequest request, HttpServletResponse response, PortletWindow window) throws PortletException, IOException;
+}
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=470984&r1=470983&r2=470984
==============================================================================
--- 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 Nov 3 12:50:01 2006
@@ -18,30 +18,37 @@
import java.io.IOException;
import java.util.Map;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
+import org.apache.pluto.EventContainer;
+import org.apache.pluto.OptionalContainerServices;
+import org.apache.pluto.PortletContainer;
+import org.apache.pluto.PortletContainerException;
+import org.apache.pluto.PortletWindow;
+import org.apache.pluto.RequiredContainerServices;
import org.apache.pluto.descriptors.portlet.PortletAppDD;
import org.apache.pluto.internal.InternalPortletWindow;
import org.apache.pluto.internal.PortletDescriptorRegistry;
import org.apache.pluto.internal.impl.ActionRequestImpl;
import org.apache.pluto.internal.impl.ActionResponseImpl;
+import org.apache.pluto.internal.impl.EventRequestImpl;
+import org.apache.pluto.internal.impl.EventResponseImpl;
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.EventProvider;
import org.apache.pluto.spi.PortletURLProvider;
-import org.apache.pluto.OptionalContainerServices;
-import org.apache.pluto.PortletContainer;
-import org.apache.pluto.PortletContainerException;
-import org.apache.pluto.PortletWindow;
-import org.apache.pluto.RequiredContainerServices;
/**
* Default Pluto Container implementation.
@@ -52,7 +59,8 @@
* @version 1.0
* @since Sep 18, 2004
*/
-public class PortletContainerImpl implements PortletContainer {
+public class PortletContainerImpl implements PortletContainer,
+ EventContainer {
/** Internal logger. */
private static final Log LOG = LogFactory.getLog(PortletContainerImpl.class);
@@ -232,6 +240,10 @@
debugWithName("Portlet action processed for: "
+ portletWindow.getPortletName());
+ EventProvider provider = this.getRequiredContainerServices().getPortalCallbackService().
+ getEventProvider(request,response);
+ provider.fireEvents(this);
+
// After processing action, send a redirect URL for rendering.
String location = actionResponse.getRedirectLocation();
@@ -404,6 +416,78 @@
LOG.info("Portlet Container [" + name + "]: " + message);
}
}
+
+
+ public void fireEvent(HttpServletRequest request, HttpServletResponse response,
+ PortletWindow window)
+ throws PortletException, IOException {
+
+ ensureInitialized();
+
+ InternalPortletWindow internalPortletWindow =
+ new PortletWindowImpl(servletContext, window);
+ debugWithName("Event request received for portlet: "
+ + window.getPortletName());
+
+ EventRequestImpl eventRequest = new EventRequestImpl(
+ this, internalPortletWindow, request);
+ EventResponseImpl eventResponse = new EventResponseImpl(
+ this, internalPortletWindow, request, response);
+
+ PortletInvoker invoker = new PortletInvoker(internalPortletWindow);
+ invoker.event(eventRequest, eventResponse);
+
+ debugWithName("Portlet event processed for: "
+ + window.getPortletName());
+
+// After processing event, change the redirect URL for rendering.
+ String location = eventResponse.getRedirectLocation();
+
+ if (location == null) {
+
+// Create portlet URL provider to encode redirect URL.
+ debugWithName("No redirect location specified.");
+ PortletURLProvider redirectURL = requiredContainerServices
+ .getPortalCallbackService()
+ .getPortletURLProvider(request, internalPortletWindow);
+
+// Encode portlet mode if it is changed.
+ if (eventResponse.getChangedPortletMode() != null) {
+ redirectURL.setPortletMode(
+ eventResponse.getChangedPortletMode());
+ }
+
+// Encode window state if it is changed.
+ if (eventResponse.getChangedWindowState() != null) {
+ redirectURL.setWindowState(
+ eventResponse.getChangedWindowState());
+ }
+
+// Encode render parameters retrieved from action response.
+ Map renderParameters = eventResponse.getRenderParameters();
+ redirectURL.clearParameters();
+ redirectURL.setParameters(renderParameters);
+
+// Encode redirect URL as a render URL.
+ redirectURL.setAction(false);
+
+// Set secure of the redirect URL if necessary.
+ if (eventRequest.isSecure()) {
+ redirectURL.setSecure();
+ }
+
+// save redirectURL in request
+ redirectURL.savePortalURL(request);
+
+// Encode the redirect URL to a string.
+ location = eventResponse.encodeRedirectURL(redirectURL.toString());
+ }
+ }
+
+
+ public ServletContext getServletContext() {
+ return servletContext;
+ }
}
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=470984&r1=470983&r2=470984
==============================================================================
--- 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 Nov 3 12:50:01 2006
@@ -150,6 +150,22 @@
invoke(request, response, Constants.METHOD_NOOP);
}
+ /**
+ * Invoke the portlet with an event request.
+ *
+ * @param request
+ * @param response
+ * @throws PortletException
+ * @throws IOException
+ */
+ public void event(PortletRequestImpl request, PortletResponseImpl response)
+ throws PortletException, IOException {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Performing Event Invocation");
+ }
+ invoke(request, response, Constants.METHOD_EVENT);
+ }
+
// Private Invoke Method ---------------------------------------------------
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=470984&r1=470983&r2=470984
==============================================================================
--- 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 Nov 3 12:50:01 2006
@@ -15,6 +15,19 @@
*/
package org.apache.pluto.core;
+import java.io.IOException;
+import java.util.Iterator;
+
+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;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
import org.apache.pluto.Constants;
import org.apache.pluto.PortletContainerException;
import org.apache.pluto.descriptors.portlet.PortletAppDD;
@@ -25,24 +38,14 @@
import org.apache.pluto.internal.InternalPortletResponse;
import org.apache.pluto.internal.impl.ActionRequestImpl;
import org.apache.pluto.internal.impl.ActionResponseImpl;
+import org.apache.pluto.internal.impl.EventRequestImpl;
+import org.apache.pluto.internal.impl.EventResponseImpl;
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;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Iterator;
-
/**
* Portlet Invocation Servlet. This servlet recieves cross context requests from
* the the container and services the portlet request for the specified method.
@@ -233,6 +236,15 @@
ActionResponseImpl actionResponse =
(ActionResponseImpl) portletResponse;
portlet.processAction(actionRequest, actionResponse);
+ }
+
+ //The request methode is Event: call Portlet.processEvent(..)
+ else if (methodId == Constants.METHOD_EVENT){
+ EventRequestImpl eventRequest =
+ (EventRequestImpl) portletRequest;
+ EventResponseImpl eventResponse =
+ (EventResponseImpl) portletResponse;
+ eventPortlet.processEvent(eventRequest, eventResponse);
}
// The requested method is NOOP: do nothing.
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/InternalEventRequest.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/InternalEventRequest.java?view=auto&rev=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/InternalEventRequest.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/InternalEventRequest.java Fri Nov 3 12:50:01 2006
@@ -0,0 +1,26 @@
+/*
+ * 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;
+
+/**
+* The internal event request extends the internal portlet request and provides
+* some action-specific methods (currently, no specific methods are declared).
+* @author <a href="mailto:chrisra@cs.uni-jena.de">Christian Raschka</a>
+*/
+
+public interface InternalEventRequest extends InternalPortletRequest {
+
+}
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/EventRequestImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/EventRequestImpl.java?view=auto&rev=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/EventRequestImpl.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/EventRequestImpl.java Fri Nov 3 12:50:01 2006
@@ -0,0 +1,83 @@
+/*
+ * 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 javax.portlet.Event;
+import javax.portlet.EventRequest;
+import javax.portlet.PortletPreferences;
+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.InternalEventRequest;
+import org.apache.pluto.internal.InternalPortletWindow;
+
+public class EventRequestImpl extends PortletRequestImpl
+ implements EventRequest, InternalEventRequest {
+
+ /** Logger. */
+ private static final Log LOG = LogFactory.getLog(ActionRequestImpl.class);
+
+ // Private Member Variables ------------------------------------------------
+
+ /** FIXME: The portlet preferences.
+ * see (ActionRequestImpl)
+ */
+ private PortletPreferences portletPreferences = null;
+
+ private HttpServletRequest request = null;
+
+ // Constructor -------------------------------------------------------------
+
+ public EventRequestImpl(PortletContainer container,
+ InternalPortletWindow internalPortletWindow,
+ HttpServletRequest servletRequest) {
+ super(container, internalPortletWindow, servletRequest);
+ this.request = servletRequest;
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Created Event request for: " + internalPortletWindow);
+ }
+
+ }
+
+ // EventRequest impl -------------------------------------------------------
+
+ public Event getEvent(){
+ Event event = (Event) request.getAttribute(
+ Constants.PORTLET_EVENT);
+ return event;
+ }
+
+ // PortletRequestImpl impl -------------------------------------------------
+
+ /**
+ * FIXME: (see ActionRequestImpl)
+ */
+ public PortletPreferences getPreferences() {
+ // TODO: Are there any changes to do in PortletPreferences?
+ if (portletPreferences == null) {
+ portletPreferences = new PortletPreferencesImpl(
+ getPortletContainer(),
+ getInternalPortletWindow(),
+ this,
+ Constants.METHOD_EVENT);
+ }
+ return portletPreferences;
+ }
+
+}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/StateAwareResponseImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/StateAwareResponseImpl.java?view=diff&rev=470984&r1=470983&r2=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/StateAwareResponseImpl.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/internal/impl/StateAwareResponseImpl.java Fri Nov 3 12:50:01 2006
@@ -15,25 +15,31 @@
*/
package org.apache.pluto.internal.impl;
+import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
import javax.portlet.PortalContext;
+import javax.portlet.PortletException;
import javax.portlet.PortletMode;
import javax.portlet.PortletModeException;
import javax.portlet.StateAwareResponse;
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
+import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import org.apache.pluto.PortletContainer;
+import org.apache.pluto.PortletContainerException;
import org.apache.pluto.descriptors.portlet.PortletDD;
import org.apache.pluto.descriptors.portlet.SupportsDD;
import org.apache.pluto.internal.InternalPortletWindow;
+import org.apache.pluto.spi.EventProvider;
import org.apache.pluto.spi.PortalCallbackService;
import org.apache.pluto.spi.ResourceURLProvider;
import org.apache.pluto.util.StringUtils;
@@ -67,11 +73,46 @@
callback = container.getRequiredContainerServices().getPortalCallbackService();
}
public void setEvent(String name, Object value) {
-
+ EventProvider provider = callback.getEventProvider(
+ getHttpServletRequest(),getHttpServletResponse());
+ try {
+ provider.registerToFireEvent(new EventImpl(name,value));
+ } catch (ServletException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (PortletException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (PortletContainerException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
public void setEvents(Map events) {
-
+ EventProvider provider = callback.getEventProvider(
+ getHttpServletRequest(),getHttpServletResponse());
+ Set keys = events.keySet();
+ try {
+ for (Object key : keys) {
+ provider.registerToFireEvent(new EventImpl((String)key,events.get(key)));
+ }
+ } catch (ServletException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (PortletException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (PortletContainerException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
public void sendRedirect(String location) throws java.io.IOException {
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/EventProvider.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/EventProvider.java?view=auto&rev=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/EventProvider.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/EventProvider.java Fri Nov 3 12:50:01 2006
@@ -0,0 +1,114 @@
+/*
+ * 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.spi;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.portlet.Event;
+import javax.portlet.PortletException;
+import javax.servlet.ServletException;
+
+import org.apache.pluto.EventContainer;
+import org.apache.pluto.PortletContainerException;
+
+ /**
+ *
+ * @author <a href="mailto:ferdy@informatik.uni-jena.de">Fred Thiele</a>
+ * @author <a href="mailto:chrisra@cs.uni-jena.de">Christian Raschka</a>
+ *
+ */
+
+public interface EventProvider {
+
+ /**
+ *
+ * @param request
+ * @param response
+ * @param event
+ * @throws ServletException
+ * @throws IOException
+ * @throws PortletException
+ * @throws PortletContainerException
+ */
+ public abstract void registerToFireEvent(Event event)
+ throws ServletException, IOException, PortletException,
+ PortletContainerException;
+
+ /**
+ * @param evtLabel -
+ * the name of the event
+ * @return ArrayList of associated InternalPortletWindows
+ */
+ public abstract List<String> getAllPortletNames(String evtLabel);
+
+ /**
+ * Bind an InternalPortletWindow to an event and/or create a new event
+ * label. If the event label isn't already in the portalEvts hashmap, add
+ * it.
+ *
+ *
+ * @param evtLabel -
+ * the event we want to add
+ * @param portletName -
+ * null or the pw to be associated with the event
+ */
+ public abstract void registerEvent(String evtLabel, String portletName);
+
+ /**
+ *
+ * @param evtLabel -
+ * creates a new event with an empty ArrayList
+ */
+ public abstract void registerEvent(String evtLabel);
+
+ /**
+ *
+ * @param evtLabel -
+ * removes an event
+ */
+ public abstract void removeEvent(String evtLabel);
+
+ /**
+ *
+ * @param pw -
+ * the InternalPortletWindow to be removed
+ * @param evtLabelsList -
+ * pw is removed from the events listed herein or all events if
+ * evtLabelsList is null
+ */
+ public abstract void removePortletName(String portletName,
+ List<String> evtLabelsList);
+
+ public abstract void removePortletName(String portletName);
+
+ /**
+ *
+ * @return Enumeration containing all events
+ */
+ public abstract Enumeration<String> getAllEventLabelsEnumeration();
+
+ /**
+ *
+ * @return ArrayList containing all events
+ */
+ public abstract List<String> getAllEventLabelsList();
+
+ public abstract List<Event> getAllSavedEvents();
+
+ public abstract void fireEvents(EventContainer container);
+}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/PortalCallbackService.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/PortalCallbackService.java?view=diff&rev=470984&r1=470983&r2=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/PortalCallbackService.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-container/src/main/java/org/apache/pluto/spi/PortalCallbackService.java Fri Nov 3 12:50:01 2006
@@ -15,12 +15,13 @@
*/
package org.apache.pluto.spi;
+import java.util.Map;
+
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import org.apache.pluto.PortletWindow;
-import java.util.Map;
-
/**
* The callback service interface defining callback methods that will be invoked
* by the portlet container when necessary.
@@ -72,5 +73,9 @@
PortletWindow portletWindow,
String property,
String value);
+
+ public EventProvider getEventProvider(HttpServletRequest request, HttpServletResponse response);
+
+ public EventProvider getEventProvider();
}
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=470984&r1=470983&r2=470984
==============================================================================
--- 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 Nov 3 12:50:01 2006
@@ -19,6 +19,7 @@
import javax.portlet.PortletMode;
import javax.portlet.WindowState;
+import javax.servlet.http.HttpServletRequest;
/**
* Defines the interface used by the portlet container to create Portal URLs.
@@ -85,4 +86,6 @@
* @return the URL
*/
public String toString();
+
+ public void savePortalURL(HttpServletRequest request);
}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/pom.xml?view=diff&rev=470984&r1=470983&r2=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/pom.xml (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/pom.xml Fri Nov 3 12:50:01 2006
@@ -1,145 +1,156 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright 2005-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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.apache.pluto</groupId>
- <artifactId>pluto</artifactId>
- <version>1.1.0-286-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>pluto-portal-driver-impl</artifactId>
- <packaging>jar</packaging>
- <name>Pluto Portal Driver Implementation Classes</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.pluto</groupId>
- <artifactId>pluto-container</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.pluto</groupId>
- <artifactId>pluto-portal-driver</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging-api</artifactId>
- <version>${commons-logging.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${commons-logging.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- <version>${commons-digester.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.portlet</groupId>
- <artifactId>portlet-api</artifactId>
- <version>${portlet-api.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>${servlet-api.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>${jstl.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>taglibs</groupId>
- <artifactId>standard</artifactId>
- <version>${taglibs.standard.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${springframework.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>${springframework.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${springframework.version}</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptor>src/assemble/bin.xml</descriptor>
- <finalName>pluto-portal-${pom.version}</finalName>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <configuration>
- <resourcesDirectory>${basedir}/../pluto-site/src/site/resources</resourcesDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
-
-
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005-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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.apache.pluto</groupId>
+ <artifactId>pluto</artifactId>
+ <version>1.1.0-286-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>pluto-portal-driver-impl</artifactId>
+ <packaging>jar</packaging>
+ <name>Pluto Portal Driver Implementation Classes</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.pluto</groupId>
+ <artifactId>pluto-container</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.pluto</groupId>
+ <artifactId>pluto-portal-driver</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging-api</artifactId>
+ <version>${commons-logging.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${commons-logging.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>${commons-digester.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>${portlet-api.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${servlet-api.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>${jstl.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>taglibs</groupId>
+ <artifactId>standard</artifactId>
+ <version>${taglibs.standard.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${springframework.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${springframework.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${springframework.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptor>src/assemble/bin.xml</descriptor>
+ <finalName>pluto-portal-${pom.version}</finalName>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <resourcesDirectory>
+ ${basedir}/../pluto-site/src/site/resources
+ </resourcesDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <!-- best lock down version of the plugin too -->
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
+
+
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.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/services/container/EventProviderImpl.java?view=auto&rev=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java Fri Nov 3 12:50:01 2006
@@ -0,0 +1,309 @@
+/*
+ * 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.driver.services.container;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.portlet.Event;
+import javax.portlet.PortletException;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.Constants;
+import org.apache.pluto.EventContainer;
+import org.apache.pluto.PortletContainerException;
+import org.apache.pluto.PortletWindow;
+import org.apache.pluto.core.PortletContextManager;
+import org.apache.pluto.driver.AttributeKeys;
+import org.apache.pluto.driver.config.DriverConfiguration;
+import org.apache.pluto.driver.core.PortletWindowImpl;
+import org.apache.pluto.driver.services.portal.PageConfig;
+import org.apache.pluto.driver.services.portal.PortletWindowConfig;
+import org.apache.pluto.driver.url.PortalURL;
+import org.apache.pluto.driver.url.PortalURLParser;
+import org.apache.pluto.driver.url.impl.PortalURLParserImpl;
+import org.apache.pluto.internal.InternalPortletContext;
+import org.apache.pluto.spi.EventProvider;
+
+/**
+ *
+ * @author <a href="mailto:ferdy@informatik.uni-jena.de">Fred Thiele</a>
+ * @author <a href="mailto:chrisra@cs.uni-jena.de">Christian Raschka</a>
+ *
+ */
+public class EventProviderImpl implements org.apache.pluto.spi.EventProvider {
+
+ /** Logger. */
+ private static final Log LOG = LogFactory.getLog(EventProviderImpl.class);
+
+ private HttpServletRequest request;
+ private HttpServletResponse response;
+
+ /**
+ * the public key, to store the EventProvider in the Request
+ */
+ public static final String PROVIDER = EventProviderImpl.class.getName();
+
+ private static final String KEY = PortalURL.class.getName();
+
+ /**
+ * Map that contains our events. The key is a string with the name of the event.
+ * The value is an ArrayList with all associated PortletWindows.
+ * FIXME: should be in another class
+ */
+ private static Map<String, List<String>> portalEvts =
+ new HashMap<String, List<String>>(100);
+
+ private List<Event> savedEvents = new ArrayList<Event>();
+
+ /**
+ * factory method
+ */
+ public static EventProviderImpl getEventProviderImpl(HttpServletRequest request,
+ HttpServletResponse response) {
+ EventProviderImpl event = (EventProviderImpl) request.getAttribute(PROVIDER);
+ if (event == null) {
+ event = new EventProviderImpl();
+ event.request = request;
+ event.response = response;
+ request.setAttribute(PROVIDER, event);
+ }
+ return event;
+ }
+
+ public static EventProvider getEventProviderImpl() {
+ return new EventProviderImpl();
+ }
+
+ /**
+ * c'tor
+ */
+ public EventProviderImpl(){
+
+ }
+
+ /**
+ * Register an event, which should be fired
+ * @param event
+ * @throws {@link IOException}
+ * @throws {@link ServletException}
+ * @throws {@link PortletContainerException}
+ * @throws {@link PortletException}
+ */
+ public void registerToFireEvent(Event event)
+ throws ServletException, IOException, PortletException, PortletContainerException {
+
+ includeEventInRequest(event);
+ savedEvents.add(event);
+ }
+
+ private void includeEventInRequest(Event event){
+ this.request.setAttribute(Constants.PORTLET_EVENT, event);
+ }
+
+ /**
+ * @param evtLabel - the name of the event
+ * @return ArrayList of associated InternalPortletWindows
+ */
+ public List<String> getAllPortletNames(String evtLabel) {
+ return portalEvts.get(evtLabel);
+ }
+
+ /**
+ * Bind an PortletWindow to an event and/or create a new event label.
+ * If the event label isn't already in the portalEvts hashmap, add it.
+ *
+ *
+ * @param evtLabel - the event we want to add
+ * @param portletName - null or the pw to be associated with the event
+ */
+ public void registerEvent(String evtLabel, String portletName) {
+ if (evtLabel == null)
+ return ;
+
+ // check, if event by that name already exists
+ if (portalEvts.containsKey(evtLabel)) {
+ if (portletName != null) {
+
+ // we don't want duplicate Portlet Window entries, so leave 'em out
+ if (!this.containsValue(portletName, portalEvts.get(evtLabel)))
+ portalEvts.get(evtLabel).add(portletName);
+
+ }
+ }
+
+ else {
+ List<String> list = new ArrayList<String>();
+ if (portletName != null)
+ list.add(portletName);
+ portalEvts.put(evtLabel, list);
+ }
+ }
+
+ /**
+ *
+ * @param evtLabel - creates a new event with an empty ArrayList
+ */
+ public void registerEvent(String evtLabel) {
+ if (evtLabel != null)
+ registerEvent(evtLabel, null);
+ }
+
+ /**
+ *
+ * @param evtLabel - removes an event
+ */
+ public synchronized void removeEvent(String evtLabel) {
+ if (!portalEvts.containsKey(evtLabel))
+ return ;
+
+ portalEvts.remove(evtLabel);
+ }
+
+ /**
+ *
+ * @param pw - the InternalPortletWindow to be removed
+ * @param evtLabelsList - pw is removed from the events listed herein or all events if evtLabelsList is null
+ */
+ public synchronized void removePortletName(String portletName, List<String> evtLabelsList) {
+
+ // set up a list of events that are going to be looked up for the portlet window we want
+ // to remove OR just a list of all events
+ List<String> listOfEvtLabels = (evtLabelsList==null)?this.getAllEventLabelsList():evtLabelsList;
+
+ // iterate through the elements of the evtLabelsList and remove the InternalPortletWindow if any
+ List<String> tmp;
+ for (String element : listOfEvtLabels) {
+ tmp = portalEvts.get(element);
+ if (this.containsValue(portletName, tmp))
+ tmp.remove(portletName);
+ }
+ }
+
+ public synchronized void removePortletName(String portletName){
+ removePortletName(portletName,null);
+ }
+
+ /**
+ *
+ * @return Enumeration containing all events
+ */
+ public Enumeration<String> getAllEventLabelsEnumeration () {
+ Vector<String> v = new Vector<String>();
+
+ for (String element : portalEvts.keySet()) {
+ v.add(element);
+ }
+ return v.elements();
+ }
+
+ /**
+ *
+ * @return ArrayList containing all events
+ */
+ public List<String> getAllEventLabelsList () {
+ List<String> l = new ArrayList<String>();
+
+ for (String element : portalEvts.keySet()) {
+ l.add(element);
+ }
+
+ return l;
+ }
+
+ // private
+
+ /**
+ * returns if InternalPortletWindow pw is contained in the ArrayList l of PortletWindows
+ */
+ private boolean containsValue(String portletName, List<String> l) {
+
+ for (String element : l)
+ if (element.equals(portletName))
+ return true;
+
+ return false;
+ }
+
+ /**
+ * @return Returns the savedEvents.
+ */
+ public List<Event> getAllSavedEvents() {
+ return savedEvents;
+ }
+
+ /**
+ * @param savedEvents The savedEvents to set.
+ */
+ public void setSavedEvents(List<Event> savedEvents) {
+ this.savedEvents = savedEvents;
+ }
+
+ public void fireEvents(EventContainer eventContainer) {
+ ServletContext servletContext = eventContainer.getServletContext();
+ DriverConfiguration driverConfig = (DriverConfiguration) servletContext.getAttribute(
+ AttributeKeys.DRIVER_CONFIG);
+
+ PortalURL portalURL = PortalURLParserImpl.getParser().parse(request);
+
+ try {
+ InternalPortletContext portletContext = PortletContextManager.getManager()
+ .getPortletContext(servletContext);
+ portletContext.getPortletApplicationDefinition();
+ } catch (PortletContainerException ex) {
+ ex.printStackTrace();
+ }
+
+ PageConfig pageConfig = portalURL.getPageConfig(servletContext);
+ // iterate all portlets on the page
+ for (Object object : pageConfig.getPortletIds()) {
+ String portletId = (String) object;
+ PortletWindowConfig windowConfig = driverConfig
+ .getPortletWindowConfig(portletId);
+ PortletWindow window = new PortletWindowImpl(windowConfig, portalURL);
+
+
+ for (Event event : this.savedEvents) {
+ // get list of portlet windows that are associated with the event
+ List<String> portletNames = portalEvts.get(event.getName());
+
+ for (String portlet : portletNames) {
+ if (portlet.equals(portletId)){
+ try {
+ eventContainer.fireEvent(this.request,this.response,window);
+ } catch (PortletException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ }
+ }
+}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortalCallbackServiceImpl.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/services/container/PortalCallbackServiceImpl.java?view=diff&rev=470984&r1=470983&r2=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortalCallbackServiceImpl.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortalCallbackServiceImpl.java Fri Nov 3 12:50:01 2006
@@ -15,18 +15,20 @@
*/
package org.apache.pluto.driver.services.container;
+import java.util.Collections;
+import java.util.Map;
+
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import org.apache.pluto.PortletWindow;
import org.apache.pluto.driver.AttributeKeys;
import org.apache.pluto.driver.core.ResourceURLProviderImpl;
+import org.apache.pluto.spi.EventProvider;
import org.apache.pluto.spi.PortalCallbackService;
import org.apache.pluto.spi.PortletURLProvider;
import org.apache.pluto.spi.ResourceURLProvider;
-import java.util.Map;
-import java.util.Collections;
-
/**
* @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
* @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
@@ -89,5 +91,15 @@
String value) {
// TODO: currently this method does nothing.
}
+
+ public EventProvider getEventProvider(
+ HttpServletRequest request,HttpServletResponse response) {
+ return EventProviderImpl.getEventProviderImpl(request,response);
+ }
+
+
+ public EventProvider getEventProvider() {
+ return EventProviderImpl.getEventProviderImpl();
+ }
}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletURLProviderImpl.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/services/container/PortletURLProviderImpl.java?view=diff&rev=470984&r1=470983&r2=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletURLProviderImpl.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletURLProviderImpl.java Fri Nov 3 12:50:01 2006
@@ -23,9 +23,10 @@
import javax.servlet.http.HttpServletRequest;
import org.apache.pluto.PortletWindow;
-import org.apache.pluto.driver.url.PortalURLParameter;
-import org.apache.pluto.driver.url.PortalURL;
import org.apache.pluto.driver.core.PortalRequestContext;
+import org.apache.pluto.driver.url.PortalURL;
+import org.apache.pluto.driver.url.PortalURLParameter;
+import org.apache.pluto.driver.url.impl.PortalURLParserImpl;
import org.apache.pluto.spi.PortletURLProvider;
/**
@@ -37,12 +38,22 @@
private PortalURL url;
private String window;
+
+ private static final String KEY = PortalURL.class.getName();
public PortletURLProviderImpl(HttpServletRequest request,
PortletWindow internalPortletWindow) {
- PortalRequestContext ctx = (PortalRequestContext)
- request.getAttribute(PortalRequestContext.REQUEST_KEY);
- url = ctx.createPortalURL();
+ PortalURL portalURL = (PortalURL) request.getAttribute(KEY);
+ if (portalURL == null) {
+ PortalRequestContext ctx = (PortalRequestContext)
+ request.getAttribute(PortalRequestContext.REQUEST_KEY);
+ url = ctx.createPortalURL();
+ request.setAttribute(KEY, portalURL);
+
+ }
+ else {
+ url = (PortalURL) portalURL.clone();
+ }
this.window = internalPortletWindow.getId().getStringId();
}
@@ -94,5 +105,11 @@
public String toString() {
return url.toString();
}
+
+ public void savePortalURL(HttpServletRequest request) {
+ PortalRequestContext ctx = (PortalRequestContext)
+ request.getAttribute(PortalRequestContext.REQUEST_KEY);
+ ctx.setPortalURL(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=470984&r1=470983&r2=470984
==============================================================================
--- 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 Nov 3 12:50:01 2006
@@ -15,18 +15,26 @@
*/
package org.apache.pluto.driver.url.impl;
-import org.apache.pluto.driver.url.PortalURL;
-import org.apache.pluto.driver.url.PortalURLParameter;
-
-import javax.portlet.PortletMode;
-import javax.portlet.WindowState;
-
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.driver.AttributeKeys;
+import org.apache.pluto.driver.config.DriverConfiguration;
+import org.apache.pluto.driver.services.container.EventProviderImpl;
+import org.apache.pluto.driver.services.portal.PageConfig;
+import org.apache.pluto.driver.url.PortalURL;
+import org.apache.pluto.driver.url.PortalURLParameter;
+
/**
* The portal URL.
* @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
@@ -51,6 +59,11 @@
/** Parameters of the portlet windows. */
private Map parameters = new HashMap();
+ /** Logger. */
+ private static final Log LOG = LogFactory.getLog(PortalURLImpl.class);
+
+ private static final String KEY = PortalURL.class.getName();
+
// Constructors ------------------------------------------------------------
@@ -235,4 +248,13 @@
portalURL.resourceWindow = resourceWindow;
return portalURL;
}
+
+ public PageConfig getPageConfig(ServletContext servletContext) {
+ String requestedPageId = getRenderPath();
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Requested Page: " + requestedPageId);
+ }
+ return ((DriverConfiguration) servletContext.getAttribute(
+ AttributeKeys.DRIVER_CONFIG)).getPageConfig(requestedPageId);
+ }
}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/pom.xml?view=diff&rev=470984&r1=470983&r2=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/pom.xml (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/pom.xml Fri Nov 3 12:50:01 2006
@@ -128,6 +128,15 @@
<resourcesDirectory>${basedir}/../pluto-site/src/site/resources</resourcesDirectory>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <!-- best lock down version of the plugin too -->
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
</plugins>
</build>
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=470984&r1=470983&r2=470984
==============================================================================
--- 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 Nov 3 12:50:01 2006
@@ -16,6 +16,7 @@
package org.apache.pluto.driver;
import java.io.IOException;
+import java.util.List;
import javax.portlet.PortletException;
import javax.servlet.RequestDispatcher;
@@ -29,6 +30,11 @@
import org.apache.commons.logging.LogFactory;
import org.apache.pluto.PortletContainer;
import org.apache.pluto.PortletContainerException;
+import org.apache.pluto.PortletWindow;
+import org.apache.pluto.core.PortletContextManager;
+import org.apache.pluto.descriptors.portlet.EventDD;
+import org.apache.pluto.descriptors.portlet.PortletDD;
+import org.apache.pluto.descriptors.portlet.RenderDD;
import org.apache.pluto.driver.config.DriverConfiguration;
import org.apache.pluto.driver.core.PortalRequestContext;
import org.apache.pluto.driver.core.PortletWindowImpl;
@@ -36,6 +42,9 @@
import org.apache.pluto.driver.services.portal.PortletWindowConfig;
import org.apache.pluto.driver.services.portal.SupportedModesService;
import org.apache.pluto.driver.url.PortalURL;
+import org.apache.pluto.internal.InternalPortletContext;
+import org.apache.pluto.internal.InternalPortletWindow;
+import org.apache.pluto.spi.EventProvider;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.WebApplicationContext;
@@ -166,6 +175,8 @@
LOG.error("PageConfig for render path [" + portalURL.getRenderPath() + "] could not be found.");
}
+ registerPortlets(pageConfig, portalURL);
+
request.setAttribute(AttributeKeys.CURRENT_PAGE, pageConfig);
String uri = (pageConfig.getUri() != null)
? pageConfig.getUri() : DEFAULT_PAGE_URI;
@@ -194,6 +205,40 @@
// Private Methods ---------------------------------------------------------
+
+ private void registerPortlets(PageConfig pageConfig, PortalURL portalURL) throws ServletException {
+ // Retrieve the associated internal portlet context.
+ try {
+ InternalPortletContext portletContext = PortletContextManager.getManager()
+ .getPortletContext(getServletContext());
+ portletContext.getPortletApplicationDefinition();
+ } catch (PortletContainerException ex) {
+ ex.printStackTrace();
+ throw new ServletException(ex);
+ }
+
+ // iterate all portlets on the page
+ for (Object object : pageConfig.getPortletIds()) {
+ String portletId = (String) object;
+ DriverConfiguration driverConfig = (DriverConfiguration)
+ getServletContext().getAttribute(AttributeKeys.DRIVER_CONFIG);
+ PortletWindowConfig windowConfig = driverConfig
+ .getPortletWindowConfig(portletId);
+ PortletWindow window = new PortletWindowImpl(windowConfig, portalURL);
+ InternalPortletWindow win = new org.apache.pluto.internal.impl.PortletWindowImpl(
+ getServletContext(),window);
+ PortletDD portletDD = win.getPortletEntity().getPortletDefinition();
+
+ // register Events
+ EventProvider eventProvider = container.getRequiredContainerServices()
+ .getPortalCallbackService().getEventProvider();
+ List<EventDD> events = portletDD.getProcessingEvents();
+ for (EventDD eventDD : events) {
+ eventProvider.registerEvent(eventDD.getName(),window.getId().getStringId());
+ LOG.debug(eventDD.getName()+" erfolgreich registriert!");
+ }
+ }
+ }
/**
* Returns the config of the portal page to be rendered.
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortalRequestContext.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortalRequestContext.java?view=diff&rev=470984&r1=470983&r2=470984
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortalRequestContext.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortalRequestContext.java Fri Nov 3 12:50:01 2006
@@ -119,4 +119,8 @@
public PortalURL createPortalURL() {
return (PortalURL)getRequestedPortalURL().clone();
}
+
+ public void setPortalURL(PortalURL portalURL){
+ requestedPortalURL = portalURL;
+ }
}
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=470984&r1=470983&r2=470984
==============================================================================
--- 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 Nov 3 12:50:01 2006
@@ -16,11 +16,16 @@
package org.apache.pluto.driver.url;
-import javax.portlet.PortletMode;
-import javax.portlet.WindowState;
import java.util.Collection;
import java.util.Map;
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.pluto.driver.services.portal.PageConfig;
+
/**
* Created by IntelliJ IDEA.
* User: ddewolf
@@ -66,4 +71,6 @@
String getResourceWindow();
void setResourceWindow(String window);
+
+ PageConfig getPageConfig(ServletContext servletContext);
}