Author: mstruk
Date: 2010-12-15 08:03:18 -0500 (Wed, 15 Dec 2010)
New Revision: 5591
Added:
sandbox/cdi_support/pc/branches/cdi/api/src/test/java/org/gatein/pc/api/cache/
sandbox/cdi_support/pc/branches/cdi/api/src/test/java/org/gatein/pc/api/cache/CacheLevelTestCase.java
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/aspects/SessionInvalidatorInterceptor.java
sandbox/cdi_support/pc/branches/cdi/samples/src/assemble/samples-shoppingcart-event-jar.xml
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr286/api/portleturl/ParameterMapTestCase.java
Removed:
sandbox/cdi_support/pc/branches/cdi/api/src/test/java/org/gatein/pc/api/cache/CacheLevelTestCase.java
Modified:
sandbox/cdi_support/pc/branches/cdi/
sandbox/cdi_support/pc/branches/cdi/api/
sandbox/cdi_support/pc/branches/cdi/api/pom.xml
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/ContainerURL.java
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/Mode.java
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/PortletContext.java
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/StateString.java
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/WindowState.java
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/cache/CacheLevel.java
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/spi/PortalContext.java
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/spi/WindowContext.java
sandbox/cdi_support/pc/branches/cdi/bridge/
sandbox/cdi_support/pc/branches/cdi/bridge/pom.xml
sandbox/cdi_support/pc/branches/cdi/controller/
sandbox/cdi_support/pc/branches/cdi/controller/pom.xml
sandbox/cdi_support/pc/branches/cdi/controller/src/main/java/org/gatein/pc/controller/impl/ControllerRequestFactory.java
sandbox/cdi_support/pc/branches/cdi/docs/
sandbox/cdi_support/pc/branches/cdi/docs/pom.xml
sandbox/cdi_support/pc/branches/cdi/docs/user-guide/
sandbox/cdi_support/pc/branches/cdi/docs/user-guide/en/modules/introduction.xml
sandbox/cdi_support/pc/branches/cdi/docs/user-guide/en/modules/simpleportal.xml
sandbox/cdi_support/pc/branches/cdi/docs/user-guide/pom.xml
sandbox/cdi_support/pc/branches/cdi/federation/
sandbox/cdi_support/pc/branches/cdi/federation/pom.xml
sandbox/cdi_support/pc/branches/cdi/federation/src/main/java/org/gatein/pc/federation/impl/FederatedPortletInvokerService.java
sandbox/cdi_support/pc/branches/cdi/federation/src/main/java/org/gatein/pc/federation/impl/FederatingPortletInvokerService.java
sandbox/cdi_support/pc/branches/cdi/jsr168api/
sandbox/cdi_support/pc/branches/cdi/jsr168api/build.xml
sandbox/cdi_support/pc/branches/cdi/jsr168api/pom.xml
sandbox/cdi_support/pc/branches/cdi/management/
sandbox/cdi_support/pc/branches/cdi/management/pom.xml
sandbox/cdi_support/pc/branches/cdi/mc/
sandbox/cdi_support/pc/branches/cdi/mc/pom.xml
sandbox/cdi_support/pc/branches/cdi/pom.xml
sandbox/cdi_support/pc/branches/cdi/portal/
sandbox/cdi_support/pc/branches/cdi/portal/pom.xml
sandbox/cdi_support/pc/branches/cdi/portal/src/main/java/org/gatein/pc/portal/jsp/taglib/PortletURLTag.java
sandbox/cdi_support/pc/branches/cdi/portal/src/main/resources/simple-portal-war/demo/home.jsp
sandbox/cdi_support/pc/branches/cdi/portlet/
sandbox/cdi_support/pc/branches/cdi/portlet/pom.xml
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/BaseURLImpl.java
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletResponseImpl.java
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceURLImpl.java
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/StateAwareResponseImpl.java
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr286/taglib/GenerateURL286Tag.java
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/spi/AbstractWindowContext.java
sandbox/cdi_support/pc/branches/cdi/samples/
sandbox/cdi_support/pc/branches/cdi/samples/pom.xml
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/google-portlet-war/WEB-INF/portlet.xml
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/shoppingcart-portlet-war/WEB-INF/portlet.xml
sandbox/cdi_support/pc/branches/cdi/samples/src/main/java/org/gatein/pc/samples/shoppingcart/CartEvent.java
sandbox/cdi_support/pc/branches/cdi/test/
sandbox/cdi_support/pc/branches/cdi/test/pom.xml
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr168/tck/portletinterface/ExceptionsDuringRequestHandlingTestCase.java
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java
Log:
Merged trunk changes up to r5590
Property changes on: sandbox/cdi_support/pc/branches/cdi
___________________________________________________________________
Name: svn:ignore
- target
.settings
.project
+ target
.settings
.project
.idea
*.iml
Property changes on: sandbox/cdi_support/pc/branches/cdi/api
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/api/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/api/pom.xml 2010-12-14 17:02:37 UTC (rev 5590)
+++ sandbox/cdi_support/pc/branches/cdi/api/pom.xml 2010-12-15 13:03:18 UTC (rev 5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.gatein.pc</groupId>
@@ -55,6 +55,7 @@
</execution>
</executions>
<configuration>
+ <failOnError>true</failOnError>
<testsuites>
<testsuite>
<config>jboss-unit.xml</config>
Modified:
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/ContainerURL.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/ContainerURL.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/ContainerURL.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -22,6 +22,8 @@
*/
package org.gatein.pc.api;
+import java.util.Map;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
@@ -48,4 +50,12 @@
* @return the navigational state
*/
StateString getNavigationalState();
+
+ /**
+ * Returns a set of properties associated with this URL. The returned map cannot be
modified.
+ *
+ * @return the property map
+ */
+ Map<String, String> getProperties();
+
}
Modified:
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/Mode.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/Mode.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/Mode.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -53,6 +53,11 @@
/** . */
private String name;
+ /**
+ * This NEEDS to be public for JAXB unmarshalling done by SupportsMetaData.
+ *
+ * @param name
+ */
public Mode(String name)
{
this(name, false);
@@ -99,22 +104,12 @@
private Object readResolve()
{
- if (VIEW.name.equals(name))
+ Mode standardMode = isStandardMode(name);
+
+ if (standardMode != null)
{
- return VIEW;
+ return standardMode;
}
- else if (EDIT.name.equals(name))
- {
- return EDIT;
- }
- else if (HELP.name.equals(name))
- {
- return HELP;
- }
- else if (EDIT_DEFAULTS.name.equals(name))
- {
- return EDIT_DEFAULTS;
- }
else
{
return this;
@@ -134,6 +129,19 @@
*/
public static Mode create(String name, boolean preserveCase)
{
+ Mode standardMode = isStandardMode(name);
+ if (standardMode != null)
+ {
+ return standardMode;
+ }
+ else
+ {
+ return new Mode(name, preserveCase);
+ }
+ }
+
+ private static Mode isStandardMode(String name)
+ {
if (Mode.VIEW.name.equals(name))
{
return Mode.VIEW;
@@ -156,7 +164,7 @@
}
else
{
- return new Mode(name, preserveCase);
+ return null;
}
}
}
\ No newline at end of file
Modified:
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/PortletContext.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/PortletContext.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/PortletContext.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -132,7 +132,7 @@
/**
* Create a PortletContext based on given id and required state: this method will fail
if state is not valid. Use
- * this method instead of {@link #createPortletContext(String,byte[])} for cases when
a state is expected and the
+ * this method instead of {@link #createPortletContext(String, byte[])} for cases when
a state is expected and the
* creation of the PortletContext should fail if no state was given.
*
* @param id the portlet id
@@ -147,7 +147,7 @@
public static PortletContext createPortletContext(String portletId)
{
- return createPortletContext(portletId, null);
+ return createPortletContext(portletId, (byte[])null);
}
public String getApplicationName()
@@ -159,4 +159,9 @@
{
return portletName;
}
+
+ public static PortletContext createPortletContext(String portletApplicationId, String
containerId)
+ {
+ return PortletContext.createPortletContext(portletApplicationId + SEPARATOR +
containerId);
+ }
}
Modified:
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/StateString.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/StateString.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/StateString.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -118,7 +118,7 @@
if (!opaqueValue.startsWith(JBPNS_PREFIX))
{
throw new IllegalArgumentException("Bad format: [" + opaqueValue
- + "] was not encoded by JBoss Portal and thus cannot be
decoded.");
+ + "] was not encoded by the JBoss portlet container and thus cannot be
decoded.");
}
//
Modified:
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/WindowState.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/WindowState.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/WindowState.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -47,6 +47,11 @@
/** . */
private String name;
+ /**
+ * This NEEDS to be public for JAXB unmarshalling done by SupportsMetaData.
+ *
+ * @param name
+ */
public WindowState(String name)
{
this(name, false);
@@ -93,6 +98,19 @@
private Object readResolve()
{
+ WindowState standardWindowState = isStandardWindowState(name);
+ if (standardWindowState != null)
+ {
+ return standardWindowState;
+ }
+ else
+ {
+ return this;
+ }
+ }
+
+ private static WindowState isStandardWindowState(String name)
+ {
if (NORMAL.name.equals(name))
{
return NORMAL;
@@ -107,7 +125,7 @@
}
else
{
- return this;
+ return null;
}
}
@@ -124,18 +142,11 @@
*/
public static WindowState create(String name, boolean preserveCase)
{
- if (WindowState.NORMAL.name.equals(name))
+ WindowState standardWindowState = isStandardWindowState(name);
+ if (standardWindowState != null)
{
- return WindowState.NORMAL;
+ return standardWindowState;
}
- else if (WindowState.MINIMIZED.name.equals(name))
- {
- return WindowState.MINIMIZED;
- }
- else if (WindowState.MAXIMIZED.name.equals(name))
- {
- return WindowState.MAXIMIZED;
- }
else
{
return new WindowState(name, preserveCase);
Modified:
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/cache/CacheLevel.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/cache/CacheLevel.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/cache/CacheLevel.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -22,13 +22,101 @@
******************************************************************************/
package org.gatein.pc.api.cache;
+import org.gatein.common.util.ParameterValidation;
+
+import java.io.Serializable;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public enum CacheLevel
+public final class CacheLevel implements Serializable
{
+ public static final CacheLevel FULL = new CacheLevel("FULL");
+ public static final CacheLevel PORTLET = new CacheLevel("PORTLET");
+ public static final CacheLevel PAGE = new CacheLevel("PAGE");
- FULL, PORTLET, PAGE
+ private static final long serialVersionUID = -7020875805659724988L;
+ private final String name;
+
+ private CacheLevel(String name)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "CacheLevel
name", null);
+ this.name = name;
+ }
+
+ public final String name()
+ {
+ return name;
+ }
+
+ private Object readResolve()
+ {
+ CacheLevel standardCacheLevel = isStandardCacheLevel(name);
+ if (standardCacheLevel != null)
+ {
+ return standardCacheLevel;
+ }
+ else
+ {
+ return this;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ CacheLevel that = (CacheLevel)o;
+
+ return !(name == null ? that.name != null : !name.equals(that.name));
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return name != null ? name.hashCode() : 0;
+ }
+
+ public static CacheLevel create(String name)
+ {
+ CacheLevel standardCacheLevel = isStandardCacheLevel(name);
+ if (standardCacheLevel != null)
+ {
+ return standardCacheLevel;
+ }
+ else
+ {
+ return new CacheLevel(name);
+ }
+ }
+
+ private static CacheLevel isStandardCacheLevel(String name)
+ {
+ if (FULL.name.equals(name))
+ {
+ return FULL;
+ }
+ else if (PORTLET.name.equals(name))
+ {
+ return PORTLET;
+ }
+ else if (PAGE.name.equals(name))
+ {
+ return PAGE;
+ }
+ else
+ {
+ return null;
+ }
+ }
}
Modified:
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/spi/PortalContext.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/spi/PortalContext.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/spi/PortalContext.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -36,7 +36,7 @@
*/
public interface PortalContext
{
- public static final Version VERSION = new Version("GateIn Portlet
Container", 2, 1, 1, new Version.Qualifier(Version.Qualifier.Prefix.GA),
"Community");
+ public static final Version VERSION = new Version("GateIn Portlet
Container", 2, 2, 0, new Version.Qualifier(Version.Qualifier.Prefix.GA),
"Community");
/**
* Return info about the portal. Must conform to
javax.portlet.PortalContext.getPortalInfo().
Modified:
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/spi/WindowContext.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/spi/WindowContext.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/api/src/main/java/org/gatein/pc/api/spi/WindowContext.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -34,4 +34,12 @@
* @return the window id
*/
String getId();
+
+ /**
+ * Return a String that can be used for the Portlet prefixing of tokens that need to
be unique within the markup of
+ * the aggregated page (e.g. JavaScript variables, HTML id attributes, etc.)
+ *
+ * @return a String that can be used as namespace in aggregated markup
+ */
+ String getNamespace();
}
Copied: sandbox/cdi_support/pc/branches/cdi/api/src/test/java/org/gatein/pc/api/cache
(from rev 5590, components/pc/trunk/api/src/test/java/org/gatein/pc/api/cache)
Deleted:
sandbox/cdi_support/pc/branches/cdi/api/src/test/java/org/gatein/pc/api/cache/CacheLevelTestCase.java
===================================================================
---
components/pc/trunk/api/src/test/java/org/gatein/pc/api/cache/CacheLevelTestCase.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/api/src/test/java/org/gatein/pc/api/cache/CacheLevelTestCase.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -1,102 +0,0 @@
-/*
-* 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.gatein.pc.api.cache;
-
-import junit.framework.TestCase;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class CacheLevelTestCase extends TestCase
-{
- public void testCacheLevelFactory()
- {
- CacheLevel cacheLevel = CacheLevel.create("FULL");
- assertTrue(CacheLevel.FULL == cacheLevel);
- assertEquals(CacheLevel.FULL, cacheLevel);
- assertEquals(CacheLevel.FULL.name(), cacheLevel.name());
-
- cacheLevel = CacheLevel.create("PORTLET");
- assertTrue(CacheLevel.PORTLET == cacheLevel);
- assertEquals(CacheLevel.PORTLET, cacheLevel);
- assertEquals(CacheLevel.PORTLET.name(), cacheLevel.name());
-
- cacheLevel = CacheLevel.create("PAGE");
- assertTrue(CacheLevel.PAGE == cacheLevel);
- assertEquals(CacheLevel.PAGE, cacheLevel);
- assertEquals(CacheLevel.PAGE.name(), cacheLevel.name());
-
- try
- {
- CacheLevel.create(null);
- fail("Shouldn't allow creating a CacheLevel with null name!");
- }
- catch (Exception e)
- {
- // expected
- }
-
- cacheLevel = CacheLevel.create("foo");
- assertNotNull(cacheLevel);
- assertEquals("foo", cacheLevel.name());
- assertEquals(cacheLevel, CacheLevel.create("foo"));
- }
-
- public void testSerialization() throws IOException, ClassNotFoundException
- {
- Object read = serializeCacheLevel(CacheLevel.FULL);
-
- assertTrue(CacheLevel.FULL == read);
-
- CacheLevel foo = CacheLevel.create("foo");
- read = serializeCacheLevel(foo);
-
- assertEquals(foo, read);
- }
-
- private Object serializeCacheLevel(final CacheLevel cacheLevel)
- throws IOException, ClassNotFoundException
- {
- File tempFile = File.createTempFile("foo", "tmp");
- tempFile.deleteOnExit();
-
- FileOutputStream fos = new FileOutputStream(tempFile);
- ObjectOutputStream oos = new ObjectOutputStream(fos);
- oos.writeObject(cacheLevel);
- oos.close();
-
- FileInputStream fis = new FileInputStream(tempFile);
- ObjectInputStream ois = new ObjectInputStream(fis);
- Object read = ois.readObject();
- ois.close();
- return read;
- }
-}
Copied:
sandbox/cdi_support/pc/branches/cdi/api/src/test/java/org/gatein/pc/api/cache/CacheLevelTestCase.java
(from rev 5590,
components/pc/trunk/api/src/test/java/org/gatein/pc/api/cache/CacheLevelTestCase.java)
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/api/src/test/java/org/gatein/pc/api/cache/CacheLevelTestCase.java
(rev 0)
+++
sandbox/cdi_support/pc/branches/cdi/api/src/test/java/org/gatein/pc/api/cache/CacheLevelTestCase.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -0,0 +1,102 @@
+/*
+* 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.gatein.pc.api.cache;
+
+import junit.framework.TestCase;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class CacheLevelTestCase extends TestCase
+{
+ public void testCacheLevelFactory()
+ {
+ CacheLevel cacheLevel = CacheLevel.create("FULL");
+ assertTrue(CacheLevel.FULL == cacheLevel);
+ assertEquals(CacheLevel.FULL, cacheLevel);
+ assertEquals(CacheLevel.FULL.name(), cacheLevel.name());
+
+ cacheLevel = CacheLevel.create("PORTLET");
+ assertTrue(CacheLevel.PORTLET == cacheLevel);
+ assertEquals(CacheLevel.PORTLET, cacheLevel);
+ assertEquals(CacheLevel.PORTLET.name(), cacheLevel.name());
+
+ cacheLevel = CacheLevel.create("PAGE");
+ assertTrue(CacheLevel.PAGE == cacheLevel);
+ assertEquals(CacheLevel.PAGE, cacheLevel);
+ assertEquals(CacheLevel.PAGE.name(), cacheLevel.name());
+
+ try
+ {
+ CacheLevel.create(null);
+ fail("Shouldn't allow creating a CacheLevel with null name!");
+ }
+ catch (Exception e)
+ {
+ // expected
+ }
+
+ cacheLevel = CacheLevel.create("foo");
+ assertNotNull(cacheLevel);
+ assertEquals("foo", cacheLevel.name());
+ assertEquals(cacheLevel, CacheLevel.create("foo"));
+ }
+
+ public void testSerialization() throws IOException, ClassNotFoundException
+ {
+ Object read = serializeCacheLevel(CacheLevel.FULL);
+
+ assertTrue(CacheLevel.FULL == read);
+
+ CacheLevel foo = CacheLevel.create("foo");
+ read = serializeCacheLevel(foo);
+
+ assertEquals(foo, read);
+ }
+
+ private Object serializeCacheLevel(final CacheLevel cacheLevel)
+ throws IOException, ClassNotFoundException
+ {
+ File tempFile = File.createTempFile("foo", "tmp");
+ tempFile.deleteOnExit();
+
+ FileOutputStream fos = new FileOutputStream(tempFile);
+ ObjectOutputStream oos = new ObjectOutputStream(fos);
+ oos.writeObject(cacheLevel);
+ oos.close();
+
+ FileInputStream fis = new FileInputStream(tempFile);
+ ObjectInputStream ois = new ObjectInputStream(fis);
+ Object read = ois.readObject();
+ ois.close();
+ return read;
+ }
+}
Property changes on: sandbox/cdi_support/pc/branches/cdi/bridge
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/bridge/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/bridge/pom.xml 2010-12-14 17:02:37 UTC (rev 5590)
+++ sandbox/cdi_support/pc/branches/cdi/bridge/pom.xml 2010-12-15 13:03:18 UTC (rev 5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-bridge</artifactId>
Property changes on: sandbox/cdi_support/pc/branches/cdi/controller
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/controller/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/controller/pom.xml 2010-12-14 17:02:37 UTC (rev
5590)
+++ sandbox/cdi_support/pc/branches/cdi/controller/pom.xml 2010-12-15 13:03:18 UTC (rev
5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-controller</artifactId>
@@ -69,6 +69,7 @@
</execution>
</executions>
<configuration>
+ <failOnError>true</failOnError>
<testsuites>
<testsuite>
<config>local-jboss-unit.xml</config>
Modified:
sandbox/cdi_support/pc/branches/cdi/controller/src/main/java/org/gatein/pc/controller/impl/ControllerRequestFactory.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/controller/src/main/java/org/gatein/pc/controller/impl/ControllerRequestFactory.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/controller/src/main/java/org/gatein/pc/controller/impl/ControllerRequestFactory.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -149,24 +149,26 @@
String resourceId =
queryParameters.get(ControllerRequestParameterNames.RESOURCE_ID);
//
- CacheLevel resourceCacheLevel =
CacheLevel.valueOf(queryParameters.get(ControllerRequestParameterNames.RESOURCE_CACHEABILITY));
+ CacheLevel resourceCacheLevel =
CacheLevel.create(queryParameters.get(ControllerRequestParameterNames.RESOURCE_CACHEABILITY));
//
PortletResourceRequest.Scope scope;
- switch (resourceCacheLevel)
+ if (CacheLevel.FULL.equals(resourceCacheLevel))
{
- case FULL:
- scope = new PortletResourceRequest.FullScope();
- break;
- case PORTLET:
- scope = new PortletResourceRequest.PortletScope(windowNavigationalState);
- break;
- case PAGE:
- scope = new PortletResourceRequest.PageScope(windowNavigationalState,
pageNavigationalState);
- break;
- default:
- throw new AssertionError();
+ scope = new PortletResourceRequest.FullScope();
}
+ else if (CacheLevel.PORTLET.equals(resourceCacheLevel))
+ {
+ scope = new PortletResourceRequest.PortletScope(windowNavigationalState);
+ }
+ else if (CacheLevel.PAGE.equals(resourceCacheLevel))
+ {
+ scope = new PortletResourceRequest.PageScope(windowNavigationalState,
pageNavigationalState);
+ }
+ else
+ {
+ throw new AssertionError();
+ }
//
return new PortletResourceRequest(
Property changes on: sandbox/cdi_support/pc/branches/cdi/docs
___________________________________________________________________
Name: svn:ignore
+ *.iml
Modified: sandbox/cdi_support/pc/branches/cdi/docs/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/docs/pom.xml 2010-12-14 17:02:37 UTC (rev 5590)
+++ sandbox/cdi_support/pc/branches/cdi/docs/pom.xml 2010-12-15 13:03:18 UTC (rev 5591)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
Property changes on: sandbox/cdi_support/pc/branches/cdi/docs/user-guide
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/docs/user-guide/en/modules/introduction.xml
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/docs/user-guide/en/modules/introduction.xml 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/docs/user-guide/en/modules/introduction.xml 2010-12-15
13:03:18 UTC (rev 5591)
@@ -15,8 +15,9 @@
<title>Introduction</title>
<sect1>
<title>Motivation</title>
- <para>JBoss Portlet Container is the next generation portlet container on
which future versions of JBoss Portal,
- and the JBoss Portal platform will be based. It provides a standard-compliant
implementation of the JSR-286
+ <para>JBoss Portlet Container is the next generation portlet container on
which future versions of GateIn,
+ and the JBoss Enterprise Portal Platform will be based. It provides a
standard-compliant implementation of the
+ JSR-286
Portlet 2.0 specification. It has been developed with reusability in mind so
that advanced users, who don't
require a full-fledged portal, can leverage the portlet management services it
provides in their own
applications. JBoss Portlet Container is available through the business-friendly
LGPL open source license.
Modified: sandbox/cdi_support/pc/branches/cdi/docs/user-guide/en/modules/simpleportal.xml
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/docs/user-guide/en/modules/simpleportal.xml 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/docs/user-guide/en/modules/simpleportal.xml 2010-12-15
13:03:18 UTC (rev 5591)
@@ -58,7 +58,7 @@
<sect2>
<title>Portlet deployment</title>
<para>Simple Portal integrates with a few web containers in order to
provide handling of portlet deployment and
- runtime. This feature leverages JBoss Portal's Web Service Provider
Interface (SPI). In particular, JBoss
+ runtime. This feature leverages GateIn's Web Service Provider Interface
(SPI). In particular, JBoss
Portlet Container uses the Web SPI in order to transparently react to the
life cycle of WAR files that
contains portlet components as they are deployed or undeployed on the target
servlet container. The SPI
defines two levels of integrations.
@@ -96,7 +96,7 @@
</listitem>
</itemizedlist>
<page>If you need more advanced page creation capabilities, you should
consider using a more advanced portal
- product such as JBoss Portal.
+ product such as GateIn.
</page>
<sect3>
<title>Page creation</title>
@@ -480,8 +480,8 @@
examine an extension provided to allow the display of portlets pretty much as
they are rendered in classic
portals, that is with decorations. This extension is built on top of Simple
Portal's tag library and uses
the JSP 2.0 tag library extension feature. A pretty good overview of this
feature can be found at<ulink
-
url="http://www.onjava.com/pub/a/onjava/2004/05/12/jsp2part4.html&qu...
-
http://www.onjava.com/pub/a/onjava/2004/05/12/jsp2part4.html</ulink>.
+
url="http://www.onjava.com/pub/a/onjava/2004/05/12/jsp2part4.html&qu...
+
http://www.onjava.com/pub/a/onjava/2004/05/12/jsp2part4.html</ulink>.
</para>
<sect3>
<title>The extended portlet tag</title>
@@ -511,10 +511,12 @@
<title>Portlet debugging</title>
<para>The Portlet 2.0 specification provides a new eventing feature for
coordinating several portlets.
This long awaited feature is very powerful but can sometime lead to complex
scenarios when multiple
- events are consumed and fired by multiple portlets on the same
page.</para>
+ events are consumed and fired by multiple portlets on the same page.
+ </para>
<para>The simple portal provides a visual debugger that can be used to
understand what happens during the
- event phase orchestrated by the portal. It comes as a portlet that you can place on
any page and it shows
- a tree of events that were produced and consumed during the event
phase.</para>
+ event phase orchestrated by the portal. It comes as a portlet that you can place
on any page and it shows
+ a tree of events that were produced and consumed during the event phase.
+ </para>
<mediaobject>
<imageobject>
<imagedata align="center"
fileref="images/debugger1.png" format="PNG"
@@ -528,7 +530,8 @@
tree don't represent events, they rather represent event routings from a
source portlet to
a destination portlet. By default it shows the name of the portlet that
published the event,
the event name and the destination of the event that was chosen by the simple
portal during
- the event distribution phase. Hovering the mouse on a node shows more
information.</para>
+ the event distribution phase. Hovering the mouse on a node shows more
information.
+ </para>
<mediaobject>
<imageobject>
<imagedata align="center"
fileref="images/debugger2.png" format="PNG"
@@ -539,9 +542,12 @@
</caption>
</mediaobject>
<para>When hovering the mouse on a node you can see the optional event
payload represented by
- the string returned when invoked its <code>toString()</code> method and
the state of the portlet
- after the event phase. The state of the portlet consist in its portlet mode, its
window state and the
- set of its render parameters. Adding the event debugger to a page is
easy.</para>
+ the string returned when invoked its
+ <code>toString()</code>
+ method and the state of the portlet
+ after the event phase. The state of the portlet consist in its portlet mode, its
window state and the
+ set of its render parameters. Adding the event debugger to a page is easy.
+ </para>
<example>
<title>Adding the event debugger to a portal page</title>
<programlisting><![CDATA[
@@ -553,12 +559,14 @@
<sect2>
<title>Admin portlet</title>
<para>The admin portlet shows the list of portlet applications deployed in
the simple portal. For each
- portlet application it is possible to unfold the appliation to display the
portlet contained in the
- unfolded application as well as the portlet filters.</para>
+ portlet application it is possible to unfold the appliation to display the
portlet contained in the
+ unfolded application as well as the portlet filters.
+ </para>
<sect3>
<title>Portlet application administration</title>
<para>By default the admin portlet displays the list of portlet
applications. It shows the status
- of each application and provides the capability to stop or start an
application.</para>
+ of each application and provides the capability to stop or start an
application.
+ </para>
<mediaobject>
<imageobject>
<imagedata align="center"
fileref="images/admin1.png" format="PNG"
@@ -569,14 +577,21 @@
</caption>
</mediaobject>
<para>On the example we can see that all the applications are in
started mode except the
- <emphasis>samples-basic-portlet</emphasis> application. It is
possible to manage the
- life cycle of each application by clicking on the
<emphasis>start</emphasis> link when it
- is stopped or clicking on the <emphasis>stop</emphasis> link when
it is started.</para>
+ <emphasis>samples-basic-portlet</emphasis>
+ application. It is possible to manage the
+ life cycle of each application by clicking on the
+ <emphasis>start</emphasis>
+ link when it
+ is stopped or clicking on the
+ <emphasis>stop</emphasis>
+ link when it is started.
+ </para>
</sect3>
<sect3>
<title>Portlet container and filter administration</title>
<para>Selecting a particular portlet application unfolds it and shows
the list of portlet containers
- that the application contains as well as the filters it
contains.</para>
+ that the application contains as well as the filters it contains.
+ </para>
<mediaobject>
<imageobject>
<imagedata align="center"
fileref="images/admin2.png" format="PNG"
@@ -587,7 +602,8 @@
</caption>
</mediaobject>
<para>Again here it displays the name of the container and filters, the
status of the life cycle and
- a link to start or stop the corresponding item.</para>
+ a link to start or stop the corresponding item.
+ </para>
</sect3>
</sect2>
<sect2>
Modified: sandbox/cdi_support/pc/branches/cdi/docs/user-guide/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/docs/user-guide/pom.xml 2010-12-14 17:02:37 UTC
(rev 5590)
+++ sandbox/cdi_support/pc/branches/cdi/docs/user-guide/pom.xml 2010-12-15 13:03:18 UTC
(rev 5591)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<groupId>org.gatein.pc</groupId>
<artifactId>user-guide-${translation}</artifactId>
Property changes on: sandbox/cdi_support/pc/branches/cdi/federation
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/federation/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/federation/pom.xml 2010-12-14 17:02:37 UTC (rev
5590)
+++ sandbox/cdi_support/pc/branches/cdi/federation/pom.xml 2010-12-15 13:03:18 UTC (rev
5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-federation</artifactId>
@@ -49,6 +49,7 @@
</execution>
</executions>
<configuration>
+ <failOnError>true</failOnError>
<testsuites>
<testsuite>
<config>jboss-unit.xml</config>
Modified:
sandbox/cdi_support/pc/branches/cdi/federation/src/main/java/org/gatein/pc/federation/impl/FederatedPortletInvokerService.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/federation/src/main/java/org/gatein/pc/federation/impl/FederatedPortletInvokerService.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/federation/src/main/java/org/gatein/pc/federation/impl/FederatedPortletInvokerService.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -28,7 +28,6 @@
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.PortletStateType;
import org.gatein.pc.api.StateEvent;
-import org.gatein.pc.api.StatefulPortletContext;
import org.gatein.pc.api.invocation.InvocationException;
import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
@@ -191,7 +190,7 @@
{
DestroyCloneFailure failure = failures.get(i);
String cloneId = failure.getPortletId();
- failure = new DestroyCloneFailure(reference(cloneId));
+ failure = new
DestroyCloneFailure(FederatingPortletInvokerService.reference(cloneId, id));
failures.set(i, failure);
}
@@ -220,13 +219,13 @@
public PortletContext exportPortlet(PortletStateType stateType, PortletContext
compoundPortletContext)
- throws PortletInvokerException
+ throws PortletInvokerException
{
PortletContext portletContext = dereference(compoundPortletContext);
portletContext = portletInvoker.exportPortlet(stateType, portletContext);
return reference(portletContext);
}
-
+
public PortletContext importPortlet(PortletStateType stateType, PortletContext
compoundPortletContext) throws PortletInvokerException
{
PortletContext portletContext = dereference(compoundPortletContext);
@@ -236,35 +235,13 @@
private PortletContext dereference(PortletContext compoundPortletContext)
{
- String portletId = compoundPortletContext.getId().substring(id.length() + 1);
- if (compoundPortletContext instanceof StatefulPortletContext)
- {
- StatefulPortletContext<?> compoundStatefulPortletContext =
(StatefulPortletContext<?>)compoundPortletContext;
- return StatefulPortletContext.create(portletId,
compoundStatefulPortletContext);
- }
- else
- {
- return PortletContext.createPortletContext(portletId);
- }
+ return FederatingPortletInvokerService.dereference(compoundPortletContext, id);
}
private PortletContext reference(PortletContext portletContext)
{
- String compoundPortletId = reference(portletContext.getId());
- if (portletContext instanceof StatefulPortletContext)
- {
- StatefulPortletContext<?> statefulPortletContext =
(StatefulPortletContext<?>)portletContext;
- return StatefulPortletContext.create(compoundPortletId,
statefulPortletContext);
- }
- else
- {
- return PortletContext.createPortletContext(compoundPortletId);
- }
+ return FederatingPortletInvokerService.reference(portletContext, id);
}
- private String reference(String portletId)
- {
- return id + FederatingPortletInvokerService.SEPARATOR + portletId;
- }
}
\ No newline at end of file
Modified:
sandbox/cdi_support/pc/branches/cdi/federation/src/main/java/org/gatein/pc/federation/impl/FederatingPortletInvokerService.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/federation/src/main/java/org/gatein/pc/federation/impl/FederatingPortletInvokerService.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/federation/src/main/java/org/gatein/pc/federation/impl/FederatingPortletInvokerService.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -31,6 +31,7 @@
import org.gatein.pc.api.PortletInvoker;
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.PortletStateType;
+import org.gatein.pc.api.StatefulPortletContext;
import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
import org.gatein.pc.api.state.DestroyCloneFailure;
@@ -68,6 +69,39 @@
private NullInvokerHandler nullHandler = NullInvokerHandler.DEFAULT_HANDLER;
+ public static PortletContext dereference(PortletContext compoundPortletContext, String
invokerId)
+ {
+ String portletId = compoundPortletContext.getId().substring(invokerId.length() +
1);
+ if (compoundPortletContext instanceof StatefulPortletContext)
+ {
+ StatefulPortletContext<?> compoundStatefulPortletContext =
(StatefulPortletContext<?>)compoundPortletContext;
+ return StatefulPortletContext.create(portletId,
compoundStatefulPortletContext);
+ }
+ else
+ {
+ return PortletContext.createPortletContext(portletId);
+ }
+ }
+
+ public static PortletContext reference(PortletContext portletContext, String
invokerId)
+ {
+ String compoundPortletId = reference(portletContext.getId(), invokerId);
+ if (portletContext instanceof StatefulPortletContext)
+ {
+ StatefulPortletContext<?> statefulPortletContext =
(StatefulPortletContext<?>)portletContext;
+ return StatefulPortletContext.create(compoundPortletId,
statefulPortletContext);
+ }
+ else
+ {
+ return PortletContext.createPortletContext(compoundPortletId);
+ }
+ }
+
+ static String reference(String portletId, String invokerId)
+ {
+ return invokerId + SEPARATOR + portletId;
+ }
+
public synchronized FederatedPortletInvoker registerInvoker(String federatedId,
PortletInvoker federatedInvoker)
{
if (federatedId == null)
@@ -232,19 +266,19 @@
}
public PortletContext exportPortlet(PortletStateType stateType, PortletContext
compoundPortletContext)
- throws PortletInvokerException
+ throws PortletInvokerException
{
PortletInvoker federated = getFederatedPortletInvokerFor(compoundPortletContext);
return federated.exportPortlet(stateType, compoundPortletContext);
}
public PortletContext importPortlet(PortletStateType stateType, PortletContext
compoundPortletContext)
- throws PortletInvokerException
+ throws PortletInvokerException
{
PortletInvoker federated = getFederatedPortletInvokerFor(compoundPortletContext);
return federated.importPortlet(stateType, compoundPortletContext);
}
-
+
public synchronized void setNullInvokerHandler(NullInvokerHandler nullHandler)
{
if (nullHandler == null)
Property changes on: sandbox/cdi_support/pc/branches/cdi/jsr168api
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/jsr168api/build.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/jsr168api/build.xml 2010-12-14 17:02:37 UTC (rev
5590)
+++ sandbox/cdi_support/pc/branches/cdi/jsr168api/build.xml 2010-12-15 13:03:18 UTC (rev
5591)
@@ -43,7 +43,7 @@
<!--| Buildmagic extentions. |-->
<!--+======================================================================+-->
-<project default="main" name="JBoss Portal">
+<project default="main" name="GateIn Portlet Container">
<!--+====================================================================+-->
<!--| Setup |-->
Modified: sandbox/cdi_support/pc/branches/cdi/jsr168api/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/jsr168api/pom.xml 2010-12-14 17:02:37 UTC (rev
5590)
+++ sandbox/cdi_support/pc/branches/cdi/jsr168api/pom.xml 2010-12-15 13:03:18 UTC (rev
5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-jsr168api</artifactId>
Property changes on: sandbox/cdi_support/pc/branches/cdi/management
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/management/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/management/pom.xml 2010-12-14 17:02:37 UTC (rev
5590)
+++ sandbox/cdi_support/pc/branches/cdi/management/pom.xml 2010-12-15 13:03:18 UTC (rev
5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-management</artifactId>
Property changes on: sandbox/cdi_support/pc/branches/cdi/mc
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/mc/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/mc/pom.xml 2010-12-14 17:02:37 UTC (rev 5590)
+++ sandbox/cdi_support/pc/branches/cdi/mc/pom.xml 2010-12-15 13:03:18 UTC (rev 5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-mc</artifactId>
@@ -46,6 +46,7 @@
</execution>
</executions>
<configuration>
+ <failOnError>true</failOnError>
<testsuites>
<testsuite>
<config>local-jboss-unit.xml</config>
Modified: sandbox/cdi_support/pc/branches/cdi/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/pom.xml 2010-12-14 17:02:37 UTC (rev 5590)
+++ sandbox/cdi_support/pc/branches/cdi/pom.xml 2010-12-15 13:03:18 UTC (rev 5591)
@@ -29,7 +29,7 @@
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
@@ -39,14 +39,14 @@
</parent>
<scm>
-
<
connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc...
-
<
developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/compone...
- <
url>http://fisheye.jboss.org/browse/gatein/components/pc/trunk/</ur...
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/compone...
+ <
url>http://fisheye.jboss.org/browse/gatein/components/pc/trunk</url...
</scm>
<properties>
<version.gatein.common>2.0.3-GA</version.gatein.common>
- <version.gatein.wci>2.0.1-GA</version.gatein.wci>
+ <version.gatein.wci>2.0.2-GA</version.gatein.wci>
<version.apache.portals.bridges>1.0.4</version.apache.portals.bridges>
<version.apache.taglibs>1.1.2</version.apache.taglibs>
<version.apache.log4j>1.2.14</version.apache.log4j>
Property changes on: sandbox/cdi_support/pc/branches/cdi/portal
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/portal/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/portal/pom.xml 2010-12-14 17:02:37 UTC (rev 5590)
+++ sandbox/cdi_support/pc/branches/cdi/portal/pom.xml 2010-12-15 13:03:18 UTC (rev 5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portal</artifactId>
Modified:
sandbox/cdi_support/pc/branches/cdi/portal/src/main/java/org/gatein/pc/portal/jsp/taglib/PortletURLTag.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portal/src/main/java/org/gatein/pc/portal/jsp/taglib/PortletURLTag.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/portal/src/main/java/org/gatein/pc/portal/jsp/taglib/PortletURLTag.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -33,6 +33,7 @@
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.util.Collections;
import java.util.Map;
import java.io.IOException;
@@ -124,6 +125,11 @@
{
return ws;
}
+
+ public Map<String, String> getProperties()
+ {
+ return Collections.emptyMap();
+ }
};
try
Modified:
sandbox/cdi_support/pc/branches/cdi/portal/src/main/resources/simple-portal-war/demo/home.jsp
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portal/src/main/resources/simple-portal-war/demo/home.jsp 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/portal/src/main/resources/simple-portal-war/demo/home.jsp 2010-12-15
13:03:18 UTC (rev 5591)
@@ -6,7 +6,7 @@
<img
src="${pageContext.request.contextPath}/images/pc20-picture.gif"
alt="" align="right"/>
<a
href="http://labs.jboss.com/portletcontainer"
target="jboss">
JBoss Portlet Container</a> is the next generation
- portlet container on which future versions of JBoss Portal will be based. It
provides a standard-compliant
+ portlet container on which future versions of GateIn will be based. It provides
a standard-compliant
implementation of the JSR-286 Portlet 2.0 specification. It has been developed
with reusability in mind so that
advanced users, who don't require a full-fledged portal, can leverage the
portlet management services it
provides in
@@ -29,7 +29,8 @@
<div class="box-content">
<p>JBoss (a division of Red Hat Inc.) offers various support services
tailored to fit your needs.
<a target="jboss"
href="http://jboss.com/services/index">Explore</a> support and service
options for
- <a
href="http://jboss.com/products/platforms/portals"
target="jboss">JBoss Portal</a>.</p>
+ <a
href="http://jboss.com/products/platforms/portals"
target="jboss">JBoss Enterprise Portal Platform</a>.
+ </p>
</div>
</div>
@@ -56,8 +57,9 @@
</div>
<div class="box-content">
<p>Learn more about <a
href="http://labs.jboss.com/portletcontainer" target="jboss">JBoss
Portlet Container</a>
- community project, <a
href="http://labs.jboss.com/jbossportal"
target="jboss">JBoss Portal</a>,
- <a
href="http://jboss.com/products/platforms/portals"
target="jboss">JBoss Portal platform</a></p>
+ community project, <a href="http://gatein.org"
target="jboss">GateIn</a>,
+ <a
href="http://jboss.com/products/platforms/portals"
target="jboss">JBoss Enterprise Portal platform</a>
+ </p>
</div>
</div>
<br/>
@@ -68,7 +70,7 @@
enjoy developing it!</p>
<p>Baci e abbracci,<br/>
- The JBoss Portal Team.</p>
+ The GateIn Team.</p>
</div>
</div>
Property changes on: sandbox/cdi_support/pc/branches/cdi/portlet
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/portlet/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/portlet/pom.xml 2010-12-14 17:02:37 UTC (rev
5590)
+++ sandbox/cdi_support/pc/branches/cdi/portlet/pom.xml 2010-12-15 13:03:18 UTC (rev
5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portlet</artifactId>
@@ -187,7 +187,7 @@
<!--<jpda>false</jpda>-->
<!--<jpdaPort>9000</jpdaPort>-->
<!--<jpdaSuspend>true</jpdaSuspend>-->
- <!--<failOnError>false</failOnError>-->
+ <failOnError>true</failOnError>
<!--<assertions>true</assertions>-->
<testsuites>
<testsuite>
Copied:
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/aspects/SessionInvalidatorInterceptor.java
(from rev 5590,
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/aspects/SessionInvalidatorInterceptor.java)
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/aspects/SessionInvalidatorInterceptor.java
(rev 0)
+++
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/aspects/SessionInvalidatorInterceptor.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -0,0 +1,151 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * 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.gatein.pc.portlet.aspects;
+
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.pc.api.invocation.PortletInvocation;
+import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
+import org.gatein.pc.portlet.PortletInvokerInterceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.util.Collections;
+
+/**
+ * This is a port of
http://svn.exoplatform.org/projects/portlet-container/branches/2.1.x/comp...
+ *
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class SessionInvalidatorInterceptor extends PortletInvokerInterceptor
+{
+
+ private static final String IDENTITY_TOKEN =
"javax.portlet.identity.token";
+
+ private final static Logger log =
LoggerFactory.getLogger(SessionInvalidatorInterceptor.class);
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
IllegalArgumentException, PortletInvokerException
+ {
+ //req =
RequestContext.<PortalRequestContext>getCurrentInstance().getRequest();
+ HttpServletRequest req = invocation.getDispatchedRequest();
+
+ check(req);
+ try
+ {
+ return super.invoke(invocation);
+ }
+ finally
+ {
+ update(req);
+ }
+ }
+
+ public void update(HttpServletRequest request)
+ {
+ String portalIdentity = request.getRemoteUser();
+ boolean trace = log.isTraceEnabled();
+ String contextPath = request.getContextPath();
+ HttpSession session = request.getSession(false);
+ if (session != null)
+ {
+ String id = session.getId();
+ String sessionIdentity = (String) session.getAttribute(IDENTITY_TOKEN);
+ if (portalIdentity != null)
+ {
+ if (!portalIdentity.equals(sessionIdentity))
+ {
+ if (trace)
+ {
+ log.trace("Updating portlet session " + id + " (" +
contextPath + ") from " + sessionIdentity + " to " + portalIdentity);
+ }
+
+ //
+ session.setAttribute(IDENTITY_TOKEN, portalIdentity);
+ }
+ }
+ else
+ {
+ if (sessionIdentity != null)
+ {
+ if (trace)
+ {
+ log.trace("Updating portlet session " + id + " (" +
contextPath + ") by removing the " + sessionIdentity + " value");
+ }
+
+ //
+ session.removeAttribute(IDENTITY_TOKEN);
+ }
+ }
+ }
+ }
+
+ public void check(HttpServletRequest request)
+ {
+ boolean trace = log.isTraceEnabled();
+ String portalIdentity = request.getRemoteUser();
+ String contextPath = request.getContextPath();
+ HttpSession session = request.getSession(false);
+ if (session != null)
+ {
+ String id = session.getId();
+ String sessionIdentity = (String) session.getAttribute(IDENTITY_TOKEN);
+
+ //
+ if (portalIdentity == null)
+ {
+ if (sessionIdentity != null)
+ {
+ // It means that user is anonymous and the portlet session is still
associated to a previous identity
+ if (trace)
+ {
+ log.trace("Detected user logout for session " + id + "
(" + contextPath + ")");
+ }
+
+ purge(session);
+ }
+ }
+ else
+ {
+ if (sessionIdentity != null &&
!sessionIdentity.equals(portalIdentity))
+ {
+ // It means that we don't have the same identity in portal and portlet
session
+ if (trace)
+ {
+ log.trace("Detected different user for session " + id +
" (" + contextPath + ")");
+ }
+
+ purge(session);
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void purge(HttpSession session)
+ {
+ for (String name : (Iterable<String>)
Collections.list(session.getAttributeNames()))
+ {
+ session.removeAttribute(name);
+ }
+ }
+}
Modified:
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -206,8 +206,7 @@
public PortletImpl(PortletContainer container)
{
this.container = container;
- this.context =
PortletContext.createPortletContext(container.getPortletApplication().getId() +
"." + container.getId());
- //this.context =
PortletContext.createPortletContext(container.getPortletApplication().getId().substring(1)
+ "/" + container.getId());
+ this.context =
PortletContext.createPortletContext(container.getPortletApplication().getId(),
container.getId());
}
public PortletContext getContext()
Modified:
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/BaseURLImpl.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/BaseURLImpl.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/BaseURLImpl.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -31,6 +31,8 @@
import javax.portlet.BaseURL;
import javax.portlet.PortletSecurityException;
import javax.portlet.PortletURLGenerationListener;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
import java.io.Writer;
import java.io.IOException;
@@ -126,25 +128,21 @@
return url.getParameters();
}
- public void addProperty(String s, String s1)
+ public void addProperty(String key, String value)
{
- if (s == null)
- {
- throw new IllegalArgumentException("property name cannot be null");
- }
-
- //TODO:
-
+ // We only support mono valued properties
+ setProperty(key, value);
}
- public void setProperty(String s, String s1)
+ public void setProperty(String key, String value)
{
- if (s == null)
+ if (key == null)
{
throw new IllegalArgumentException("property name cannot be null");
}
- //TODO:
+ //
+ getContainerURL().setProperty(key, value);
}
private InternalContainerURL blah()
@@ -212,6 +210,46 @@
protected static abstract class InternalContainerURL implements ContainerURL
{
+ /** . */
+ static final Map<String, String> EMPTY_MAP = Collections.emptyMap();
+
+ /** . */
+ private Map<String, String> properties;
+
+ protected InternalContainerURL()
+ {
+ this.properties = EMPTY_MAP;
+ }
+
+ protected InternalContainerURL(InternalContainerURL that)
+ {
+ this.properties = that.properties.isEmpty() ? EMPTY_MAP : new HashMap<String,
String>(this.properties);
+ }
+
+ public final Map<String, String> getProperties()
+ {
+ return properties;
+ }
+
+ private void setProperty(String key, String value)
+ {
+ if (value == null)
+ {
+ if (properties.size() > 0)
+ {
+ properties.remove(key);
+ }
+ }
+ else
+ {
+ if (properties == EMPTY_MAP)
+ {
+ properties = new HashMap<String, String>();
+ }
+ properties.put(key, value);
+ }
+ }
+
protected abstract void setParameter(String name, String value);
protected abstract void setParameter(String name, String[] values);
Modified:
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletResponseImpl.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletResponseImpl.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletResponseImpl.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -25,10 +25,9 @@
import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
import org.gatein.pc.api.invocation.response.ResponseProperties;
-import org.gatein.pc.portlet.impl.jsr168.PortletUtils;
-import org.w3c.dom.Element;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import javax.portlet.PortletResponse;
import javax.servlet.http.Cookie;
@@ -49,9 +48,6 @@
/** . */
protected final PortletRequestImpl preq;
- /** The namespace. */
- private String namespace;
-
/** . */
private Document doc;
@@ -138,12 +134,7 @@
public String getNamespace()
{
- if (namespace == null)
- {
- String windowId = invocation.getWindowContext().getId();
- namespace = PortletUtils.generateNamespaceFrom(windowId);
- }
- return namespace;
+ return invocation.getWindowContext().getNamespace();
}
public final HttpServletResponseWrapper getRealResponse()
Modified:
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -164,6 +164,9 @@
protected InternalPortletURL(InternalPortletURL original)
{
+ super(original);
+
+ //
this.windowState = original.windowState;
this.portletMode = original.portletMode;
}
@@ -239,7 +242,7 @@
protected Map<String, String[]> getParameters()
{
- return ParameterMap.clone(interactionState.getParameters());
+ return interactionState.getParameters();
}
public StateString getNavigationalState()
@@ -298,7 +301,7 @@
protected Map<String, String[]> getParameters()
{
- return ParameterMap.clone(parameters.getMap());
+ return parameters.getMap();
}
}
}
Modified:
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceURLImpl.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceURLImpl.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceURLImpl.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -124,21 +124,16 @@
}
else
{
- switch (url.parentCacheLevel)
+ if (CacheLevel.FULL == url.parentCacheLevel && cacheLevel !=
CacheLevel.FULL)
{
- case FULL:
- if (cacheLevel != CacheLevel.FULL)
- {
- throw new IllegalStateException();
- }
- break;
- case PORTLET:
- if (cacheLevel == CacheLevel.PAGE)
- {
- throw new IllegalStateException();
- }
- break;
+ throw new IllegalStateException();
}
+
+ if (CacheLevel.PORTLET == url.parentCacheLevel && cacheLevel ==
CacheLevel.PAGE)
+ {
+ throw new IllegalStateException();
+ }
+
url.cacheLevel = cacheLevel;
}
}
@@ -232,7 +227,7 @@
protected Map<String, String[]> getParameters()
{
- return ParameterMap.clone(parameters.getParameters());
+ return parameters.getParameters();
}
public StateString getResourceState()
Modified:
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/StateAwareResponseImpl.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/StateAwareResponseImpl.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/StateAwareResponseImpl.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -22,20 +22,20 @@
******************************************************************************/
package org.gatein.pc.portlet.impl.jsr168.api;
+import org.gatein.common.NotYetImplemented;
import org.gatein.common.logging.Logger;
-import org.gatein.common.NotYetImplemented;
import org.gatein.common.logging.LoggerFactory;
import org.gatein.common.util.Tools;
import org.gatein.pc.api.ParametersStateString;
+import org.gatein.pc.api.invocation.PortletInvocation;
+import org.gatein.pc.api.invocation.response.HTTPRedirectionResponse;
+import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
+import org.gatein.pc.api.invocation.response.UpdateNavigationalStateResponse;
import org.gatein.pc.portlet.impl.info.ContainerEventInfo;
import org.gatein.pc.portlet.impl.info.ContainerPortletApplicationInfo;
import org.gatein.pc.portlet.impl.info.ContainerTypeInfo;
import org.gatein.pc.portlet.impl.jsr168.PortletApplicationImpl;
import org.gatein.pc.portlet.impl.jsr168.PortletParameterMap;
-import org.gatein.pc.api.invocation.PortletInvocation;
-import org.gatein.pc.api.invocation.response.HTTPRedirectionResponse;
-import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
-import org.gatein.pc.api.invocation.response.UpdateNavigationalStateResponse;
import javax.portlet.PortletMode;
import javax.portlet.PortletModeException;
@@ -362,10 +362,10 @@
protected PortletParameterMap navigationalState = new
PortletParameterMap(preq.navigationInfo);
/** The new window state requested. */
- protected org.gatein.pc.api.WindowState windowState = new
org.gatein.pc.api.WindowState(preq.getWindowState().toString());
+ protected org.gatein.pc.api.WindowState windowState =
org.gatein.pc.api.WindowState.create(preq.getWindowState().toString());
/** The new mode requested. */
- protected org.gatein.pc.api.Mode mode = new
org.gatein.pc.api.Mode(preq.getPortletMode().toString());
+ protected org.gatein.pc.api.Mode mode =
org.gatein.pc.api.Mode.create(preq.getPortletMode().toString());
protected PortletInvocationResponse getResponse()
{
Modified:
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr286/taglib/GenerateURL286Tag.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr286/taglib/GenerateURL286Tag.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr286/taglib/GenerateURL286Tag.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -75,7 +75,8 @@
{
// Parameters values specified in tag need to be pre-pended
- Map<String, String[]> parameters = portletURL.getParameterMap();
+ // Clone the map
+ Map<String, String[]> parameters = new HashMap<String,
String[]>(portletURL.getParameterMap());
Map<String, String[]> privateParams =
getPortletRequest().getPrivateParameterMap();
@@ -112,7 +113,7 @@
{
// Introduced in jsr 286 - the empty param tag value removes the parameter
- Map<String, String[]> parameters = portletURL.getParameterMap();
+ Map<String, String[]> parameters = new HashMap<String,
String[]>(portletURL.getParameterMap());
Map<String, String[]> tagParams = getURLParameters();
Modified:
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/spi/AbstractWindowContext.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/spi/AbstractWindowContext.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/portlet/src/main/java/org/gatein/pc/portlet/impl/spi/AbstractWindowContext.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -23,6 +23,7 @@
package org.gatein.pc.portlet.impl.spi;
import org.gatein.pc.api.spi.WindowContext;
+import org.gatein.pc.portlet.impl.jsr168.PortletUtils;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -33,6 +34,7 @@
/** . */
private final String id;
+ private final String namespace;
public AbstractWindowContext(String id)
{
@@ -41,10 +43,17 @@
throw new IllegalArgumentException("No window id provided");
}
this.id = id;
+
+ namespace = PortletUtils.generateNamespaceFrom(id);
}
public String getId()
{
return id;
}
+
+ public String getNamespace()
+ {
+ return namespace;
+ }
}
Property changes on: sandbox/cdi_support/pc/branches/cdi/samples
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/samples/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/samples/pom.xml 2010-12-14 17:02:37 UTC (rev
5590)
+++ sandbox/cdi_support/pc/branches/cdi/samples/pom.xml 2010-12-15 13:03:18 UTC (rev
5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-samples</artifactId>
@@ -33,6 +33,7 @@
<descriptors>
<descriptor>src/assemble/samples-basic-portlet.xml</descriptor>
<descriptor>src/assemble/samples-shoppingcart-portlet.xml</descriptor>
+
<descriptor>src/assemble/samples-shoppingcart-event-jar.xml</descriptor>
<descriptor>src/assemble/samples-google-portlet.xml</descriptor>
<descriptor>src/assemble/samples-remotecontroller-portlet.xml</descriptor>
<descriptor>src/assemble/samples-jsp-portlet.xml</descriptor>
Copied:
sandbox/cdi_support/pc/branches/cdi/samples/src/assemble/samples-shoppingcart-event-jar.xml
(from rev 5590,
components/pc/trunk/samples/src/assemble/samples-shoppingcart-event-jar.xml)
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/samples/src/assemble/samples-shoppingcart-event-jar.xml
(rev 0)
+++
sandbox/cdi_support/pc/branches/cdi/samples/src/assemble/samples-shoppingcart-event-jar.xml 2010-12-15
13:03:18 UTC (rev 5591)
@@ -0,0 +1,18 @@
+<assembly>
+ <id>shoppingcart-event</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>target/classes</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+
<include>org/gatein/pc/samples/shoppingcart/CartEvent.*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+</assembly>
\ No newline at end of file
Modified:
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml 2010-12-15
13:03:18 UTC (rev 5591)
@@ -51,46 +51,46 @@
</portlet>
<portlet>
- <description>Event Portlet B</description>
- <portlet-name>portletB</portlet-name>
- <display-name>Debug Portlet B</display-name>
-
<portlet-class>org.gatein.pc.samples.eventdebug.EventPortletB</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- </supports>
- <portlet-info>
- <title>Debug Event B</title>
- <keywords>sample,event</keywords>
- </portlet-info>
- <supported-publishing-event>
- <qname
xmlns:jbp='urn:jboss:portal:samples:eventa'>jbp:EventA</qname>
- </supported-publishing-event>
- <supported-processing-event>
- <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
- </supported-processing-event>
- </portlet>
+ <description>Event Portlet B</description>
+ <portlet-name>portletB</portlet-name>
+ <display-name>Debug Portlet B</display-name>
+
<portlet-class>org.gatein.pc.samples.eventdebug.EventPortletB</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Debug Event B</title>
+ <keywords>sample,event</keywords>
+ </portlet-info>
+ <supported-publishing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventa'>jbp:EventA</qname>
+ </supported-publishing-event>
+ <supported-processing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-processing-event>
+ </portlet>
<portlet>
- <description>Event Portlet C</description>
- <portlet-name>portletC</portlet-name>
- <display-name>Debug Portlet C</display-name>
-
<portlet-class>org.gatein.pc.samples.eventdebug.EventPortletC</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- </supports>
- <portlet-info>
- <title>Debug Event C</title>
- <keywords>sample,event</keywords>
- </portlet-info>
- <supported-publishing-event>
- <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
- </supported-publishing-event>
- <supported-processing-event>
- <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
- </supported-processing-event>
- </portlet>
+ <description>Event Portlet C</description>
+ <portlet-name>portletC</portlet-name>
+ <display-name>Debug Portlet C</display-name>
+
<portlet-class>org.gatein.pc.samples.eventdebug.EventPortletC</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Debug Event C</title>
+ <keywords>sample,event</keywords>
+ </portlet-info>
+ <supported-publishing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-publishing-event>
+ <supported-processing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-processing-event>
+ </portlet>
<event-definition>
<qname
xmlns:jbp='urn:jboss:portal:samples:eventa'>jbp:EventA</qname>
@@ -104,5 +104,10 @@
<qname
xmlns:jbp='urn:jboss:portal:samples:eventc'>jbp:EventC</qname>
<value-type>org.gatein.pc.samples.eventdebug.EventC</value-type>
</event-definition>
+
+ <container-runtime-option>
+ <name>org.gatein.pc.remotable</name>
+ <value>true</value>
+ </container-runtime-option>
</portlet-app>
Modified:
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/google-portlet-war/WEB-INF/portlet.xml
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/google-portlet-war/WEB-INF/portlet.xml 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/google-portlet-war/WEB-INF/portlet.xml 2010-12-15
13:03:18 UTC (rev 5591)
@@ -107,6 +107,9 @@
<read-only>false</read-only>
</preference>
</portlet-preferences>
+ <supported-publishing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:event'>jbp:ZipEvent</qname>
+ </supported-publishing-event>
<supported-public-render-parameter>zipcode</supported-public-render-parameter>
</portlet>
Modified:
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/shoppingcart-portlet-war/WEB-INF/portlet.xml
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/shoppingcart-portlet-war/WEB-INF/portlet.xml 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/samples/src/main/artifacts/shoppingcart-portlet-war/WEB-INF/portlet.xml 2010-12-15
13:03:18 UTC (rev 5591)
@@ -66,5 +66,10 @@
<qname
xmlns:jbp='urn:jboss:portal:samples:event'>jbp:CartEvent</qname>
<value-type>org.gatein.pc.samples.shoppingcart.CartEvent</value-type>
</event-definition>
+
+ <container-runtime-option>
+ <name>org.gatein.pc.remotable</name>
+ <value>true</value>
+ </container-runtime-option>
</portlet-app>
Modified:
sandbox/cdi_support/pc/branches/cdi/samples/src/main/java/org/gatein/pc/samples/shoppingcart/CartEvent.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/samples/src/main/java/org/gatein/pc/samples/shoppingcart/CartEvent.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/samples/src/main/java/org/gatein/pc/samples/shoppingcart/CartEvent.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -38,6 +38,10 @@
public static final QName QNAME = new
QName("urn:jboss:portal:samples:event", "CartEvent");
+ public CartEvent()
+ {
+ }
+
public CartEvent(String id)
{
this.id = id;
@@ -47,4 +51,9 @@
{
return id;
}
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
}
Property changes on: sandbox/cdi_support/pc/branches/cdi/test
___________________________________________________________________
Name: svn:ignore
- target
+ target
*.iml
Modified: sandbox/cdi_support/pc/branches/cdi/test/pom.xml
===================================================================
--- sandbox/cdi_support/pc/branches/cdi/test/pom.xml 2010-12-14 17:02:37 UTC (rev 5590)
+++ sandbox/cdi_support/pc/branches/cdi/test/pom.xml 2010-12-15 13:03:18 UTC (rev 5591)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.1-GA-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-test</artifactId>
@@ -292,7 +292,7 @@
<!--<jpda>false</jpda>-->
<!--<jpdaPort>9000</jpdaPort>-->
<!--<jpdaSuspend>true</jpdaSuspend>-->
- <!--<failOnError>false</failOnError>-->
+ <failOnError>true</failOnError>
<!--<assertions>true</assertions>-->
<testsuites>
<testsuite>
Modified:
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr168/tck/portletinterface/ExceptionsDuringRequestHandlingTestCase.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr168/tck/portletinterface/ExceptionsDuringRequestHandlingTestCase.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr168/tck/portletinterface/ExceptionsDuringRequestHandlingTestCase.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -22,23 +22,19 @@
******************************************************************************/
package org.gatein.pc.test.portlet.jsr168.tck.portletinterface;
+import org.gatein.pc.test.unit.Assertion;
import org.gatein.pc.test.unit.PortletTestCase;
import org.gatein.pc.test.unit.annotations.TestCase;
-import org.gatein.pc.test.unit.Assertion;
/**
- * This case is based on:
- * - ExceptionsDuringRequestHandlingControllerPortlet
- * - PortletExceptionDuringRequestHandlingPortlet
- * - RuntimeExceptionDuringRequestHandlingPortlet
- * - UnavailableExceptionDuringProcessActionPortlet
- * - UnavailableExceptionDuringRenderPortlet
+ * This case is based on: - ExceptionsDuringRequestHandlingControllerPortlet -
PortletExceptionDuringRequestHandlingPortlet
+ * - RuntimeExceptionDuringRequestHandlingPortlet -
UnavailableExceptionDuringProcessActionPortlet -
+ * UnavailableExceptionDuringRenderPortlet
+ * <p/>
+ * This test is disabled. Specification doesn't defined strictly portal behaviour
when one of the portlets throws
+ * PortletException. Currently in GateIn if one portlet throws an PortletException than
the rest of portlet of the page
+ * is not rendered - code 500 is returned. Tests are based on different behaviour where
rest of portlets are rendered.
*
- * This test is disabled. Specification doesn't defined strictly portal behaviour
when
- * one of the portlets throws PortletException. Currently in JBoss Portal if one portlet
- * throws an PortletException than the rest of portlet of the page is not rendered - code
500
- * is returned. Tests are based on different behaviour where rest of portlets are
rendered.
- *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
Modified:
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java 2010-12-14
17:02:37 UTC (rev 5590)
+++
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -97,7 +97,7 @@
// * - UnavailableExceptionDuringRenderPortlet
// *
// * This test is disabled. Specification doesn't defined strictly portal
behaviour when
-// * one of the portlets throws PortletException. Currently in JBoss Portal if one
portlet
+// * one of the portlets throws PortletException. Currently in GateIn if one
portlet
// * throws an PortletException than the rest of portlet of the page is not
rendered - code 500
// * is returned. Tests are based on different behaviour where rest of portlets are
rendered.
// */
Copied:
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr286/api/portleturl/ParameterMapTestCase.java
(from rev 5590,
components/pc/trunk/test/src/test/java/org/gatein/pc/test/portlet/jsr286/api/portleturl/ParameterMapTestCase.java)
===================================================================
---
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr286/api/portleturl/ParameterMapTestCase.java
(rev 0)
+++
sandbox/cdi_support/pc/branches/cdi/test/src/test/java/org/gatein/pc/test/portlet/jsr286/api/portleturl/ParameterMapTestCase.java 2010-12-15
13:03:18 UTC (rev 5591)
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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.gatein.pc.test.portlet.jsr286.api.portleturl;
+
+import org.gatein.pc.test.portlet.framework.UTP1;
+import org.gatein.pc.test.unit.Assertion;
+import org.gatein.pc.test.unit.PortletTestCase;
+import org.gatein.pc.test.unit.PortletTestContext;
+import org.gatein.pc.test.unit.actions.PortletActionTestAction;
+import org.gatein.pc.test.unit.actions.PortletRenderTestAction;
+import org.gatein.pc.test.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+
+import static org.jboss.unit.api.Assert.assertEquals;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+(a)TestCase(Assertion.API286_BASE_URL_4)
+public class ParameterMapTestCase
+{
+ public ParameterMapTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ PortletURL url = response.createActionURL();
+
+ // Set parameter
+ url.setParameter("foo", "bar");
+
+ // Clear parameters
+ Map<String, String[]> map = url.getParameterMap();
+
+ // Check expected entry
+ String[] bar1 = map.get("foo");
+ assertEquals(1, bar1.length);
+ assertEquals("bar", bar1[0]);
+
+ // Check that the entry we had a copy of the value
+ url.setParameter("foo", "juu");
+ assertEquals("bar", bar1[0]);
+
+ //
+ map.clear();
+
+ // Invoker with the no parameter URL
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+ seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
+ {
+ @Override
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ // It should be empty
+ assertEquals(Collections.<Object, Object>emptyMap(),
request.getParameterMap());
+ }
+ });
+ seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ PortletURL url = response.createRenderURL();
+
+ // Set parameter
+ url.setParameter("foo", "bar");
+
+ // Clear parameters
+ Map<String, String[]> map = url.getParameterMap();
+
+ // Check expected entry
+ String[] bar1 = map.get("foo");
+ assertEquals(1, bar1.length);
+ assertEquals("bar", bar1[0]);
+
+ // Check that the entry we had a copy of the value
+ url.setParameter("foo", "juu");
+ assertEquals("bar", bar1[0]);
+
+ //
+ map.clear();
+
+ // Invoker with the no parameter URL
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+ seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ // It should be empty
+ assertEquals(Collections.<Object, Object>emptyMap(),
request.getParameterMap());
+
+ // Done
+ return new EndTestResponse();
+ }
+ });
+ }
+}