Author: julien(a)jboss.com
Date: 2008-02-04 17:35:20 -0500 (Mon, 04 Feb 2008)
New Revision: 9750
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderControllerResponse.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java
Log:
removed inner classes ControllerRequest and its subclasses
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.controller;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerRequest extends ControllerRequest
+{
+
+ /** . */
+ final String portletId;
+
+ ContainerRequest(PortletControllerContext controllerContext, String portletId)
+ {
+ super(controllerContext);
+
+ //
+ this.portletId = portletId;
+ }
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.controller;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ControllerRequest
+{
+ /** . */
+ final PortletControllerContext controllerContext;
+
+ ControllerRequest(PortletControllerContext controllerContext)
+ {
+ this.controllerContext = controllerContext;
+ }
+}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java 2008-02-04
22:24:27 UTC (rev 9749)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -23,8 +23,6 @@
package org.jboss.portal.portlet.test.controller;
-import java.io.IOException;
-
/**
* Must be used as base class for high level response provided by the controller that
will be translated into something
* at the portal level. The goal is to avoid to manipulate the HTTP response directly.
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.controller;
+
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class FullScopedCacheablePortletResourceRequest extends PortletResourceRequest
+{
+
+ public FullScopedCacheablePortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters)
+ {
+ super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
+ }
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.controller;
+
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PageScopedFullPortletResourceRequest extends
PortletScopedPortletResourceRequest
+{
+
+ /** . */
+ private final PageNavigationalState pageState;
+
+ public PageScopedFullPortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters,
+ PageNavigationalState pageState,
+ WindowNavigationalState windowNavigationalState)
+ {
+ super(controllerContext, portletId, resourceId, resourceState, bodyParameters,
windowNavigationalState);
+
+ //
+ this.pageState = pageState;
+ }
+
+ PageNavigationalState getPageState()
+ {
+ return pageState;
+ }
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.controller;
+
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletActionRequest extends PortletRequest
+{
+
+ /** . */
+ final StateString interactionState;
+
+ /** . */
+ final ParameterMap bodyParameters;
+
+ public PortletActionRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ StateString interactionState,
+ ParameterMap bodyParameters,
+ WindowNavigationalState windowNavigationalState,
+ PageNavigationalState pageState)
+ {
+ super(controllerContext, portletId, windowNavigationalState, pageState);
+
+ //
+ this.interactionState = interactionState;
+ this.bodyParameters = bodyParameters;
+ }
+}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-04
22:24:27 UTC (rev 9749)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -24,17 +24,9 @@
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.common.util.MediaType;
-import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.cache.CacheLevel;
-import org.jboss.portal.portlet.impl.spi.AbstractPortalContext;
-import org.jboss.portal.portlet.spi.PortalContext;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -46,17 +38,6 @@
/** . */
public static final MarkupInfo MARKUP_INFO = new MarkupInfo(MediaType.HTML,
"UTF8");
- /** . */
- static final PortalContext portalContext;
-
- static
- {
- Map<String, String> portalProperties = new HashMap<String, String>();
- portalProperties.put("javax.portlet.markup.head.element.support",
"true");
-
- portalContext = new AbstractPortalContext(portalProperties);
- }
-
public ControllerResponse process(ControllerRequest controllerRequest) throws
IOException, PortletInvokerException
{
RequestHandler handler;
@@ -76,196 +57,4 @@
return handler.handle(controllerRequest);
}
-
- public static class ControllerRequest
- {
- /** . */
- final PortletControllerContext controllerContext;
-
- ControllerRequest(PortletControllerContext controllerContext)
- {
- this.controllerContext = controllerContext;
- }
- }
-
- public static class ContainerRequest extends ControllerRequest
- {
- /** . */
- final String portletId;
-
- ContainerRequest(PortletControllerContext controllerContext, String portletId)
- {
- super(controllerContext);
-
- //
- this.portletId = portletId;
- }
- }
-
- public static class PortletRequest extends ContainerRequest
- {
- /** . */
- final PageNavigationalState pageState;
-
- /** . */
- final WindowNavigationalState windowNavigationalState;
-
- PortletRequest(
- PortletControllerContext controllerContext,
- String portletId,
- WindowNavigationalState windowNavigationalState,
- PageNavigationalState pageState)
- {
- super(controllerContext, portletId);
-
- //
- this.windowNavigationalState = windowNavigationalState;
- this.pageState = pageState;
- }
- }
-
- public static abstract class PortletResourceRequest extends ContainerRequest
- {
- /** . */
- private static final Map<Class, CacheLevel> cacheability = new
HashMap<Class, CacheLevel>();
-
- static
- {
- cacheability.put(FullScopedCacheablePortletResourceRequest.class,
CacheLevel.FULL);
- cacheability.put(PortletScopedPortletResourceRequest.class,
CacheLevel.PORTLET);
- cacheability.put(PageScopedFullPortletResourceRequest.class, CacheLevel.PAGE);
- }
-
- /** . */
- final String resourceId;
-
- /** . */
- final StateString resourceState;
-
- /** . */
- final ParameterMap bodyParameters;
-
- PortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters
- )
- {
- super(controllerContext, portletId);
-
- //
- this.resourceId = resourceId;
- this.resourceState = resourceState;
- this.bodyParameters = bodyParameters;
- }
-
- public CacheLevel getCacheabilityType()
- {
- return cacheability.get(getClass());
- }
- }
-
- public static class FullScopedCacheablePortletResourceRequest extends
PortletResourceRequest
- {
- public FullScopedCacheablePortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters)
- {
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
- }
- }
-
- public static class PortletScopedPortletResourceRequest extends
FullScopedCacheablePortletResourceRequest
- {
- /** . */
- final WindowNavigationalState windowNavigationalState;
-
- public PortletScopedPortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters,
- WindowNavigationalState windowNavigationalState)
- {
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
-
- //
- this.windowNavigationalState = windowNavigationalState;
- }
- }
-
- public static class PageScopedFullPortletResourceRequest extends
PortletScopedPortletResourceRequest
- {
- /** . */
- private final PageNavigationalState pageState;
-
- public PageScopedFullPortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters,
- PageNavigationalState pageState,
- WindowNavigationalState windowNavigationalState)
- {
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters,
windowNavigationalState);
-
- //
- this.pageState = pageState;
- }
-
- PageNavigationalState getPageState()
- {
- return pageState;
- }
- }
-
- public static class PortletActionRequest extends PortletRequest
- {
- /** . */
- final StateString interactionState;
-
- /** . */
- final ParameterMap bodyParameters;
-
- public PortletActionRequest(
- PortletControllerContext controllerContext,
- String portletId,
- StateString interactionState,
- ParameterMap bodyParameters,
- WindowNavigationalState windowNavigationalState,
- PageNavigationalState pageState)
- {
- super(controllerContext, portletId, windowNavigationalState, pageState);
-
- //
- this.interactionState = interactionState;
- this.bodyParameters = bodyParameters;
- }
- }
-
- public static class PortletRenderRequest extends PortletRequest
- {
- /** . */
- final Map<String, String[]> publicNavigationalStateChanges;
-
- public PortletRenderRequest(
- PortletControllerContext controllerContext,
- String portletId,
- WindowNavigationalState windowNavigationalState,
- Map<String, String[]> publicNavigationalStateChanges,
- PageNavigationalState pageState)
- {
- super(controllerContext, portletId, windowNavigationalState, pageState);
-
- //
- this.publicNavigationalStateChanges = publicNavigationalStateChanges;
- }
- }
}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * 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.controller;
+
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletRenderRequest extends PortletRequest
+{
+
+ /** . */
+ final Map<String, String[]> publicNavigationalStateChanges;
+
+ public PortletRenderRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ WindowNavigationalState windowNavigationalState,
+ Map<String, String[]> publicNavigationalStateChanges,
+ PageNavigationalState pageState)
+ {
+ super(controllerContext, portletId, windowNavigationalState, pageState);
+
+ //
+ this.publicNavigationalStateChanges = publicNavigationalStateChanges;
+ }
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * 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.controller;
+
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletRequest extends ContainerRequest
+{
+
+ /** . */
+ final PageNavigationalState pageState;
+
+ /** . */
+ final WindowNavigationalState windowNavigationalState;
+
+ PortletRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ WindowNavigationalState windowNavigationalState,
+ PageNavigationalState pageState)
+ {
+ super(controllerContext, portletId);
+
+ //
+ this.windowNavigationalState = windowNavigationalState;
+ this.pageState = pageState;
+ }
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * 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.controller;
+
+import org.jboss.portal.portlet.cache.CacheLevel;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.common.util.ParameterMap;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletResourceRequest extends ContainerRequest
+{
+
+ /** . */
+ private static final Map<Class, CacheLevel> cacheability = new HashMap<Class,
CacheLevel>();
+
+ static
+ {
+ cacheability.put(FullScopedCacheablePortletResourceRequest.class,
CacheLevel.FULL);
+ cacheability.put(PortletScopedPortletResourceRequest.class, CacheLevel.PORTLET);
+ cacheability.put(PageScopedFullPortletResourceRequest.class, CacheLevel.PAGE);
+ }
+
+ /** . */
+ final String resourceId;
+
+ /** . */
+ final StateString resourceState;
+
+ /** . */
+ final ParameterMap bodyParameters;
+
+ PortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters
+ )
+ {
+ super(controllerContext, portletId);
+
+ //
+ this.resourceId = resourceId;
+ this.resourceState = resourceState;
+ this.bodyParameters = bodyParameters;
+ }
+
+ public CacheLevel getCacheabilityType()
+ {
+ return cacheability.get(getClass());
+ }
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * 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.controller;
+
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletScopedPortletResourceRequest extends
FullScopedCacheablePortletResourceRequest
+{
+
+ /** . */
+ final WindowNavigationalState windowNavigationalState;
+
+ public PortletScopedPortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters,
+ WindowNavigationalState windowNavigationalState)
+ {
+ super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
+
+ //
+ this.windowNavigationalState = windowNavigationalState;
+ }
+}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java 2008-02-04
22:24:27 UTC (rev 9749)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -7,7 +7,6 @@
import org.apache.log4j.Logger;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import static
org.jboss.portal.portlet.test.controller.PortletController.ControllerRequest;
import java.io.IOException;
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderControllerResponse.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderControllerResponse.java 2008-02-04
22:24:27 UTC (rev 9749)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderControllerResponse.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -1,93 +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.test.controller;
-
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.Writer;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class ResourceRenderControllerResponse extends RenderControllerResponse
-{
- private FragmentResponse fragment;
-
- public ResourceRenderControllerResponse(ResponseProperties properties,
FragmentResponse fragment)
- {
- super(properties);
- this.fragment = fragment;
- }
-
- protected void renderContent(HttpServletResponse resp) throws IOException
- {
- //
- if (fragment.getType() == FragmentResponse.TYPE_EMPTY)
- {
- resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
- }
- else
- {
- String contentType = fragment.getContentType();
- if (contentType != null)
- {
- resp.setContentType(contentType);
- }
-
- //
- if (fragment.getType() == FragmentResponse.TYPE_BYTES)
- {
- ServletOutputStream out = null;
- try
- {
- out = resp.getOutputStream();
- out.write(fragment.getBytes().toByteArray());
- }
- finally
- {
- IOTools.safeClose(out);
- }
- }
- else
- {
- Writer writer = null;
- try
- {
- writer = resp.getWriter();
- writer.write(fragment.getChars().toString());
- }
- finally
- {
- writer.close();
- }
- }
- }
- }
-}
\ No newline at end of file
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-04
22:24:27 UTC (rev 9749)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -40,8 +40,13 @@
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
import org.jboss.portal.portlet.test.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
-import org.jboss.portal.portlet.test.controller.PortletController;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletRenderRequest;
+import org.jboss.portal.portlet.test.controller.ControllerRequest;
+import org.jboss.portal.portlet.test.controller.PortletScopedPortletResourceRequest;
+import
org.jboss.portal.portlet.test.controller.FullScopedCacheablePortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.PageScopedFullPortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.PortletActionRequest;
import org.jboss.portal.portlet.test.event.EventControllerContext;
import org.jboss.portal.portlet.test.event.EventControllerContextImpl;
import org.jboss.portal.web.Body;
@@ -78,7 +83,7 @@
private final ServletContext servletContext;
/** . */
- private final PortletController.ControllerRequest request;
+ private final ControllerRequest request;
/** . */
private final PortletInvoker invoker;
@@ -98,7 +103,7 @@
PageNavigationalState pageState = null;
// The request decoded if not null
- PortletController.ControllerRequest request = null;
+ ControllerRequest request = null;
// Process
String pathInfo = req.getPathInfo();
@@ -164,7 +169,7 @@
switch (resourceCacheLevel)
{
case FULL:
- request = new
PortletController.FullScopedCacheablePortletResourceRequest(
+ request = new FullScopedCacheablePortletResourceRequest(
this,
targetId,
resourceId,
@@ -172,7 +177,7 @@
formParameters);
break;
case PORTLET:
- request = new PortletController.PortletScopedPortletResourceRequest(
+ request = new PortletScopedPortletResourceRequest(
this,
targetId,
resourceId,
@@ -181,7 +186,7 @@
windowNavigationalState);
break;
case PAGE:
- request = new PortletController.PageScopedFullPortletResourceRequest(
+ request = new PageScopedFullPortletResourceRequest(
this,
targetId,
resourceId,
@@ -206,7 +211,7 @@
StateString interactionState =
ParametersStateString.create(req.getParameter(INTERACTION_STATE));
//
- request = new PortletController.PortletActionRequest(
+ request = new PortletActionRequest(
this,
targetId,
interactionState,
@@ -219,7 +224,7 @@
Map<String, String[]> publicNavigationalStateChanges =
(Map<String,
String[]>)IOTools.unserialize(Tools.fromHexString(req.getParameter(PUBLIC_NAVIGATIONAL_STATE_CHANGES)));
//
- request = new PortletController.PortletRenderRequest(
+ request = new PortletRenderRequest(
this,
targetId,
windowNavigationalState,
@@ -238,7 +243,7 @@
this.eventControllerContext = new EventControllerContextImpl(invoker);
}
- public PortletController.ControllerRequest getRequest()
+ public ControllerRequest getRequest()
{
return request;
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java 2008-02-04
22:24:27 UTC (rev 9749)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java 2008-02-04
22:35:20 UTC (rev 9750)
@@ -25,7 +25,6 @@
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.test.controller2.FragmentRenderer;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>