Author: julien(a)jboss.com
Date: 2008-06-12 05:51:29 -0400 (Thu, 12 Jun 2008)
New Revision: 10996
Added:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentResponse.java
Modified:
modules/presentation/trunk/build/pom.xml
modules/presentation/trunk/classic/pom.xml
modules/presentation/trunk/classic/src/assemble/presentation-war.xml
modules/presentation/trunk/portal/pom.xml
modules/presentation/trunk/portal/src/assemble/presentation-portal-war.xml
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/web.xml
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationEventControllerContext.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletControllerContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationResponse.java
Log:
minor adjustement
Modified: modules/presentation/trunk/build/pom.xml
===================================================================
--- modules/presentation/trunk/build/pom.xml 2008-06-12 02:15:10 UTC (rev 10995)
+++ modules/presentation/trunk/build/pom.xml 2008-06-12 09:51:29 UTC (rev 10996)
@@ -29,7 +29,6 @@
<version.junit>3.8.1</version.junit>
<version.httpunit>1.6</version.httpunit>
<version.gwt>1.4.60</version.gwt>
- <version.mygwt>0.3.0</version.mygwt>
<version.portlet-api>2.0</version.portlet-api>
@@ -71,7 +70,6 @@
</repository>
</repositories>
-
<pluginRepositories>
<pluginRepository>
<
id>java.net maven repository</id>
@@ -115,10 +113,10 @@
<version>${version.gwt}</version>
</dependency>
- <dependency>
- <groupId>net.mygwt</groupId>
- <artifactId>mygwt</artifactId>
- <version>${version.mygwt}</version>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev-mac</artifactId>
+ <version>${version.gwt}</version>
</dependency>
<dependency>
Modified: modules/presentation/trunk/classic/pom.xml
===================================================================
--- modules/presentation/trunk/classic/pom.xml 2008-06-12 02:15:10 UTC (rev 10995)
+++ modules/presentation/trunk/classic/pom.xml 2008-06-12 09:51:29 UTC (rev 10996)
@@ -21,12 +21,6 @@
</dependency>
<dependency>
- <groupId>org.jboss.portal.presentation</groupId>
- <artifactId>presentation-portlet</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
<groupId>sun-servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
Modified: modules/presentation/trunk/classic/src/assemble/presentation-war.xml
===================================================================
--- modules/presentation/trunk/classic/src/assemble/presentation-war.xml 2008-06-12
02:15:10 UTC (rev 10995)
+++ modules/presentation/trunk/classic/src/assemble/presentation-war.xml 2008-06-12
09:51:29 UTC (rev 10996)
@@ -33,7 +33,6 @@
<include>org.jboss.portal.portlet:portlet-mc</include>
<include>org.jboss.portal.portlet:portlet-samples</include>
<include>org.jboss.portal.presentation:presentation-presentation</include>
-
<include>org.jboss.portal.presentation:presentation-portlet</include>
<include>javax.ccpp:ccpp</include>
<include>javax.portlet:portlet-api</include>
Modified: modules/presentation/trunk/portal/pom.xml
===================================================================
--- modules/presentation/trunk/portal/pom.xml 2008-06-12 02:15:10 UTC (rev 10995)
+++ modules/presentation/trunk/portal/pom.xml 2008-06-12 09:51:29 UTC (rev 10996)
@@ -28,13 +28,13 @@
<dependency>
<groupId>org.jboss.portal.presentation</groupId>
- <artifactId>presentation-ajax2</artifactId>
+ <artifactId>presentation-ajax</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.portal.presentation</groupId>
- <artifactId>presentation-ajax2</artifactId>
+ <artifactId>presentation-ajax</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
@@ -145,7 +145,7 @@
<phase>generate-resources</phase>
<configuration>
<outputDirectory>target/presentation-portal-war</outputDirectory>
-
<includeArtifacIds>presentation-ajax2</includeArtifacIds>
+
<includeArtifacIds>presentation-ajax</includeArtifacIds>
<includeGroupIds>org.jboss.portal.presentation</includeGroupIds>
<includeTypes>war</includeTypes>
<excludeTransitive>true</excludeTransitive>
Modified: modules/presentation/trunk/portal/src/assemble/presentation-portal-war.xml
===================================================================
--- modules/presentation/trunk/portal/src/assemble/presentation-portal-war.xml 2008-06-12
02:15:10 UTC (rev 10995)
+++ modules/presentation/trunk/portal/src/assemble/presentation-portal-war.xml 2008-06-12
09:51:29 UTC (rev 10996)
@@ -31,7 +31,7 @@
<unpack>true</unpack>
<outputDirectory></outputDirectory>
<includes>
-
<include>org.jboss.portal.presentation:presentation-ajax2:war</include>
+
<include>org.jboss.portal.presentation:presentation-ajax:war</include>
</includes>
</dependencySet>
-->
@@ -52,7 +52,7 @@
<include>org.jboss.portal.presentation:presentation-classic</include>
-
<include>org.jboss.portal.presentation:presentation-ajax2</include>
+
<include>org.jboss.portal.presentation:presentation-ajax</include>
<include>com.google.gwt:gwt-user</include>
<include>javax.ccpp:ccpp</include>
Modified:
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/web.xml
===================================================================
---
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/web.xml 2008-06-12
02:15:10 UTC (rev 10995)
+++
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/web.xml 2008-06-12
09:51:29 UTC (rev 10996)
@@ -49,7 +49,7 @@
<servlet>
<servlet-name>AjaxPresentationServlet</servlet-name>
-
<servlet-class>org.jboss.portal.presentation.ajax2.server.PresentationClientServlet</servlet-class>
+
<servlet-class>org.jboss.portal.presentation.ajax.server.PresentationClientServlet</servlet-class>
</servlet>
<servlet-mapping>
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-06-12
02:15:10 UTC (rev 10995)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-06-12
09:51:29 UTC (rev 10996)
@@ -36,6 +36,7 @@
import org.jboss.portal.presentation.portal.content.PageContentContext;
import org.jboss.portal.presentation.portal.content.WindowContentContext;
import org.jboss.portal.presentation.portal.content.Content;
+import org.jboss.portal.presentation.portal.content.ContentResponse;
import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.protocol.ErrorResponse;
import org.jboss.portal.presentation.protocol.ProtocolAction;
@@ -158,9 +159,12 @@
WindowContentContext windowContext =
pageContext.getWindowContext("node." + window.getId());
//
- ProtocolResponse response = handler.process(windowContext, client,
contentAction);
+ ContentResponse contentResponse = handler.process(windowContext, client,
contentAction);
//
+ ProtocolResponse response = contentResponse.getProtocolResponse();
+
+ //
if (response == null)
{
PageNode page = (PageNode)window.getParent();
@@ -170,7 +174,7 @@
}
//
- return new PresentationResponse(response);
+ return new PresentationResponse(response,
contentResponse.getStaleObjects());
}
}
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java 2008-06-12
02:15:10 UTC (rev 10995)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java 2008-06-12
09:51:29 UTC (rev 10996)
@@ -35,7 +35,7 @@
public interface ContentHandler
{
- ProtocolResponse process(WindowContentContext windowContentContext, PresentationClient
client, ContentAction action) throws PresentationServerException;
+ ContentResponse process(WindowContentContext windowContentContext, PresentationClient
client, ContentAction action) throws PresentationServerException;
ContentFragment render(WindowContentContext windowContentContext, PresentationClient
client) throws PresentationServerException;
Added:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentResponse.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentResponse.java
(rev 0)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentResponse.java 2008-06-12
09:51:29 UTC (rev 10996)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.portal.content;
+
+import org.jboss.portal.presentation.protocol.ProtocolResponse;
+
+import java.util.Set;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContentResponse
+{
+
+ /** . */
+ private static final Set<String> EMPTY_STRING_SET = Collections.emptySet();
+
+ /** . */
+ private ProtocolResponse protocolResponse;
+
+ /** . */
+ private Set<String> staleObjects;
+
+ public ContentResponse(ProtocolResponse protocolResponse, Set<String>
staleObjects)
+ {
+ if (staleObjects == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.protocolResponse = protocolResponse;
+ this.staleObjects = staleObjects;
+ }
+
+ public ContentResponse(ProtocolResponse protocolResponse)
+ {
+ this(protocolResponse, EMPTY_STRING_SET);
+ }
+
+ public ProtocolResponse getProtocolResponse()
+ {
+ return protocolResponse;
+ }
+
+ public Set<String> getStaleObjects()
+ {
+ return staleObjects;
+ }
+}
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java 2008-06-12
02:15:10 UTC (rev 10995)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java 2008-06-12
09:51:29 UTC (rev 10996)
@@ -24,11 +24,11 @@
import org.jboss.portal.presentation.portal.content.ContentHandler;
import org.jboss.portal.presentation.portal.content.WindowContentContext;
+import org.jboss.portal.presentation.portal.content.ContentResponse;
import org.jboss.portal.presentation.portal.content.protocol.ContentAction;
import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.client.PresentationClient;
import org.jboss.portal.presentation.server.PresentationServerException;
-import org.jboss.portal.presentation.protocol.ProtocolResponse;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -37,7 +37,7 @@
public class MarkupContentHandler implements ContentHandler
{
- public ProtocolResponse process(WindowContentContext windowContentContext,
PresentationClient client, ContentAction action) throws PresentationServerException
+ public ContentResponse process(WindowContentContext windowContentContext,
PresentationClient client, ContentAction action) throws PresentationServerException
{
throw new UnsupportedOperationException();
}
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java 2008-06-12
02:15:10 UTC (rev 10995)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java 2008-06-12
09:51:29 UTC (rev 10996)
@@ -24,6 +24,7 @@
import org.jboss.portal.presentation.portal.content.ContentHandler;
import org.jboss.portal.presentation.portal.content.WindowContentContext;
+import org.jboss.portal.presentation.portal.content.ContentResponse;
import org.jboss.portal.presentation.portal.content.protocol.ContentAction;
import
org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPortletControllerContext;
import
org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPortletPageNavigationalState;
@@ -46,6 +47,8 @@
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.common.NotYetImplemented;
+import java.util.Set;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
@@ -71,7 +74,7 @@
return new PortletPageContextImpl(portletInvoker,
windowContentContext.getPageContext());
}
- public ProtocolResponse process(WindowContentContext windowContentContext,
PresentationClient client, ContentAction action) throws PresentationServerException
+ public ContentResponse process(WindowContentContext windowContentContext,
PresentationClient client, ContentAction action) throws PresentationServerException
{
PortletContainerAction pcAction = (PortletContainerAction)action;
@@ -141,8 +144,11 @@
e.printStackTrace();
}
+ // Windows that consumed at least one event during the interaction
+ Set<String> staleWindows =
portletControllerContext.getEventControllerContext().getStaleWindows();
+
//
- return null;
+ return new ContentResponse(null, staleWindows);
}
public ContentFragment render(WindowContentContext windowContentContext,
PresentationClient client) throws PresentationServerException
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationEventControllerContext.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationEventControllerContext.java 2008-06-12
02:15:10 UTC (rev 10995)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationEventControllerContext.java 2008-06-12
09:51:29 UTC (rev 10996)
@@ -28,6 +28,10 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.info.PortletInfo;
+import java.util.Set;
+import java.util.Collections;
+import java.util.HashSet;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
@@ -38,11 +42,20 @@
/** . */
private final PresentationPortletControllerContext portletControllerContext;
+ /** . */
+ private Set<String> staleWindows;
+
public PresentationEventControllerContext(PresentationPortletControllerContext
portletControllerContext)
{
this.portletControllerContext = portletControllerContext;
+ this.staleWindows = Collections.emptySet();
}
+ public Set<String> getStaleWindows()
+ {
+ return staleWindows;
+ }
+
public void eventProduced(EventPhaseContext context, PortletWindowEvent producedEvent,
PortletWindowEvent sourceEvent)
{
for (String windowId : portletControllerContext.getWindowIds())
@@ -58,6 +71,13 @@
public void eventConsumed(EventPhaseContext context, PortletWindowEvent consumedEvent,
PortletInvocationResponse consumerResponse)
{
+ if (staleWindows.isEmpty())
+ {
+ staleWindows = new HashSet<String>();
+ }
+
+ //
+ staleWindows.add(consumedEvent.getWindowId());
}
public void eventFailed(EventPhaseContext context, PortletWindowEvent failedEvent,
Throwable throwable)
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletControllerContext.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletControllerContext.java 2008-06-12
02:15:10 UTC (rev 10995)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletControllerContext.java 2008-06-12
09:51:29 UTC (rev 10996)
@@ -26,8 +26,6 @@
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
import org.jboss.portal.portlet.controller.PortletControllerContext;
-import org.jboss.portal.portlet.controller.event.EventControllerContext;
-import org.jboss.portal.portlet.controller.state.StateControllerContext;
import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.ActionInvocation;
@@ -61,13 +59,13 @@
private final PresentationPageContext pageContext;
/** . */
- private final StateControllerContext stateControllerContext;
+ private final PresentationStateControllerContext stateControllerContext;
/** . */
private final PresentationClient client;
/** . */
- private final EventControllerContext eventControllerContext;
+ private final PresentationEventControllerContext eventControllerContext;
public PresentationPortletControllerContext(PresentationClient client,
PresentationPageContext pageContext)
{
@@ -145,12 +143,12 @@
return window.invoke(portletInvocation);
}
- public EventControllerContext getEventControllerContext()
+ public PresentationEventControllerContext getEventControllerContext()
{
return eventControllerContext;
}
- public StateControllerContext getStateControllerContext()
+ public PresentationStateControllerContext getStateControllerContext()
{
return stateControllerContext;
}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationResponse.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationResponse.java 2008-06-12
02:15:10 UTC (rev 10995)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationResponse.java 2008-06-12
09:51:29 UTC (rev 10996)
@@ -24,6 +24,9 @@
import org.jboss.portal.presentation.protocol.ProtocolResponse;
+import java.util.Set;
+import java.util.Collections;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
@@ -32,21 +35,45 @@
{
/** . */
+ private static final Set<String> EMPTY_STRING_SET = Collections.emptySet();
+
+ /** . */
private final ProtocolResponse protocolResponse;
- public PresentationResponse(ProtocolResponse protocolResponse)
+ /** . */
+ private final Set<String> staleObjects;
+
+ public PresentationResponse(
+ ProtocolResponse protocolResponse,
+ Set<String> staleObjects)
{
if (protocolResponse == null)
{
throw new IllegalArgumentException("No null protocol response");
}
+ if (staleObjects == null)
+ {
+ throw new IllegalArgumentException();
+ }
//
this.protocolResponse = protocolResponse;
+ this.staleObjects = staleObjects;
}
+ public PresentationResponse(
+ ProtocolResponse protocolResponse)
+ {
+ this(protocolResponse, EMPTY_STRING_SET);
+ }
+
public ProtocolResponse getProtocolResponse()
{
return protocolResponse;
}
+
+ public Set<String> getStaleObjects()
+ {
+ return staleObjects;
+ }
}