[portal-commits] JBoss Portal SVN: r5976 - in trunk: core/src/main/org/jboss/portal/core/aspects/controller/node and 18 other directories.
portal-commits at lists.jboss.org
portal-commits at lists.jboss.org
Wed Jan 10 09:10:21 EST 2007
Author: julien at jboss.com
Date: 2007-01-10 09:09:42 -0500 (Wed, 10 Jan 2007)
New Revision: 5976
Added:
trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java
trunk/portlet/src/main/org/jboss/portal/portlet/PortletParametersStateString.java
Removed:
trunk/portlet/src/main/org/jboss/portal/portlet/Parameters.java
trunk/portlet/src/main/org/jboss/portal/portlet/ParametersStateString.java
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeURLFactory.java
trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactory.java
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceActionCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestDecoder.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestEncoder.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionRequestImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionResponseImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletURLImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderRequestImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/spi/ActionContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/spi/RenderContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/ActionContextSupport.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/ParametersTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestDecoderTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/navigation/StateStringTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
Log:
- renamed Parameters to PortletParameters
- renamed ParametersStateString to PortletParametersStateString
- improved javadoc or PortletInvocationContext, ActionContext, RenderContext
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -44,8 +44,7 @@
import org.jboss.portal.core.model.portal.command.ImportPageToDashboardCommand;
import org.jboss.portal.core.model.CustomizationManager;
import org.jboss.portal.identity.User;
-import org.jboss.portal.portlet.impl.PortletRequestDecoder;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.security.PortalSecurityException;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
import org.jboss.portal.server.request.URLContext;
@@ -179,7 +178,7 @@
if (isDashboard)
{
// Edit page
- ParametersStateString navState = new ParametersStateString();
+ PortletParametersStateString navState = new PortletParametersStateString();
navState.setValue("editPageSelect", pageName);
InvokePortletInstanceRenderCommand command = new InvokePortletInstanceRenderCommand("ConfiguratorPortletInstance", navState);
dashboardActionURL = controllerCtx.renderURL(command, null, null);
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -42,8 +42,8 @@
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.event.PortalEventListenerRegistry;
import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.portlet.Parameters;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
@@ -107,10 +107,10 @@
Map params = wae.getParameters();
//
- Parameters interactionParams = null;
+ PortletParameters interactionParams = null;
if (params instanceof LazyParameterMap)
{
- interactionParams = (Parameters)((LazyParameterMap)params).createDelegate();
+ interactionParams = (PortletParameters)((LazyParameterMap)params).createDelegate();
}
else
{
@@ -125,7 +125,7 @@
mode,
windowState,
null,
- new ParametersStateString(interactionParams),
+ new PortletParametersStateString(interactionParams),
null);
}
}
@@ -135,7 +135,7 @@
Map params = wre.getParameters();
//
- Parameters navigationalParams = asParameters(params);
+ PortletParameters navigationalParams = asParameters(params);
//
if (navigationalParams != null)
@@ -144,7 +144,7 @@
nodeRef,
mode,
windowState,
- new ParametersStateString(navigationalParams));
+ new PortletParametersStateString(navigationalParams));
}
}
else if (nextEvent instanceof WindowNavigationEvent)
@@ -167,7 +167,7 @@
LazyParameterMap lpm = (LazyParameterMap)params;
if (lpm.isModified())
{
- iwac.setInteractionState(new ParametersStateString(lpm.params));
+ iwac.setInteractionState(new PortletParametersStateString(lpm.params));
iwac.setFormParameters(null);
}
}
@@ -204,13 +204,13 @@
InvokePortletWindowActionCommand iwac = (InvokePortletWindowActionCommand)wc;
//
- Parameters formParams = iwac.getFormParameters();
+ PortletParameters formParams = iwac.getFormParameters();
//
- Parameters interactionParams = null;
- if (iwac.getInteractionState() instanceof ParametersStateString)
+ PortletParameters interactionParams = null;
+ if (iwac.getInteractionState() instanceof PortletParametersStateString)
{
- interactionParams = ((ParametersStateString)iwac.getInteractionState()).getParameters();
+ interactionParams = ((PortletParametersStateString)iwac.getInteractionState()).getParameters();
}
//
@@ -234,7 +234,7 @@
}
else
{
- params = new Parameters();
+ params = new PortletParameters();
}
}
@@ -254,9 +254,9 @@
if (navigationalState != null)
{
Map params = null;
- if (navigationalState instanceof ParametersStateString)
+ if (navigationalState instanceof PortletParametersStateString)
{
- params = ((ParametersStateString)navigationalState).getParameters();
+ params = ((PortletParametersStateString)navigationalState).getParameters();
}
//
@@ -284,21 +284,21 @@
return null;
}
- private Parameters asParameters(Map map)
+ private PortletParameters asParameters(Map map)
{
if (map == null)
{
return null;
}
- if (map instanceof Parameters)
+ if (map instanceof PortletParameters)
{
- return (Parameters)map;
+ return (PortletParameters)map;
}
else
{
try
{
- return new Parameters(map);
+ return new PortletParameters(map);
}
catch (IllegalArgumentException e)
{
@@ -311,15 +311,15 @@
private static class LazyParameterMap extends LazyMap
{
/** . */
- private Parameters formParams;
+ private PortletParameters formParams;
/** . */
- private Parameters interactionParams;
+ private PortletParameters interactionParams;
/** . */
- private Parameters params;
+ private PortletParameters params;
- public LazyParameterMap(Parameters interactionParams, Parameters formParams)
+ public LazyParameterMap(PortletParameters interactionParams, PortletParameters formParams)
{
this.formParams = formParams;
this.interactionParams = interactionParams;
@@ -330,7 +330,7 @@
{
if (params == null)
{
- params = new Parameters(interactionParams);
+ params = new PortletParameters(interactionParams);
params.append(formParams);
}
return params;
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeURLFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeURLFactory.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeURLFactory.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -24,7 +24,7 @@
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.PortalNodeURL;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
import org.jboss.portal.core.controller.ControllerContext;
@@ -74,7 +74,7 @@
protected PortalObjectId id;
protected ControllerContext controllerContext;
- protected ParametersStateString parameters;
+ protected PortletParametersStateString parameters;
protected Boolean wantSecure;
protected Boolean wantAuthenticated;
protected boolean relative;
@@ -84,7 +84,7 @@
this.id = id;
this.controllerContext = controllerContext;
this.relative = true;
- this.parameters = new ParametersStateString();
+ this.parameters = new PortletParametersStateString();
}
public void setParameter(String name, String value)
Modified: trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactory.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactory.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -32,7 +32,7 @@
import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.controller.command.mapper.AbstractCommandFactory;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.server.ServerInvocation;
import java.util.Locale;
@@ -137,7 +137,7 @@
else
{
//Set the content as a render parameter
- ParametersStateString parameters = new ParametersStateString();
+ PortletParametersStateString parameters = new PortletParametersStateString();
parameters.setValue("path", requestPath);
// Perform a render URL on the target window
@@ -150,7 +150,7 @@
{
if(e.toString().indexOf("Access to this resource is denied")!=-1)
{
- ParametersStateString parameters = new ParametersStateString();
+ PortletParametersStateString parameters = new PortletParametersStateString();
parameters.setValue("path", requestPath);
return new InvokePortletWindowRenderCommand(targetWindowId, Mode.VIEW, null, parameters);
}
Modified: trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -26,7 +26,7 @@
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.PortletURL;
import org.jboss.portal.portlet.ActionURL;
import org.jboss.portal.portlet.RenderURL;
@@ -78,7 +78,7 @@
WindowState windowState,
StateString navigationalState,
StateString interactionState,
- Parameters form,
+ PortletParameters form,
Window window,
Portal portal)
{
@@ -93,7 +93,7 @@
WindowState windowState,
StateString navigationalState,
StateString interactionState,
- Parameters form,
+ PortletParameters form,
PortletContextFactory cf,
InvokePortletCommandFactory cpc)
{
@@ -166,7 +166,7 @@
{
private InvokePortletCommandFactory cmdFactory;
private ControllerContext controllerContext;
- public ControllerActionContext(InvokePortletCommandFactory cmdFactory, ControllerContext controllerContext, Mode mode, WindowState windowState, StateString navigationalState, HTTPStreamInfo streamInfo, StateString interactionState, Parameters form)
+ public ControllerActionContext(InvokePortletCommandFactory cmdFactory, ControllerContext controllerContext, Mode mode, WindowState windowState, StateString navigationalState, HTTPStreamInfo streamInfo, StateString interactionState, PortletParameters form)
{
super(mode, windowState, navigationalState, streamInfo, interactionState, form);
Modified: trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceActionCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceActionCommand.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceActionCommand.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -30,7 +30,7 @@
import org.jboss.portal.core.model.instance.InvokePortletInstanceCommandFactory;
import org.jboss.portal.core.model.instance.command.response.PortletInstanceResponse;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -48,9 +48,9 @@
private StateString interactionState;
/** The nform. */
- private Parameters form;
+ private PortletParameters form;
- public InvokePortletInstanceActionCommand(String instanceId, StateString navigationalState, StateString interactionState, Parameters form)
+ public InvokePortletInstanceActionCommand(String instanceId, StateString navigationalState, StateString interactionState, PortletParameters form)
{
super(instanceId, navigationalState);
@@ -64,7 +64,7 @@
return interactionState;
}
- public Parameters getForm()
+ public PortletParameters getForm()
{
return form;
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -33,7 +33,7 @@
import org.jboss.portal.core.model.portal.command.response.PortletWindowResponse;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.portlet.NoSuchPortletException;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -59,7 +59,7 @@
private StateString interactionState;
/** . */
- private Parameters formParameters;
+ private PortletParameters formParameters;
public InvokePortletWindowActionCommand(
PortalObjectId windowId,
@@ -67,7 +67,7 @@
WindowState windowState,
StateString navigationalState,
StateString interactionState,
- Parameters formParameters)
+ PortletParameters formParameters)
throws IllegalArgumentException
{
super(windowId, mode, windowState);
@@ -91,12 +91,12 @@
this.interactionState = interactionState;
}
- public Parameters getFormParameters()
+ public PortletParameters getFormParameters()
{
return formParameters;
}
- public void setFormParameters(Parameters formParameters)
+ public void setFormParameters(PortletParameters formParameters)
{
this.formParameters = formParameters;
}
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/Parameters.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/Parameters.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/Parameters.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -1,171 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.portlet;
-
-import org.jboss.portal.common.util.ParameterMap;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-
-/**
- * A set of parameters.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public final class Parameters extends ParameterMap implements Serializable
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = -8529807471117491810L;
-
- /** The data. */
- private Map map;
-
- /** Creates an empty parameter set. */
- public Parameters()
- {
- this.map = new HashMap();
- }
-
- /**
- * Copy constructor.
- *
- * @throws IllegalArgumentException if the parameters is null
- */
- public Parameters(Parameters parameters) throws IllegalArgumentException
- {
- if (parameters == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.map = new HashMap(parameters.map);
- }
-
- /**
- * Copy the parameter map to initialize the object state.
- *
- * @throws IllegalArgumentException if the parameter map is null or not valid
- * @throws NullPointerException if the map contains a null key or a null value
- * @throws IllegalArgumentException if the map is null or it contains a value with a zero length array or a null
- * element in the array
- * @throws ClassCastException if the map contains a key that is not a string or a value that is not a string
- * array
- */
- public Parameters(Map parameterMap) throws NullPointerException, ClassCastException, IllegalArgumentException
- {
- if (parameterMap == null)
- {
- throw new IllegalArgumentException("No null map accepted");
- }
-
- //
- this.map = new HashMap();
-
- //
- replace(parameterMap);
- }
-
- protected Map getDelegate()
- {
- return map;
- }
-
- /**
- * Append the content of the argument map to that map. If both maps contains an entry sharing the same key, then the
- * string arrays or the two entries will be concatenated into a single array. Each entry present on the argument map
- * and not in the current map will be kept as is. The argument validation is performed before the state is updated.
- *
- * @param params the parameters to appends
- * @throws NullPointerException if the map contains a null key or a null value
- * @throws IllegalArgumentException if the map is null or it contains a value with a zero length array or a null
- * element in the array
- * @throws ClassCastException if the map contains a key that is not a string or a value that is not a string
- * array
- */
- public void append(Map params) throws ClassCastException, NullPointerException, IllegalArgumentException
- {
- validate(params, false);
-
- //
- internalAppend(params);
- }
-
- /** Append actual implementation. */
- private void internalAppend(Map params)
- {
- for (Iterator entries = params.entrySet().iterator(); entries.hasNext();)
- {
- Map.Entry entry = (Map.Entry)entries.next();
- String name = (String)entry.getKey();
- String[] appendedValues = (String[])entry.getValue();
-
- // Merge or use appended values
- String[] values = (String[])map.get(name);
- if (values != null)
- {
- String[] tmp = new String[values.length + appendedValues.length];
- System.arraycopy(values, 0, tmp, 0, values.length);
- System.arraycopy(appendedValues, 0, tmp, values.length, appendedValues.length);
- values = tmp;
- }
- else
- {
- values = appendedValues;
- }
-
- //
- map.put(name, values);
- }
- }
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer("Parameters[");
- if (map != null)
- {
- for (Iterator i = map.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String name = (String)entry.getKey();
- String[] values = (String[])entry.getValue();
- buffer.append(name);
- for (int j = 0; j < values.length; j++)
- {
- buffer.append(j > 0 ? ',' : '=').append(values[j]);
- }
- if (i.hasNext())
- {
- buffer.append(" | ");
- }
- }
- }
- buffer.append(']');
- return buffer.toString();
- }
-}
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/ParametersStateString.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/ParametersStateString.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/ParametersStateString.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -1,293 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.portlet;
-
-import org.jboss.portal.common.util.Base64;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * A set of parameters.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class ParametersStateString extends StateString implements Serializable
-{
- /** . */
- public static final String JBPNS_PREFIX = "JBPNS_";
-
- /** The serialVersionUID */
- private static final long serialVersionUID = -8529807471117491810L;
-
- /** . */
- private static final String EOF = "__EOF__";
-
- /** The data. */
- private Parameters parameters;
-
- public ParametersStateString(String opaqueValue)
- {
- if (opaqueValue == null)
- {
- throw new IllegalArgumentException("No navigational state provided");
- }
- if (!opaqueValue.startsWith(JBPNS_PREFIX))
- {
- throw new IllegalArgumentException("Bad format");
- }
- opaqueValue = opaqueValue.substring(JBPNS_PREFIX.length());
- if (opaqueValue.length() > 0)
- {
- try
- {
- byte[] bytes = Base64.decode(opaqueValue, true);
- ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- ObjectInputStream ois = new ObjectInputStream(bais);
- Map params = new HashMap();
-
- String[] values = null;
-
- // read the first String which should be a param name
- String current = ois.readUTF();
-
- // keep reading until we haven't reached the EOF marker
- while (!EOF.equals(current))
- {
- // next is the size of the value array
- int length = ois.readInt();
- values = new String[length];
-
- // read as many Strings as are supposed to be in the array
- for (int i = 0; i < length; i++)
- {
- values[i] = ois.readUTF();
- }
-
- // we're done for this param, add it to the param map
- params.put(current, values);
-
- // read the next string to loop
- current = ois.readUTF();
- }
-
- parameters = new Parameters(params);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- else
- {
- parameters = new Parameters();
- }
- }
-
- /** Creates an empty parameter set. */
- public ParametersStateString()
- {
- this.parameters = new Parameters();
- }
-
- /**
- * Copy the parameter map to initialize the object state.
- *
- * @throws IllegalArgumentException if the parameter map is null or not valid
- */
- public ParametersStateString(Parameters parameterMap)
- {
- this.parameters = new Parameters(parameterMap);
- }
-
- /**
- * Return the parameter value or null if it does not exist.
- *
- * @param name the parameter name
- * @return the parameter value or null if it does not exist
- * @throws IllegalArgumentException if the name is null
- */
- public String getValue(String name) throws IllegalArgumentException
- {
- return parameters.getValue(name);
- }
-
- /**
- * Return the parameter values or null if it does not exist.
- *
- * @param name the value to get
- * @return the parameter values
- * @throws IllegalArgumentException if the name is null
- */
- public String[] getValues(String name) throws IllegalArgumentException
- {
- return parameters.getValues(name);
- }
-
- /** Return the a map containing the values. */
- public Map getMap()
- {
- return parameters;
- }
-
- /** Clear all the parameters. */
- public void clear()
- {
- parameters.clear();
- }
-
- /**
- * Replace all the parameters.
- *
- * @throws IllegalArgumentException if the map is not valid
- */
- public void replace(Map map)
- {
- this.parameters.replace(map);
- }
-
- /**
- * Set the a parameter value.
- *
- * @param name the parameter name
- * @param value the parameter value
- * @throws IllegalArgumentException if the name is null
- * @throws IllegalArgumentException if the value is null
- */
- public void setValue(String name, String value)
- {
- parameters.setValue(name, value);
- }
-
- /**
- * Set the parameter values. This method does not make a defensive copy of the values.
- *
- * @param name the parameter name
- * @param values the parameter values
- * @throws IllegalArgumentException if the name is null
- */
- public void setValues(String name, String[] values)
- {
- parameters.setValues(name, values);
- }
-
- /**
- * Remove a parameter.
- *
- * @throws IllegalArgumentException if the name is null
- */
- public void remove(String name)
- {
- parameters.remove(name);
- }
-
- /** Return the size. */
- public int getSize()
- {
- return parameters.size();
- }
-
- /**
- * Return the underlying parameter object.
- *
- * @return the parameter object
- */
- public Parameters getParameters()
- {
- return parameters;
- }
-
- /**
- * Retrieves the opaque version associated with this navigational state.
- *
- * @return a URL-safe String representation of this navigational state.
- */
- public String getStringValue()
- {
- if (parameters != null && parameters.size() != 0)
- {
- try
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- for (Iterator entries = parameters.entrySet().iterator(); entries.hasNext();)
- {
- Map.Entry entry = (Map.Entry)entries.next();
- String name = (String)entry.getKey();
- oos.writeUTF(name);
- String[] values = (String[])entry.getValue();
- int length = values.length;
- oos.writeInt(length);
- for (int i = 0; i < values.length; i++)
- {
- oos.writeUTF(values[i]);
- }
- }
- oos.writeUTF(EOF);
- oos.close();
- byte[] bytes = baos.toByteArray();
- return JBPNS_PREFIX + Base64.encodeBytes(bytes, true);
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
- else
- {
- return JBPNS_PREFIX;
- }
- }
-
- public int hashCode()
- {
- return getMap().hashCode();
- }
-
- public boolean equals(Object o)
- {
- if (o == this)
- {
- return true;
- }
- if (o instanceof ParametersStateString)
- {
- ParametersStateString that = (ParametersStateString)o;
- return that.parameters.equals(parameters);
- }
- return false;
- }
-
- public String toString()
- {
- return "StateString[" + parameters + "]";
- }
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java (from rev 5972, trunk/portlet/src/main/org/jboss/portal/portlet/Parameters.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/Parameters.java 2007-01-10 02:17:27 UTC (rev 5972)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -0,0 +1,171 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.portlet;
+
+import org.jboss.portal.common.util.ParameterMap;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+
+/**
+ * A set of parameters.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public final class PortletParameters extends ParameterMap implements Serializable
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8529807471117491810L;
+
+ /** The data. */
+ private Map map;
+
+ /** Creates an empty parameter set. */
+ public PortletParameters()
+ {
+ this.map = new HashMap();
+ }
+
+ /**
+ * Copy constructor.
+ *
+ * @throws IllegalArgumentException if the parameters is null
+ */
+ public PortletParameters(PortletParameters parameters) throws IllegalArgumentException
+ {
+ if (parameters == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.map = new HashMap(parameters.map);
+ }
+
+ /**
+ * Copy the parameter map to initialize the object state.
+ *
+ * @throws IllegalArgumentException if the parameter map is null or not valid
+ * @throws NullPointerException if the map contains a null key or a null value
+ * @throws IllegalArgumentException if the map is null or it contains a value with a zero length array or a null
+ * element in the array
+ * @throws ClassCastException if the map contains a key that is not a string or a value that is not a string
+ * array
+ */
+ public PortletParameters(Map parameterMap) throws NullPointerException, ClassCastException, IllegalArgumentException
+ {
+ if (parameterMap == null)
+ {
+ throw new IllegalArgumentException("No null map accepted");
+ }
+
+ //
+ this.map = new HashMap();
+
+ //
+ replace(parameterMap);
+ }
+
+ protected Map getDelegate()
+ {
+ return map;
+ }
+
+ /**
+ * Append the content of the argument map to that map. If both maps contains an entry sharing the same key, then the
+ * string arrays or the two entries will be concatenated into a single array. Each entry present on the argument map
+ * and not in the current map will be kept as is. The argument validation is performed before the state is updated.
+ *
+ * @param params the parameters to appends
+ * @throws NullPointerException if the map contains a null key or a null value
+ * @throws IllegalArgumentException if the map is null or it contains a value with a zero length array or a null
+ * element in the array
+ * @throws ClassCastException if the map contains a key that is not a string or a value that is not a string
+ * array
+ */
+ public void append(Map params) throws ClassCastException, NullPointerException, IllegalArgumentException
+ {
+ validate(params, false);
+
+ //
+ internalAppend(params);
+ }
+
+ /** Append actual implementation. */
+ private void internalAppend(Map params)
+ {
+ for (Iterator entries = params.entrySet().iterator(); entries.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)entries.next();
+ String name = (String)entry.getKey();
+ String[] appendedValues = (String[])entry.getValue();
+
+ // Merge or use appended values
+ String[] values = (String[])map.get(name);
+ if (values != null)
+ {
+ String[] tmp = new String[values.length + appendedValues.length];
+ System.arraycopy(values, 0, tmp, 0, values.length);
+ System.arraycopy(appendedValues, 0, tmp, values.length, appendedValues.length);
+ values = tmp;
+ }
+ else
+ {
+ values = appendedValues;
+ }
+
+ //
+ map.put(name, values);
+ }
+ }
+
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer("Parameters[");
+ if (map != null)
+ {
+ for (Iterator i = map.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+ String[] values = (String[])entry.getValue();
+ buffer.append(name);
+ for (int j = 0; j < values.length; j++)
+ {
+ buffer.append(j > 0 ? ',' : '=').append(values[j]);
+ }
+ if (i.hasNext())
+ {
+ buffer.append(" | ");
+ }
+ }
+ }
+ buffer.append(']');
+ return buffer.toString();
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/PortletParametersStateString.java (from rev 5968, trunk/portlet/src/main/org/jboss/portal/portlet/ParametersStateString.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/ParametersStateString.java 2007-01-09 00:35:52 UTC (rev 5968)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/PortletParametersStateString.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -0,0 +1,293 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.portlet;
+
+import org.jboss.portal.common.util.Base64;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * A set of parameters.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PortletParametersStateString extends StateString implements Serializable
+{
+ /** . */
+ public static final String JBPNS_PREFIX = "JBPNS_";
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8529807471117491810L;
+
+ /** . */
+ private static final String EOF = "__EOF__";
+
+ /** The data. */
+ private PortletParameters parameters;
+
+ public PortletParametersStateString(String opaqueValue)
+ {
+ if (opaqueValue == null)
+ {
+ throw new IllegalArgumentException("No navigational state provided");
+ }
+ if (!opaqueValue.startsWith(JBPNS_PREFIX))
+ {
+ throw new IllegalArgumentException("Bad format");
+ }
+ opaqueValue = opaqueValue.substring(JBPNS_PREFIX.length());
+ if (opaqueValue.length() > 0)
+ {
+ try
+ {
+ byte[] bytes = Base64.decode(opaqueValue, true);
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ Map params = new HashMap();
+
+ String[] values = null;
+
+ // read the first String which should be a param name
+ String current = ois.readUTF();
+
+ // keep reading until we haven't reached the EOF marker
+ while (!EOF.equals(current))
+ {
+ // next is the size of the value array
+ int length = ois.readInt();
+ values = new String[length];
+
+ // read as many Strings as are supposed to be in the array
+ for (int i = 0; i < length; i++)
+ {
+ values[i] = ois.readUTF();
+ }
+
+ // we're done for this param, add it to the param map
+ params.put(current, values);
+
+ // read the next string to loop
+ current = ois.readUTF();
+ }
+
+ parameters = new PortletParameters(params);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ else
+ {
+ parameters = new PortletParameters();
+ }
+ }
+
+ /** Creates an empty parameter set. */
+ public PortletParametersStateString()
+ {
+ this.parameters = new PortletParameters();
+ }
+
+ /**
+ * Copy the parameter map to initialize the object state.
+ *
+ * @throws IllegalArgumentException if the parameter map is null or not valid
+ */
+ public PortletParametersStateString(PortletParameters parameterMap)
+ {
+ this.parameters = new PortletParameters(parameterMap);
+ }
+
+ /**
+ * Return the parameter value or null if it does not exist.
+ *
+ * @param name the parameter name
+ * @return the parameter value or null if it does not exist
+ * @throws IllegalArgumentException if the name is null
+ */
+ public String getValue(String name) throws IllegalArgumentException
+ {
+ return parameters.getValue(name);
+ }
+
+ /**
+ * Return the parameter values or null if it does not exist.
+ *
+ * @param name the value to get
+ * @return the parameter values
+ * @throws IllegalArgumentException if the name is null
+ */
+ public String[] getValues(String name) throws IllegalArgumentException
+ {
+ return parameters.getValues(name);
+ }
+
+ /** Return the a map containing the values. */
+ public Map getMap()
+ {
+ return parameters;
+ }
+
+ /** Clear all the parameters. */
+ public void clear()
+ {
+ parameters.clear();
+ }
+
+ /**
+ * Replace all the parameters.
+ *
+ * @throws IllegalArgumentException if the map is not valid
+ */
+ public void replace(Map map)
+ {
+ this.parameters.replace(map);
+ }
+
+ /**
+ * Set the a parameter value.
+ *
+ * @param name the parameter name
+ * @param value the parameter value
+ * @throws IllegalArgumentException if the name is null
+ * @throws IllegalArgumentException if the value is null
+ */
+ public void setValue(String name, String value)
+ {
+ parameters.setValue(name, value);
+ }
+
+ /**
+ * Set the parameter values. This method does not make a defensive copy of the values.
+ *
+ * @param name the parameter name
+ * @param values the parameter values
+ * @throws IllegalArgumentException if the name is null
+ */
+ public void setValues(String name, String[] values)
+ {
+ parameters.setValues(name, values);
+ }
+
+ /**
+ * Remove a parameter.
+ *
+ * @throws IllegalArgumentException if the name is null
+ */
+ public void remove(String name)
+ {
+ parameters.remove(name);
+ }
+
+ /** Return the size. */
+ public int getSize()
+ {
+ return parameters.size();
+ }
+
+ /**
+ * Return the underlying parameter object.
+ *
+ * @return the parameter object
+ */
+ public PortletParameters getParameters()
+ {
+ return parameters;
+ }
+
+ /**
+ * Retrieves the opaque version associated with this navigational state.
+ *
+ * @return a URL-safe String representation of this navigational state.
+ */
+ public String getStringValue()
+ {
+ if (parameters != null && parameters.size() != 0)
+ {
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ for (Iterator entries = parameters.entrySet().iterator(); entries.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)entries.next();
+ String name = (String)entry.getKey();
+ oos.writeUTF(name);
+ String[] values = (String[])entry.getValue();
+ int length = values.length;
+ oos.writeInt(length);
+ for (int i = 0; i < values.length; i++)
+ {
+ oos.writeUTF(values[i]);
+ }
+ }
+ oos.writeUTF(EOF);
+ oos.close();
+ byte[] bytes = baos.toByteArray();
+ return JBPNS_PREFIX + Base64.encodeBytes(bytes, true);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ else
+ {
+ return JBPNS_PREFIX;
+ }
+ }
+
+ public int hashCode()
+ {
+ return getMap().hashCode();
+ }
+
+ public boolean equals(Object o)
+ {
+ if (o == this)
+ {
+ return true;
+ }
+ if (o instanceof PortletParametersStateString)
+ {
+ PortletParametersStateString that = (PortletParametersStateString)o;
+ return that.parameters.equals(parameters);
+ }
+ return false;
+ }
+
+ public String toString()
+ {
+ return "StateString[" + parameters + "]";
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/PortletParametersStateString.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -30,7 +30,7 @@
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.spi.RenderContext;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.invocation.AttributeResolver;
@@ -89,17 +89,17 @@
{
useEntry = true;
}
- else if (entryNavState instanceof ParametersStateString)
+ else if (entryNavState instanceof PortletParametersStateString)
{
// We consider a parameters state string empty equivalent to a null value
- useEntry = ((ParametersStateString)entryNavState).getSize() == 0;
+ useEntry = ((PortletParametersStateString)entryNavState).getSize() == 0;
}
}
else if (entryNavState == null)
{
- if (navState instanceof ParametersStateString)
+ if (navState instanceof PortletParametersStateString)
{
- useEntry = ((ParametersStateString)navState).getSize() == 0;
+ useEntry = ((PortletParametersStateString)navState).getSize() == 0;
}
}
else
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestDecoder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestDecoder.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestDecoder.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -25,8 +25,8 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.Parameters;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.OpaqueStateString;
import java.util.Iterator;
@@ -94,7 +94,7 @@
private StateString interactionState;
/** . */
- private Parameters form;
+ private PortletParameters form;
/** . */
private int type;
@@ -170,7 +170,7 @@
if (!opaque)
{
// Compute the parameters skipping the portlet navigational state that may be encoded as well
- ParametersStateString query = new ParametersStateString();
+ PortletParametersStateString query = new PortletParametersStateString();
for (Iterator i = queryParams.entrySet().iterator(); i.hasNext();)
{
Map.Entry entry = (Map.Entry)i.next();
@@ -202,7 +202,7 @@
}
// Julien :
- Parameters form = new Parameters();
+ PortletParameters form = new PortletParameters();
if (bodyParams != null)
{
form.putAll(bodyParams);
@@ -250,7 +250,7 @@
}
//
- form = new Parameters();
+ form = new PortletParameters();
if (bodyParams != null)
{
form.putAll(bodyParams);
@@ -312,7 +312,7 @@
return interactionState;
}
- public Parameters getForm()
+ public PortletParameters getForm()
{
return form;
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestEncoder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestEncoder.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestEncoder.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -25,8 +25,8 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.ParametersStateString;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.server.ServerURL;
import java.util.Iterator;
@@ -51,7 +51,7 @@
//
if (interactionState != null)
{
- if (interactionState instanceof ParametersStateString)
+ if (interactionState instanceof PortletParametersStateString)
{
if (navigationalState != null)
{
@@ -59,7 +59,7 @@
}
// Add the parameters
- Parameters parameters = ((ParametersStateString)interactionState).getParameters();
+ PortletParameters parameters = ((PortletParametersStateString)interactionState).getParameters();
configure(url, parameters);
}
else
@@ -92,10 +92,10 @@
//
if (navigationalState != null)
{
- if (navigationalState instanceof ParametersStateString)
+ if (navigationalState instanceof PortletParametersStateString)
{
// Add the parameters
- Parameters parameters = ((ParametersStateString)navigationalState).getParameters();
+ PortletParameters parameters = ((PortletParametersStateString)navigationalState).getParameters();
configure(url, parameters);
}
else
@@ -111,7 +111,7 @@
configure(meta, url, mode, windowState);
}
- private static void configure(ServerURL url, Parameters parameters)
+ private static void configure(ServerURL url, PortletParameters parameters)
{
for (Iterator i = parameters.entrySet().iterator(); i.hasNext();)
{
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionRequestImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionRequestImpl.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionRequestImpl.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168;
-import org.jboss.portal.portlet.Parameters;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.spi.ActionContext;
@@ -56,14 +56,14 @@
if (interactionState != null)
{
// Unserialize the interaction state if necessary
- ParametersStateString parametersState = null;
- if (interactionState instanceof ParametersStateString)
+ PortletParametersStateString parametersState = null;
+ if (interactionState instanceof PortletParametersStateString)
{
- parametersState = (ParametersStateString)interactionState;
+ parametersState = (PortletParametersStateString)interactionState;
}
else
{
- parametersState = new ParametersStateString(interactionState.getStringValue());
+ parametersState = new PortletParametersStateString(interactionState.getStringValue());
}
//
@@ -71,7 +71,7 @@
}
//
- Parameters form = actionContext.getForm();
+ PortletParameters form = actionContext.getForm();
if (form != null)
{
if (parameters == null)
@@ -80,7 +80,7 @@
}
else
{
- parameters = new Parameters(parameters);
+ parameters = new PortletParameters(parameters);
parameters.append(form);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionResponseImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionResponseImpl.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionResponseImpl.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -25,7 +25,7 @@
import org.apache.log4j.Logger;
import org.jboss.portal.Mode;
import org.jboss.portal.common.util.URLTools;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -62,7 +62,7 @@
//
RenderResponse rr = new RenderResponse();
- rr.setNavigationalState(new ParametersStateString());
+ rr.setNavigationalState(new PortletParametersStateString());
//
this.response = rr;
@@ -157,7 +157,7 @@
//
if (decision == WANT_NOTHING || decision == WANT_RENDER)
{
- ((ParametersStateString)((RenderResponse)response).getNavigationalState()).replace(map);
+ ((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).replace(map);
decision = WANT_RENDER;
}
else
@@ -173,7 +173,7 @@
//
if (decision == WANT_NOTHING || decision == WANT_RENDER)
{
- ((ParametersStateString)((RenderResponse)response).getNavigationalState()).setValue(name, value);
+ ((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).setValue(name, value);
decision = WANT_RENDER;
}
else
@@ -189,7 +189,7 @@
//
if (decision == WANT_NOTHING || decision == WANT_RENDER)
{
- ((ParametersStateString)((RenderResponse)response).getNavigationalState()).setValues(name, values);
+ ((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).setValues(name, values);
decision = WANT_RENDER;
}
else
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -24,7 +24,7 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.container.PortletApplicationImpl;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.info.ContainerPortletInfo;
@@ -90,7 +90,7 @@
protected int sessionStatus;
/** . */
- protected Parameters parameters;
+ protected PortletParameters parameters;
/** The lazy request attributes map added or removed during the request of the portlet. */
protected Map attributes;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletURLImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletURLImpl.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletURLImpl.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -24,8 +24,8 @@
import org.jboss.portal.Mode;
import org.jboss.portal.portlet.ActionURL;
-import org.jboss.portal.portlet.Parameters;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.RenderURL;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -155,16 +155,16 @@
return null;
}
- protected abstract Parameters getInternalParameters();
+ protected abstract PortletParameters getInternalParameters();
}
static class InternalActionURL extends InternalPortletURL implements ActionURL
{
/** . */
- private ParametersStateString parameters = new ParametersStateString();
+ private PortletParametersStateString parameters = new PortletParametersStateString();
- protected Parameters getInternalParameters()
+ protected PortletParameters getInternalParameters()
{
return parameters.getParameters();
}
@@ -185,9 +185,9 @@
{
/** . */
- private ParametersStateString navigationalState = new ParametersStateString();
+ private PortletParametersStateString navigationalState = new PortletParametersStateString();
- protected Parameters getInternalParameters()
+ protected PortletParameters getInternalParameters()
{
return navigationalState.getParameters();
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderRequestImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderRequestImpl.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderRequestImpl.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.spi.RenderContext;
@@ -55,13 +55,13 @@
{
}
- else if (navigationalState instanceof ParametersStateString)
+ else if (navigationalState instanceof PortletParametersStateString)
{
- parameters = ((ParametersStateString)navigationalState).getParameters();
+ parameters = ((PortletParametersStateString)navigationalState).getParameters();
}
else
{
- ParametersStateString parametersState = new ParametersStateString(navigationalState.getStringValue());
+ PortletParametersStateString parametersState = new PortletParametersStateString(navigationalState.getStringValue());
parameters = parametersState.getParameters();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -24,7 +24,7 @@
import org.jboss.portal.portlet.spi.ActionContext;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.server.util.HTTPStreamInfo;
@@ -44,7 +44,7 @@
protected StateString interactionState;
/** . */
- protected Parameters form;
+ protected PortletParameters form;
protected AbstractActionContext(
@@ -53,7 +53,7 @@
StateString navigationalState,
HTTPStreamInfo streamInfo,
StateString interactionState,
- Parameters form)
+ PortletParameters form)
{
super(mode, windowState, navigationalState, streamInfo);
this.interactionState = interactionState;
@@ -90,7 +90,7 @@
return interactionState;
}
- public Parameters getForm()
+ public PortletParameters getForm()
{
return form;
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/spi/ActionContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/spi/ActionContext.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/spi/ActionContext.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.spi;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.StateString;
import java.io.BufferedReader;
@@ -30,43 +30,84 @@
import java.io.InputStream;
/**
- * Abstract how the container access the input parameters of the request.
+ * Extends the generic invocation context to provide action invocation specific input/services.
*
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision$
*/
public interface ActionContext extends PortletInvocationContext
{
+
/**
+ * Returns the name of the character encoding used in the body of this request. This method returns <code>null</code>
+ * if the request does not specify a character encoding.
*
+ * @return a <code>String</code> containing the name of the chararacter encoding, or <code>null</code> if the
+ * request does not specify a character encoding.
*/
String getCharacterEncoding();
/**
+ * Returns the length, in bytes, of the request body which is made available by the input stream, or -1 if the length
+ * is not known.
*
+ * @return an integer containing the length of the request body or -1 if the length is not known
*/
int getContentLength();
/**
+ * Retrieves the body of the HTTP request from the client to the portal as character data using a
+ * <code>BufferedReader</code>. The reader translates the character data according to the character encoding used on
+ * the body. Either this method or {@link #getInputStream} may be called to read the body, not both.
+ * <p/>
+ * For HTTP POST data of type application/x-www-form-urlencoded this method throws an
+ * <code>IllegalStateException</code> as this data has been already processed by the portal/portlet-container and is
+ * available as request parameters.
*
+ * @throws java.io.UnsupportedEncodingException if the character set encoding used is not supported and
+ * the text cannot be decoded
+ * @throws java.lang.IllegalStateException if {@link #getInputStream} method has been called on this request,
+ * it is a HTTP POST data of type application/x-www-form-urlencoded.
+ * @throws java.io.IOException if an input or output exception occurred
+ * @return a <code>BufferedReader</code> containing the body of the request
+ * @see #getInputStream
*/
BufferedReader getReader() throws IOException;
/**
+ * Retrieves the body of the HTTP request from client to portal as binary data using an <CODE>InputStream</CODE>.
+ * Either this method or {@link #getReader} may be called to read the body, but not both.
+ * <p/>
+ * For HTTP POST data of type application/x-www-form-urlencoded this method throws an
+ * <code>IllegalStateException</code> as this data has been already processed by the portal/portlet-container and is
+ * available as request parameters.
*
+ * @return an input stream containing the body of the request
+ * @throws java.lang.IllegalStateException if getReader was already called, or it is a HTTP POST data of type
+ * application/x-www-form-urlencoded
+ * @throws java.io.IOException if an input or output exception occurred
*/
- InputStream getInputStream() throws IOException;
+ InputStream getInputStream() throws IOException, IllegalStateException;
- /** The content type accepted by the portal. */
+ /**
+ * Returns the MIME type of the body of the request, or null if the type is not known.
+ *
+ * @return a <code>String</code> containing the name of the MIME type of the request, or null if the type is not
+ * known.
+ */
String getContentType();
/**
+ * Returns the interaction state of the request.
*
+ * @return the interaction state
*/
StateString getInteractionState();
/**
+ * Returns the form parameters of the request or null if no form could be decoded by the caller.
*
+ * @return the request form
*/
- Parameters getForm();
+ PortletParameters getForm();
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -30,6 +30,8 @@
import org.jboss.portal.server.util.HTTPStreamInfo;
/**
+ * Contract that defines what input/services the caller of a portlet container must provide.
+ *
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision: 5064 $
*/
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/spi/RenderContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/spi/RenderContext.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/spi/RenderContext.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -23,6 +23,8 @@
package org.jboss.portal.portlet.spi;
/**
+ * Extends the generic invocation context to provide render invocation specific input/services.
+ *
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision$
*/
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/ActionContextSupport.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/ActionContextSupport.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/ActionContextSupport.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.support.spi;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.spi.ActionContext;
@@ -67,7 +67,7 @@
throw new UnsupportedOperationException();
}
- public Parameters getForm()
+ public PortletParameters getForm()
{
throw new UnsupportedOperationException();
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -30,8 +30,8 @@
import org.jboss.portal.common.util.URLTools;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.portlet.ActionURL;
-import org.jboss.portal.portlet.Parameters;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvoker;
@@ -140,7 +140,7 @@
if (decoder.getType() == PortletRequestDecoder.ACTION_TYPE)
{
// Get the navigational state if it exist
- ParametersStateString navigationalState = (ParametersStateString)invocation.getAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE, portlet.getContext().getId());
+ PortletParametersStateString navigationalState = (PortletParametersStateString)invocation.getAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE, portlet.getContext().getId());
//
ActionContextImpl actionContext = new ActionContextImpl(
@@ -449,7 +449,7 @@
private HttpServletRequest req;
private StateString interactionState;
- private Parameters form;
+ private PortletParameters form;
public ActionContextImpl(
Portlet portlet,
@@ -458,7 +458,7 @@
WindowState windowState,
Mode mode,
StateString interactionState,
- Parameters form)
+ PortletParameters form)
{
super(portlet, invocation, navigationalState, windowState, mode);
req = invocation.getServerContext().getClientRequest();
@@ -496,7 +496,7 @@
return interactionState;
}
- public Parameters getForm()
+ public PortletParameters getForm()
{
return form;
}
@@ -640,10 +640,10 @@
serverURL.setParameterValue(PortletRequestDecoder.META_PARAMETER, Integer.toHexString(meta));
// Unwrap in a specific jboss portlet navigational state
- Parameters parameters = null;
+ PortletParameters parameters = null;
if (portletURL instanceof ActionURL)
{
- ParametersStateString interactionState = (ParametersStateString)((ActionURL)portletURL).getInteractionState();
+ PortletParametersStateString interactionState = (PortletParametersStateString)((ActionURL)portletURL).getInteractionState();
if (interactionState != null)
{
parameters = interactionState.getParameters();
@@ -651,7 +651,7 @@
}
else
{
- ParametersStateString navState = (ParametersStateString)((RenderURL)portletURL).getNavigationalState();
+ PortletParametersStateString navState = (PortletParametersStateString)((RenderURL)portletURL).getNavigationalState();
if (navState != null)
{
parameters = navState.getParameters();
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/ParametersTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/ParametersTestCase.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/ParametersTestCase.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.portlet;
import org.jboss.portal.common.junit.ExtendedAssert;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import java.util.Arrays;
import java.util.HashMap;
@@ -44,11 +44,11 @@
super(name);
}
- private Parameters param;
+ private PortletParameters param;
public void setUp()
{
- param = new Parameters();
+ param = new PortletParameters();
}
public void tearDown()
@@ -175,7 +175,7 @@
public void testReplaceWithParameters()
{
- Parameters other = new Parameters();
+ PortletParameters other = new PortletParameters();
other.setValue("a", "b");
other.setValues("c", new String[]{"d", "e"});
param.replace(other);
@@ -187,7 +187,7 @@
{
try
{
- new Parameters(null);
+ new PortletParameters(null);
fail("Expected IllegalArgumentException");
}
catch (IllegalArgumentException e)
@@ -199,7 +199,7 @@
{
try
{
- new Parameters((Map)null);
+ new PortletParameters((Map)null);
fail("Expected IllegalArgumentException");
}
catch (IllegalArgumentException e)
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestDecoderTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestDecoderTestCase.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestDecoderTestCase.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -26,8 +26,8 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.portlet.OpaqueStateString;
-import org.jboss.portal.portlet.Parameters;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.impl.PortletRequestDecoder;
import java.util.HashMap;
@@ -260,7 +260,7 @@
o.decode(queryParams, null);
assertNull(o.getForm());
assertNull(o.getInteractionState());
- assertEquals(new ParametersStateString(), o.getNavigationalstate());
+ assertEquals(new PortletParametersStateString(), o.getNavigationalstate());
assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
assertNull(o.getMode());
assertNull(o.getWindowState());
@@ -272,7 +272,7 @@
o.decode(queryParams, null);
assertNull(o.getForm());
assertNull(o.getInteractionState());
- assertEquals(new ParametersStateString(), o.getNavigationalstate());
+ assertEquals(new PortletParametersStateString(), o.getNavigationalstate());
assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
assertEquals(Mode.VIEW, o.getMode());
assertNull(o.getWindowState());
@@ -284,7 +284,7 @@
o.decode(queryParams, null);
assertNull(o.getForm());
assertNull(o.getInteractionState());
- assertEquals(new ParametersStateString(), o.getNavigationalstate());
+ assertEquals(new PortletParametersStateString(), o.getNavigationalstate());
assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
assertNull(o.getMode());
assertEquals(WindowState.NORMAL, o.getWindowState());
@@ -296,7 +296,7 @@
Map queryParams = new HashMap();
Map bodyParams = new HashMap();
PortletRequestDecoder o = new PortletRequestDecoder();
- ParametersStateString navState = new ParametersStateString();
+ PortletParametersStateString navState = new PortletParametersStateString();
// Query parameter
queryParams.put(PortletRequestDecoder.META_PARAMETER, asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK)));
@@ -502,8 +502,8 @@
// Empty
queryParams.put(PortletRequestDecoder.META_PARAMETER, asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK)));
o.decode(queryParams, null);
- assertEquals(new Parameters(), o.getForm());
- assertEquals(new ParametersStateString(), o.getInteractionState());
+ assertEquals(new PortletParameters(), o.getForm());
+ assertEquals(new PortletParametersStateString(), o.getInteractionState());
assertNull(o.getNavigationalstate());
assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
assertNull(o.getMode());
@@ -514,8 +514,8 @@
queryParams.put(PortletRequestDecoder.META_PARAMETER, asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK | PortletRequestDecoder.MODE_MASK)));
queryParams.put(PortletRequestDecoder.MODE_PARAMETER, asStringArray(Mode.VIEW.toString()));
o.decode(queryParams, null);
- assertEquals(new Parameters(), o.getForm());
- assertEquals(new ParametersStateString(), o.getInteractionState());
+ assertEquals(new PortletParameters(), o.getForm());
+ assertEquals(new PortletParametersStateString(), o.getInteractionState());
assertNull(o.getNavigationalstate());
assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
assertEquals(Mode.VIEW, o.getMode());
@@ -526,8 +526,8 @@
queryParams.put(PortletRequestDecoder.META_PARAMETER, asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK | PortletRequestDecoder.WINDOW_STATE_MASK)));
queryParams.put(PortletRequestDecoder.WINDOW_STATE_PARAMETER, asStringArray(WindowState.NORMAL.toString()));
o.decode(queryParams, null);
- assertEquals(new Parameters(), o.getForm());
- assertEquals(new ParametersStateString(), o.getInteractionState());
+ assertEquals(new PortletParameters(), o.getForm());
+ assertEquals(new PortletParametersStateString(), o.getInteractionState());
assertNull(o.getNavigationalstate());
assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
assertNull(o.getMode());
@@ -540,8 +540,8 @@
Map queryParams = new HashMap();
Map bodyParams = new HashMap();
PortletRequestDecoder o = new PortletRequestDecoder();
- ParametersStateString intState = new ParametersStateString();
- Parameters form = new Parameters();
+ PortletParametersStateString intState = new PortletParametersStateString();
+ PortletParameters form = new PortletParameters();
// Query parameter
queryParams.put(PortletRequestDecoder.META_PARAMETER, asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK)));
@@ -615,7 +615,7 @@
// Empty
queryParams.put(PortletRequestDecoder.META_PARAMETER, asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK | PortletRequestDecoder.OPAQUE_MASK)));
o.decode(queryParams, null);
- assertEquals(new Parameters(), o.getForm());
+ assertEquals(new PortletParameters(), o.getForm());
assertNull(o.getInteractionState());
assertNull(o.getNavigationalstate());
assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
@@ -627,7 +627,7 @@
queryParams.put(PortletRequestDecoder.META_PARAMETER, asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK | PortletRequestDecoder.OPAQUE_MASK)));
queryParams.put(PortletRequestDecoder.NAVIGATIONAL_STATE_PARAMETER, asStringArray("navstatevalue"));
o.decode(queryParams, null);
- assertEquals(new Parameters(), o.getForm());
+ assertEquals(new PortletParameters(), o.getForm());
assertNull(o.getInteractionState());
assertEquals(new OpaqueStateString("navstatevalue"), o.getNavigationalstate());
assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
@@ -639,7 +639,7 @@
queryParams.put(PortletRequestDecoder.META_PARAMETER, asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK | PortletRequestDecoder.OPAQUE_MASK)));
queryParams.put(PortletRequestDecoder.INTERACTION_STATE_PARAMETER, asStringArray("intstatevalue"));
o.decode(queryParams, null);
- assertEquals(new Parameters(), o.getForm());
+ assertEquals(new PortletParameters(), o.getForm());
assertEquals(new OpaqueStateString("intstatevalue"), o.getInteractionState());
assertNull(o.getNavigationalstate());
assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
@@ -654,7 +654,7 @@
queryParams.put("foo3", new String[]{"bar4"});
bodyParams.put("foo3", new String[]{"bar5"});
o.decode(queryParams, bodyParams);
- Parameters form = new Parameters();
+ PortletParameters form = new PortletParameters();
form.setValue("foo1", "bar1");
form.setValues("foo2", new String[]{"bar2", "bar3"});
form.setValues("foo3", new String[]{"bar5"});
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/navigation/StateStringTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/navigation/StateStringTestCase.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/navigation/StateStringTestCase.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -24,7 +24,7 @@
package org.jboss.portal.test.portlet.navigation;
import junit.framework.TestCase;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParametersStateString;
/**
* @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
@@ -39,7 +39,7 @@
public void testNavigationalState() throws Exception
{
- ParametersStateString ns = new ParametersStateString();
+ PortletParametersStateString ns = new PortletParametersStateString();
ns.setValue(NAME1, VALUE1);
assertEquals(VALUE1, ns.getValue(NAME1));
@@ -47,7 +47,7 @@
System.out.println("opaqueValue = " + opaqueValue);
assertNotNull(opaqueValue);
- ns = new ParametersStateString(opaqueValue);
+ ns = new PortletParametersStateString(opaqueValue);
assertEquals(VALUE1, ns.getValue(NAME1));
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -26,7 +26,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.MediaType;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.PortletURL;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
@@ -48,7 +48,7 @@
/**
* @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
- * @version $Revision: 5064 $
+ * @version $Revision$
* @since 2.4
*/
public class TestPortletInvocationContext extends AbstractPortletInvocationContext
@@ -145,7 +145,7 @@
return null;
}
- public Parameters getForm()
+ public PortletParameters getForm()
{
return null;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -24,8 +24,8 @@
package org.jboss.portal.wsrp.consumer;
import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.portlet.Parameters;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.StateString;
@@ -86,14 +86,14 @@
if (interactionState != null)
{
String state = interactionState.getStringValue();
- if (!ParametersStateString.JBPNS_PREFIX.equals(state)) // fix-me: see JBPORTAL-900
+ if (!PortletParametersStateString.JBPNS_PREFIX.equals(state)) // fix-me: see JBPORTAL-900
{
interactionParams.setInteractionState(state);
}
}
// form parameters
- Parameters params = actionContext.getForm();
+ PortletParameters params = actionContext.getForm();
if (params != null && !params.isEmpty())
{
List formParameters = new ArrayList(params.size());
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -25,7 +25,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -117,7 +117,7 @@
if (navigationalState != null)
{
String state = navigationalState.getStringValue();
- if (!ParametersStateString.JBPNS_PREFIX.equals(state)) // fix-me: see JBPORTAL-900
+ if (!PortletParametersStateString.JBPNS_PREFIX.equals(state)) // fix-me: see JBPORTAL-900
{
markupParams.setNavigationalState(state);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPActionContext.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -25,7 +25,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.spi.ActionContext;
import org.jboss.portal.portlet.spi.InstanceContext;
@@ -49,7 +49,7 @@
*/
public class WSRPActionContext extends WSRPPortletInvocationContext implements ActionContext
{
- private Parameters formParameters;
+ private PortletParameters formParameters;
private HttpServletRequest request;
private String characterEncoding;
private String contentType;
@@ -59,7 +59,7 @@
SecurityContext securityContext, HTTPStreamInfo streamInfo, PortalContext portalContext,
UserContext userContext, InstanceContext instanceContext, WindowContext windowContext,
StateString interactionState, Mode mode, WindowState windowState,
- Parameters formParameters, String characterEncoding, String contentType)
+ PortletParameters formParameters, String characterEncoding, String contentType)
{
super(navigationalState, securityContext, streamInfo, portalContext, userContext, instanceContext,
windowContext, mode, windowState);
@@ -100,7 +100,7 @@
return contentType;
}
- public Parameters getForm()
+ public PortletParameters getForm()
{
return formParameters;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2007-01-10 13:42:44 UTC (rev 5975)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2007-01-10 14:09:42 UTC (rev 5976)
@@ -28,7 +28,7 @@
import org.jboss.portal.common.util.LocaleInfo;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.portlet.OpaqueStateString;
-import org.jboss.portal.portlet.Parameters;
+import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
@@ -335,7 +335,7 @@
WSRPInstanceContext instanceContext = createInstanceContext(portletHandle, WSRPUtils.getAccessModeFromStateChange(stateChange));
- Parameters parameters;
+ PortletParameters parameters;
NamedString[] formParams = interactionParams.getFormParameters();
if (formParams != null && formParams.length > 0)
{
@@ -361,11 +361,11 @@
params.put(paramName, new String[]{paramValue});
}
}
- parameters = new Parameters(params);
+ parameters = new PortletParameters(params);
}
else
{
- parameters = new Parameters();
+ parameters = new PortletParameters();
}
log.debug("form parameters:\n" + parameters);
More information about the portal-commits
mailing list