Author: julien(a)jboss.com
Date: 2008-04-14 08:39:36 -0400 (Mon, 14 Apr 2008)
New Revision: 10578
Added:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/PortletWindowEvent.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/PortletPageNavigationalStateImpl.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletPageNavigationalState.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletPageNavigationalStateSerialization.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletWindowNavigationalState.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPortletPageNavigationalState.java
Removed:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/Event.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/PageNavigationalStateImpl.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalState.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalStateSerialization.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/WindowNavigationalState.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPageNavigationalState.java
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventControllerContextSafeInvoker.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventPhaseContextImpl.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventProduction.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/AbstractEventControllerContext.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventControllerContext.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventPhaseContext.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/AbstractPortletControllerContext.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/ControllerPortletInvocationContext.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/PortletURLRenderer.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/event/EventControllerContextImpl.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/request/ControllerRequestFactory.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/request/ControllerRequestParameterMapFactory.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/StateControllerContextImpl.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/ControllerRequest.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletActionRequest.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletEventRequest.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletRenderRequest.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletRequest.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletResourceRequest.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/response/PageUpdateResponse.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/StateControllerContext.java
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/EventControllerContextFailureTestCase.java
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerContextSupport.java
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerRequestConstructorTestCase.java
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerRequestTestCase.java
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerTestCase.java
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletInvocationContextSupport.java
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/WiringEventControllerContext.java
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/ControllerFilter.java
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/EventRoute.java
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PageEventControllerContext.java
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PagePortletControllerContext.java
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PortalRenderResponse.java
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/PortletMarkupTag.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/ControllerResponseRendererFactory.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/tck/TCKPageNavigationalStateSerialization.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKServlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKStateControllerContext.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/controller/StateControllerContextTestCase.java
Log:
renamed Window terms to PortletWindow to be more precise in the portlet controller module
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventControllerContextSafeInvoker.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventControllerContextSafeInvoker.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventControllerContextSafeInvoker.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -24,7 +24,7 @@
import org.jboss.portal.portlet.controller.event.EventControllerContext;
import org.jboss.portal.portlet.controller.event.EventPhaseContext;
-import org.jboss.portal.portlet.controller.event.Event;
+import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.apache.log4j.Logger;
@@ -40,7 +40,7 @@
/** . */
private final Logger log = Logger.getLogger(EventControllerContextSafeInvoker.class);
- public boolean eventProduced(EventControllerContext controllerContext,
EventPhaseContext phaseContext, Event sourceEvent, Event producedEvent)
+ public boolean eventProduced(EventControllerContext controllerContext,
EventPhaseContext phaseContext, PortletWindowEvent sourceEvent, PortletWindowEvent
producedEvent)
{
try
{
@@ -59,7 +59,7 @@
}
}
- public boolean eventConsumed(EventControllerContext controllerContext,
EventPhaseContext phaseContext, Event consumedEvent, PortletInvocationResponse
consumerResponse)
+ public boolean eventConsumed(EventControllerContext controllerContext,
EventPhaseContext phaseContext, PortletWindowEvent consumedEvent,
PortletInvocationResponse consumerResponse)
{
try
{
@@ -77,7 +77,7 @@
}
}
- public boolean eventFailed(EventControllerContext controllerContext, EventPhaseContext
phaseContext, Event failedEvent, Throwable throwable)
+ public boolean eventFailed(EventControllerContext controllerContext, EventPhaseContext
phaseContext, PortletWindowEvent failedEvent, Throwable throwable)
{
try
{
@@ -95,7 +95,7 @@
}
}
- public boolean eventDiscarded(EventControllerContext controllerContext,
EventPhaseContext phaseContext, Event discardedEvent, int cause)
+ public boolean eventDiscarded(EventControllerContext controllerContext,
EventPhaseContext phaseContext, PortletWindowEvent discardedEvent, int cause)
{
try
{
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventPhaseContextImpl.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventPhaseContextImpl.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventPhaseContextImpl.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.controller;
import org.jboss.portal.portlet.controller.event.EventPhaseContext;
-import org.jboss.portal.portlet.controller.event.Event;
+import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
import org.apache.log4j.Logger;
import java.util.LinkedList;
@@ -51,7 +51,7 @@
LinkedList<EventProduction> producedEvents;
/** . */
- LinkedList<Event> toConsumeEvents;
+ LinkedList<PortletWindowEvent> toConsumeEvents;
/** . */
int consumedEventSize;
@@ -66,13 +66,13 @@
{
this.log = log;
this.producedEvents = new LinkedList<EventProduction>();
- this.toConsumeEvents = new LinkedList<Event>();
+ this.toConsumeEvents = new LinkedList<PortletWindowEvent>();
this.consumedEventSize = 0;
this.producedEventSize = 0;
this.mode = READ_MODE;
}
- public void queueEvent(Event event)
+ public void queueEvent(PortletWindowEvent event)
{
if (mode == INTERRUPTED_MODE)
{
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventProduction.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventProduction.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventProduction.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.controller;
-import org.jboss.portal.portlet.controller.event.Event;
+import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -32,23 +32,23 @@
{
/** . */
- private final Event consumedEvent;
+ private final PortletWindowEvent consumedEvent;
/** . */
- private final Event producedEvent;
+ private final PortletWindowEvent producedEvent;
- EventProduction(Event consumedEvent, Event producedEvent)
+ EventProduction(PortletWindowEvent consumedEvent, PortletWindowEvent producedEvent)
{
this.consumedEvent = consumedEvent;
this.producedEvent = producedEvent;
}
- public Event getConsumedEvent()
+ public PortletWindowEvent getConsumedEvent()
{
return consumedEvent;
}
- public Event getProducedEvent()
+ public PortletWindowEvent getProducedEvent()
{
return producedEvent;
}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -24,7 +24,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.state.StateControllerContext;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.ActionInvocation;
@@ -33,10 +33,7 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@@ -63,7 +60,7 @@
* @param pageNavigationalState
* @return
*/
- PortletInvocationContext createPortletInvocationContext(String windowId,
PageNavigationalState pageNavigationalState);
+ PortletInvocationContext createPortletInvocationContext(String windowId,
PortletPageNavigationalState pageNavigationalState);
PortletInvocationResponse invoke( ActionInvocation actionInvocation) throws
PortletInvokerException;
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -29,7 +29,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.controller.event.Event;
+import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
import org.jboss.portal.portlet.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
@@ -37,9 +37,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.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.state.StateControllerContext;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.EventInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -76,14 +76,14 @@
// 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
- PageNavigationalState pageNavigationalState =
portletRequest.getPageNavigationalState();
+ PortletPageNavigationalState pageNavigationalState =
portletRequest.getPageNavigationalState();
if (pageNavigationalState == null)
{
- pageNavigationalState = stateContext.createPageNavigationalState(true);
+ pageNavigationalState = stateContext.createPortletPageNavigationalState(true);
}
else
{
- pageNavigationalState =
stateContext.clonePageNavigationalState(pageNavigationalState, true);
+ pageNavigationalState =
stateContext.clonePortletPageNavigationalState(pageNavigationalState, true);
}
//
@@ -113,7 +113,7 @@
// Feed session it with the events that may have been produced
for (UpdateNavigationalStateResponse.Event portletEvent :
stateResponse.getEvents())
{
- Event producedEvent = new Event(portletEvent.getName(),
portletEvent.getPayload(), portletRequest.getWindowId());
+ PortletWindowEvent producedEvent = new
PortletWindowEvent(portletEvent.getName(), portletEvent.getPayload(),
portletRequest.getWindowId());
phaseContext.producedEvents.add(new EventProduction(null, producedEvent));
}
@@ -124,7 +124,7 @@
while (phaseContext.producedEvents.size() > 0)
{
EventProduction eventProduction = phaseContext.producedEvents.removeFirst();
- Event producedEvent = eventProduction.getProducedEvent();
+ PortletWindowEvent producedEvent = eventProduction.getProducedEvent();
//
String producerId = producedEvent.getWindowId();
@@ -180,7 +180,7 @@
//
while (phaseContext.toConsumeEvents.size() > 0)
{
- Event toConsumeEvent = phaseContext.toConsumeEvents.removeFirst();
+ PortletWindowEvent toConsumeEvent =
phaseContext.toConsumeEvents.removeFirst();
String consumedId = toConsumeEvent.getWindowId();
//
@@ -243,7 +243,7 @@
// Add events to source event queue
for (UpdateNavigationalStateResponse.Event portletEvent :
eventStateResponse.getEvents())
{
- Event toRouteEvent = new Event(portletEvent.getName(),
portletEvent.getPayload(), toConsumeEvent.getWindowId());
+ PortletWindowEvent toRouteEvent = new
PortletWindowEvent(portletEvent.getName(), portletEvent.getPayload(),
toConsumeEvent.getWindowId());
phaseContext.producedEvents.add(new EventProduction(toConsumeEvent,
toRouteEvent));
}
@@ -294,7 +294,7 @@
PortletActionRequest portletActionRequest =
(PortletActionRequest)portletRequest;
//
- PageNavigationalState pageNavigationalState =
portletActionRequest.getPageNavigationalState();
+ PortletPageNavigationalState pageNavigationalState =
portletActionRequest.getPageNavigationalState();
//
Mode mode = portletActionRequest.getWindowNavigationalState().getMode();
@@ -314,7 +314,7 @@
ParameterMap publicNS = null;
if (pageNavigationalState != null)
{
- publicNS =
pageNavigationalState.getPublicNavigationalState(portletRequest.getWindowId());
+ publicNS =
pageNavigationalState.getPortletPublicNavigationalState(portletRequest.getWindowId());
}
PortletInvocationContext portletInvocationContext =
context.createPortletInvocationContext(portletRequest.getWindowId(),
pageNavigationalState);
@@ -334,20 +334,20 @@
}
private PortletInvocationResponse deliverEvent(
- PortletControllerContext context, Event event,
- PageNavigationalState pageNavigationalState,
+ PortletControllerContext context, PortletWindowEvent event,
+ PortletPageNavigationalState pageNavigationalState,
List<Cookie> requestCookies) throws PortletInvokerException
{
- WindowNavigationalState windowNS =
pageNavigationalState.getWindowNavigationalState(event.getWindowId());
+ PortletWindowNavigationalState windowNS =
pageNavigationalState.getPortletWindowNavigationalState(event.getWindowId());
//
if (windowNS == null)
{
- windowNS = new WindowNavigationalState();
+ windowNS = new PortletWindowNavigationalState();
}
//
- ParameterMap publicNS =
pageNavigationalState.getPublicNavigationalState(event.getWindowId());
+ ParameterMap publicNS =
pageNavigationalState.getPortletPublicNavigationalState(event.getWindowId());
//
PortletInvocationContext portletInvocationContext =
context.createPortletInvocationContext(event.getWindowId(), pageNavigationalState);
@@ -369,15 +369,15 @@
PortletControllerContext context,
String windowId,
UpdateNavigationalStateResponse update,
- PageNavigationalState pageNavigationalState)
+ PortletPageNavigationalState pageNavigationalState)
throws PortletInvokerException
{
- WindowNavigationalState windowNS =
pageNavigationalState.getWindowNavigationalState(windowId);
+ PortletWindowNavigationalState windowNS =
pageNavigationalState.getPortletWindowNavigationalState(windowId);
//
if (windowNS == null)
{
- windowNS = new WindowNavigationalState();
+ windowNS = new PortletWindowNavigationalState();
}
//
@@ -396,14 +396,14 @@
{
portletNS = update.getNavigationalState();
}
- windowNS = new WindowNavigationalState(portletNS, mode, windowState);
- pageNavigationalState.setWindowNavigationalState(windowId, windowNS);
+ windowNS = new PortletWindowNavigationalState(portletNS, mode, windowState);
+ pageNavigationalState.setPortletWindowNavigationalState(windowId, windowNS);
// Now update shared state scoped at page
Map<String, String[]> publicNS = update.getPublicNavigationalStateUpdates();
if (publicNS != null)
{
- pageNavigationalState.setPublicNavigationalState(windowId, publicNS);
+ pageNavigationalState.setPortletPublicNavigationalState(windowId, publicNS);
}
}
}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletResourceRequestHandler.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletResourceRequestHandler.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletResourceRequestHandler.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -35,8 +35,8 @@
import org.jboss.portal.portlet.controller.request.PortletResourceRequest;
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 org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
@@ -61,7 +61,7 @@
//
Mode mode = null;
WindowState windowState = null;
- PageNavigationalState pageNavigationalState = null;
+ PortletPageNavigationalState pageNavigationalState = null;
ParameterMap publicNS = null;
StateString portletNS = null;
CacheLevel cacheability;
@@ -72,7 +72,7 @@
if (scope instanceof PortletResourceRequest.PortletScope)
{
PortletResourceRequest.PortletScope portletScope =
(PortletResourceRequest.PortletScope)scope;
- WindowNavigationalState navigationalState =
portletScope.getWindowNavigationalState();
+ PortletWindowNavigationalState navigationalState =
portletScope.getWindowNavigationalState();
//
if (navigationalState != null)
@@ -92,7 +92,7 @@
//
if (pageNavigationalState != null)
{
- publicNS =
pageNavigationalState.getPublicNavigationalState(portletResourceRequest.getWindowId());
+ publicNS =
pageNavigationalState.getPortletPublicNavigationalState(portletResourceRequest.getWindowId());
}
}
else
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/AbstractEventControllerContext.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/AbstractEventControllerContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/AbstractEventControllerContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -32,19 +32,19 @@
*/
public class AbstractEventControllerContext implements EventControllerContext
{
- public void eventProduced(EventPhaseContext context, Event producedEvent, Event
sourceEvent)
+ public void eventProduced(EventPhaseContext context, PortletWindowEvent producedEvent,
PortletWindowEvent sourceEvent)
{
}
- public void eventConsumed(EventPhaseContext context, Event consumedEvent,
PortletInvocationResponse consumerResponse)
+ public void eventConsumed(EventPhaseContext context, PortletWindowEvent consumedEvent,
PortletInvocationResponse consumerResponse)
{
}
- public void eventFailed(EventPhaseContext context, Event consumedEvent, Throwable
throwable)
+ public void eventFailed(EventPhaseContext context, PortletWindowEvent consumedEvent,
Throwable throwable)
{
}
- public void eventDiscarded(EventPhaseContext context, Event discardedEvent, int
cause)
+ public void eventDiscarded(EventPhaseContext context, PortletWindowEvent
discardedEvent, int cause)
{
}
}
Deleted:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/Event.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/Event.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/Event.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -1,91 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.controller.event;
-
-import javax.xml.namespace.QName;
-import java.io.Serializable;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * An event associated with a portlet window.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class Event
-{
-
- private static final AtomicLong generator = new AtomicLong();
-
- /** . */
- private final QName name;
-
- /** . */
- private final Serializable payload;
-
- /** . */
- private final String windowId;
-
- /** . */
- private final long serialNumber = generator.incrementAndGet();
-
- public Event(QName name, Serializable payload, String windowId)
- {
- if (name == null)
- {
- throw new IllegalArgumentException();
- }
- if (windowId == null)
- {
- throw new IllegalArgumentException();
- }
- this.name = name;
- this.payload = payload;
- this.windowId = windowId;
- }
-
- public QName getName()
- {
- return name;
- }
-
- public Serializable getPayload()
- {
- return payload;
- }
-
- public String getWindowId()
- {
- return windowId;
- }
-
- public long getSerialNumber()
- {
- return serialNumber;
- }
-
- public String toString()
- {
- return "Event[name=" + name + ",windowId=" + windowId +
",payload=" + payload + ",serialNumber=" + serialNumber +
"]";
- }
-}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventControllerContext.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventControllerContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventControllerContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -70,7 +70,7 @@
* @param producedEvent the produced event
* @param sourceEvent the source event
*/
- void eventProduced(EventPhaseContext context, Event producedEvent, Event
sourceEvent);
+ void eventProduced(EventPhaseContext context, PortletWindowEvent producedEvent,
PortletWindowEvent sourceEvent);
/**
* <p>Context call back when an event is consumed by a portlet. The session
argument
@@ -87,7 +87,7 @@
* @param consumedEvent the consumed event
* @param consumerResponse the consumer response
*/
- void eventConsumed(EventPhaseContext context, Event consumedEvent,
PortletInvocationResponse consumerResponse);
+ void eventConsumed(EventPhaseContext context, PortletWindowEvent consumedEvent,
PortletInvocationResponse consumerResponse);
/**
* <p>Context call back when an event failed to be delivered because the invoker
threw an exception.
@@ -104,7 +104,7 @@
* @param failedEvent the failed event
* @param throwable the throwable
*/
- void eventFailed(EventPhaseContext context, Event failedEvent, Throwable throwable);
+ void eventFailed(EventPhaseContext context, PortletWindowEvent failedEvent, Throwable
throwable);
/**
* <p>Context call back when an event is discarded by the controller for a
specific reason.
@@ -132,6 +132,6 @@
* @param discardedEvent the discarded event
* @param cause the cause
*/
- void eventDiscarded(EventPhaseContext context, Event discardedEvent, int cause);
+ void eventDiscarded(EventPhaseContext context, PortletWindowEvent discardedEvent, int
cause);
}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventPhaseContext.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventPhaseContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventPhaseContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -36,7 +36,7 @@
* @throws IllegalArgumentException if the event is null
* @throws IllegalStateException if an event cannot be published
*/
- void queueEvent(Event event) throws IllegalArgumentException, IllegalStateException;
+ void queueEvent(PortletWindowEvent event) throws IllegalArgumentException,
IllegalStateException;
/**
* Stop processing of all events and returns from the controller.
Copied:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/PortletWindowEvent.java
(from rev 10533,
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/Event.java)
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/PortletWindowEvent.java
(rev 0)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/PortletWindowEvent.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.controller.event;
+
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * An event associated with a portlet window.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletWindowEvent
+{
+
+ private static final AtomicLong generator = new AtomicLong();
+
+ /** . */
+ private final QName name;
+
+ /** . */
+ private final Serializable payload;
+
+ /** . */
+ private final String windowId;
+
+ /** . */
+ private final long serialNumber = generator.incrementAndGet();
+
+ public PortletWindowEvent(QName name, Serializable payload, String windowId)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (windowId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.name = name;
+ this.payload = payload;
+ this.windowId = windowId;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public Serializable getPayload()
+ {
+ return payload;
+ }
+
+ public String getWindowId()
+ {
+ return windowId;
+ }
+
+ public long getSerialNumber()
+ {
+ return serialNumber;
+ }
+
+ public String toString()
+ {
+ return "Event[name=" + name + ",windowId=" + windowId +
",payload=" + payload + ",serialNumber=" + serialNumber +
"]";
+ }
+}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/AbstractPortletControllerContext.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/AbstractPortletControllerContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/AbstractPortletControllerContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -29,7 +29,7 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.controller.PortletControllerContext;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
@@ -121,7 +121,7 @@
protected abstract PortletInvocationResponse invoke(PortletInvocation invocation)
throws PortletInvokerException;
- protected abstract Serialization<PageNavigationalState>
getPageNavigationalStateSerialization();
+ protected abstract Serialization<PortletPageNavigationalState>
getPageNavigationalStateSerialization();
public PortletInvocationResponse invoke(ActionInvocation actionInvocation) throws
PortletInvokerException
{
@@ -193,7 +193,7 @@
public PortletInvocationContext createPortletInvocationContext(
String windowId,
- PageNavigationalState pageNavigationalState)
+ PortletPageNavigationalState pageNavigationalState)
{
return new
ControllerPortletInvocationContext(getPageNavigationalStateSerialization(), req, resp,
windowId, pageNavigationalState, MARKUP_INFO);
}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/ControllerPortletInvocationContext.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/ControllerPortletInvocationContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/ControllerPortletInvocationContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -30,7 +30,7 @@
import org.jboss.portal.common.io.Serialization;
import org.jboss.portal.portlet.ContainerURL;
import org.jboss.portal.portlet.URLFormat;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.impl.PortletURLRenderer;
import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -61,11 +61,11 @@
private final HttpServletResponse clientResponse;
public ControllerPortletInvocationContext(
- Serialization<PageNavigationalState> serialization,
+ Serialization<PortletPageNavigationalState> serialization,
HttpServletRequest clientRequest,
HttpServletResponse clientResponse,
String windowId,
- PageNavigationalState pageNavigationalState,
+ PortletPageNavigationalState pageNavigationalState,
MarkupInfo markupInfo)
{
super(markupInfo);
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/PortletURLRenderer.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/PortletURLRenderer.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/PortletURLRenderer.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -31,7 +31,7 @@
import org.jboss.portal.common.util.Base64;
import org.jboss.portal.portlet.ContainerURL;
import org.jboss.portal.portlet.URLFormat;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.impl.request.ControllerRequestParameterNames;
import
org.jboss.portal.portlet.controller.impl.request.ControllerRequestParameterMapFactory;
import static org.jboss.portal.portlet.controller.impl.URLParameterConstants.*;
@@ -51,7 +51,7 @@
{
/** . */
- final Serialization<PageNavigationalState> serialization;
+ final Serialization<PortletPageNavigationalState> serialization;
/** . */
final HttpServletRequest clientReq;
@@ -60,13 +60,13 @@
final HttpServletResponse clientResp;
/** . */
- final PageNavigationalState pageNS;
+ final PortletPageNavigationalState pageNS;
public PortletURLRenderer(
- PageNavigationalState pageNS,
+ PortletPageNavigationalState pageNS,
HttpServletRequest clientReq,
HttpServletResponse clientResp,
- Serialization<PageNavigationalState> serialization)
+ Serialization<PortletPageNavigationalState> serialization)
{
this.pageNS = pageNS;
this.clientReq = clientReq;
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/event/EventControllerContextImpl.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/event/EventControllerContextImpl.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/event/EventControllerContextImpl.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -26,7 +26,7 @@
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.controller.event.Event;
+import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
import org.jboss.portal.portlet.controller.event.EventPhaseContext;
import org.jboss.portal.portlet.info.PortletInfo;
@@ -46,7 +46,7 @@
this.invoker = invoker;
}
- public void eventProduced(EventPhaseContext context, Event producedEvent, Event
sourceEvent)
+ public void eventProduced(EventPhaseContext context, PortletWindowEvent producedEvent,
PortletWindowEvent sourceEvent)
{
try
{
@@ -55,7 +55,7 @@
PortletInfo portletInfo = portlet.getInfo();
if
(portletInfo.getEventing().getConsumedEvents().containsKey(producedEvent.getName()))
{
- Event distributedEvent = new Event(producedEvent.getName(),
producedEvent.getPayload(), portlet.getContext().getId());
+ PortletWindowEvent distributedEvent = new
PortletWindowEvent(producedEvent.getName(), producedEvent.getPayload(),
portlet.getContext().getId());
context.queueEvent(distributedEvent);
}
}
@@ -67,15 +67,15 @@
}
}
- public void eventConsumed(EventPhaseContext context, Event consumedEvent,
PortletInvocationResponse consumerResponse)
+ public void eventConsumed(EventPhaseContext context, PortletWindowEvent consumedEvent,
PortletInvocationResponse consumerResponse)
{
}
- public void eventFailed(EventPhaseContext context, Event failedEvent, Throwable
throwable)
+ public void eventFailed(EventPhaseContext context, PortletWindowEvent failedEvent,
Throwable throwable)
{
}
- public void eventDiscarded(EventPhaseContext context, Event discardedEvent, int
cause)
+ public void eventDiscarded(EventPhaseContext context, PortletWindowEvent
discardedEvent, int cause)
{
}
}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/request/ControllerRequestFactory.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/request/ControllerRequestFactory.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/request/ControllerRequestFactory.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.controller.impl.request;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
import org.jboss.portal.portlet.controller.request.ControllerRequest;
import org.jboss.portal.portlet.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
@@ -51,9 +51,9 @@
{
/** . */
- private final Serialization<PageNavigationalState> serialization;
+ private final Serialization<PortletPageNavigationalState> serialization;
- public ControllerRequestFactory(Serialization<PageNavigationalState>
serialization)
+ public ControllerRequestFactory(Serialization<PortletPageNavigationalState>
serialization)
{
this.serialization = serialization;
}
@@ -63,7 +63,7 @@
// The nav state provided with the request
// Unmarshall portal navigational state if it is provided
- PageNavigationalState pageNavigationalState = null;
+ PortletPageNavigationalState pageNavigationalState = null;
String context =
req.getParameter(ControllerRequestParameterNames.PAGE_NAVIGATIONAL_STATE);
if (context != null)
{
@@ -97,7 +97,7 @@
}
//
- WindowNavigationalState windowNavigationalState = new
WindowNavigationalState(navigationalState, mode, windowState);
+ PortletWindowNavigationalState windowNavigationalState = new
PortletWindowNavigationalState(navigationalState, mode, windowState);
//
String phase = req.getParameter(ControllerRequestParameterNames.LIFECYCLE_PHASE);
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/request/ControllerRequestParameterMapFactory.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/request/ControllerRequestParameterMapFactory.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/request/ControllerRequestParameterMapFactory.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.controller.impl.request;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.ContainerURL;
import org.jboss.portal.portlet.ActionURL;
import org.jboss.portal.portlet.RenderURL;
@@ -46,14 +46,14 @@
{
/** . */
- private final Serialization<PageNavigationalState> serialization;
+ private final Serialization<PortletPageNavigationalState> serialization;
- public ControllerRequestParameterMapFactory(Serialization<PageNavigationalState>
serialization)
+ public
ControllerRequestParameterMapFactory(Serialization<PortletPageNavigationalState>
serialization)
{
this.serialization = serialization;
}
- public Map<String, String> blah(PageNavigationalState pageNS, String windowId,
ContainerURL containerURL)
+ public Map<String, String> blah(PortletPageNavigationalState pageNS, String
windowId, ContainerURL containerURL)
{
Map<String, String> parameters = new HashMap<String, String>();
Deleted:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/PageNavigationalStateImpl.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/PageNavigationalStateImpl.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/PageNavigationalStateImpl.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -1,195 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.controller.impl.state;
-
-import org.jboss.portal.common.util.ParameterMap;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
-import org.jboss.portal.portlet.info.ParameterInfo;
-import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.info.NavigationInfo;
-
-import javax.xml.namespace.QName;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PageNavigationalStateImpl implements PageNavigationalState, Serializable
-{
-
- /** . */
- protected final StateControllerContextImpl context;
-
- /** . */
- protected final Map<String, WindowNavigationalState> windows;
-
- /** . */
- protected final Map<QName, String[]> page;
-
- /** . */
- private final boolean modifiable;
-
- protected PageNavigationalStateImpl(StateControllerContextImpl context, boolean
modifiable)
- {
- this.context = context;
- this.windows = new HashMap<String, WindowNavigationalState>();
- this.page = new HashMap<QName, String[]>();
- this.modifiable = modifiable;
- }
-
- public PageNavigationalStateImpl(PageNavigationalStateImpl original, boolean
modifiable)
- {
- this.context = original.context;
- this.windows = new HashMap<String,
WindowNavigationalState>(original.windows);
- this.page = new HashMap<QName, String[]>(original.page);
- this.modifiable = modifiable;
- }
-
- public Set<String> getWindowIds()
- {
- return windows.keySet();
- }
-
- public WindowNavigationalState getWindowNavigationalState(String windowId)
- {
- return windows.get(windowId);
- }
-
- public ParameterMap getPublicNavigationalState(String windowId)
- {
- PortletInfo info = context.portletControllerContext.getPortletInfo(windowId);
-
- //
- if (info != null)
- {
- ParameterMap publicNavigationalState = new ParameterMap();
- for (ParameterInfo parameterInfo : info.getNavigation().getPublicParameters())
- {
- String[] parameterValue = page.get(parameterInfo.getName());
-
- //
- if (parameterValue != null)
- {
- String parameterId = parameterInfo.getId();
-
- // We clone the value here so we keep the internal state not potentially
changed
- publicNavigationalState.put(parameterId, parameterValue.clone());
- }
- }
-
- //
- return publicNavigationalState;
- }
-
- //
- return null;
- }
-
- public Set<QName> getPublicNames()
- {
- return page.keySet();
- }
-
- public String[] getPublicNavigationalState(QName name)
- {
- String[] values = page.get(name);
- return values != null ? values.clone() : null;
- }
-
- public void setWindowNavigationalState(String windowId, WindowNavigationalState
windowState)
- {
- if (!modifiable)
- {
- throw new IllegalStateException("The page navigational state is not
modifiable");
- }
-
- //
- windows.put(windowId, windowState);
- }
-
- public void setPublicNavigationalState(String windowId, Map<String, String[]>
update)
- {
- if (!modifiable)
- {
- throw new IllegalStateException("The page navigational state is not
modifiable");
- }
-
- //
- PortletInfo info = context.portletControllerContext.getPortletInfo(windowId);
-
- //
- if (info != null)
- {
- NavigationInfo navigationInfo = info.getNavigation();
- for (Map.Entry<String, String[]> entry : update.entrySet())
- {
- String id = entry.getKey();
-
- //
- ParameterInfo parameterInfo = navigationInfo.getPublicParameter(id);
-
- //
- if (parameterInfo != null)
- {
- QName name = parameterInfo.getName();
- String[] value = entry.getValue();
- if (value.length > 0)
- {
- setPublicNavigationalState(name, value);
- }
- else
- {
- removePublicNavigationalState(name);
- }
- }
- }
- }
- }
-
- public void setPublicNavigationalState(QName name, String[] value)
- {
- if (!modifiable)
- {
- throw new IllegalStateException("The page navigational state is not
modifiable");
- }
-
- // 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)
- {
- if (!modifiable)
- {
- throw new IllegalStateException("The page navigational state is not
modifiable");
- }
-
- //
- page.remove(name);
- }
-}
\ No newline at end of file
Copied:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/PortletPageNavigationalStateImpl.java
(from rev 10534,
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/PageNavigationalStateImpl.java)
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/PortletPageNavigationalStateImpl.java
(rev 0)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/PortletPageNavigationalStateImpl.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -0,0 +1,195 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.controller.impl.state;
+
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.portlet.info.ParameterInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.NavigationInfo;
+
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletPageNavigationalStateImpl implements PortletPageNavigationalState,
Serializable
+{
+
+ /** . */
+ protected final StateControllerContextImpl context;
+
+ /** . */
+ protected final Map<String, PortletWindowNavigationalState> windows;
+
+ /** . */
+ protected final Map<QName, String[]> page;
+
+ /** . */
+ private final boolean modifiable;
+
+ protected PortletPageNavigationalStateImpl(StateControllerContextImpl context, boolean
modifiable)
+ {
+ this.context = context;
+ this.windows = new HashMap<String, PortletWindowNavigationalState>();
+ this.page = new HashMap<QName, String[]>();
+ this.modifiable = modifiable;
+ }
+
+ public PortletPageNavigationalStateImpl(PortletPageNavigationalStateImpl original,
boolean modifiable)
+ {
+ this.context = original.context;
+ this.windows = new HashMap<String,
PortletWindowNavigationalState>(original.windows);
+ this.page = new HashMap<QName, String[]>(original.page);
+ this.modifiable = modifiable;
+ }
+
+ public Set<String> getPortletWindowIds()
+ {
+ return windows.keySet();
+ }
+
+ public PortletWindowNavigationalState getPortletWindowNavigationalState(String
portletWindowId)
+ {
+ return windows.get(portletWindowId);
+ }
+
+ public ParameterMap getPortletPublicNavigationalState(String portletWindowId)
+ {
+ PortletInfo info =
context.portletControllerContext.getPortletInfo(portletWindowId);
+
+ //
+ if (info != null)
+ {
+ ParameterMap publicNavigationalState = new ParameterMap();
+ for (ParameterInfo parameterInfo : info.getNavigation().getPublicParameters())
+ {
+ String[] parameterValue = page.get(parameterInfo.getName());
+
+ //
+ if (parameterValue != null)
+ {
+ String parameterId = parameterInfo.getId();
+
+ // We clone the value here so we keep the internal state not potentially
changed
+ publicNavigationalState.put(parameterId, parameterValue.clone());
+ }
+ }
+
+ //
+ return publicNavigationalState;
+ }
+
+ //
+ return null;
+ }
+
+ public Set<QName> getPublicNames()
+ {
+ return page.keySet();
+ }
+
+ public String[] getPublicNavigationalState(QName name)
+ {
+ String[] values = page.get(name);
+ return values != null ? values.clone() : null;
+ }
+
+ public void setPortletWindowNavigationalState(String portletWindowId,
PortletWindowNavigationalState portletWindowState)
+ {
+ if (!modifiable)
+ {
+ throw new IllegalStateException("The page navigational state is not
modifiable");
+ }
+
+ //
+ windows.put(portletWindowId, portletWindowState);
+ }
+
+ public void setPortletPublicNavigationalState(String portletWindowId, Map<String,
String[]> update)
+ {
+ if (!modifiable)
+ {
+ throw new IllegalStateException("The page navigational state is not
modifiable");
+ }
+
+ //
+ PortletInfo info =
context.portletControllerContext.getPortletInfo(portletWindowId);
+
+ //
+ if (info != null)
+ {
+ NavigationInfo navigationInfo = info.getNavigation();
+ for (Map.Entry<String, String[]> entry : update.entrySet())
+ {
+ String id = entry.getKey();
+
+ //
+ ParameterInfo parameterInfo = navigationInfo.getPublicParameter(id);
+
+ //
+ if (parameterInfo != null)
+ {
+ QName name = parameterInfo.getName();
+ String[] value = entry.getValue();
+ if (value.length > 0)
+ {
+ setPublicNavigationalState(name, value);
+ }
+ else
+ {
+ removePublicNavigationalState(name);
+ }
+ }
+ }
+ }
+ }
+
+ public void setPublicNavigationalState(QName name, String[] value)
+ {
+ if (!modifiable)
+ {
+ throw new IllegalStateException("The page navigational state is not
modifiable");
+ }
+
+ // 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)
+ {
+ if (!modifiable)
+ {
+ throw new IllegalStateException("The page navigational state is not
modifiable");
+ }
+
+ //
+ page.remove(name);
+ }
+}
\ No newline at end of file
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/StateControllerContextImpl.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/StateControllerContextImpl.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/state/StateControllerContextImpl.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.controller.impl.state;
import org.jboss.portal.portlet.controller.PortletControllerContext;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.state.StateControllerContext;
/**
@@ -48,13 +48,13 @@
this.portletControllerContext = portletControllerContext;
}
- public PageNavigationalState clonePageNavigationalState(PageNavigationalState
pageNavigationalState, boolean modifiable)
+ public PortletPageNavigationalState
clonePortletPageNavigationalState(PortletPageNavigationalState
portletPageNavigationalState, boolean modifiable)
{
- return new
PageNavigationalStateImpl((PageNavigationalStateImpl)pageNavigationalState, modifiable);
+ return new
PortletPageNavigationalStateImpl((PortletPageNavigationalStateImpl)portletPageNavigationalState,
modifiable);
}
- public PageNavigationalState createPageNavigationalState(boolean modifiable)
+ public PortletPageNavigationalState createPortletPageNavigationalState(boolean
modifiable)
{
- return new PageNavigationalStateImpl(this, modifiable);
+ return new PortletPageNavigationalStateImpl(this, modifiable);
}
}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/ControllerRequest.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/ControllerRequest.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/ControllerRequest.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.controller.request;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -40,5 +40,5 @@
*
* @return the page state
*/
- public abstract PageNavigationalState getPageNavigationalState();
+ public abstract PortletPageNavigationalState getPageNavigationalState();
}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletActionRequest.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletActionRequest.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletActionRequest.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -24,8 +24,8 @@
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -54,8 +54,8 @@
String windowId,
StateString interactionState,
ParameterMap bodyParameters,
- WindowNavigationalState windowNavigationalState,
- PageNavigationalState pageNavigationalState) throws IllegalArgumentException
+ PortletWindowNavigationalState windowNavigationalState,
+ PortletPageNavigationalState pageNavigationalState) throws
IllegalArgumentException
{
super(windowId, windowNavigationalState, pageNavigationalState);
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletEventRequest.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletEventRequest.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletEventRequest.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.controller.request;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import javax.xml.namespace.QName;
import java.io.Serializable;
@@ -46,8 +46,8 @@
public PortletEventRequest(
String windowId,
- WindowNavigationalState windowNavigationalState,
- PageNavigationalState pageNavigationalState,
+ PortletWindowNavigationalState windowNavigationalState,
+ PortletPageNavigationalState pageNavigationalState,
QName name,
Serializable payload)
{
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletRenderRequest.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletRenderRequest.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletRenderRequest.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.controller.request;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
import java.util.Map;
@@ -39,9 +39,9 @@
public PortletRenderRequest(
String windowId,
- WindowNavigationalState windowNavigationalState,
+ PortletWindowNavigationalState windowNavigationalState,
Map<String, String[]> publicNavigationalStateChanges,
- PageNavigationalState pageNavigationalState)
+ PortletPageNavigationalState pageNavigationalState)
{
super(windowId, windowNavigationalState, pageNavigationalState);
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletRequest.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletRequest.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletRequest.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.controller.request;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -33,15 +33,15 @@
{
/** . */
- private final PageNavigationalState pageNavigationalState;
+ private final PortletPageNavigationalState pageNavigationalState;
/** . */
- private final WindowNavigationalState windowNavigationalState;
+ private final PortletWindowNavigationalState windowNavigationalState;
PortletRequest(
String windowId,
- WindowNavigationalState windowNavigationalState,
- PageNavigationalState pageNavigationalState)
+ PortletWindowNavigationalState windowNavigationalState,
+ PortletPageNavigationalState pageNavigationalState)
{
super(windowId);
@@ -50,12 +50,12 @@
this.pageNavigationalState = pageNavigationalState;
}
- public PageNavigationalState getPageNavigationalState()
+ public PortletPageNavigationalState getPageNavigationalState()
{
return pageNavigationalState;
}
- public WindowNavigationalState getWindowNavigationalState()
+ public PortletWindowNavigationalState getWindowNavigationalState()
{
return windowNavigationalState;
}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletResourceRequest.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletResourceRequest.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/request/PortletResourceRequest.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -24,8 +24,8 @@
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.cache.CacheLevel;
/**
@@ -108,7 +108,7 @@
return bodyParameters;
}
- public PageNavigationalState getPageNavigationalState()
+ public PortletPageNavigationalState getPageNavigationalState()
{
if (scope instanceof PageScope)
{
@@ -139,14 +139,14 @@
{
/** . */
- private final WindowNavigationalState windowNavigationalState;
+ private final PortletWindowNavigationalState windowNavigationalState;
- public PortletScope(WindowNavigationalState windowNavigationalState)
+ public PortletScope(PortletWindowNavigationalState windowNavigationalState)
{
this.windowNavigationalState = windowNavigationalState;
}
- public WindowNavigationalState getWindowNavigationalState()
+ public PortletWindowNavigationalState getWindowNavigationalState()
{
return windowNavigationalState;
}
@@ -161,9 +161,9 @@
{
/** . */
- private final PageNavigationalState pageNavigationalState;
+ private final PortletPageNavigationalState pageNavigationalState;
- public PageScope(WindowNavigationalState windowNavigationalState,
PageNavigationalState pageNavigationalState)
+ public PageScope(PortletWindowNavigationalState windowNavigationalState,
PortletPageNavigationalState pageNavigationalState)
{
super(windowNavigationalState);
@@ -171,7 +171,7 @@
this.pageNavigationalState = pageNavigationalState;
}
- public PageNavigationalState getPageNavigationalState()
+ public PortletPageNavigationalState getPageNavigationalState()
{
return pageNavigationalState;
}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/response/PageUpdateResponse.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/response/PageUpdateResponse.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/response/PageUpdateResponse.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.controller.response;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStateResponse;
@@ -37,12 +37,12 @@
private ResponseProperties properties;
/** . */
- private PageNavigationalState pageNavigationalState;
+ private PortletPageNavigationalState pageNavigationalState;
public PageUpdateResponse(
UpdateNavigationalStateResponse update,
ResponseProperties properties,
- PageNavigationalState pageNavigationalState,
+ PortletPageNavigationalState pageNavigationalState,
int eventCycleStatus)
{
super(update, eventCycleStatus);
@@ -57,7 +57,7 @@
return properties;
}
- public PageNavigationalState getPageNavigationalState()
+ public PortletPageNavigationalState getPageNavigationalState()
{
return pageNavigationalState;
}
Deleted:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalState.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalState.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalState.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -1,127 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.controller.state;
-
-import org.jboss.portal.common.util.ParameterMap;
-
-import javax.xml.namespace.QName;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Defines the page navigational state view that the controller needs to operate on. Its
name begins with page
- * however it does not mandate that the represented context to be a page. I.E it could
represent a set
- * of physical pages or something else.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface PageNavigationalState
-{
-
- /**
- * Returns the window ids referenced.
- *
- * @return a set of window id
- */
- Set<String> getWindowIds();
-
- /**
- * Returns the navigational state of a window or null if it does not exist.
- *
- * @param windowId the window
- * @return the window navigational state
- * @throws IllegalArgumentException if an argument is not valid
- */
- WindowNavigationalState getWindowNavigationalState(String windowId) throws
IllegalArgumentException;
-
- /**
- * Update the navigational state of a window.
- *
- * @param windowId the window id
- * @param windowState the window state
- * @throws IllegalArgumentException if an argument is not valid
- * @throws IllegalStateException if the page state is read only
- */
- void setWindowNavigationalState(String windowId, WindowNavigationalState windowState)
throws IllegalArgumentException, IllegalStateException;
-
- /**
- * Obtain the public navigational state of a window. The interpretation of what should
be retrieved is left up to the
- * implementor. An example of implementation would use the mapping between qnames and
name provided by the referenced
- * portlet info.
- *
- * @param windowId the window id
- * @return the public navigational state
- * @throws IllegalArgumentException if an argument is not valid
- */
- ParameterMap getPublicNavigationalState(String windowId) throws
IllegalArgumentException;
-
- /**
- * Returns the set of public names.
- *
- * @return the public names
- */
- Set<QName> getPublicNames();
-
- /**
- * Update the public navigational state of a window. The interpretation of what should
be updated is left up to the
- * implementor. An example of implementation would use the mapping between qname and
name provided by the referenced
- * portlet info.
- * <p/>
- * The update argument values with a length of zero should be treated as removals.
- *
- * @param windowId the window id
- * @param update the updates
- * @throws IllegalArgumentException if an argument is not valid
- * @throws IllegalStateException if the page state is read only
- */
- void setPublicNavigationalState(String windowId, Map<String, String[]> update)
throws IllegalArgumentException, IllegalStateException;
-
- /**
- * Returns a public navigational state entry or null if it is not found.
- *
- * @param name the name
- * @return the entry value
- * @throws IllegalArgumentException if an argument is not valid
- */
- String[] getPublicNavigationalState(QName name) throws IllegalArgumentException;
-
- /**
- * Sets a public navigational state entry.
- *
- * @param name the name
- * @param value the new value
- * @throws IllegalArgumentException if an argument is not valid
- * @throws IllegalStateException if the page state is read only
- */
- void setPublicNavigationalState(QName name, String[] value) throws
IllegalArgumentException, IllegalStateException;
-
- /**
- * Removes a public navigational state entry.
- *
- * @param name the name
- * @throws IllegalArgumentException if an argument is not valid
- * @throws IllegalStateException if the page state is read only
- */
- void removePublicNavigationalState(QName name) throws IllegalArgumentException,
IllegalStateException;
-}
Deleted:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalStateSerialization.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalStateSerialization.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalStateSerialization.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -1,234 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.controller.state;
-
-import org.jboss.portal.common.io.Serialization;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.Mode;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.ParametersStateString;
-
-import javax.xml.namespace.QName;
-import java.io.OutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.DataOutputStream;
-import java.io.DataInputStream;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Set;
-
-/**
- * Implement serialization of a page navigational state in a compact manner.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PageNavigationalStateSerialization implements
Serialization<PageNavigationalState>
-{
-
- /** . */
- private static final Map<WindowState, Integer> windowStateToCode = new
HashMap<WindowState, Integer>();
-
- /** . */
- private static final Map<Mode, Integer> modeToCode = new HashMap<Mode,
Integer>();
-
- /** . */
- private static final Map<Integer, WindowState> codeToWindowState = new
HashMap<Integer, WindowState>();
-
- /** . */
- private static final Map<Integer, Mode> codeToMode = new HashMap<Integer,
Mode>();
-
- static
- {
- windowStateToCode.put(WindowState.NORMAL, 1);
- windowStateToCode.put(WindowState.MINIMIZED, 2);
- windowStateToCode.put(WindowState.MAXIMIZED, 3);
- codeToWindowState.put(1, WindowState.NORMAL);
- codeToWindowState.put(2, WindowState.MINIMIZED);
- codeToWindowState.put(3, WindowState.MAXIMIZED);
- modeToCode.put(Mode.VIEW, 1);
- modeToCode.put(Mode.EDIT, 2);
- modeToCode.put(Mode.HELP, 3);
- codeToMode.put(1, Mode.VIEW);
- codeToMode.put(2, Mode.EDIT);
- codeToMode.put(3, Mode.HELP);
- }
-
- /** . */
- private final StateControllerContext context;
-
- public PageNavigationalStateSerialization(StateControllerContext context)
- {
- if (context == null)
- {
- throw new IllegalArgumentException();
- }
- this.context = context;
- }
-
- public void serialize(PageNavigationalState pageNavigationalState, OutputStream out)
throws IOException, IllegalArgumentException
- {
- DataOutputStream data = out instanceof DataOutputStream ? (DataOutputStream)out :
new DataOutputStream(out);
-
- //
- data.writeInt(pageNavigationalState.getWindowIds().size());
- for (String windowId : pageNavigationalState.getWindowIds())
- {
- data.writeUTF(windowId);
- WindowNavigationalState windowNS =
pageNavigationalState.getWindowNavigationalState(windowId);
- byte header = 0;
- int decision = 0;
- if (windowNS.getPortletNavigationalState() != null)
- {
- header |= 1;
- decision |= 1;
- }
- if (windowNS.getWindowState() != null)
- {
- Integer value = windowStateToCode.get(windowNS.getWindowState());
- if (value != null)
- {
- header |= value << 1;
- }
- else
- {
- header |= 4 << 1;
- decision |= 2;
- }
- }
- if (windowNS.getMode() != null)
- {
- Integer value = modeToCode.get(windowNS.getMode());
- if (value != null)
- {
- header |= value << 4;
- }
- else
- {
- header |= 4 << 4;
- decision |= 4;
- }
- }
- data.writeByte(header);
- if ((decision & 1) != 0)
- {
- windowNS.getPortletNavigationalState().writeTo(data);
- }
- if ((decision & 2) != 0)
- {
- data.writeUTF(windowNS.getWindowState().toString());
- }
- if ((decision & 4) != 0)
- {
- data.writeUTF(windowNS.getMode().toString());
- }
- }
-
- //
- Set<QName> publicNames = pageNavigationalState.getPublicNames();
- data.writeInt(publicNames.size());
- for (QName name : pageNavigationalState.getPublicNames())
- {
- data.writeUTF(name.getNamespaceURI());
- data.writeUTF(name.getLocalPart());
- String[] values = pageNavigationalState.getPublicNavigationalState(name);
- int length = values.length;
- data.writeInt(length);
- for (String value : values)
- {
- data.writeUTF(value);
- }
- }
-
- // Need to flush before returning otherwise bytes may stay in the buffer when we
allocated
- // a data stream
- data.flush();
- }
-
- public PageNavigationalState unserialize(InputStream in) throws IOException,
IllegalArgumentException
- {
- DataInputStream data = in instanceof DataInputStream ? (DataInputStream)in : new
DataInputStream(in);
-
- //
- PageNavigationalState pageNS = context.createPageNavigationalState(true);
-
- //
- int size = data.readInt();
- while (size-- > 0)
- {
- String windowId = data.readUTF();
- byte header = data.readByte();
- StateString portletNS = null;
- if ((header & 1) != 0)
- {
- portletNS = ParametersStateString.create(data);
- }
- WindowState windowState = null;
- int windowStateHeader = (header & (7 << 1)) >> 1;
- switch (windowStateHeader)
- {
- case 0:
- break;
- case 4:
- windowState = WindowState.create(data.readUTF());
- break;
- default:
- windowState = codeToWindowState.get(windowStateHeader);
- }
- Mode mode = null;
- int modeStateHeader = (header & (7 << (1 + 3))) >> (1 + 3);
- switch (modeStateHeader)
- {
- case 0:
- break;
- case 4:
- mode = Mode.create(data.readUTF());
- break;
- default:
- mode = codeToMode.get(modeStateHeader);
- }
- WindowNavigationalState windowNS = new WindowNavigationalState(portletNS, mode,
windowState);
- pageNS.setWindowNavigationalState(windowId, windowNS);
- }
-
- //
- size = data.readInt();
- while (size-- > 0)
- {
- String namespaceURI = data.readUTF();
- String localName = data.readUTF();
- QName name = new QName(namespaceURI, localName);
- int length = data.readInt();
- String[] values = new String[length];
- for (int i = 0;i < length;i++)
- {
- values[i] = data.readUTF();
- }
- pageNS.setPublicNavigationalState(name, values);
- }
-
- //
- return pageNS;
- }
-}
Copied:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletPageNavigationalState.java
(from rev 10534,
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalState.java)
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletPageNavigationalState.java
(rev 0)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletPageNavigationalState.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.controller.state;
+
+import org.jboss.portal.common.util.ParameterMap;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Defines the page navigational state view that the controller needs to operate on. Its
name begins with page
+ * however it does not mandate that the represented context to be a page. I.E it could
represent a set
+ * of physical pages or something else.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PortletPageNavigationalState
+{
+
+ /**
+ * Returns the portlet window ids referenced.
+ *
+ * @return a set of window id
+ */
+ Set<String> getPortletWindowIds();
+
+ /**
+ * Returns the navigational state of a portlet window or null if it does not exist.
+ *
+ * @param portletWindowId the portlet window id
+ * @return the portlet window navigational state
+ * @throws IllegalArgumentException if an argument is not valid
+ */
+ PortletWindowNavigationalState getPortletWindowNavigationalState(String
portletWindowId) throws IllegalArgumentException;
+
+ /**
+ * Update the navigational state of a portlet window.
+ *
+ * @param portletWindowId the portlet window id
+ * @param portletWindowState the portlet window state
+ * @throws IllegalArgumentException if an argument is not valid
+ * @throws IllegalStateException if the page state is read only
+ */
+ void setPortletWindowNavigationalState(String portletWindowId,
PortletWindowNavigationalState portletWindowState) throws IllegalArgumentException,
IllegalStateException;
+
+ /**
+ * Obtain the public navigational state of a portlet window. The interpretation of
what should be retrieved is left up
+ * to the implementor. An example of implementation would use the mapping between
qnames and name provided by the
+ * referenced portlet info.
+ *
+ * @param portletWindowId the portlet window id
+ * @return the portlet public navigational state
+ * @throws IllegalArgumentException if an argument is not valid
+ */
+ ParameterMap getPortletPublicNavigationalState(String portletWindowId) throws
IllegalArgumentException;
+
+ /**
+ * <p>Update the public navigational state of a portlet window. The
interpretation of what should be updated is left up
+ * to the implementor. An example of implementation would use the mapping between
qname and name provided by the referenced
+ * portlet info.</p>
+ *
+ * <p>The update argument values with a length of zero should be treated as
removals.</p>
+ *
+ * @param portletWindowId the portlet window id
+ * @param update the updates
+ * @throws IllegalArgumentException if an argument is not valid
+ * @throws IllegalStateException if the page state is read only
+ */
+ void setPortletPublicNavigationalState(String portletWindowId, Map<String,
String[]> update) throws IllegalArgumentException, IllegalStateException;
+
+ /**
+ * Returns the set of public names.
+ *
+ * @return the public names
+ */
+ Set<QName> getPublicNames();
+
+ /**
+ * Returns a public navigational state entry or null if it is not found.
+ *
+ * @param name the name
+ * @return the entry value
+ * @throws IllegalArgumentException if an argument is not valid
+ */
+ String[] getPublicNavigationalState(QName name) throws IllegalArgumentException;
+
+ /**
+ * Sets a public navigational state entry.
+ *
+ * @param name the name
+ * @param value the new value
+ * @throws IllegalArgumentException if an argument is not valid
+ * @throws IllegalStateException if the page state is read only
+ */
+ void setPublicNavigationalState(QName name, String[] value) throws
IllegalArgumentException, IllegalStateException;
+
+ /**
+ * Removes a public navigational state entry.
+ *
+ * @param name the name
+ * @throws IllegalArgumentException if an argument is not valid
+ * @throws IllegalStateException if the page state is read only
+ */
+ void removePublicNavigationalState(QName name) throws IllegalArgumentException,
IllegalStateException;
+}
Copied:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletPageNavigationalStateSerialization.java
(from rev 10533,
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PageNavigationalStateSerialization.java)
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletPageNavigationalStateSerialization.java
(rev 0)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletPageNavigationalStateSerialization.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -0,0 +1,234 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.controller.state;
+
+import org.jboss.portal.common.io.Serialization;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.Mode;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.ParametersStateString;
+
+import javax.xml.namespace.QName;
+import java.io.OutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.DataOutputStream;
+import java.io.DataInputStream;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+
+/**
+ * Implement serialization of a page navigational state in a compact manner.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletPageNavigationalStateSerialization implements
Serialization<PortletPageNavigationalState>
+{
+
+ /** . */
+ private static final Map<WindowState, Integer> windowStateToCode = new
HashMap<WindowState, Integer>();
+
+ /** . */
+ private static final Map<Mode, Integer> modeToCode = new HashMap<Mode,
Integer>();
+
+ /** . */
+ private static final Map<Integer, WindowState> codeToWindowState = new
HashMap<Integer, WindowState>();
+
+ /** . */
+ private static final Map<Integer, Mode> codeToMode = new HashMap<Integer,
Mode>();
+
+ static
+ {
+ windowStateToCode.put(WindowState.NORMAL, 1);
+ windowStateToCode.put(WindowState.MINIMIZED, 2);
+ windowStateToCode.put(WindowState.MAXIMIZED, 3);
+ codeToWindowState.put(1, WindowState.NORMAL);
+ codeToWindowState.put(2, WindowState.MINIMIZED);
+ codeToWindowState.put(3, WindowState.MAXIMIZED);
+ modeToCode.put(Mode.VIEW, 1);
+ modeToCode.put(Mode.EDIT, 2);
+ modeToCode.put(Mode.HELP, 3);
+ codeToMode.put(1, Mode.VIEW);
+ codeToMode.put(2, Mode.EDIT);
+ codeToMode.put(3, Mode.HELP);
+ }
+
+ /** . */
+ private final StateControllerContext context;
+
+ public PortletPageNavigationalStateSerialization(StateControllerContext context)
+ {
+ if (context == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.context = context;
+ }
+
+ public void serialize(PortletPageNavigationalState pageNavigationalState, OutputStream
out) throws IOException, IllegalArgumentException
+ {
+ DataOutputStream data = out instanceof DataOutputStream ? (DataOutputStream)out :
new DataOutputStream(out);
+
+ //
+ data.writeInt(pageNavigationalState.getPortletWindowIds().size());
+ for (String windowId : pageNavigationalState.getPortletWindowIds())
+ {
+ data.writeUTF(windowId);
+ PortletWindowNavigationalState windowNS =
pageNavigationalState.getPortletWindowNavigationalState(windowId);
+ byte header = 0;
+ int decision = 0;
+ if (windowNS.getPortletNavigationalState() != null)
+ {
+ header |= 1;
+ decision |= 1;
+ }
+ if (windowNS.getWindowState() != null)
+ {
+ Integer value = windowStateToCode.get(windowNS.getWindowState());
+ if (value != null)
+ {
+ header |= value << 1;
+ }
+ else
+ {
+ header |= 4 << 1;
+ decision |= 2;
+ }
+ }
+ if (windowNS.getMode() != null)
+ {
+ Integer value = modeToCode.get(windowNS.getMode());
+ if (value != null)
+ {
+ header |= value << 4;
+ }
+ else
+ {
+ header |= 4 << 4;
+ decision |= 4;
+ }
+ }
+ data.writeByte(header);
+ if ((decision & 1) != 0)
+ {
+ windowNS.getPortletNavigationalState().writeTo(data);
+ }
+ if ((decision & 2) != 0)
+ {
+ data.writeUTF(windowNS.getWindowState().toString());
+ }
+ if ((decision & 4) != 0)
+ {
+ data.writeUTF(windowNS.getMode().toString());
+ }
+ }
+
+ //
+ Set<QName> publicNames = pageNavigationalState.getPublicNames();
+ data.writeInt(publicNames.size());
+ for (QName name : pageNavigationalState.getPublicNames())
+ {
+ data.writeUTF(name.getNamespaceURI());
+ data.writeUTF(name.getLocalPart());
+ String[] values = pageNavigationalState.getPublicNavigationalState(name);
+ int length = values.length;
+ data.writeInt(length);
+ for (String value : values)
+ {
+ data.writeUTF(value);
+ }
+ }
+
+ // Need to flush before returning otherwise bytes may stay in the buffer when we
allocated
+ // a data stream
+ data.flush();
+ }
+
+ public PortletPageNavigationalState unserialize(InputStream in) throws IOException,
IllegalArgumentException
+ {
+ DataInputStream data = in instanceof DataInputStream ? (DataInputStream)in : new
DataInputStream(in);
+
+ //
+ PortletPageNavigationalState pageNS =
context.createPortletPageNavigationalState(true);
+
+ //
+ int size = data.readInt();
+ while (size-- > 0)
+ {
+ String windowId = data.readUTF();
+ byte header = data.readByte();
+ StateString portletNS = null;
+ if ((header & 1) != 0)
+ {
+ portletNS = ParametersStateString.create(data);
+ }
+ WindowState windowState = null;
+ int windowStateHeader = (header & (7 << 1)) >> 1;
+ switch (windowStateHeader)
+ {
+ case 0:
+ break;
+ case 4:
+ windowState = WindowState.create(data.readUTF());
+ break;
+ default:
+ windowState = codeToWindowState.get(windowStateHeader);
+ }
+ Mode mode = null;
+ int modeStateHeader = (header & (7 << (1 + 3))) >> (1 + 3);
+ switch (modeStateHeader)
+ {
+ case 0:
+ break;
+ case 4:
+ mode = Mode.create(data.readUTF());
+ break;
+ default:
+ mode = codeToMode.get(modeStateHeader);
+ }
+ PortletWindowNavigationalState windowNS = new
PortletWindowNavigationalState(portletNS, mode, windowState);
+ pageNS.setPortletWindowNavigationalState(windowId, windowNS);
+ }
+
+ //
+ size = data.readInt();
+ while (size-- > 0)
+ {
+ String namespaceURI = data.readUTF();
+ String localName = data.readUTF();
+ QName name = new QName(namespaceURI, localName);
+ int length = data.readInt();
+ String[] values = new String[length];
+ for (int i = 0;i < length;i++)
+ {
+ values[i] = data.readUTF();
+ }
+ pageNS.setPublicNavigationalState(name, values);
+ }
+
+ //
+ return pageNS;
+ }
+}
Copied:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletWindowNavigationalState.java
(from rev 10533,
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/WindowNavigationalState.java)
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletWindowNavigationalState.java
(rev 0)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/PortletWindowNavigationalState.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.controller.state;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.portlet.StateString;
+
+import java.io.Serializable;
+
+/**
+ * The navigational state of a window that contains the portlet navigational state, the
mode and window state.
+ * This class is immutable.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletWindowNavigationalState implements Serializable
+{
+
+ /** . */
+ private final StateString portletNavigationalState;
+
+ /** . */
+ private final Mode mode;
+
+ /** . */
+ private final WindowState windowState;
+
+ public PortletWindowNavigationalState()
+ {
+ this.portletNavigationalState = null;
+ this.mode = Mode.VIEW;
+ this.windowState = WindowState.NORMAL;
+ }
+
+ public PortletWindowNavigationalState(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/controller/src/main/java/org/jboss/portal/portlet/controller/state/StateControllerContext.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/StateControllerContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/StateControllerContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -34,18 +34,20 @@
/**
* Clone an existing page state object.
*
- * @param pageNavigationalState the page navigational state
- * @param modifiable set the modifiable status @return the page state clone
- * @return the cloned page navigational state
+ * @param portletPageNavigationalState the portlet page navigational state
+ * @param modifiable set the modifiable status
+ * @return the page state clone @return the cloned page navigational state
*/
- PageNavigationalState clonePageNavigationalState(PageNavigationalState
pageNavigationalState, boolean modifiable);
+ PortletPageNavigationalState clonePortletPageNavigationalState(
+ PortletPageNavigationalState portletPageNavigationalState,
+ boolean modifiable);
/**
- * Create a new page state object.
+ * Create a new portlet page state object.
*
* @param modifiable set the modifiable status
- * @return the new page state
+ * @return the new portlet page state
*/
- PageNavigationalState createPageNavigationalState(boolean modifiable);
+ PortletPageNavigationalState createPortletPageNavigationalState(boolean modifiable);
}
Deleted:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/WindowNavigationalState.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/WindowNavigationalState.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/state/WindowNavigationalState.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -1,78 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.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;
-
-/**
- * The navigational state of a window that contains the portlet navigational state, the
mode and window state.
- * This class is immutable.
- *
- * @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/controller/src/test/java/org/jboss/portal/portlet/controller/EventControllerContextFailureTestCase.java
===================================================================
---
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/EventControllerContextFailureTestCase.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/EventControllerContextFailureTestCase.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -26,7 +26,7 @@
import org.jboss.portal.portlet.support.PortletSupport;
import org.jboss.portal.portlet.controller.request.ControllerRequest;
import org.jboss.portal.portlet.controller.event.EventPhaseContext;
-import org.jboss.portal.portlet.controller.event.Event;
+import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
import org.jboss.portal.portlet.controller.event.AbstractEventControllerContext;
import org.jboss.portal.portlet.controller.response.ControllerResponse;
import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
@@ -97,7 +97,7 @@
{
WiringEventControllerContext ecc = new WiringEventControllerContext()
{
- public void eventConsumed(EventPhaseContext context, Event consumedEvent,
PortletInvocationResponse consumerResponse)
+ public void eventConsumed(EventPhaseContext context, PortletWindowEvent
consumedEvent, PortletInvocationResponse consumerResponse)
{
called = true;
throw new RuntimeException();
@@ -119,7 +119,7 @@
final Error error = new Error();
ecc = new WiringEventControllerContext()
{
- public void eventConsumed(EventPhaseContext context, Event consumedEvent,
PortletInvocationResponse consumerResponse)
+ public void eventConsumed(EventPhaseContext context, PortletWindowEvent
consumedEvent, PortletInvocationResponse consumerResponse)
{
called = true;
throw error;
@@ -148,7 +148,7 @@
{
AbstractEventControllerContext ecc = new AbstractEventControllerContext()
{
- public void eventProduced(EventPhaseContext context, Event producedEvent, Event
sourceEvent)
+ public void eventProduced(EventPhaseContext context, PortletWindowEvent
producedEvent, PortletWindowEvent sourceEvent)
{
called = true;
throw new RuntimeException();
@@ -168,7 +168,7 @@
final Error error = new Error();
ecc = new AbstractEventControllerContext()
{
- public void eventProduced(EventPhaseContext context, Event producedEvent, Event
sourceEvent)
+ public void eventProduced(EventPhaseContext context, PortletWindowEvent
producedEvent, PortletWindowEvent sourceEvent)
{
called = true;
throw error;
@@ -195,7 +195,7 @@
{
WiringEventControllerContext ecc = new WiringEventControllerContext()
{
- public void eventFailed(EventPhaseContext context, Event failedEvent, Throwable
throwable)
+ public void eventFailed(EventPhaseContext context, PortletWindowEvent
failedEvent, Throwable throwable)
{
called = true;
throw new RuntimeException();
@@ -217,7 +217,7 @@
final Error error = new Error();
ecc = new WiringEventControllerContext()
{
- public void eventFailed(EventPhaseContext context, Event failedEvent, Throwable
throwable)
+ public void eventFailed(EventPhaseContext context, PortletWindowEvent
failedEvent, Throwable throwable)
{
called = true;
throw error;
@@ -246,7 +246,7 @@
{
WiringEventControllerContext ecc = new WiringEventControllerContext()
{
- public void eventDiscarded(EventPhaseContext context, Event discardedEvent, int
cause)
+ public void eventDiscarded(EventPhaseContext context, PortletWindowEvent
discardedEvent, int cause)
{
assertEquals(EVENT_CONSUMER_INFO_NOT_AVAILABLE, cause);
called = true;
@@ -268,7 +268,7 @@
final Error error = new Error();
ecc = new WiringEventControllerContext()
{
- public void eventDiscarded(EventPhaseContext context, Event discardedEvent, int
cause)
+ public void eventDiscarded(EventPhaseContext context, PortletWindowEvent
discardedEvent, int cause)
{
assertEquals(EVENT_CONSUMER_INFO_NOT_AVAILABLE, cause);
called = true;
Modified:
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerContextSupport.java
===================================================================
---
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerContextSupport.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerContextSupport.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -24,9 +24,9 @@
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.state.StateControllerContext;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
import org.jboss.portal.portlet.controller.impl.state.StateControllerContextImpl;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
import org.jboss.portal.portlet.controller.request.ControllerRequest;
@@ -82,7 +82,7 @@
}
//
- public PortletInvocationContext createPortletInvocationContext(String windowId,
PageNavigationalState pageNavigationalState)
+ public PortletInvocationContext createPortletInvocationContext(String windowId,
PortletPageNavigationalState pageNavigationalState)
{
if (windowId == null)
{
@@ -143,8 +143,8 @@
windowId,
new OpaqueStateString(""),
new ParameterMap(),
- new WindowNavigationalState(),
- getStateControllerContext().createPageNavigationalState(false)
+ new PortletWindowNavigationalState(),
+ getStateControllerContext().createPortletPageNavigationalState(false)
);
}
}
Modified:
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerRequestConstructorTestCase.java
===================================================================
---
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerRequestConstructorTestCase.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerRequestConstructorTestCase.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -25,8 +25,8 @@
import org.jboss.portal.portlet.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
import org.jboss.portal.portlet.controller.request.PortletResourceRequest;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.impl.state.StateControllerContextImpl;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.OpaqueStateString;
@@ -49,8 +49,8 @@
private StateString interactionState = new OpaqueStateString("");
private StateString resourceState = new OpaqueStateString("");
private ParameterMap body = new ParameterMap();
- private WindowNavigationalState windowNS = new WindowNavigationalState();
- private PageNavigationalState pageNS = new StateControllerContextImpl(new
PortletControllerContextSupport()).createPageNavigationalState(false);
+ private PortletWindowNavigationalState windowNS = new
PortletWindowNavigationalState();
+ private PortletPageNavigationalState pageNS = new StateControllerContextImpl(new
PortletControllerContextSupport()).createPortletPageNavigationalState(false);
private Map<String, String[]> pageNSChanges = Collections.emptyMap();
@Test
Modified:
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerRequestTestCase.java
===================================================================
---
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerRequestTestCase.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerRequestTestCase.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -37,8 +37,8 @@
import org.jboss.portal.portlet.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.controller.request.PortletResourceRequest;
import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
@@ -67,13 +67,13 @@
PortletInvokerSupport invoker = context.getInvoker();
/** . */
- PageNavigationalState pageNS =
context.getStateControllerContext().createPageNavigationalState(false);
+ PortletPageNavigationalState pageNS =
context.getStateControllerContext().createPortletPageNavigationalState(false);
/** . */
StateString portletNS = new OpaqueStateString("abc");
/** . */
- WindowNavigationalState windowNS = new WindowNavigationalState(portletNS, Mode.EDIT,
WindowState.MAXIMIZED);
+ PortletWindowNavigationalState windowNS = new
PortletWindowNavigationalState(portletNS, Mode.EDIT, WindowState.MAXIMIZED);
/** . */
ParameterMap body = new ParameterMap(Collections.singletonMap("param", new
String[]{"value"}));
Modified:
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerTestCase.java
===================================================================
---
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerTestCase.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerTestCase.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -24,13 +24,13 @@
import org.jboss.portal.portlet.controller.request.ControllerRequest;
import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
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.event.EventPhaseContext;
-import org.jboss.portal.portlet.controller.event.Event;
+import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
import org.jboss.portal.portlet.controller.event.AbstractEventControllerContext;
import org.jboss.portal.portlet.controller.handlers.EventProducerActionHandler;
import org.jboss.portal.portlet.controller.handlers.EventProducerEventHandler;
@@ -86,14 +86,14 @@
{
invoker.addPortlet("foo");
StateString portletNS = new OpaqueStateString("abc");
- PageNavigationalState pageNS =
context.getStateControllerContext().createPageNavigationalState(true);
- WindowNavigationalState windowNS = new WindowNavigationalState(portletNS,
Mode.EDIT, WindowState.MAXIMIZED);
+ PortletPageNavigationalState pageNS =
context.getStateControllerContext().createPortletPageNavigationalState(true);
+ PortletWindowNavigationalState windowNS = new
PortletWindowNavigationalState(portletNS, Mode.EDIT, WindowState.MAXIMIZED);
PortletRenderRequest render = new PortletRenderRequest("foo", windowNS,
new HashMap<String, String[]>(), pageNS);
ControllerResponse response = controller.process(context, render);
PageUpdateResponse pageUpdate = assertInstanceOf(response,
PageUpdateResponse.class);
- PageNavigationalState pageNS2 =
assertNotNull(pageUpdate.getPageNavigationalState());
- assertEquals(Tools.toSet("foo"), pageNS2.getWindowIds());
- WindowNavigationalState windowNS2 =
pageNS2.getWindowNavigationalState("foo");
+ PortletPageNavigationalState pageNS2 =
assertNotNull(pageUpdate.getPageNavigationalState());
+ assertEquals(Tools.toSet("foo"), pageNS2.getPortletWindowIds());
+ PortletWindowNavigationalState windowNS2 =
pageNS2.getPortletWindowNavigationalState("foo");
assertNotNull(windowNS2);
assertEquals(portletNS, windowNS2.getPortletNavigationalState());
assertEquals(Mode.EDIT, windowNS2.getMode());
@@ -166,10 +166,10 @@
ControllerRequest request = context.createActionRequest("foo");
ControllerResponse response = controller.process(context, request);
PageUpdateResponse pageUpdate = assertInstanceOf(response,
PageUpdateResponse.class);
- PageNavigationalState pageNS =
assertNotNull(pageUpdate.getPageNavigationalState());
+ PortletPageNavigationalState pageNS =
assertNotNull(pageUpdate.getPageNavigationalState());
//
- WindowNavigationalState fooNS =
assertNotNull(pageNS.getWindowNavigationalState("foo"));
+ PortletWindowNavigationalState fooNS =
assertNotNull(pageNS.getPortletWindowNavigationalState("foo"));
assertEquals(WindowState.MAXIMIZED, fooNS.getWindowState());
assertEquals(Mode.EDIT, fooNS.getMode());
assertEquals(new OpaqueStateString("abc"),
fooNS.getPortletNavigationalState());
@@ -177,17 +177,17 @@
//
if (publishEvent)
{
- assertEquals(Tools.toSet("foo", "bar"),
pageNS.getWindowIds());
+ assertEquals(Tools.toSet("foo", "bar"),
pageNS.getPortletWindowIds());
//
- WindowNavigationalState barNS =
assertNotNull(pageNS.getWindowNavigationalState("bar"));
+ PortletWindowNavigationalState barNS =
assertNotNull(pageNS.getPortletWindowNavigationalState("bar"));
assertEquals(WindowState.MINIMIZED, barNS.getWindowState());
assertEquals(Mode.HELP, barNS.getMode());
assertEquals(new OpaqueStateString("def"),
barNS.getPortletNavigationalState());
}
else
{
- assertEquals(Tools.toSet("foo"), pageNS.getWindowIds());
+ assertEquals(Tools.toSet("foo"), pageNS.getPortletWindowIds());
}
}
@@ -353,7 +353,7 @@
controller.setProducedEventThreshold(10);
context.setEventControllerContext(new AbstractEventControllerContext()
{
- public void eventProduced(EventPhaseContext context, Event producedEvent, Event
sourceEvent)
+ public void eventProduced(EventPhaseContext context, PortletWindowEvent
producedEvent, PortletWindowEvent sourceEvent)
{
context.interrupt();
}
Modified:
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletInvocationContextSupport.java
===================================================================
---
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletInvocationContextSupport.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletInvocationContextSupport.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.controller;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -35,9 +35,9 @@
private final String windowId;
/** . */
- private final PageNavigationalState pageNavigationalState;
+ private final PortletPageNavigationalState pageNavigationalState;
- public PortletInvocationContextSupport(String windowId, PageNavigationalState
pageNavigationalState)
+ public PortletInvocationContextSupport(String windowId, PortletPageNavigationalState
pageNavigationalState)
{
this.windowId = windowId;
this.pageNavigationalState = pageNavigationalState;
@@ -48,7 +48,7 @@
return windowId;
}
- public PageNavigationalState getPageNavigationalState()
+ public PortletPageNavigationalState getPageNavigationalState()
{
return pageNavigationalState;
}
Modified:
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/WiringEventControllerContext.java
===================================================================
---
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/WiringEventControllerContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/WiringEventControllerContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.controller;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
-import org.jboss.portal.portlet.controller.event.Event;
+import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
import org.jboss.portal.portlet.controller.event.EventPhaseContext;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -49,7 +49,7 @@
/** . */
private final List<EventCallback> callbacks = new
LinkedList<EventCallback>();
- public void eventProduced(EventPhaseContext context, Event producedEvent, Event
sourceEvent)
+ public void eventProduced(EventPhaseContext context, PortletWindowEvent producedEvent,
PortletWindowEvent sourceEvent)
{
List<Coordinate> dsts = wires.get(new Coordinate(producedEvent.getName(),
producedEvent.getWindowId()));
@@ -58,22 +58,22 @@
{
for (Coordinate dst : dsts)
{
- context.queueEvent(new Event(dst.name, producedEvent.getPayload(),
dst.windowId));
+ context.queueEvent(new PortletWindowEvent(dst.name,
producedEvent.getPayload(), dst.windowId));
}
}
}
- public void eventConsumed(EventPhaseContext context, Event consumedEvent,
PortletInvocationResponse consumerResponse)
+ public void eventConsumed(EventPhaseContext context, PortletWindowEvent consumedEvent,
PortletInvocationResponse consumerResponse)
{
callbacks.add(new EventCallback(EventCallback.EVENT_CONSUMED, consumedEvent,
consumerResponse));
}
- public void eventFailed(EventPhaseContext context, Event failedEvent, Throwable
throwable)
+ public void eventFailed(EventPhaseContext context, PortletWindowEvent failedEvent,
Throwable throwable)
{
callbacks.add(new EventCallback(EventCallback.EVENT_FAILED, failedEvent,
throwable));
}
- public void eventDiscarded(EventPhaseContext context, Event discardedEvent, int
cause)
+ public void eventDiscarded(EventPhaseContext context, PortletWindowEvent
discardedEvent, int cause)
{
callbacks.add(new EventCallback(EventCallback.EVENT_DISCARDED, discardedEvent,
cause));
}
@@ -120,12 +120,12 @@
private final int type;
/** . */
- private final Event event;
+ private final PortletWindowEvent event;
/** . */
private final Object data;
- private EventCallback(int type, Event event, Object data)
+ private EventCallback(int type, PortletWindowEvent event, Object data)
{
this.type = type;
this.event = event;
@@ -137,7 +137,7 @@
return type;
}
- public Event getEvent()
+ public PortletWindowEvent getEvent()
{
return event;
}
Modified:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/ControllerFilter.java
===================================================================
---
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/ControllerFilter.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/ControllerFilter.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -41,8 +41,8 @@
import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
import org.jboss.portal.portlet.controller.response.ResourceResponse;
import org.jboss.portal.portlet.controller.response.PortletResponse;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.PageNavigationalStateSerialization;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import
org.jboss.portal.portlet.controller.state.PortletPageNavigationalStateSerialization;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.common.io.SerializationFilter;
import org.jboss.portal.common.util.Base64;
@@ -114,7 +114,7 @@
// Process only portlet type
// The request decoded if not null
- PageNavigationalState pageNavigationalState = null;
+ PortletPageNavigationalState pageNavigationalState = null;
if (URLParameterConstants.PORTLET_TYPE.equals(type))
{
WebRequest wr = new WebRequest(req);
@@ -253,7 +253,7 @@
}
else
{
- PageNavigationalStateSerialization serialization = new
PageNavigationalStateSerialization(context.getStateControllerContext());
+ PortletPageNavigationalStateSerialization serialization = new
PortletPageNavigationalStateSerialization(context.getStateControllerContext());
// The nav state provided with the request
// Unmarshall portal navigational state if it is provided
pageNavigationalState = null;
Modified:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/EventRoute.java
===================================================================
---
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/EventRoute.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/EventRoute.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,8 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.portal.jsp;
-import org.jboss.portal.portlet.controller.event.Event;
-
import javax.xml.namespace.QName;
import java.util.LinkedList;
import java.util.List;
Modified:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PageEventControllerContext.java
===================================================================
---
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PageEventControllerContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PageEventControllerContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.portal.jsp;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
-import org.jboss.portal.portlet.controller.event.Event;
+import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
import org.jboss.portal.portlet.controller.event.EventPhaseContext;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
@@ -52,7 +52,7 @@
private final PagePortletControllerContext context;
/** Used internally. */
- private final Map<Event, EventRoute> routings;
+ private final Map<PortletWindowEvent, EventRoute> routings;
/** . */
private final List<EventRoute> roots;
@@ -63,7 +63,7 @@
{
this.context = context;
this.prepareResponse = prepareResponse;
- this.routings = new LinkedHashMap<Event, EventRoute>();
+ this.routings = new LinkedHashMap<PortletWindowEvent, EventRoute>();
this.roots = new ArrayList<EventRoute>();
}
@@ -72,7 +72,7 @@
return roots;
}
- public void eventProduced(EventPhaseContext context, Event producedEvent, Event
causeEvent)
+ public void eventProduced(EventPhaseContext context, PortletWindowEvent producedEvent,
PortletWindowEvent causeEvent)
{
EventRoute relatedRoute = routings.get(causeEvent);
@@ -91,7 +91,7 @@
//
if
(portletInfo.getEventing().getConsumedEvents().containsKey(producedEvent.getName()))
{
- Event destinationEvent = new Event(producedEvent.getName(),
producedEvent.getPayload(), windowId);
+ PortletWindowEvent destinationEvent = new
PortletWindowEvent(producedEvent.getName(), producedEvent.getPayload(), windowId);
//
EventRoute eventRoute = new EventRoute(
@@ -127,19 +127,19 @@
}
}
- public void eventConsumed(EventPhaseContext context, Event consumedEvent,
PortletInvocationResponse consumerResponse)
+ public void eventConsumed(EventPhaseContext context, PortletWindowEvent consumedEvent,
PortletInvocationResponse consumerResponse)
{
EventRoute route = routings.get(consumedEvent);
route.acknowledgement = new EventAcknowledgement.Consumed(consumerResponse);
}
- public void eventFailed(EventPhaseContext context, Event failedEvent, Throwable
throwable)
+ public void eventFailed(EventPhaseContext context, PortletWindowEvent failedEvent,
Throwable throwable)
{
EventRoute route = routings.get(failedEvent);
route.acknowledgement = new EventAcknowledgement.Failed(throwable);
}
- public void eventDiscarded(EventPhaseContext context, Event discardedEvent, int
cause)
+ public void eventDiscarded(EventPhaseContext context, PortletWindowEvent
discardedEvent, int cause)
{
EventRoute route = routings.get(discardedEvent);
route.acknowledgement = new EventAcknowledgement.Discarded(cause);
Modified:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PagePortletControllerContext.java
===================================================================
---
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PagePortletControllerContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PagePortletControllerContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -27,8 +27,8 @@
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.controller.state.StateControllerContext;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.PageNavigationalStateSerialization;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import
org.jboss.portal.portlet.controller.state.PortletPageNavigationalStateSerialization;
import org.jboss.portal.portlet.controller.impl.state.StateControllerContextImpl;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -58,7 +58,7 @@
private final StateControllerContext stateControllerContext;
/** . */
- private final Serialization<PageNavigationalState> serialization;
+ private final Serialization<PortletPageNavigationalState> serialization;
/** . */
private final PortalPrepareResponse prepareResponse;
@@ -96,7 +96,7 @@
this.prepareResponse = prepareResponse;
this.stateControllerContext = new StateControllerContextImpl(this);
this.eventControllerContext = new PageEventControllerContext(this,
prepareResponse);
- this.serialization = new
PageNavigationalStateSerialization(stateControllerContext);
+ this.serialization = new
PortletPageNavigationalStateSerialization(stateControllerContext);
}
public Portlet findPortlet(String applicationName, String portletName)
@@ -127,7 +127,7 @@
return stateControllerContext;
}
- public Serialization<PageNavigationalState>
getPageNavigationalStateSerialization()
+ public Serialization<PortletPageNavigationalState>
getPageNavigationalStateSerialization()
{
return serialization;
}
Modified:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PortalRenderResponse.java
===================================================================
---
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PortalRenderResponse.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PortalRenderResponse.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -23,8 +23,8 @@
package org.jboss.portal.portlet.portal.jsp;
import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerContext;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.PortletInvokerException;
@@ -56,7 +56,7 @@
{
/** . */
- private PageNavigationalState pageNavigationalState;
+ private PortletPageNavigationalState pageNavigationalState;
/** . */
private PagePortletControllerContext portletControllerContext;
@@ -68,7 +68,7 @@
HttpServletRequest request,
HttpServletResponse response,
PagePortletControllerContext portletControllerContext,
- PageNavigationalState pageNavigationalState,
+ PortletPageNavigationalState pageNavigationalState,
PortalPrepareResponse prepareResponse) throws PortletInvokerException
{
super(request, response);
@@ -79,7 +79,7 @@
{
if (pageNavigationalState == null)
{
- pageNavigationalState =
portletControllerContext.getStateControllerContext().createPageNavigationalState(true);
+ pageNavigationalState =
portletControllerContext.getStateControllerContext().createPortletPageNavigationalState(true);
}
for (QName parameterName : pageParameterNames)
{
@@ -106,7 +106,7 @@
*
* @return the page state
*/
- public PageNavigationalState getPageNavigationalState()
+ public PortletPageNavigationalState getPageNavigationalState()
{
return pageNavigationalState;
}
@@ -128,17 +128,17 @@
private PortletInvocationResponse render(Portlet portlet, String windowId) throws
PortletInvokerException
{
- WindowNavigationalState windowNS = null;
+ PortletWindowNavigationalState windowNS = null;
if (pageNavigationalState != null)
{
- windowNS = pageNavigationalState.getWindowNavigationalState(windowId);
+ windowNS = pageNavigationalState.getPortletWindowNavigationalState(windowId);
}
//
ParameterMap publicNS = null;
if (pageNavigationalState != null)
{
- publicNS = pageNavigationalState.getPublicNavigationalState(windowId);
+ publicNS = pageNavigationalState.getPortletPublicNavigationalState(windowId);
}
//
@@ -230,9 +230,9 @@
{
if (pageNavigationalState != null)
{
- for (String windowId : pageNavigationalState.getWindowIds())
+ for (String windowId : pageNavigationalState.getPortletWindowIds())
{
- WindowNavigationalState windowNS =
pageNavigationalState.getWindowNavigationalState(windowId);
+ PortletWindowNavigationalState windowNS =
pageNavigationalState.getPortletWindowNavigationalState(windowId);
if (WindowState.MAXIMIZED.equals(windowNS.getWindowState()))
{
return windowId;
Modified:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/PortletMarkupTag.java
===================================================================
---
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/PortletMarkupTag.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/PortletMarkupTag.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -25,7 +25,7 @@
import org.jboss.portal.portlet.portal.jsp.PortalRenderResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.ContentResponse;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
import org.jboss.portal.WindowState;
import javax.servlet.jsp.tagext.SimpleTagSupport;
@@ -52,10 +52,10 @@
if (portletResp instanceof ContentResponse)
{
ContentResponse fragment = (ContentResponse)portletResp;
- WindowNavigationalState windowNS = null;
+ PortletWindowNavigationalState windowNS = null;
if (renderResponse.getPageNavigationalState() != null)
{
- windowNS =
renderResponse.getPageNavigationalState().getWindowNavigationalState(portletTag.result.getWindowDef().getWindowId());
+ windowNS =
renderResponse.getPageNavigationalState().getPortletWindowNavigationalState(portletTag.result.getWindowDef().getWindowId());
}
if (windowNS == null ||
!windowNS.getWindowState().equals(WindowState.MINIMIZED))
{
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-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -107,7 +107,7 @@
else
{
- PageRenderer renderer = new PageRenderer(new ResponseProperties(),
context.getStateControllerContext().createPageNavigationalState(false));
+ PageRenderer renderer = new PageRenderer(new ResponseProperties(),
context.getStateControllerContext().createPortletPageNavigationalState(false));
//
renderer.render(new RendererContextImpl(context));
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -27,7 +27,7 @@
import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
import org.jboss.portal.portlet.controller.response.PortletResponse;
import org.jboss.portal.portlet.controller.response.ResourceResponse;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.state.StateControllerContext;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
@@ -49,7 +49,7 @@
private boolean sendErrorOnProcessActionError;
/** The page navigational state if there is one in the request. */
- private PageNavigationalState requestPageNavigationalState;
+ private PortletPageNavigationalState requestPageNavigationalState;
/** . */
private StateControllerContext stateControllerContext;
@@ -58,7 +58,7 @@
boolean sendNoContentResponseOnEmptyResource,
boolean sendErrorOnProcessActionError,
StateControllerContext stateControllerContext,
- PageNavigationalState requestPageNavigationalState)
+ PortletPageNavigationalState requestPageNavigationalState)
{
this.sendNoContentResponseOnEmptyResource = sendNoContentResponseOnEmptyResource;
this.sendErrorOnProcessActionError = sendErrorOnProcessActionError;
@@ -112,7 +112,7 @@
}
else
{
- return new PageRenderer(new ResponseProperties(),
requestPageNavigationalState != null ? requestPageNavigationalState :
stateControllerContext.createPageNavigationalState(false));
+ return new PageRenderer(new ResponseProperties(),
requestPageNavigationalState != null ? requestPageNavigationalState :
stateControllerContext.createPortletPageNavigationalState(false));
}
}
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-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -43,8 +43,8 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import org.jboss.portal.portlet.invocation.response.ContentResponse;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerContext;
import org.w3c.dom.Element;
@@ -66,9 +66,9 @@
protected FragmentRenderer fragmentRenderer = new SimpleFragmentRenderer();
protected List<ContentResponse> fragments;
protected List<ErrorResponse> errors;
- protected PageNavigationalState pageNavigationalState;
+ protected PortletPageNavigationalState pageNavigationalState;
- public PageRenderer(ResponseProperties properties, PageNavigationalState
pageNavigationalState)
+ public PageRenderer(ResponseProperties properties, PortletPageNavigationalState
pageNavigationalState)
{
super(properties);
@@ -143,7 +143,7 @@
for (Portlet portlet : portlets)
{
- WindowNavigationalState windowNS =
pageNavigationalState.getWindowNavigationalState(portlet.getContext().getId());
+ PortletWindowNavigationalState windowNS =
pageNavigationalState.getPortletWindowNavigationalState(portlet.getContext().getId());
//
Mode mode = Mode.VIEW;
@@ -168,7 +168,7 @@
}
//
- ParameterMap publicNS =
pageNavigationalState.getPublicNavigationalState(portlet.getContext().getId());
+ ParameterMap publicNS =
pageNavigationalState.getPortletPublicNavigationalState(portlet.getContext().getId());
RenderInvocation render = createRenderInvocation(context, properties,
pageNavigationalState, portlet, windowNS, mode, windowState, portletNS, publicNS);
@@ -210,9 +210,9 @@
protected RenderInvocation createRenderInvocation(
RendererContext context,
ResponseProperties pageProperties,
- PageNavigationalState pageNS,
+ PortletPageNavigationalState pageNS,
Portlet portlet,
- WindowNavigationalState windowNS,
+ PortletWindowNavigationalState windowNS,
Mode mode,
WindowState windowState,
StateString portletNS,
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-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -32,8 +32,8 @@
import org.jboss.portal.portlet.controller.impl.state.StateControllerContextImpl;
import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerContext;
import org.jboss.portal.portlet.controller.state.StateControllerContext;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.PageNavigationalStateSerialization;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import
org.jboss.portal.portlet.controller.state.PortletPageNavigationalStateSerialization;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.web.IllegalRequestException;
@@ -62,7 +62,7 @@
private final StateControllerContext stateControllerContext;
/** . */
- private final Serialization<PageNavigationalState> serialization;
+ private final Serialization<PortletPageNavigationalState> serialization;
public PortletControllerContextImpl(HttpServletRequest req, HttpServletResponse resp,
ServletContext servletContext)
throws IllegalRequestException, IOException, ClassNotFoundException
@@ -73,7 +73,7 @@
this.portletInvoker =
(PortletInvoker)servletContext.getAttribute("ConsumerPortletInvoker");
this.eventControllerContext = new EventControllerContextImpl(portletInvoker);
this.stateControllerContext = new StateControllerContextImpl(this);
- this.serialization = new
PageNavigationalStateSerialization(stateControllerContext);
+ this.serialization = new
PortletPageNavigationalStateSerialization(stateControllerContext);
}
public PortletInvoker getPortletInvoker()
@@ -106,7 +106,7 @@
return portletInvoker.getPortlets();
}
- public Serialization<PageNavigationalState>
getPageNavigationalStateSerialization()
+ public Serialization<PortletPageNavigationalState>
getPageNavigationalStateSerialization()
{
return serialization;
}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPageNavigationalState.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPageNavigationalState.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPageNavigationalState.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -1,102 +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.test.tck;
-
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
-import org.jboss.portal.common.util.ParameterMap;
-
-import javax.xml.namespace.QName;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public class TCKPageNavigationalState implements PageNavigationalState
-{
-
- /** . */
- final PageNavigationalState defaultState;
-
- /** . */
- final Set<String> involvedPortlets;
-
- public TCKPageNavigationalState(PageNavigationalState defaultState, Set<String>
involvedPortlets)
- {
- this.defaultState = defaultState;
- this.involvedPortlets = involvedPortlets;
- }
-
- public Set<String> getInvolvedPortlets()
- {
- return involvedPortlets;
- }
-
- public Set<String> getWindowIds()
- {
- return defaultState.getWindowIds();
- }
-
- public WindowNavigationalState getWindowNavigationalState(String windowId) throws
IllegalArgumentException
- {
- return defaultState.getWindowNavigationalState(windowId);
- }
-
- public void setWindowNavigationalState(String windowId, WindowNavigationalState
windowState) throws IllegalArgumentException, IllegalStateException
- {
- defaultState.setWindowNavigationalState(windowId, windowState);
- }
-
- public ParameterMap getPublicNavigationalState(String windowId) throws
IllegalArgumentException
- {
- return defaultState.getPublicNavigationalState(windowId);
- }
-
- public Set<QName> getPublicNames()
- {
- return defaultState.getPublicNames();
- }
-
- public void setPublicNavigationalState(String windowId, Map<String, String[]>
update) throws IllegalArgumentException, IllegalStateException
- {
- defaultState.setPublicNavigationalState(windowId, update);
- }
-
- public String[] getPublicNavigationalState(QName name) throws
IllegalArgumentException
- {
- return defaultState.getPublicNavigationalState(name);
- }
-
- public void setPublicNavigationalState(QName name, String[] value) throws
IllegalArgumentException, IllegalStateException
- {
- defaultState.setPublicNavigationalState(name, value);
- }
-
- public void removePublicNavigationalState(QName name) throws IllegalArgumentException,
IllegalStateException
- {
- defaultState.removePublicNavigationalState(name);
- }
-}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPageNavigationalStateSerialization.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPageNavigationalStateSerialization.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPageNavigationalStateSerialization.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.test.tck;
-import org.jboss.portal.portlet.controller.state.PageNavigationalStateSerialization;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import
org.jboss.portal.portlet.controller.state.PortletPageNavigationalStateSerialization;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.common.io.Serialization;
import java.io.OutputStream;
@@ -38,20 +38,20 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class TCKPageNavigationalStateSerialization implements
Serialization<PageNavigationalState>
+public class TCKPageNavigationalStateSerialization implements
Serialization<PortletPageNavigationalState>
{
/** . */
- private final PageNavigationalStateSerialization defaultSerialization;
+ private final PortletPageNavigationalStateSerialization defaultSerialization;
public TCKPageNavigationalStateSerialization(TCKStateControllerContext context)
{
- this.defaultSerialization = new
PageNavigationalStateSerialization(context.defaultStateControllerContext);
+ this.defaultSerialization = new
PortletPageNavigationalStateSerialization(context.defaultStateControllerContext);
}
- public void serialize(PageNavigationalState pageNavigationalState, OutputStream out)
throws IOException, IllegalArgumentException
+ public void serialize(PortletPageNavigationalState pageNavigationalState, OutputStream
out) throws IOException, IllegalArgumentException
{
- TCKPageNavigationalState tckPageNavigationalState =
(TCKPageNavigationalState)pageNavigationalState;
+ TCKPortletPageNavigationalState tckPageNavigationalState =
(TCKPortletPageNavigationalState)pageNavigationalState;
//
DataOutputStream data = out instanceof DataOutputStream ? (DataOutputStream)out :
new DataOutputStream(out);
@@ -70,13 +70,13 @@
data.flush();
}
- public PageNavigationalState unserialize(InputStream in) throws IOException,
IllegalArgumentException
+ public PortletPageNavigationalState unserialize(InputStream in) throws IOException,
IllegalArgumentException
{
//
DataInputStream data = in instanceof DataInputStream ? (DataInputStream)in : new
DataInputStream(in);
//
- PageNavigationalState defaultState = defaultSerialization.unserialize(in);
+ PortletPageNavigationalState defaultState = defaultSerialization.unserialize(in);
//
int size = data.readInt();
@@ -88,6 +88,6 @@
}
//
- return new TCKPageNavigationalState(defaultState, involvedPortlets);
+ return new TCKPortletPageNavigationalState(defaultState, involvedPortlets);
}
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPortletControllerContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPortletControllerContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPortletControllerContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -29,7 +29,7 @@
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
import org.jboss.portal.portlet.controller.state.StateControllerContext;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.impl.state.StateControllerContextImpl;
import org.jboss.portal.portlet.controller.impl.event.EventControllerContextImpl;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -60,7 +60,7 @@
private final EventControllerContext eventControllerContext;
/** . */
- private final Serialization<PageNavigationalState> serialization;
+ private final Serialization<PortletPageNavigationalState> serialization;
public TCKPortletControllerContext(
HttpServletRequest req,
@@ -96,7 +96,7 @@
return portletInvoker.invoke(invocation);
}
- protected Serialization<PageNavigationalState>
getPageNavigationalStateSerialization()
+ protected Serialization<PortletPageNavigationalState>
getPageNavigationalStateSerialization()
{
return serialization;
}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPortletPageNavigationalState.java
(from rev 10534,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPageNavigationalState.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPortletPageNavigationalState.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKPortletPageNavigationalState.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -0,0 +1,101 @@
+/*
+* 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.test.tck;
+
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.common.util.ParameterMap;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class TCKPortletPageNavigationalState implements PortletPageNavigationalState
+{
+
+ /** . */
+ final PortletPageNavigationalState defaultState;
+
+ /** . */
+ final Set<String> involvedPortlets;
+
+ public TCKPortletPageNavigationalState(PortletPageNavigationalState defaultState,
Set<String> involvedPortlets)
+ {
+ this.defaultState = defaultState;
+ this.involvedPortlets = involvedPortlets;
+ }
+
+ public Set<String> getInvolvedPortlets()
+ {
+ return involvedPortlets;
+ }
+
+ public Set<String> getPortletWindowIds()
+ {
+ return defaultState.getPortletWindowIds();
+ }
+
+ public PortletWindowNavigationalState getPortletWindowNavigationalState(String
portletWindowId) throws IllegalArgumentException
+ {
+ return defaultState.getPortletWindowNavigationalState(portletWindowId);
+ }
+
+ public void setPortletWindowNavigationalState(String portletWindowId,
PortletWindowNavigationalState portletWindowState) throws IllegalArgumentException,
IllegalStateException
+ {
+ defaultState.setPortletWindowNavigationalState(portletWindowId,
portletWindowState);
+ }
+
+ public ParameterMap getPortletPublicNavigationalState(String portletWindowId) throws
IllegalArgumentException
+ {
+ return defaultState.getPortletPublicNavigationalState(portletWindowId);
+ }
+
+ public Set<QName> getPublicNames()
+ {
+ return defaultState.getPublicNames();
+ }
+
+ public void setPortletPublicNavigationalState(String portletWindowId, Map<String,
String[]> update) throws IllegalArgumentException, IllegalStateException
+ {
+ defaultState.setPortletPublicNavigationalState(portletWindowId, update);
+ }
+
+ public String[] getPublicNavigationalState(QName name) throws
IllegalArgumentException
+ {
+ return defaultState.getPublicNavigationalState(name);
+ }
+
+ public void setPublicNavigationalState(QName name, String[] value) throws
IllegalArgumentException, IllegalStateException
+ {
+ defaultState.setPublicNavigationalState(name, value);
+ }
+
+ public void removePublicNavigationalState(QName name) throws IllegalArgumentException,
IllegalStateException
+ {
+ defaultState.removePublicNavigationalState(name);
+ }
+}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -26,7 +26,6 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.NoSuchPortletException;
-import org.jboss.portal.portlet.PortletInvoker;
import java.util.Collection;
import java.util.ArrayList;
@@ -43,7 +42,7 @@
public TCKRendererContext(
TCKPortletControllerContext portletControllerContext,
- TCKPageNavigationalState tckPageNavigationalState) throws PortletInvokerException
+ TCKPortletPageNavigationalState tckPageNavigationalState) throws
PortletInvokerException
{
super(portletControllerContext, portletControllerContext.getPortletInvoker());
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKServlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKServlet.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKServlet.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -95,7 +95,7 @@
ControllerRequest request = factory.createRequest(wr);
// We must have one!!!
- TCKPageNavigationalState tckPageNavigationalState =
(TCKPageNavigationalState)request.getPageNavigationalState();
+ TCKPortletPageNavigationalState tckPageNavigationalState =
(TCKPortletPageNavigationalState)request.getPageNavigationalState();
//
ControllerResponse response = controller.process(context, request);
@@ -140,7 +140,7 @@
throw new IllegalStateException("Portlets requested by TCK were not
found");
}
- TCKPageNavigationalState tckPageNavigationalState = new
TCKPageNavigationalState(context.getStateControllerContext().createPageNavigationalState(false),
involvedPortlets);
+ TCKPortletPageNavigationalState tckPageNavigationalState = new
TCKPortletPageNavigationalState(context.getStateControllerContext().createPortletPageNavigationalState(false),
involvedPortlets);
//
PageRenderer renderer = new PageRenderer(new ResponseProperties(),
tckPageNavigationalState);
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKStateControllerContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKStateControllerContext.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKStateControllerContext.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.test.tck;
import org.jboss.portal.portlet.controller.state.StateControllerContext;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import java.util.HashSet;
@@ -41,18 +41,18 @@
this.defaultStateControllerContext = defaultStateControllerContext;
}
- public PageNavigationalState clonePageNavigationalState(PageNavigationalState
pageNavigationalState, boolean modifiable)
+ public PortletPageNavigationalState
clonePortletPageNavigationalState(PortletPageNavigationalState
portletPageNavigationalState, boolean modifiable)
{
- TCKPageNavigationalState tckPageNavigationalState =
(TCKPageNavigationalState)pageNavigationalState;
+ TCKPortletPageNavigationalState tckPageNavigationalState =
(TCKPortletPageNavigationalState)portletPageNavigationalState;
//
- return new TCKPageNavigationalState(
-
defaultStateControllerContext.clonePageNavigationalState(tckPageNavigationalState.defaultState,
modifiable),
+ return new TCKPortletPageNavigationalState(
+
defaultStateControllerContext.clonePortletPageNavigationalState(tckPageNavigationalState.defaultState,
modifiable),
new HashSet<String>(tckPageNavigationalState.involvedPortlets));
}
- public PageNavigationalState createPageNavigationalState(boolean modifiable)
+ public PortletPageNavigationalState createPortletPageNavigationalState(boolean
modifiable)
{
- return new
TCKPageNavigationalState(defaultStateControllerContext.createPageNavigationalState(modifiable),
new HashSet<String>());
+ return new
TCKPortletPageNavigationalState(defaultStateControllerContext.createPortletPageNavigationalState(modifiable),
new HashSet<String>());
}
}
Modified:
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/controller/StateControllerContextTestCase.java
===================================================================
---
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/controller/StateControllerContextTestCase.java 2008-04-14
12:18:16 UTC (rev 10577)
+++
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/controller/StateControllerContextTestCase.java 2008-04-14
12:39:36 UTC (rev 10578)
@@ -24,10 +24,10 @@
import org.jboss.unit.api.pojo.annotations.Test;
import org.jboss.portal.portlet.controller.impl.state.StateControllerContextImpl;
-import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.state.StateControllerContext;
-import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
-import org.jboss.portal.portlet.controller.state.PageNavigationalStateSerialization;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import
org.jboss.portal.portlet.controller.state.PortletPageNavigationalStateSerialization;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.PortletInvokerException;
@@ -63,7 +63,7 @@
@Test
public void testMarshalling1()
{
- PageNavigationalState pageNS = cc.createPageNavigationalState(true);
+ PortletPageNavigationalState pageNS = cc.createPortletPageNavigationalState(true);
assertMarshallable(pageNS);
}
@@ -90,20 +90,20 @@
private void test(StateString portletNavigationalState, Mode mode, WindowState
windowState)
{
- PageNavigationalState pageNS = cc.createPageNavigationalState(true);
- pageNS.setWindowNavigationalState("foo", new
WindowNavigationalState(portletNavigationalState, mode, windowState));
+ PortletPageNavigationalState pageNS = cc.createPortletPageNavigationalState(true);
+ pageNS.setPortletWindowNavigationalState("foo", new
PortletWindowNavigationalState(portletNavigationalState, mode, windowState));
assertMarshallable(pageNS);
}
- private void assertMarshallable(PageNavigationalState pageNS)
+ private void assertMarshallable(PortletPageNavigationalState pageNS)
{
- byte[] bytes = IOTools.serialize(new PageNavigationalStateSerialization(cc),
/*SerializationFilter.COMPRESSOR, */pageNS);
- PageNavigationalState expectedPageNS = IOTools.unserialize(new
PageNavigationalStateSerialization(cc), /*SerializationFilter.COMPRESSOR, */bytes);
- assertEquals(expectedPageNS.getWindowIds(), pageNS.getWindowIds());
- for (String windowId : expectedPageNS.getWindowIds())
+ byte[] bytes = IOTools.serialize(new PortletPageNavigationalStateSerialization(cc),
/*SerializationFilter.COMPRESSOR, */pageNS);
+ PortletPageNavigationalState expectedPageNS = IOTools.unserialize(new
PortletPageNavigationalStateSerialization(cc), /*SerializationFilter.COMPRESSOR,
*/bytes);
+ assertEquals(expectedPageNS.getPortletWindowIds(), pageNS.getPortletWindowIds());
+ for (String windowId : expectedPageNS.getPortletWindowIds())
{
- WindowNavigationalState windowNS =
expectedPageNS.getWindowNavigationalState(windowId);
- WindowNavigationalState expectedWindowNS =
pageNS.getWindowNavigationalState(windowId);
+ PortletWindowNavigationalState windowNS =
expectedPageNS.getPortletWindowNavigationalState(windowId);
+ PortletWindowNavigationalState expectedWindowNS =
pageNS.getPortletWindowNavigationalState(windowId);
assertEquals(windowNS.getPortletNavigationalState(),
expectedWindowNS.getPortletNavigationalState());
assertEquals(windowNS.getMode(), expectedWindowNS.getMode());
assertEquals(windowNS.getWindowState(), expectedWindowNS.getWindowState());
@@ -127,7 +127,7 @@
throw new NotYetImplemented();
}
- public PortletInvocationContext createPortletInvocationContext(String windowId,
PageNavigationalState pageNavigationalState)
+ public PortletInvocationContext createPortletInvocationContext(String windowId,
PortletPageNavigationalState pageNavigationalState)
{
throw new NotYetImplemented();
}