Author: chris.laprun(a)jboss.com
Date: 2011-10-28 07:08:02 -0400 (Fri, 28 Oct 2011)
New Revision: 7907
Modified:
components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
components/pc/trunk/api/src/main/java/org/gatein/pc/api/StatefulPortletContext.java
Log:
- GTNPC-77: StatefulPortletContext now properly honors requests to not interpret its
String identifier into components.
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2011-10-28
08:05:15 UTC (rev 7906)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2011-10-28
11:08:02 UTC (rev 7907)
@@ -320,7 +320,7 @@
@Deprecated
public static StatefulPortletContext<byte[]> createStatefulPortletContext(String
id, byte[] state)
{
- return new StatefulPortletContext<byte[]>(id, PortletStateType.OPAQUE,
state);
+ return new StatefulPortletContext<byte[]>(id, PortletStateType.OPAQUE, state,
true);
}
/**
@@ -348,7 +348,7 @@
{
if (state != null && state.length > 0)
{
- return new StatefulPortletContext<byte[]>(portletId,
PortletStateType.OPAQUE, state);
+ return new StatefulPortletContext<byte[]>(portletId,
PortletStateType.OPAQUE, state, interpret);
}
else
{
Modified:
components/pc/trunk/api/src/main/java/org/gatein/pc/api/StatefulPortletContext.java
===================================================================
---
components/pc/trunk/api/src/main/java/org/gatein/pc/api/StatefulPortletContext.java 2011-10-28
08:05:15 UTC (rev 7906)
+++
components/pc/trunk/api/src/main/java/org/gatein/pc/api/StatefulPortletContext.java 2011-10-28
11:08:02 UTC (rev 7907)
@@ -37,7 +37,7 @@
public static <S extends Serializable> StatefulPortletContext<S>
create(String id, StatefulPortletContext<S> spc)
{
- return new StatefulPortletContext<S>(id, spc.type, spc.state);
+ return new StatefulPortletContext<S>(id, spc.type, spc.state, true);
}
static <S extends Serializable> StatefulPortletContext<S>
create(Components components, StatefulPortletContext<S> spc)
@@ -45,12 +45,9 @@
return new StatefulPortletContext<S>(components, spc.type, spc.state);
}
- public static <S extends Serializable> StatefulPortletContext<S> create(
- String id,
- PortletStateType<S> type,
- S state)
+ public static <S extends Serializable> StatefulPortletContext<S>
create(String id, PortletStateType<S> type, S state)
{
- return new StatefulPortletContext<S>(id, type, state);
+ return new StatefulPortletContext<S>(id, type, state, true);
}
/** . */
@@ -59,9 +56,9 @@
/** . */
private final PortletStateType<S> type;
- StatefulPortletContext(String id, PortletStateType<S> type, S state) throws
IllegalArgumentException
+ StatefulPortletContext(String id, PortletStateType<S> type, S state, boolean
interpret) throws IllegalArgumentException
{
- super(id);
+ super(id, interpret);
ParameterValidation.throwIllegalArgExceptionIfNull(type, "Portlet
type");
ParameterValidation.throwIllegalArgExceptionIfNull(state, "Portlet
state");