Author: julien(a)jboss.com
Date: 2008-02-05 12:17:28 -0500 (Tue, 05 Feb 2008)
New Revision: 9780
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/event/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/event/EventControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/MutablePageNavigationalState.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/PageNavigationalStateImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/StateControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalState.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/StateControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/WindowNavigationalState.java
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PageNavigationalState.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/WindowNavigationalState.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PageScopedFullPortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletActionRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletRenderRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletScopedPortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/response/PageUpdateResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java
Log:
- introduce state controller context class
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PageNavigationalState.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PageNavigationalState.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PageNavigationalState.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -1,115 +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.controller;
-
-import org.jboss.portal.common.util.ParameterMap;
-import org.jboss.portal.portlet.info.ParameterInfo;
-import org.jboss.portal.portlet.info.PortletInfo;
-
-import javax.xml.namespace.QName;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.zip.GZIPOutputStream;
-import java.util.zip.GZIPInputStream;
-import java.io.Serializable;
-import java.io.ObjectOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ByteArrayInputStream;
-import java.io.ObjectInputStream;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PageNavigationalState implements Serializable
-{
-
- /** . */
- protected final Map<String, WindowNavigationalState> windows;
-
- /** . */
- protected final Map<QName, String[]> page;
-
- public PageNavigationalState()
- {
- this.windows = new HashMap<String, WindowNavigationalState>();
- this.page = new HashMap<QName, String[]>();
- }
-
- public PageNavigationalState(PageNavigationalState original)
- {
- this.windows = new HashMap<String,
WindowNavigationalState>(original.windows);
- this.page = new HashMap<QName, String[]>(original.page);
- }
-
- public WindowNavigationalState getWindowNavigationalState(String windowId)
- {
- return windows.get(windowId);
- }
-
- public ParameterMap getPublicNavigationalState(PortletInfo portlet)
- {
- ParameterMap publicNavigationalState = null;
- for (ParameterInfo parameterInfo : portlet.getNavigation().getPublicParameters())
- {
- String[] parameterValue = page.get(parameterInfo.getName());
-
- //
- if (parameterValue != null)
- {
- String parameterId = parameterInfo.getId();
-
- // Lazy create
- if (publicNavigationalState == null)
- {
- publicNavigationalState = new ParameterMap();
- }
-
- // We clone the value here so we keep the internal state not potentially
changed
- publicNavigationalState.put(parameterId, parameterValue.clone());
- }
- }
-
- //
- return publicNavigationalState;
- }
-
- public static byte[] serialize(PageNavigationalState object) throws IOException
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- GZIPOutputStream zos = new GZIPOutputStream(baos);
- ObjectOutputStream oos = new ObjectOutputStream(zos);
- oos.writeObject(object);
- oos.close();
- return baos.toByteArray();
- }
-
- public static PageNavigationalState unserialize(byte[] bytes) throws IOException,
ClassNotFoundException
- {
- ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- GZIPInputStream zis = new GZIPInputStream(bais);
- ObjectInputStream ois = new ObjectInputStream(zis);
- return (PageNavigationalState)ois.readObject();
- }
-}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -30,6 +30,8 @@
import org.jboss.portal.portlet.invocation.ResourceInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.StateControllerContext;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
@@ -64,4 +66,6 @@
EventControllerContext getEventControllerContext();
+ StateControllerContext getStateControllerContext();
+
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -28,6 +28,9 @@
import org.jboss.portal.portlet.controller.response.ControllerResponse;
import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
import org.jboss.portal.portlet.controller.response.PortletResponse;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.StateControllerContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@@ -64,10 +67,20 @@
{
PortletControllerContext context = portletRequest.getControllerContext();
+ StateControllerContext stateContext = context.getStateControllerContext();
+
// The page navigational state we will operate on during the request
// Either we have nothing in the request so we create a new one
// Or we have one but we copy it as we should not modify the input state provided
- MutablePageNavigationalState pageState = portletRequest.getPageState() == null ?
new MutablePageNavigationalState() : new
MutablePageNavigationalState(portletRequest.getPageState());
+ PageNavigationalState pageState = portletRequest.getPageState();
+ if (pageState == null)
+ {
+ pageState = stateContext.createPageState();
+ }
+ else
+ {
+ pageState = stateContext.clonePageState(pageState);
+ }
//
ResponseProperties requestProperties = new ResponseProperties();
@@ -244,8 +257,11 @@
return context.invoke(event.getWindowId(), requestCookies, eventInvocation);
}
- private void updateNavigationalState(PortletControllerContext context, String
windowId,
- UpdateNavigationalStateResponse update,
MutablePageNavigationalState pageState)
+ private void updateNavigationalState(
+ PortletControllerContext context,
+ String windowId,
+ UpdateNavigationalStateResponse update,
+ PageNavigationalState pageState)
throws PortletInvokerException
{
PortletInfo portlet = context.getPortletInfo(windowId);
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletResourceRequestHandler.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletResourceRequestHandler.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PortletResourceRequestHandler.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -39,6 +39,7 @@
import org.jboss.portal.portlet.controller.request.PortletScopedPortletResourceRequest;
import org.jboss.portal.portlet.controller.response.ControllerResponse;
import org.jboss.portal.portlet.controller.response.ResourceResponse;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/WindowNavigationalState.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/WindowNavigationalState.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/WindowNavigationalState.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -1,75 +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.controller;
-
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.portlet.StateString;
-
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class WindowNavigationalState implements Serializable
-{
-
- /** . */
- private final StateString portletNavigationalState;
-
- /** . */
- private final Mode mode;
-
- /** . */
- private final WindowState windowState;
-
- public WindowNavigationalState()
- {
- this.portletNavigationalState = null;
- this.mode = Mode.VIEW;
- this.windowState = WindowState.NORMAL;
- }
-
- public WindowNavigationalState(StateString portletNavigationalState, Mode mode,
WindowState windowState)
- {
- this.portletNavigationalState = portletNavigationalState;
- this.mode = mode;
- this.windowState = windowState;
- }
-
- public StateString getPortletNavigationalState()
- {
- return portletNavigationalState;
- }
-
- public Mode getMode()
- {
- return mode;
- }
-
- public WindowState getWindowState()
- {
- return windowState;
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/event/EventControllerContextImpl.java
(from rev 9779,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/event/EventControllerContextImpl.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/event/EventControllerContextImpl.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/event/EventControllerContextImpl.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.controller.impl.event;
+
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.controller.event.EventControllerContext;
+import org.jboss.portal.portlet.controller.event.Event;
+import org.jboss.portal.portlet.info.PortletInfo;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class EventControllerContextImpl implements EventControllerContext
+{
+
+ /** . */
+ private PortletInvoker invoker;
+
+ public EventControllerContextImpl(PortletInvoker invoker)
+ {
+ this.invoker = invoker;
+ }
+
+ public List<Event> getConsumedEvents(Event producedEvent)
+ {
+ try
+ {
+ ArrayList<Event> consumedEvents = new ArrayList<Event>();
+ for (Portlet portlet : invoker.getPortlets())
+ {
+ PortletInfo portletInfo = portlet.getInfo();
+ if
(portletInfo.getEventing().getConsumedEvents().containsKey(producedEvent.getName()))
+ {
+ Event consumedEvent = new Event(producedEvent.getName(),
producedEvent.getPayload(), portlet.getContext().getId());
+ consumedEvents.add(consumedEvent);
+ }
+ }
+ return consumedEvents;
+ }
+ catch (PortletInvokerException e)
+ {
+ System.out.println("e = " + e);
+
+ //
+ return Collections.emptyList();
+ }
+ }
+}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/MutablePageNavigationalState.java
(from rev 9779,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/MutablePageNavigationalState.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/MutablePageNavigationalState.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/MutablePageNavigationalState.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.controller.impl.state;
+
+import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class MutablePageNavigationalState extends PageNavigationalStateImpl
+{
+
+ public MutablePageNavigationalState()
+ {
+ }
+
+ public MutablePageNavigationalState(PageNavigationalStateImpl original)
+ {
+ super(original);
+ }
+
+ public void setWindowNavigationalState(String windowId, WindowNavigationalState
windowNS)
+ {
+ windows.put(windowId, windowNS);
+ }
+
+ public void setPublicNavigationalState(QName name, String[] value)
+ {
+ // We clone the value in order to keep the state not mutated by a side effect
+ page.put(name, value.clone());
+ }
+
+ public void removePublicNavigationalState(QName name)
+ {
+ page.remove(name);
+ }
+}
\ No newline at end of file
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/PageNavigationalStateImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/PageNavigationalStateImpl.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/PageNavigationalStateImpl.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -0,0 +1,115 @@
+/******************************************************************************
+ * 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.controller.impl.state;
+
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.portlet.info.ParameterInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.zip.GZIPOutputStream;
+import java.util.zip.GZIPInputStream;
+import java.io.Serializable;
+import java.io.ObjectOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class PageNavigationalStateImpl implements PageNavigationalState, Serializable
+{
+
+ /** . */
+ protected final Map<String, WindowNavigationalState> windows;
+
+ /** . */
+ protected final Map<QName, String[]> page;
+
+ public PageNavigationalStateImpl()
+ {
+ this.windows = new HashMap<String, WindowNavigationalState>();
+ this.page = new HashMap<QName, String[]>();
+ }
+
+ public PageNavigationalStateImpl(PageNavigationalStateImpl original)
+ {
+ this.windows = new HashMap<String,
WindowNavigationalState>(original.windows);
+ this.page = new HashMap<QName, String[]>(original.page);
+ }
+
+ public WindowNavigationalState getWindowNavigationalState(String windowId)
+ {
+ return windows.get(windowId);
+ }
+
+ public ParameterMap getPublicNavigationalState(PortletInfo portlet)
+ {
+ ParameterMap publicNavigationalState = null;
+ for (ParameterInfo parameterInfo : portlet.getNavigation().getPublicParameters())
+ {
+ String[] parameterValue = page.get(parameterInfo.getName());
+
+ //
+ if (parameterValue != null)
+ {
+ String parameterId = parameterInfo.getId();
+
+ // Lazy create
+ if (publicNavigationalState == null)
+ {
+ publicNavigationalState = new ParameterMap();
+ }
+
+ // We clone the value here so we keep the internal state not potentially
changed
+ publicNavigationalState.put(parameterId, parameterValue.clone());
+ }
+ }
+
+ //
+ return publicNavigationalState;
+ }
+
+ public void setWindowNavigationalState(String windowId, WindowNavigationalState
windowNS) throws UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setPublicNavigationalState(QName name, String[] value) throws
UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removePublicNavigationalState(QName name) throws
UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
\ No newline at end of file
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/StateControllerContextImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/StateControllerContextImpl.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/impl/state/StateControllerContextImpl.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.controller.impl.state;
+
+import org.jboss.portal.portlet.controller.state.StateControllerContext;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+
+import java.io.IOException;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
+import java.util.zip.GZIPOutputStream;
+import java.util.zip.GZIPInputStream;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class StateControllerContextImpl implements StateControllerContext
+{
+
+ public PageNavigationalState clonePageState(PageNavigationalState pageState)
+ {
+ return new MutablePageNavigationalState((PageNavigationalStateImpl)pageState);
+ }
+
+ public PageNavigationalState createPageState()
+ {
+ return new MutablePageNavigationalState();
+ }
+
+ public static byte[] serialize(PageNavigationalState object) throws IOException
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ GZIPOutputStream zos = new GZIPOutputStream(baos);
+ ObjectOutputStream oos = new ObjectOutputStream(zos);
+ oos.writeObject(object);
+ oos.close();
+ return baos.toByteArray();
+ }
+
+ public static PageNavigationalState unserialize(byte[] bytes) throws IOException,
ClassNotFoundException
+ {
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ GZIPInputStream zis = new GZIPInputStream(bais);
+ ObjectInputStream ois = new ObjectInputStream(zis);
+ return (PageNavigationalState)ois.readObject();
+ }
+}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PageScopedFullPortletResourceRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PageScopedFullPortletResourceRequest.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PageScopedFullPortletResourceRequest.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -23,8 +23,8 @@
package org.jboss.portal.portlet.controller.request;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.controller.WindowNavigationalState;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
import org.jboss.portal.portlet.controller.PortletControllerContext;
import org.jboss.portal.common.util.ParameterMap;
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletActionRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletActionRequest.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletActionRequest.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -23,9 +23,9 @@
package org.jboss.portal.portlet.controller.request;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.controller.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
import org.jboss.portal.portlet.controller.PortletControllerContext;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
import org.jboss.portal.common.util.ParameterMap;
/**
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletRenderRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletRenderRequest.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletRenderRequest.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.portlet.controller.request;
-import org.jboss.portal.portlet.controller.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
import org.jboss.portal.portlet.controller.PortletControllerContext;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
import java.util.Map;
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletRequest.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletRequest.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.controller.request;
-import org.jboss.portal.portlet.controller.WindowNavigationalState;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
import org.jboss.portal.portlet.controller.PortletControllerContext;
/**
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletScopedPortletResourceRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletScopedPortletResourceRequest.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/request/PortletScopedPortletResourceRequest.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.controller.request;
-import org.jboss.portal.portlet.controller.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
import org.jboss.portal.portlet.controller.PortletControllerContext;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.common.util.ParameterMap;
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/response/PageUpdateResponse.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/response/PageUpdateResponse.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/response/PageUpdateResponse.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -24,7 +24,7 @@
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStateResponse;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalState.java
(from rev 9779,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/PageNavigationalState.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalState.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalState.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * 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.controller.state;
+
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.portlet.info.PortletInfo;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PageNavigationalState
+{
+
+ WindowNavigationalState getWindowNavigationalState(String windowId);
+
+ ParameterMap getPublicNavigationalState(PortletInfo portlet);
+
+ void setWindowNavigationalState(String windowId, WindowNavigationalState windowNS)
throws UnsupportedOperationException;
+
+ void setPublicNavigationalState(QName name, String[] value) throws
UnsupportedOperationException;
+
+ void removePublicNavigationalState(QName name) throws UnsupportedOperationException;
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/StateControllerContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/StateControllerContext.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/StateControllerContext.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * 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.controller.state;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface StateControllerContext
+{
+
+ PageNavigationalState clonePageState(PageNavigationalState pageState);
+
+ PageNavigationalState createPageState();
+
+}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/WindowNavigationalState.java
(from rev 9779,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/WindowNavigationalState.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/WindowNavigationalState.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/controller/state/WindowNavigationalState.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.controller.state;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.portlet.StateString;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WindowNavigationalState implements Serializable
+{
+
+ /** . */
+ private final StateString portletNavigationalState;
+
+ /** . */
+ private final Mode mode;
+
+ /** . */
+ private final WindowState windowState;
+
+ public WindowNavigationalState()
+ {
+ this.portletNavigationalState = null;
+ this.mode = Mode.VIEW;
+ this.windowState = WindowState.NORMAL;
+ }
+
+ public WindowNavigationalState(StateString portletNavigationalState, Mode mode,
WindowState windowState)
+ {
+ this.portletNavigationalState = portletNavigationalState;
+ this.mode = mode;
+ this.windowState = windowState;
+ }
+
+ public StateString getPortletNavigationalState()
+ {
+ return portletNavigationalState;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -25,7 +25,7 @@
import org.jboss.portal.portlet.controller.response.ControllerResponse;
import org.jboss.portal.portlet.controller.PortletController;
import org.jboss.portal.portlet.test.controller.PortletControllerContextImpl;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
import org.jboss.portal.portlet.test.controller.ControllerResponseRendererFactory;
import org.jboss.portal.portlet.test.controller.Renderer;
import org.jboss.portal.portlet.test.controller.PageRenderer;
@@ -88,7 +88,7 @@
}
else
{
- PageRenderer renderer = new PageRenderer(new ResponseProperties(), new
PageNavigationalState());
+ PageRenderer renderer = new PageRenderer(new ResponseProperties(),
context.getStateControllerContext().createPageState());
//
renderer.render(context);
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -42,8 +42,8 @@
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.controller.WindowNavigationalState;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
import org.jboss.portal.portlet.controller.PortletControllerContext;
import org.w3c.dom.Element;
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -51,13 +51,13 @@
import org.jboss.portal.portlet.invocation.ResourceInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.test.StringCodec;
-import org.jboss.portal.portlet.test.controller.TestInstanceContext;
-import org.jboss.portal.portlet.test.controller.TestPortalContext;
-import org.jboss.portal.portlet.test.controller.TestPortletInvocationContext;
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
-import org.jboss.portal.portlet.controller.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
import org.jboss.portal.portlet.controller.PortletControllerContext;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.impl.state.StateControllerContextImpl;
+import org.jboss.portal.portlet.controller.impl.event.EventControllerContextImpl;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.StateControllerContext;
import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
import org.jboss.portal.portlet.controller.request.ControllerRequest;
import org.jboss.portal.portlet.controller.request.PortletScopedPortletResourceRequest;
@@ -65,7 +65,6 @@
import org.jboss.portal.portlet.controller.request.PageScopedFullPortletResourceRequest;
import org.jboss.portal.portlet.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
-import org.jboss.portal.portlet.controller.event.EventControllerContextImpl;
import org.jboss.portal.web.Body;
import org.jboss.portal.web.IllegalRequestException;
import org.jboss.portal.web.WebRequest;
@@ -113,6 +112,9 @@
/** . */
private final EventControllerContext eventControllerContext;
+ /** . */
+ private final StateControllerContext stateControllerContext;
+
public PortletControllerContextImpl(
HttpServletRequest req,
HttpServletResponse resp,
@@ -142,7 +144,7 @@
if (context != null)
{
byte[] bytes = Tools.fromHexString(context);
- pageState = PageNavigationalState.unserialize(bytes);
+ pageState = StateControllerContextImpl.unserialize(bytes);
}
//
@@ -263,6 +265,7 @@
this.servletContext = servletContext;
this.invoker = invoker;
this.eventControllerContext = new EventControllerContextImpl(invoker);
+ this.stateControllerContext = new StateControllerContextImpl();
}
public ControllerRequest getRequest()
@@ -310,6 +313,11 @@
return eventControllerContext;
}
+ public StateControllerContext getStateControllerContext()
+ {
+ return stateControllerContext;
+ }
+
public String renderURL(String windowId, PageNavigationalState pageState, ContainerURL
containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
{
PortletURLRenderer renderer = new PortletURLRenderer(pageState, windowId, req,
resp);
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -34,7 +34,8 @@
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.cache.CacheLevel;
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.impl.state.StateControllerContextImpl;
import org.jboss.portal.portlet.test.StringCodec;
import javax.servlet.http.HttpServletRequest;
@@ -113,7 +114,7 @@
String pageState;
try
{
- byte[] bytes = PageNavigationalState.serialize(pageNS);
+ byte[] bytes = StateControllerContextImpl.serialize(pageNS);
pageState = Tools.toHexString(bytes);
}
catch (IOException e)
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.test.controller;
import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletURLRenderer;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java 2008-02-05
16:07:25 UTC (rev 9779)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java 2008-02-05
17:17:28 UTC (rev 9780)
@@ -23,7 +23,6 @@
package org.jboss.portal.simple;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.controller.PageNavigationalState;
import org.jboss.portal.portlet.controller.PortletController;
import org.jboss.portal.portlet.controller.response.ControllerResponse;
import org.jboss.portal.portlet.test.controller.Renderer;
@@ -88,7 +87,7 @@
}
else
{
- PageRenderer renderer = new PageRenderer(new ResponseProperties(), new
PageNavigationalState());
+ PageRenderer renderer = new PageRenderer(new ResponseProperties(),
context.getStateControllerContext().createPageState());
//
renderer.render(context);