Author: julien(a)jboss.com
Date: 2008-02-05 10:46:21 -0500 (Tue, 05 Feb 2008)
New Revision: 9778
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.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/ErrorResponseRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectResponseRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/Renderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/SimpleFragmentRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestInstanceContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortalContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.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/ErrorResponseRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectResponseRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/Renderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/SimpleFragmentRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestInstanceContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortalContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/
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/simple/SimplePortalServlet.java
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml
Log:
renamed controller2 package to controller as the previous controller package moved to
org.jboss.portal.portlet
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-05
15:38:52 UTC (rev 9777)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -24,11 +24,11 @@
import org.jboss.portal.portlet.controller.response.ControllerResponse;
import org.jboss.portal.portlet.controller.PortletController;
-import org.jboss.portal.portlet.test.controller2.PortletControllerContextImpl;
+import org.jboss.portal.portlet.test.controller.PortletControllerContextImpl;
import org.jboss.portal.portlet.controller.PageNavigationalState;
-import org.jboss.portal.portlet.test.controller2.ControllerResponseRendererFactory;
-import org.jboss.portal.portlet.test.controller2.Renderer;
-import org.jboss.portal.portlet.test.controller2.PageRenderer;
+import org.jboss.portal.portlet.test.controller.ControllerResponseRendererFactory;
+import org.jboss.portal.portlet.test.controller.Renderer;
+import org.jboss.portal.portlet.test.controller.PageRenderer;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import javax.servlet.ServletException;
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller
(from rev 9775,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2)
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/AbstractMarkupRenderer.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,91 +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.controller2;
-
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.test.controller.PortletControllerContext;
-import org.jboss.portal.common.util.MultiValuedPropertyMap;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.Cookie;
-import java.io.IOException;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public abstract class AbstractMarkupRenderer implements Renderer
-{
-
- /** . */
- protected ResponseProperties properties;
-
- public AbstractMarkupRenderer(ResponseProperties properties)
- {
- this.properties = properties;
- }
-
- public void render(PortletControllerContext context) throws IOException
- {
- prepareRendering(context);
- HttpServletResponse resp = context.getClientResponse();
-
- // Render the headers and cookies
- if (properties != null)
- {
- renderTransportHeaders(properties, resp);
- renderCookies(properties, resp);
- }
-
- renderContent(resp);
- }
-
- protected abstract void renderContent(HttpServletResponse resp) throws IOException;
-
- private void renderCookies(ResponseProperties pageProperties, HttpServletResponse
resp)
- {
- List<Cookie> cookies = pageProperties.getCookies();
- for (Cookie cookie : cookies)
- {
- resp.addCookie(cookie);
- }
- }
-
- private void renderTransportHeaders(ResponseProperties pageProperties,
HttpServletResponse resp)
- {
- MultiValuedPropertyMap<String> transportHeaders =
pageProperties.getTransportHeaders();
- for (String headerName : transportHeaders.keySet())
- {
- for (String headerValue : transportHeaders.getValues(headerName))
- {
- resp.addHeader(headerName, headerValue);
- }
- }
- }
-
- protected void prepareRendering(PortletControllerContext context)
- {
- // default behavior does nothing
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/AbstractMarkupRenderer.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * 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.invocation.response.ResponseProperties;
+import org.jboss.portal.portlet.controller.PortletControllerContext;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.Cookie;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class AbstractMarkupRenderer implements Renderer
+{
+
+ /** . */
+ protected ResponseProperties properties;
+
+ public AbstractMarkupRenderer(ResponseProperties properties)
+ {
+ this.properties = properties;
+ }
+
+ public void render(PortletControllerContext context) throws IOException
+ {
+ prepareRendering(context);
+ HttpServletResponse resp = context.getClientResponse();
+
+ // Render the headers and cookies
+ if (properties != null)
+ {
+ renderTransportHeaders(properties, resp);
+ renderCookies(properties, resp);
+ }
+
+ renderContent(resp);
+ }
+
+ protected abstract void renderContent(HttpServletResponse resp) throws IOException;
+
+ private void renderCookies(ResponseProperties pageProperties, HttpServletResponse
resp)
+ {
+ List<Cookie> cookies = pageProperties.getCookies();
+ for (Cookie cookie : cookies)
+ {
+ resp.addCookie(cookie);
+ }
+ }
+
+ private void renderTransportHeaders(ResponseProperties pageProperties,
HttpServletResponse resp)
+ {
+ MultiValuedPropertyMap<String> transportHeaders =
pageProperties.getTransportHeaders();
+ for (String headerName : transportHeaders.keySet())
+ {
+ for (String headerValue : transportHeaders.getValues(headerName))
+ {
+ resp.addHeader(headerName, headerValue);
+ }
+ }
+ }
+
+ protected void prepareRendering(PortletControllerContext context)
+ {
+ // default behavior does nothing
+ }
+}
Deleted:
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/controller2/ControllerResponseRendererFactory.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,87 +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.controller2;
-
-import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
-import org.jboss.portal.portlet.test.controller.response.PageUpdateResponse;
-import org.jboss.portal.portlet.test.controller.response.ResourceResponse;
-import org.jboss.portal.portlet.test.controller.response.PortletResponse;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ControllerResponseRendererFactory
-{
- public static Renderer getRenderer(ControllerResponse response)
- {
- if (response instanceof PageUpdateResponse)
- {
- PageUpdateResponse pageUpdate = (PageUpdateResponse)response;
-
- //
- return new PageRenderer(pageUpdate.getProperties(), pageUpdate.getPageState());
- }
- else if (response instanceof PortletResponse)
- {
- return getRenderer(((PortletResponse)response).response);
- }
- else if (response instanceof ResourceResponse)
- {
- ResourceResponse resourceResponse = (ResourceResponse)response;
-
- //
- if (resourceResponse.response instanceof FragmentResponse)
- {
- return new ResourceRenderer((FragmentResponse)resourceResponse.response);
- }
- else
- {
- return getRenderer(((PortletResponse)response).response);
- }
- }
-
- //
- throw new IllegalArgumentException("Unknown response type: " +
response);
- }
-
- private static Renderer getRenderer(PortletInvocationResponse response)
- {
- if (response instanceof HTTPRedirectionResponse)
- {
- return new RedirectResponseRenderer((HTTPRedirectionResponse)response);
- }
- else if (response instanceof ErrorResponse)
- {
- return new ErrorResponseRenderer((ErrorResponse)response);
- }
-
- //
- throw new IllegalArgumentException("Unknown response type: " +
response);
- }
-
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * 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.controller.response.ControllerResponse;
+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.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ControllerResponseRendererFactory
+{
+ public static Renderer getRenderer(ControllerResponse response)
+ {
+ if (response instanceof PageUpdateResponse)
+ {
+ PageUpdateResponse pageUpdate = (PageUpdateResponse)response;
+
+ //
+ return new PageRenderer(pageUpdate.getProperties(), pageUpdate.getPageState());
+ }
+ else if (response instanceof PortletResponse)
+ {
+ return getRenderer(((PortletResponse)response).response);
+ }
+ else if (response instanceof ResourceResponse)
+ {
+ ResourceResponse resourceResponse = (ResourceResponse)response;
+
+ //
+ if (resourceResponse.response instanceof FragmentResponse)
+ {
+ return new ResourceRenderer((FragmentResponse)resourceResponse.response);
+ }
+ else
+ {
+ return getRenderer(((PortletResponse)response).response);
+ }
+ }
+
+ //
+ throw new IllegalArgumentException("Unknown response type: " +
response);
+ }
+
+ private static Renderer getRenderer(PortletInvocationResponse response)
+ {
+ if (response instanceof HTTPRedirectionResponse)
+ {
+ return new RedirectResponseRenderer((HTTPRedirectionResponse)response);
+ }
+ else if (response instanceof ErrorResponse)
+ {
+ return new ErrorResponseRenderer((ErrorResponse)response);
+ }
+
+ //
+ throw new IllegalArgumentException("Unknown response type: " +
response);
+ }
+
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorResponseRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResponseRenderer.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorResponseRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,63 +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.controller2;
-
-import org.jboss.portal.portlet.test.controller.PortletControllerContext;
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.apache.log4j.Logger;
-
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ErrorResponseRenderer implements Renderer
-{
-
- /** . */
- private static final Logger log = Logger.getLogger(ErrorResponseRenderer.class);
-
- /** . */
- private ErrorResponse response;
-
- public ErrorResponseRenderer(ErrorResponse response)
- {
- this.response = response;
- }
-
- public void render(PortletControllerContext context) throws IOException
- {
- if (response.getCause() != null)
- {
- log.error("Portlet action threw an error: " + response.getMessage(),
response.getCause());
- }
- else
- {
- log.error("Portlet action threw an error: " + response.getMessage());
- }
-
- //
- context.getClientResponse().sendError(404, response.getMessage());
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorResponseRenderer.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResponseRenderer.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorResponseRenderer.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorResponseRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.controller.PortletControllerContext;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.apache.log4j.Logger;
+
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ErrorResponseRenderer implements Renderer
+{
+
+ /** . */
+ private static final Logger log = Logger.getLogger(ErrorResponseRenderer.class);
+
+ /** . */
+ private ErrorResponse response;
+
+ public ErrorResponseRenderer(ErrorResponse response)
+ {
+ this.response = response;
+ }
+
+ public void render(PortletControllerContext context) throws IOException
+ {
+ if (response.getCause() != null)
+ {
+ log.error("Portlet action threw an error: " + response.getMessage(),
response.getCause());
+ }
+ else
+ {
+ log.error("Portlet action threw an error: " + response.getMessage());
+ }
+
+ //
+ context.getClientResponse().sendError(404, response.getMessage());
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/FragmentRenderer.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,38 +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.controller2;
-
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision: 9748 $
- */
-public interface FragmentRenderer
-{
- String renderPortlet(FragmentResponse fragment);
-
- String renderError(ErrorResponse error);
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/FragmentRenderer.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 9748 $
+ */
+public interface FragmentRenderer
+{
+ String renderPortlet(FragmentResponse fragment);
+
+ String renderError(ErrorResponse error);
+}
Deleted:
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/controller2/PageRenderer.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,246 +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.controller2;
-
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.MultiValuedPropertyMap;
-import org.jboss.portal.common.util.ParameterMap;
-import org.jboss.portal.common.xml.XMLTools;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
-import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
-import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
-import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
-import org.jboss.portal.portlet.impl.spi.AbstractWindowContext;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
-import org.jboss.portal.portlet.test.controller.PageNavigationalState;
-import org.jboss.portal.portlet.test.controller.PortletControllerContext;
-import org.w3c.dom.Element;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision: 9748 $
- */
-public class PageRenderer extends AbstractMarkupRenderer
-{
-
- private FragmentRenderer fragmentRenderer = new SimpleFragmentRenderer();
- private List<FragmentResponse> fragments;
- private List<ErrorResponse> errors;
- private PageNavigationalState pageState;
-
- public PageRenderer(ResponseProperties properties, PageNavigationalState pageState)
- {
- super(properties);
-
- //
- this.pageState = pageState;
- }
-
- public void setFragmentRenderer(FragmentRenderer fragmentRenderer)
- {
- this.fragmentRenderer = fragmentRenderer;
- }
-
- protected void renderContent(HttpServletResponse resp) throws IOException
- {
- //
- resp.setContentType("text/html");
- PrintWriter writer = resp.getWriter();
- writer.print("<html>");
-
- // Render the head contributions
- writer.print("<head>");
- MultiValuedPropertyMap<Element> markupHeaders =
properties.getMarkupHeaders();
- List<Element> headElement =
markupHeaders.getValues("javax.portlet.markup.head.element");
- if (headElement != null)
- {
- for (Element headerValue : headElement)
- {
- try
- {
- String serializedElement = XMLTools.toString(headerValue);
- writer.print(serializedElement);
- }
- catch (Exception e)
- {
- // todo
- e.printStackTrace();
- }
- }
- }
- writer.print("</head>");
-
-
- writer.print("<body>");
- for (FragmentResponse fragment : fragments)
- {
- writer.print(fragmentRenderer.renderPortlet(fragment));
-
- }
-
- for (ErrorResponse error : errors)
- {
- writer.print(fragmentRenderer.renderError(error));
- }
-
- writer.print("</body></html>");
- }
-
- protected void prepareRendering(PortletControllerContext context)
- {
-
- // What we collect during the different renders
- // we don't reuse the render properties argument since we want to avoid that
- // a portlet rendition affects another rendition of a portlet on the same page
- ResponseProperties renderProperties = new ResponseProperties();
-
- //
- try
- {
- Collection<Portlet> portlets =
((PortletControllerContextImpl)context).getPortlets();
-
- int capacity = portlets.size();
- fragments = new ArrayList<FragmentResponse>(capacity);
- errors = new ArrayList<ErrorResponse>(capacity);
-
- for (Portlet portlet : portlets)
- {
- WindowNavigationalState windowNS =
pageState.getWindowNavigationalState(portlet.getContext().getId());
-
- //
- Mode mode = Mode.VIEW;
- WindowState windowState = WindowState.NORMAL;
- StateString portletNS = null;
-
- //
- if (windowNS != null)
- {
- if (windowNS.getMode() != null)
- {
- mode = windowNS.getMode();
- }
- if (windowNS.getWindowState() != null)
- {
- windowState = windowNS.getWindowState();
- }
- if (windowNS.getPortletNavigationalState() != null)
- {
- portletNS = windowNS.getPortletNavigationalState();
- }
- }
-
- //
- ParameterMap publicNS =
pageState.getPublicNavigationalState(portlet.getInfo());
-
- RenderInvocation render = createRenderInvocation(context, properties,
pageState, portlet, windowNS, mode, windowState, portletNS, publicNS);
-
- //
- try
- {
- PortletInvocationResponse response =
((PortletControllerContextImpl)context).invoke(render);
-
- if (response instanceof FragmentResponse)
- {
- FragmentResponse fragment = (FragmentResponse)response;
-
- //
- fragments.add(fragment);
-
- //
- ResponseProperties fragmentProperties = fragment.getProperties();
- if (fragmentProperties != null)
- {
- renderProperties.append(fragmentProperties);
- }
- }
- else if (response instanceof ErrorResponse)
- {
- ErrorResponse error = (ErrorResponse)response;
- errors.add(error);
- }
-
- }
- catch (PortletInvokerException e)
- {
- e.printStackTrace();
- }
- }
- }
- catch (PortletInvokerException e)
- {
- // todo
- e.printStackTrace();
- }
-
- // Now we combine the render properties with the page properties
- properties.append(renderProperties);
- }
-
- protected RenderInvocation createRenderInvocation(
- PortletControllerContext context, ResponseProperties pageProperties,
PageNavigationalState pageNS, Portlet portlet,
- WindowNavigationalState windowNS, Mode mode, WindowState windowState, StateString
portletNS, ParameterMap publicNS)
- {
- HttpServletRequest req = context.getClientRequest();
- HttpServletResponse resp = context.getClientResponse();
-
- //
- TestInstanceContext instanceContext = new TestInstanceContext(req,
portlet.getContext(), false);
-
- PortletInvocationContext renderContext =
context.createPortletInvocationContext(portlet.getContext().getId(), pageNS);
-
- //
- RenderInvocation render = new RenderInvocation(renderContext);
- render.setClientContext(new AbstractClientContext(req,
pageProperties.getCookies()));
- render.setServerContext(new AbstractServerContext(req, resp));
- render.setInstanceContext(instanceContext);
- render.setUserContext(new AbstractUserContext(req));
- render.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
- render.setPortalContext(new TestPortalContext());
- render.setSecurityContext(new AbstractSecurityContext(req));
- render.setTarget(instanceContext.getTarget());
- render.setMode(mode);
- render.setWindowState(windowState);
- render.setNavigationalState(portletNS);
- render.setPublicNavigationalState(publicNS);
- return render;
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageRenderer.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,246 @@
+/******************************************************************************
+ * 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.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.xml.XMLTools;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
+import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
+import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
+import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
+import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
+import org.jboss.portal.portlet.impl.spi.AbstractWindowContext;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
+import org.jboss.portal.portlet.controller.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.PortletControllerContext;
+import org.w3c.dom.Element;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 9748 $
+ */
+public class PageRenderer extends AbstractMarkupRenderer
+{
+
+ private FragmentRenderer fragmentRenderer = new SimpleFragmentRenderer();
+ private List<FragmentResponse> fragments;
+ private List<ErrorResponse> errors;
+ private PageNavigationalState pageState;
+
+ public PageRenderer(ResponseProperties properties, PageNavigationalState pageState)
+ {
+ super(properties);
+
+ //
+ this.pageState = pageState;
+ }
+
+ public void setFragmentRenderer(FragmentRenderer fragmentRenderer)
+ {
+ this.fragmentRenderer = fragmentRenderer;
+ }
+
+ protected void renderContent(HttpServletResponse resp) throws IOException
+ {
+ //
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+ writer.print("<html>");
+
+ // Render the head contributions
+ writer.print("<head>");
+ MultiValuedPropertyMap<Element> markupHeaders =
properties.getMarkupHeaders();
+ List<Element> headElement =
markupHeaders.getValues("javax.portlet.markup.head.element");
+ if (headElement != null)
+ {
+ for (Element headerValue : headElement)
+ {
+ try
+ {
+ String serializedElement = XMLTools.toString(headerValue);
+ writer.print(serializedElement);
+ }
+ catch (Exception e)
+ {
+ // todo
+ e.printStackTrace();
+ }
+ }
+ }
+ writer.print("</head>");
+
+
+ writer.print("<body>");
+ for (FragmentResponse fragment : fragments)
+ {
+ writer.print(fragmentRenderer.renderPortlet(fragment));
+
+ }
+
+ for (ErrorResponse error : errors)
+ {
+ writer.print(fragmentRenderer.renderError(error));
+ }
+
+ writer.print("</body></html>");
+ }
+
+ protected void prepareRendering(PortletControllerContext context)
+ {
+
+ // What we collect during the different renders
+ // we don't reuse the render properties argument since we want to avoid that
+ // a portlet rendition affects another rendition of a portlet on the same page
+ ResponseProperties renderProperties = new ResponseProperties();
+
+ //
+ try
+ {
+ Collection<Portlet> portlets =
((PortletControllerContextImpl)context).getPortlets();
+
+ int capacity = portlets.size();
+ fragments = new ArrayList<FragmentResponse>(capacity);
+ errors = new ArrayList<ErrorResponse>(capacity);
+
+ for (Portlet portlet : portlets)
+ {
+ WindowNavigationalState windowNS =
pageState.getWindowNavigationalState(portlet.getContext().getId());
+
+ //
+ Mode mode = Mode.VIEW;
+ WindowState windowState = WindowState.NORMAL;
+ StateString portletNS = null;
+
+ //
+ if (windowNS != null)
+ {
+ if (windowNS.getMode() != null)
+ {
+ mode = windowNS.getMode();
+ }
+ if (windowNS.getWindowState() != null)
+ {
+ windowState = windowNS.getWindowState();
+ }
+ if (windowNS.getPortletNavigationalState() != null)
+ {
+ portletNS = windowNS.getPortletNavigationalState();
+ }
+ }
+
+ //
+ ParameterMap publicNS =
pageState.getPublicNavigationalState(portlet.getInfo());
+
+ RenderInvocation render = createRenderInvocation(context, properties,
pageState, portlet, windowNS, mode, windowState, portletNS, publicNS);
+
+ //
+ try
+ {
+ PortletInvocationResponse response =
((PortletControllerContextImpl)context).invoke(render);
+
+ if (response instanceof FragmentResponse)
+ {
+ FragmentResponse fragment = (FragmentResponse)response;
+
+ //
+ fragments.add(fragment);
+
+ //
+ ResponseProperties fragmentProperties = fragment.getProperties();
+ if (fragmentProperties != null)
+ {
+ renderProperties.append(fragmentProperties);
+ }
+ }
+ else if (response instanceof ErrorResponse)
+ {
+ ErrorResponse error = (ErrorResponse)response;
+ errors.add(error);
+ }
+
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ // todo
+ e.printStackTrace();
+ }
+
+ // Now we combine the render properties with the page properties
+ properties.append(renderProperties);
+ }
+
+ protected RenderInvocation createRenderInvocation(
+ PortletControllerContext context, ResponseProperties pageProperties,
PageNavigationalState pageNS, Portlet portlet,
+ WindowNavigationalState windowNS, Mode mode, WindowState windowState, StateString
portletNS, ParameterMap publicNS)
+ {
+ HttpServletRequest req = context.getClientRequest();
+ HttpServletResponse resp = context.getClientResponse();
+
+ //
+ TestInstanceContext instanceContext = new TestInstanceContext(req,
portlet.getContext(), false);
+
+ PortletInvocationContext renderContext =
context.createPortletInvocationContext(portlet.getContext().getId(), pageNS);
+
+ //
+ RenderInvocation render = new RenderInvocation(renderContext);
+ render.setClientContext(new AbstractClientContext(req,
pageProperties.getCookies()));
+ render.setServerContext(new AbstractServerContext(req, resp));
+ render.setInstanceContext(instanceContext);
+ render.setUserContext(new AbstractUserContext(req));
+ render.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
+ render.setPortalContext(new TestPortalContext());
+ render.setSecurityContext(new AbstractSecurityContext(req));
+ render.setTarget(instanceContext.getTarget());
+ render.setMode(mode);
+ render.setWindowState(windowState);
+ render.setNavigationalState(portletNS);
+ render.setPublicNavigationalState(publicNS);
+ return render;
+ }
+}
Deleted:
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/controller2/PortletControllerContextImpl.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,382 +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.controller2;
-
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.common.util.ParameterMap;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.common.util.MediaType;
-import org.jboss.portal.portlet.ParametersStateString;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
-import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
-import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
-import org.jboss.portal.portlet.impl.spi.AbstractWindowContext;
-import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
-import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
-import org.jboss.portal.portlet.cache.CacheLevel;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.EventInvocation;
-import org.jboss.portal.portlet.invocation.ResourceInvocation;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.test.StringCodec;
-import org.jboss.portal.portlet.test.controller2.TestInstanceContext;
-import org.jboss.portal.portlet.test.controller2.TestPortalContext;
-import org.jboss.portal.portlet.test.controller2.TestPortletInvocationContext;
-import static org.jboss.portal.portlet.test.URLParameterConstants.*;
-import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
-import org.jboss.portal.portlet.test.controller.PortletControllerContext;
-import org.jboss.portal.portlet.test.controller.PageNavigationalState;
-import org.jboss.portal.portlet.test.controller.request.PortletRenderRequest;
-import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
-import
org.jboss.portal.portlet.test.controller.request.PortletScopedPortletResourceRequest;
-import
org.jboss.portal.portlet.test.controller.request.FullScopedCacheablePortletResourceRequest;
-import
org.jboss.portal.portlet.test.controller.request.PageScopedFullPortletResourceRequest;
-import org.jboss.portal.portlet.test.controller.request.PortletActionRequest;
-import org.jboss.portal.portlet.test.controller.event.EventControllerContext;
-import org.jboss.portal.portlet.test.controller.event.EventControllerContextImpl;
-import org.jboss.portal.web.Body;
-import org.jboss.portal.web.IllegalRequestException;
-import org.jboss.portal.web.WebRequest;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.Cookie;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Map;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletControllerContextImpl implements PortletControllerContext
-{
-
- /** . */
- public static final MarkupInfo MARKUP_INFO = new MarkupInfo(MediaType.HTML,
"UTF8");
-
- /** . */
- public static final int NAV_SCOPE = 0;
-
- /** . */
- public static final int SESSION_SCOPE = 1;
-
- /** . */
- private final HttpServletRequest req;
-
- /** . */
- private final HttpServletResponse resp;
-
- /** . */
- private final ServletContext servletContext;
-
- /** . */
- private final ControllerRequest request;
-
- /** . */
- private final PortletInvoker invoker;
-
- /** . */
- private final EventControllerContext eventControllerContext;
-
- public PortletControllerContextImpl(
- HttpServletRequest req,
- HttpServletResponse resp,
- ServletContext servletContext)
- throws IllegalRequestException, IOException, ClassNotFoundException
- {
- PortletInvoker invoker =
(PortletInvoker)servletContext.getAttribute("ConsumerPortletInvoker");
-
- // The nav state provided with the request
- PageNavigationalState pageState = null;
-
- // The request decoded if not null
- ControllerRequest request = null;
-
- // Process
- String pathInfo = req.getPathInfo();
- if (pathInfo != null && pathInfo.startsWith("/") &&
pathInfo.length() > 1)
- {
- // Get the target portlet
- String targetId = StringCodec.decode(pathInfo.substring(1));
-
- // Helper
- WebRequest ri = new WebRequest(req);
-
- // Unmarshall portal navigational state if it is provided
- String context = req.getParameter(PAGE_STATE);
- if (context != null)
- {
- byte[] bytes = Tools.fromHexString(context);
- pageState = PageNavigationalState.unserialize(bytes);
- }
-
- //
- Mode mode = null;
- if (req.getParameter(MODE) != null)
- {
- mode = Mode.create(req.getParameter(MODE));
- }
-
- //
- WindowState windowState = null;
- if (req.getParameter(WINDOW_STATE) != null)
- {
- windowState = WindowState.create(req.getParameter(WINDOW_STATE));
- }
-
- //
- String navigationalStateString = req.getParameter(NAVIGATIONAL_STATE);
- StateString navigationalState = null;
- if (navigationalStateString != null)
- {
- navigationalState = ParametersStateString.create(navigationalStateString);
- }
-
- //
- WindowNavigationalState windowNavigationalState = new
WindowNavigationalState(navigationalState, mode, windowState);
-
- //
- String type = req.getParameter(LIFECYCLE_TYPE);
- if (RESOURCE_LIFECYCLE.equals(type))
- {
- StateString resourceState =
ParametersStateString.create(req.getParameter(RESOURCE_STATE));
- String resourceId = req.getParameter(RESOURCE_ID);
-
- //
- ParameterMap formParameters = null;
- if (ri.getBody() instanceof Body.Form)
- {
- formParameters = ((Body.Form)ri.getBody()).getParameters();
- }
-
- //
- CacheLevel resourceCacheLevel =
CacheLevel.valueOf(req.getParameter(RESOURCE_CACHEABILITY));
-
- //
- switch (resourceCacheLevel)
- {
- case FULL:
- request = new FullScopedCacheablePortletResourceRequest(
- this,
- targetId,
- resourceId,
- resourceState,
- formParameters);
- break;
- case PORTLET:
- request = new PortletScopedPortletResourceRequest(
- this,
- targetId,
- resourceId,
- resourceState,
- formParameters,
- windowNavigationalState);
- break;
- case PAGE:
- request = new PageScopedFullPortletResourceRequest(
- this,
- targetId,
- resourceId,
- resourceState,
- formParameters,
- pageState,
- windowNavigationalState);
- break;
- }
- }
- else
- {
- if (ACTION_LIFECYCLE.equals(type))
- {
- ParameterMap formParameters = null;
- if (ri.getBody() instanceof Body.Form)
- {
- formParameters = ((Body.Form)ri.getBody()).getParameters();
- }
-
- //
- StateString interactionState =
ParametersStateString.create(req.getParameter(INTERACTION_STATE));
-
- //
- request = new PortletActionRequest(
- this,
- targetId,
- interactionState,
- formParameters,
- windowNavigationalState,
- pageState);
- }
- else
- {
- Map<String, String[]> publicNavigationalStateChanges =
(Map<String,
String[]>)IOTools.unserialize(Tools.fromHexString(req.getParameter(PUBLIC_NAVIGATIONAL_STATE_CHANGES)));
-
- //
- request = new PortletRenderRequest(
- this,
- targetId,
- windowNavigationalState,
- publicNavigationalStateChanges,
- pageState);
- }
- }
- }
-
- //
- this.request = request;
- this.req = req;
- this.resp = resp;
- this.servletContext = servletContext;
- this.invoker = invoker;
- this.eventControllerContext = new EventControllerContextImpl(invoker);
- }
-
- public ControllerRequest getRequest()
- {
- return request;
- }
-
- public ServletContext getServletContext()
- {
- return servletContext;
- }
-
- public HttpServletRequest getClientRequest()
- {
- return req;
- }
-
- public HttpServletResponse getClientResponse()
- {
- return resp;
- }
-
- public PortletInfo getPortletInfo(String windowId) throws PortletInvokerException
- {
- return _getPortlet(windowId).getInfo();
- }
-
- private Portlet _getPortlet(String windowId) throws PortletInvokerException
- {
- return invoker.getPortlet(PortletContext.createPortletContext(windowId));
- }
-
- public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
- {
- return invoker.invoke(invocation);
- }
-
- public Collection<Portlet> getPortlets() throws PortletInvokerException
- {
- return invoker.getPortlets();
- }
-
- public EventControllerContext getEventControllerContext()
- {
- return eventControllerContext;
- }
-
- public String renderURL(String windowId, PageNavigationalState pageState, ContainerURL
containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
- {
- PortletURLRenderer renderer = new PortletURLRenderer(pageState, windowId, req,
resp);
-
- //
- return renderer.renderURL(containerURL, wantSecure, wantAuthenticated, relative);
- }
-
- public PortletInvocationResponse invoke(String windowId, ActionInvocation
actionInvocation) throws PortletInvokerException
- {
-
- Portlet portlet =_getPortlet(windowId);
-
- TestInstanceContext instanceContext = new TestInstanceContext(req,
portlet.getContext(), true);
-
- actionInvocation.setClientContext(new AbstractClientContext(req));
- actionInvocation.setServerContext(new AbstractServerContext(req, resp));
- actionInvocation.setInstanceContext(instanceContext);
- actionInvocation.setUserContext(new AbstractUserContext(req));
- actionInvocation.setWindowContext(new
AbstractWindowContext(portlet.getContext().getId()));
- actionInvocation.setPortalContext(new TestPortalContext());
- actionInvocation.setSecurityContext(new AbstractSecurityContext(req));
- actionInvocation.setRequestContext(new AbstractRequestContext(req));
- actionInvocation.setTarget(instanceContext.getTarget());
-
- return invoke(actionInvocation);
- }
-
- public PortletInvocationResponse invoke(String windowId, List<Cookie>
requestCookies, EventInvocation eventInvocation) throws PortletInvokerException
- {
- Portlet portlet = _getPortlet(windowId);
-
- TestInstanceContext instanceContext = new TestInstanceContext(req,
portlet.getContext(), true);
-
- eventInvocation.setClientContext(new AbstractClientContext(req, requestCookies));
- eventInvocation.setServerContext(new AbstractServerContext(req, resp));
- eventInvocation.setInstanceContext(instanceContext);
- eventInvocation.setUserContext(new AbstractUserContext(req));
- eventInvocation.setWindowContext(new AbstractWindowContext(windowId));
- eventInvocation.setPortalContext(new TestPortalContext());
- eventInvocation.setSecurityContext(new AbstractSecurityContext(req));
- eventInvocation.setTarget(instanceContext.getTarget());
-
- return invoke(eventInvocation);
- }
-
- public PortletInvocationResponse invoke(String windowId, ResourceInvocation
resourceInvocation) throws PortletInvokerException
- {
- Portlet portlet = _getPortlet(windowId);
-
- TestInstanceContext instanceContext = new TestInstanceContext(req,
portlet.getContext(), true);
-
- resourceInvocation.setClientContext(new AbstractClientContext(req));
- resourceInvocation.setServerContext(new AbstractServerContext(req, resp));
- resourceInvocation.setInstanceContext(instanceContext);
- resourceInvocation.setUserContext(new AbstractUserContext(req));
- resourceInvocation.setWindowContext(new
AbstractWindowContext(portlet.getContext().getId()));
- resourceInvocation.setPortalContext(new TestPortalContext());
- resourceInvocation.setSecurityContext(new AbstractSecurityContext(req));
- resourceInvocation.setRequestContext(new AbstractRequestContext(req));
- resourceInvocation.setTarget(instanceContext.getTarget());
-
- return invoke(resourceInvocation);
- }
-
- public PortletInvocationContext createPortletInvocationContext(String windowId,
PageNavigationalState pageState)
- {
- return new TestPortletInvocationContext(req, resp, windowId, pageState,
MARKUP_INFO);
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java
(from rev 9777,
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/controller/PortletControllerContextImpl.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,382 @@
+/******************************************************************************
+ * 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.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.ContainerURL;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
+import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
+import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
+import org.jboss.portal.portlet.impl.spi.AbstractWindowContext;
+import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
+import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
+import org.jboss.portal.portlet.cache.CacheLevel;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.EventInvocation;
+import org.jboss.portal.portlet.invocation.ResourceInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.test.StringCodec;
+import org.jboss.portal.portlet.test.controller.TestInstanceContext;
+import org.jboss.portal.portlet.test.controller.TestPortalContext;
+import org.jboss.portal.portlet.test.controller.TestPortletInvocationContext;
+import static org.jboss.portal.portlet.test.URLParameterConstants.*;
+import org.jboss.portal.portlet.controller.WindowNavigationalState;
+import org.jboss.portal.portlet.controller.PortletControllerContext;
+import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
+import org.jboss.portal.portlet.controller.request.ControllerRequest;
+import org.jboss.portal.portlet.controller.request.PortletScopedPortletResourceRequest;
+import
org.jboss.portal.portlet.controller.request.FullScopedCacheablePortletResourceRequest;
+import org.jboss.portal.portlet.controller.request.PageScopedFullPortletResourceRequest;
+import org.jboss.portal.portlet.controller.request.PortletActionRequest;
+import org.jboss.portal.portlet.controller.event.EventControllerContext;
+import org.jboss.portal.portlet.controller.event.EventControllerContextImpl;
+import org.jboss.portal.web.Body;
+import org.jboss.portal.web.IllegalRequestException;
+import org.jboss.portal.web.WebRequest;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.Cookie;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Map;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletControllerContextImpl implements PortletControllerContext
+{
+
+ /** . */
+ public static final MarkupInfo MARKUP_INFO = new MarkupInfo(MediaType.HTML,
"UTF8");
+
+ /** . */
+ public static final int NAV_SCOPE = 0;
+
+ /** . */
+ public static final int SESSION_SCOPE = 1;
+
+ /** . */
+ private final HttpServletRequest req;
+
+ /** . */
+ private final HttpServletResponse resp;
+
+ /** . */
+ private final ServletContext servletContext;
+
+ /** . */
+ private final ControllerRequest request;
+
+ /** . */
+ private final PortletInvoker invoker;
+
+ /** . */
+ private final EventControllerContext eventControllerContext;
+
+ public PortletControllerContextImpl(
+ HttpServletRequest req,
+ HttpServletResponse resp,
+ ServletContext servletContext)
+ throws IllegalRequestException, IOException, ClassNotFoundException
+ {
+ PortletInvoker invoker =
(PortletInvoker)servletContext.getAttribute("ConsumerPortletInvoker");
+
+ // The nav state provided with the request
+ PageNavigationalState pageState = null;
+
+ // The request decoded if not null
+ ControllerRequest request = null;
+
+ // Process
+ String pathInfo = req.getPathInfo();
+ if (pathInfo != null && pathInfo.startsWith("/") &&
pathInfo.length() > 1)
+ {
+ // Get the target portlet
+ String targetId = StringCodec.decode(pathInfo.substring(1));
+
+ // Helper
+ WebRequest ri = new WebRequest(req);
+
+ // Unmarshall portal navigational state if it is provided
+ String context = req.getParameter(PAGE_STATE);
+ if (context != null)
+ {
+ byte[] bytes = Tools.fromHexString(context);
+ pageState = PageNavigationalState.unserialize(bytes);
+ }
+
+ //
+ Mode mode = null;
+ if (req.getParameter(MODE) != null)
+ {
+ mode = Mode.create(req.getParameter(MODE));
+ }
+
+ //
+ WindowState windowState = null;
+ if (req.getParameter(WINDOW_STATE) != null)
+ {
+ windowState = WindowState.create(req.getParameter(WINDOW_STATE));
+ }
+
+ //
+ String navigationalStateString = req.getParameter(NAVIGATIONAL_STATE);
+ StateString navigationalState = null;
+ if (navigationalStateString != null)
+ {
+ navigationalState = ParametersStateString.create(navigationalStateString);
+ }
+
+ //
+ WindowNavigationalState windowNavigationalState = new
WindowNavigationalState(navigationalState, mode, windowState);
+
+ //
+ String type = req.getParameter(LIFECYCLE_TYPE);
+ if (RESOURCE_LIFECYCLE.equals(type))
+ {
+ StateString resourceState =
ParametersStateString.create(req.getParameter(RESOURCE_STATE));
+ String resourceId = req.getParameter(RESOURCE_ID);
+
+ //
+ ParameterMap formParameters = null;
+ if (ri.getBody() instanceof Body.Form)
+ {
+ formParameters = ((Body.Form)ri.getBody()).getParameters();
+ }
+
+ //
+ CacheLevel resourceCacheLevel =
CacheLevel.valueOf(req.getParameter(RESOURCE_CACHEABILITY));
+
+ //
+ switch (resourceCacheLevel)
+ {
+ case FULL:
+ request = new FullScopedCacheablePortletResourceRequest(
+ this,
+ targetId,
+ resourceId,
+ resourceState,
+ formParameters);
+ break;
+ case PORTLET:
+ request = new PortletScopedPortletResourceRequest(
+ this,
+ targetId,
+ resourceId,
+ resourceState,
+ formParameters,
+ windowNavigationalState);
+ break;
+ case PAGE:
+ request = new PageScopedFullPortletResourceRequest(
+ this,
+ targetId,
+ resourceId,
+ resourceState,
+ formParameters,
+ pageState,
+ windowNavigationalState);
+ break;
+ }
+ }
+ else
+ {
+ if (ACTION_LIFECYCLE.equals(type))
+ {
+ ParameterMap formParameters = null;
+ if (ri.getBody() instanceof Body.Form)
+ {
+ formParameters = ((Body.Form)ri.getBody()).getParameters();
+ }
+
+ //
+ StateString interactionState =
ParametersStateString.create(req.getParameter(INTERACTION_STATE));
+
+ //
+ request = new PortletActionRequest(
+ this,
+ targetId,
+ interactionState,
+ formParameters,
+ windowNavigationalState,
+ pageState);
+ }
+ else
+ {
+ Map<String, String[]> publicNavigationalStateChanges =
(Map<String,
String[]>)IOTools.unserialize(Tools.fromHexString(req.getParameter(PUBLIC_NAVIGATIONAL_STATE_CHANGES)));
+
+ //
+ request = new PortletRenderRequest(
+ this,
+ targetId,
+ windowNavigationalState,
+ publicNavigationalStateChanges,
+ pageState);
+ }
+ }
+ }
+
+ //
+ this.request = request;
+ this.req = req;
+ this.resp = resp;
+ this.servletContext = servletContext;
+ this.invoker = invoker;
+ this.eventControllerContext = new EventControllerContextImpl(invoker);
+ }
+
+ public ControllerRequest getRequest()
+ {
+ return request;
+ }
+
+ public ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
+ public HttpServletRequest getClientRequest()
+ {
+ return req;
+ }
+
+ public HttpServletResponse getClientResponse()
+ {
+ return resp;
+ }
+
+ public PortletInfo getPortletInfo(String windowId) throws PortletInvokerException
+ {
+ return _getPortlet(windowId).getInfo();
+ }
+
+ private Portlet _getPortlet(String windowId) throws PortletInvokerException
+ {
+ return invoker.getPortlet(PortletContext.createPortletContext(windowId));
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
+ {
+ return invoker.invoke(invocation);
+ }
+
+ public Collection<Portlet> getPortlets() throws PortletInvokerException
+ {
+ return invoker.getPortlets();
+ }
+
+ public EventControllerContext getEventControllerContext()
+ {
+ return eventControllerContext;
+ }
+
+ public String renderURL(String windowId, PageNavigationalState pageState, ContainerURL
containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
+ {
+ PortletURLRenderer renderer = new PortletURLRenderer(pageState, windowId, req,
resp);
+
+ //
+ return renderer.renderURL(containerURL, wantSecure, wantAuthenticated, relative);
+ }
+
+ public PortletInvocationResponse invoke(String windowId, ActionInvocation
actionInvocation) throws PortletInvokerException
+ {
+
+ Portlet portlet =_getPortlet(windowId);
+
+ TestInstanceContext instanceContext = new TestInstanceContext(req,
portlet.getContext(), true);
+
+ actionInvocation.setClientContext(new AbstractClientContext(req));
+ actionInvocation.setServerContext(new AbstractServerContext(req, resp));
+ actionInvocation.setInstanceContext(instanceContext);
+ actionInvocation.setUserContext(new AbstractUserContext(req));
+ actionInvocation.setWindowContext(new
AbstractWindowContext(portlet.getContext().getId()));
+ actionInvocation.setPortalContext(new TestPortalContext());
+ actionInvocation.setSecurityContext(new AbstractSecurityContext(req));
+ actionInvocation.setRequestContext(new AbstractRequestContext(req));
+ actionInvocation.setTarget(instanceContext.getTarget());
+
+ return invoke(actionInvocation);
+ }
+
+ public PortletInvocationResponse invoke(String windowId, List<Cookie>
requestCookies, EventInvocation eventInvocation) throws PortletInvokerException
+ {
+ Portlet portlet = _getPortlet(windowId);
+
+ TestInstanceContext instanceContext = new TestInstanceContext(req,
portlet.getContext(), true);
+
+ eventInvocation.setClientContext(new AbstractClientContext(req, requestCookies));
+ eventInvocation.setServerContext(new AbstractServerContext(req, resp));
+ eventInvocation.setInstanceContext(instanceContext);
+ eventInvocation.setUserContext(new AbstractUserContext(req));
+ eventInvocation.setWindowContext(new AbstractWindowContext(windowId));
+ eventInvocation.setPortalContext(new TestPortalContext());
+ eventInvocation.setSecurityContext(new AbstractSecurityContext(req));
+ eventInvocation.setTarget(instanceContext.getTarget());
+
+ return invoke(eventInvocation);
+ }
+
+ public PortletInvocationResponse invoke(String windowId, ResourceInvocation
resourceInvocation) throws PortletInvokerException
+ {
+ Portlet portlet = _getPortlet(windowId);
+
+ TestInstanceContext instanceContext = new TestInstanceContext(req,
portlet.getContext(), true);
+
+ resourceInvocation.setClientContext(new AbstractClientContext(req));
+ resourceInvocation.setServerContext(new AbstractServerContext(req, resp));
+ resourceInvocation.setInstanceContext(instanceContext);
+ resourceInvocation.setUserContext(new AbstractUserContext(req));
+ resourceInvocation.setWindowContext(new
AbstractWindowContext(portlet.getContext().getId()));
+ resourceInvocation.setPortalContext(new TestPortalContext());
+ resourceInvocation.setSecurityContext(new AbstractSecurityContext(req));
+ resourceInvocation.setRequestContext(new AbstractRequestContext(req));
+ resourceInvocation.setTarget(instanceContext.getTarget());
+
+ return invoke(resourceInvocation);
+ }
+
+ public PortletInvocationContext createPortletInvocationContext(String windowId,
PageNavigationalState pageState)
+ {
+ return new TestPortletInvocationContext(req, resp, windowId, pageState,
MARKUP_INFO);
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletURLRenderer.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,246 +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.controller2;
-
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.common.text.CharBuffer;
-import org.jboss.portal.common.text.FastURLEncoder;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.portlet.ActionURL;
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletURL;
-import org.jboss.portal.portlet.RenderURL;
-import org.jboss.portal.portlet.ResourceURL;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.cache.CacheLevel;
-import static org.jboss.portal.portlet.test.URLParameterConstants.*;
-import org.jboss.portal.portlet.test.controller.PageNavigationalState;
-import org.jboss.portal.portlet.test.StringCodec;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletURLRenderer
-{
-
- /** . */
- final String windowId;
-
- /** . */
- final HttpServletRequest clientReq;
-
- /** . */
- final HttpServletResponse clientResp;
-
- /** . */
- final PageNavigationalState pageNS;
-
- public PortletURLRenderer(
- PageNavigationalState pageNS,
- String windowId,
- HttpServletRequest clientReq,
- HttpServletResponse clientResp)
- {
- this.pageNS = pageNS;
- this.windowId = windowId;
- this.clientReq = clientReq;
- this.clientResp = clientResp;
- }
-
- public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean
wantAuthenticated, boolean relative)
- {
- CharBuffer buffer = new CharBuffer();
- buffer.append(clientReq.getScheme());
- buffer.append("://");
- buffer.append(clientReq.getServerName());
- buffer.append(':');
- buffer.append(Integer.toString(clientReq.getServerPort()));
- buffer.append(clientReq.getContextPath());
- buffer.append('/');
- buffer.append(StringCodec.encode(windowId));
-
- //
- Map<String, String> parameters = new HashMap<String, String>();
-
- //
- String type;
- if (containerURL instanceof ActionURL)
- {
- type = ACTION_LIFECYCLE;
- }
- else if (containerURL instanceof RenderURL)
- {
- type = RENDER_LIFECYCLE;
- }
- else if (containerURL instanceof ResourceURL)
- {
- type = RESOURCE_LIFECYCLE;
- }
- else
- {
- throw new Error();
- }
- parameters.put(LIFECYCLE_TYPE, type);
-
- //
- String pageState;
- try
- {
- byte[] bytes = PageNavigationalState.serialize(pageNS);
- pageState = Tools.toHexString(bytes);
- }
- catch (IOException e)
- {
- throw new Error(e); //
- }
-
- //
- if (containerURL instanceof PortletURL)
- {
- PortletURL portletURL = (PortletURL)containerURL;
-
- if (portletURL.getMode() != null)
- {
- parameters.put(MODE, portletURL.getMode().toString());
- }
-
- //
- if (portletURL.getWindowState() != null)
- {
- parameters.put(WINDOW_STATE, portletURL.getWindowState().toString());
- }
-
- //
- parameters.put(PAGE_STATE, pageState);
-
- //
- if (containerURL instanceof ActionURL)
- {
- ActionURL actionURL = (ActionURL)containerURL;
-
- //
- if (actionURL.getNavigationalState() != null)
- {
- parameters.put(NAVIGATIONAL_STATE,
actionURL.getNavigationalState().getStringValue());
- }
-
- //
- StateString interactionState = actionURL.getInteractionState();
- parameters.put(INTERACTION_STATE, interactionState.getStringValue());
- }
- else
- {
- RenderURL renderURL = (RenderURL)containerURL;
-
- //
- try
- {
- Map<String, String[]> changes =
renderURL.getPublicNavigationalStateChanges();
- HashMap<String, String[]> serialiableChanges = new
HashMap<String, String[]>(changes);
- byte[] bytes = IOTools.serialize(serialiableChanges);
- String ns = Tools.toHexString(bytes);
- parameters.put(PUBLIC_NAVIGATIONAL_STATE_CHANGES, ns);
- }
- catch (IOException e)
- {
- throw new Error(e);
- }
-
- //
- StateString navigationalState = renderURL.getNavigationalState();
- parameters.put(NAVIGATIONAL_STATE, navigationalState.getStringValue());
- }
- }
- else
- {
- ResourceURL resourceURL = (ResourceURL)containerURL;
-
- //
- StateString resourceState = resourceURL.getResourceState();
- parameters.put(RESOURCE_STATE, resourceState.getStringValue());
-
- //
- String resourceId = resourceURL.getResourceId();
- if (resourceId != null)
- {
- parameters.put(RESOURCE_ID, resourceId);
- }
-
- //
- CacheLevel cacheability = resourceURL.getCacheability();
- parameters.put(RESOURCE_CACHEABILITY, cacheability.name());
-
- //
- if (cacheability != CacheLevel.FULL)
- {
- if (resourceURL.getNavigationalState() != null)
- {
- parameters.put(NAVIGATIONAL_STATE,
resourceURL.getNavigationalState().getStringValue());
- }
-
- //
- if (resourceURL.getMode() != null)
- {
- parameters.put(MODE, resourceURL.getMode().toString());
- }
-
- //
- if (resourceURL.getWindowState() != null)
- {
- parameters.put(WINDOW_STATE, resourceURL.getWindowState().toString());
- }
-
- if (cacheability == CacheLevel.PAGE)
- {
- parameters.put(PAGE_STATE, pageState);
- }
- }
- }
-
- //
- boolean first = true;
- for (Map.Entry<String, String> entry : parameters.entrySet())
- {
- String name = entry.getKey();
- String value = entry.getValue();
- buffer.append(first ? '?' : '&');
- buffer.append(name, FastURLEncoder.getUTF8Instance());
- buffer.append('=');
- buffer.append(value, FastURLEncoder.getUTF8Instance());
- first = false;
- }
-
- //
- String url = buffer.asString();
- return clientResp.encodeURL(url);
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletURLRenderer.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletURLRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,244 @@
+/******************************************************************************
+ * 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.common.io.IOTools;
+import org.jboss.portal.common.text.CharBuffer;
+import org.jboss.portal.common.text.FastURLEncoder;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.ActionURL;
+import org.jboss.portal.portlet.ContainerURL;
+import org.jboss.portal.portlet.PortletURL;
+import org.jboss.portal.portlet.RenderURL;
+import org.jboss.portal.portlet.ResourceURL;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.cache.CacheLevel;
+import static org.jboss.portal.portlet.test.URLParameterConstants.*;
+import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.StringCodec;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletURLRenderer
+{
+
+ /** . */
+ final String windowId;
+
+ /** . */
+ final HttpServletRequest clientReq;
+
+ /** . */
+ final HttpServletResponse clientResp;
+
+ /** . */
+ final PageNavigationalState pageNS;
+
+ public PortletURLRenderer(
+ PageNavigationalState pageNS,
+ String windowId,
+ HttpServletRequest clientReq,
+ HttpServletResponse clientResp)
+ {
+ this.pageNS = pageNS;
+ this.windowId = windowId;
+ this.clientReq = clientReq;
+ this.clientResp = clientResp;
+ }
+
+ public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean
wantAuthenticated, boolean relative)
+ {
+ CharBuffer buffer = new CharBuffer();
+ buffer.append(clientReq.getScheme());
+ buffer.append("://");
+ buffer.append(clientReq.getServerName());
+ buffer.append(':');
+ buffer.append(Integer.toString(clientReq.getServerPort()));
+ buffer.append(clientReq.getContextPath());
+ buffer.append('/');
+ buffer.append(StringCodec.encode(windowId));
+
+ //
+ Map<String, String> parameters = new HashMap<String, String>();
+
+ //
+ String type;
+ if (containerURL instanceof ActionURL)
+ {
+ type = ACTION_LIFECYCLE;
+ }
+ else if (containerURL instanceof RenderURL)
+ {
+ type = RENDER_LIFECYCLE;
+ }
+ else if (containerURL instanceof ResourceURL)
+ {
+ type = RESOURCE_LIFECYCLE;
+ }
+ else
+ {
+ throw new Error();
+ }
+ parameters.put(LIFECYCLE_TYPE, type);
+
+ //
+ String pageState;
+ try
+ {
+ byte[] bytes = PageNavigationalState.serialize(pageNS);
+ pageState = Tools.toHexString(bytes);
+ }
+ catch (IOException e)
+ {
+ throw new Error(e); //
+ }
+
+ //
+ if (containerURL instanceof PortletURL)
+ {
+ PortletURL portletURL = (PortletURL)containerURL;
+
+ if (portletURL.getMode() != null)
+ {
+ parameters.put(MODE, portletURL.getMode().toString());
+ }
+
+ //
+ if (portletURL.getWindowState() != null)
+ {
+ parameters.put(WINDOW_STATE, portletURL.getWindowState().toString());
+ }
+
+ //
+ parameters.put(PAGE_STATE, pageState);
+
+ //
+ if (containerURL instanceof ActionURL)
+ {
+ ActionURL actionURL = (ActionURL)containerURL;
+
+ //
+ if (actionURL.getNavigationalState() != null)
+ {
+ parameters.put(NAVIGATIONAL_STATE,
actionURL.getNavigationalState().getStringValue());
+ }
+
+ //
+ StateString interactionState = actionURL.getInteractionState();
+ parameters.put(INTERACTION_STATE, interactionState.getStringValue());
+ }
+ else
+ {
+ RenderURL renderURL = (RenderURL)containerURL;
+
+ //
+ try
+ {
+ Map<String, String[]> changes =
renderURL.getPublicNavigationalStateChanges();
+ HashMap<String, String[]> serialiableChanges = new
HashMap<String, String[]>(changes);
+ byte[] bytes = IOTools.serialize(serialiableChanges);
+ String ns = Tools.toHexString(bytes);
+ parameters.put(PUBLIC_NAVIGATIONAL_STATE_CHANGES, ns);
+ }
+ catch (IOException e)
+ {
+ throw new Error(e);
+ }
+
+ //
+ StateString navigationalState = renderURL.getNavigationalState();
+ parameters.put(NAVIGATIONAL_STATE, navigationalState.getStringValue());
+ }
+ }
+ else
+ {
+ ResourceURL resourceURL = (ResourceURL)containerURL;
+
+ //
+ StateString resourceState = resourceURL.getResourceState();
+ parameters.put(RESOURCE_STATE, resourceState.getStringValue());
+
+ //
+ String resourceId = resourceURL.getResourceId();
+ if (resourceId != null)
+ {
+ parameters.put(RESOURCE_ID, resourceId);
+ }
+
+ //
+ CacheLevel cacheability = resourceURL.getCacheability();
+ parameters.put(RESOURCE_CACHEABILITY, cacheability.name());
+
+ //
+ if (cacheability != CacheLevel.FULL)
+ {
+ if (resourceURL.getNavigationalState() != null)
+ {
+ parameters.put(NAVIGATIONAL_STATE,
resourceURL.getNavigationalState().getStringValue());
+ }
+
+ //
+ if (resourceURL.getMode() != null)
+ {
+ parameters.put(MODE, resourceURL.getMode().toString());
+ }
+
+ //
+ if (resourceURL.getWindowState() != null)
+ {
+ parameters.put(WINDOW_STATE, resourceURL.getWindowState().toString());
+ }
+
+ if (cacheability == CacheLevel.PAGE)
+ {
+ parameters.put(PAGE_STATE, pageState);
+ }
+ }
+ }
+
+ //
+ boolean first = true;
+ for (Map.Entry<String, String> entry : parameters.entrySet())
+ {
+ String name = entry.getKey();
+ String value = entry.getValue();
+ buffer.append(first ? '?' : '&');
+ buffer.append(name, FastURLEncoder.getUTF8Instance());
+ buffer.append('=');
+ buffer.append(value, FastURLEncoder.getUTF8Instance());
+ first = false;
+ }
+
+ //
+ String url = buffer.asString();
+ return clientResp.encodeURL(url);
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectResponseRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/RedirectResponseRenderer.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectResponseRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,49 +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.controller2;
-
-import org.jboss.portal.portlet.test.controller.PortletControllerContext;
-import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
-
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class RedirectResponseRenderer implements Renderer
-{
-
- /** . */
- private HTTPRedirectionResponse response;
-
- public RedirectResponseRenderer(HTTPRedirectionResponse response)
- {
- this.response = response;
- }
-
- public void render(PortletControllerContext context) throws IOException
- {
- context.getClientResponse().sendRedirect(response.getLocation());
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectResponseRenderer.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/RedirectResponseRenderer.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectResponseRenderer.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectResponseRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.controller.PortletControllerContext;
+import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
+
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class RedirectResponseRenderer implements Renderer
+{
+
+ /** . */
+ private HTTPRedirectionResponse response;
+
+ public RedirectResponseRenderer(HTTPRedirectionResponse response)
+ {
+ this.response = response;
+ }
+
+ public void render(PortletControllerContext context) throws IOException
+ {
+ context.getClientResponse().sendRedirect(response.getLocation());
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/Renderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/Renderer.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/Renderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,36 +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.controller2;
-
-import org.jboss.portal.portlet.test.controller.PortletControllerContext;
-
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface Renderer
-{
- void render(PortletControllerContext context) throws IOException;
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/Renderer.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/Renderer.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/Renderer.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/Renderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.portlet.controller.PortletControllerContext;
+
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface Renderer
+{
+ void render(PortletControllerContext context) throws IOException;
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRenderer.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,95 +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.controller2;
-
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.common.io.IOTools;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.ServletOutputStream;
-import java.io.IOException;
-import java.io.Writer;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ResourceRenderer extends AbstractMarkupRenderer
-{
-
- /** . */
- private FragmentResponse fragment;
-
- public ResourceRenderer(FragmentResponse response)
- {
- super(response.getProperties());
-
- //
- this.fragment = response;
- }
-
- 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();
- }
- }
- }
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRenderer.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * 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.invocation.response.FragmentResponse;
+import org.jboss.portal.common.io.IOTools;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletOutputStream;
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ResourceRenderer extends AbstractMarkupRenderer
+{
+
+ /** . */
+ private FragmentResponse fragment;
+
+ public ResourceRenderer(FragmentResponse response)
+ {
+ super(response.getProperties());
+
+ //
+ this.fragment = response;
+ }
+
+ 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();
+ }
+ }
+ }
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/SimpleFragmentRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/SimpleFragmentRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,69 +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.controller2;
-
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision: 9748 $
- */
-public class SimpleFragmentRenderer implements FragmentRenderer
-{
- public String renderPortlet(FragmentResponse fragment)
- {
-
- if (fragment.getType() != FragmentResponse.TYPE_EMPTY)
- {
- String frag;
-
- //
- if (fragment.getType() == FragmentResponse.TYPE_BYTES)
- {
- frag = fragment.getBytes().toString();
- }
- else
- {
- frag = fragment.getChars().toString();
- }
-
- StringBuilder builder = new StringBuilder(frag.length() + 50);
- builder.append("<div
class=\"portlet\">").append(frag).append("</div>");
- return builder.toString();
- }
- else
- {
- return "<div/>";
- }
- }
-
- public String renderError(ErrorResponse error)
- {
- String html = error.toHTML();
- StringBuilder builder = new StringBuilder(html + 50);
- builder.append("<div
class='error'>").append(html).append("</div>");
- return builder.toString();
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/SimpleFragmentRenderer.java
(from rev 9777,
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/controller/SimpleFragmentRenderer.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/SimpleFragmentRenderer.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 9748 $
+ */
+public class SimpleFragmentRenderer implements FragmentRenderer
+{
+ public String renderPortlet(FragmentResponse fragment)
+ {
+
+ if (fragment.getType() != FragmentResponse.TYPE_EMPTY)
+ {
+ String frag;
+
+ //
+ if (fragment.getType() == FragmentResponse.TYPE_BYTES)
+ {
+ frag = fragment.getBytes().toString();
+ }
+ else
+ {
+ frag = fragment.getChars().toString();
+ }
+
+ StringBuilder builder = new StringBuilder(frag.length() + 50);
+ builder.append("<div
class=\"portlet\">").append(frag).append("</div>");
+ return builder.toString();
+ }
+ else
+ {
+ return "<div/>";
+ }
+ }
+
+ public String renderError(ErrorResponse error)
+ {
+ String html = error.toHTML();
+ StringBuilder builder = new StringBuilder(html + 50);
+ builder.append("<div
class='error'>").append(html).append("</div>");
+ return builder.toString();
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestInstanceContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/TestInstanceContext.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestInstanceContext.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -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.controller2;
-
-import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.StateEvent;
-import org.jboss.portal.portlet.spi.InstanceContext;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestInstanceContext implements InstanceContext
-{
-
- /** . */
- private HttpServletRequest req;
-
- /** . */
- private boolean modifiable;
-
- /** . */
- private PortletContext target;
-
- /** . */
- private boolean useClone;
-
- /** . */
- private String id;
-
- public TestInstanceContext(
- HttpServletRequest req,
- PortletContext portletContext,
- boolean modifiable)
- {
- String id = portletContext.getId();
- PortletContext target = portletContext;
- boolean useClone = false;
- HttpSession session = req.getSession(false);
- if (session != null)
- {
- PortletContext clone = (PortletContext)session.getAttribute("clone." +
id);
- if (clone != null)
- {
- target = clone;
- useClone = true;
- }
- }
-
- //
- this.req = req;
- this.useClone = useClone;
- this.target = target;
- this.id = id;
- this.modifiable = modifiable;
- }
-
- public PortletContext getTarget()
- {
- return target;
- }
-
- public String getId()
- {
- return id;
- }
-
- public AccessMode getAccessMode()
- {
- return modifiable ? (useClone ? AccessMode.READ_WRITE :
AccessMode.CLONE_BEFORE_WRITE) : AccessMode.READ_ONLY;
- }
-
- public void onStateEvent(StateEvent event)
- {
- target = event.getPortletContext();
- req.getSession().setAttribute("clone." + id, target);
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestInstanceContext.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/TestInstanceContext.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestInstanceContext.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestInstanceContext.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * 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.state.AccessMode;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.StateEvent;
+import org.jboss.portal.portlet.spi.InstanceContext;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestInstanceContext implements InstanceContext
+{
+
+ /** . */
+ private HttpServletRequest req;
+
+ /** . */
+ private boolean modifiable;
+
+ /** . */
+ private PortletContext target;
+
+ /** . */
+ private boolean useClone;
+
+ /** . */
+ private String id;
+
+ public TestInstanceContext(
+ HttpServletRequest req,
+ PortletContext portletContext,
+ boolean modifiable)
+ {
+ String id = portletContext.getId();
+ PortletContext target = portletContext;
+ boolean useClone = false;
+ HttpSession session = req.getSession(false);
+ if (session != null)
+ {
+ PortletContext clone = (PortletContext)session.getAttribute("clone." +
id);
+ if (clone != null)
+ {
+ target = clone;
+ useClone = true;
+ }
+ }
+
+ //
+ this.req = req;
+ this.useClone = useClone;
+ this.target = target;
+ this.id = id;
+ this.modifiable = modifiable;
+ }
+
+ public PortletContext getTarget()
+ {
+ return target;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public AccessMode getAccessMode()
+ {
+ return modifiable ? (useClone ? AccessMode.READ_WRITE :
AccessMode.CLONE_BEFORE_WRITE) : AccessMode.READ_ONLY;
+ }
+
+ public void onStateEvent(StateEvent event)
+ {
+ target = event.getPortletContext();
+ req.getSession().setAttribute("clone." + id, target);
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortalContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/TestPortalContext.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortalContext.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,40 +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.controller2;
-
-import org.jboss.portal.portlet.impl.spi.AbstractPortalContext;
-
-import java.util.Map;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class TestPortalContext extends AbstractPortalContext
-{
- public TestPortalContext()
- {
-
super(Collections.singletonMap("javax.portlet.markup.head.element.support",
"true"));
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortalContext.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/TestPortalContext.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortalContext.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortalContext.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.impl.spi.AbstractPortalContext;
+
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class TestPortalContext extends AbstractPortalContext
+{
+ public TestPortalContext()
+ {
+
super(Collections.singletonMap("javax.portlet.markup.head.element.support",
"true"));
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/TestPortletInvocationContext.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,97 +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.controller2;
-
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.test.controller.PageNavigationalState;
-import org.jboss.portal.portlet.test.controller2.PortletURLRenderer;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
-import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestPortletInvocationContext extends AbstractPortletInvocationContext
-{
-
- /** . */
- private final PortletURLRenderer urlRenderer;
-
- /** . */
- private final String windowId;
-
- /** . */
- private final PageNavigationalState pageState;
-
- /** . */
- private final HttpServletRequest clientRequest;
-
- /** . */
- private final HttpServletResponse clientResponse;
-
- public TestPortletInvocationContext(
- HttpServletRequest clientRequest,
- HttpServletResponse clientResponse,
- String windowId,
- PageNavigationalState pageState,
- MarkupInfo markupInfo)
- {
- super(markupInfo);
-
- //
- this.clientRequest = clientRequest;
- this.clientResponse = clientResponse;
- this.windowId = windowId;
- this.pageState = pageState;
- this.urlRenderer = new PortletURLRenderer(pageState, windowId, clientRequest,
clientResponse);
-
- //
- addResolver(PortletInvocation.PRINCIPAL_SCOPE, new
PrincipalAttributeResolver(clientRequest));
- addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new
MapAttributeResolver());
- addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new
MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolver());
- }
-
- public HttpServletRequest getClientRequest() throws IllegalStateException
- {
- return clientRequest;
- }
-
- public HttpServletResponse getClientResponse() throws IllegalStateException
- {
- return clientResponse;
- }
-
- public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean
wantAuthenticated, boolean relative)
- {
- return urlRenderer.renderURL(containerURL, wantSecure, wantAuthenticated,
relative);
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/TestPortletInvocationContext.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvocationContext.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * 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.ContainerURL;
+import org.jboss.portal.portlet.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletURLRenderer;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestPortletInvocationContext extends AbstractPortletInvocationContext
+{
+
+ /** . */
+ private final PortletURLRenderer urlRenderer;
+
+ /** . */
+ private final String windowId;
+
+ /** . */
+ private final PageNavigationalState pageState;
+
+ /** . */
+ private final HttpServletRequest clientRequest;
+
+ /** . */
+ private final HttpServletResponse clientResponse;
+
+ public TestPortletInvocationContext(
+ HttpServletRequest clientRequest,
+ HttpServletResponse clientResponse,
+ String windowId,
+ PageNavigationalState pageState,
+ MarkupInfo markupInfo)
+ {
+ super(markupInfo);
+
+ //
+ this.clientRequest = clientRequest;
+ this.clientResponse = clientResponse;
+ this.windowId = windowId;
+ this.pageState = pageState;
+ this.urlRenderer = new PortletURLRenderer(pageState, windowId, clientRequest,
clientResponse);
+
+ //
+ addResolver(PortletInvocation.PRINCIPAL_SCOPE, new
PrincipalAttributeResolver(clientRequest));
+ addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
+ addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new
MapAttributeResolver());
+ addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new
MapAttributeResolver());
+ addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolver());
+ }
+
+ public HttpServletRequest getClientRequest() throws IllegalStateException
+ {
+ return clientRequest;
+ }
+
+ public HttpServletResponse getClientResponse() throws IllegalStateException
+ {
+ return clientResponse;
+ }
+
+ public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean
wantAuthenticated, boolean relative)
+ {
+ return urlRenderer.renderURL(containerURL, wantSecure, wantAuthenticated,
relative);
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/TestPortletInvoker.java 2008-02-05
15:13:09 UTC (rev 9775)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -1,158 +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.controller2;
-
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.state.PropertyMap;
-import org.jboss.portal.portlet.state.PropertyChange;
-import org.jboss.portal.portlet.state.DestroyCloneFailure;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.common.invocation.InterceptorStackFactory;
-import org.jboss.portal.common.invocation.InvocationHandler;
-import org.jboss.portal.common.invocation.Invocation;
-import org.jboss.portal.common.invocation.InvocationException;
-
-import java.util.Set;
-import java.util.List;
-
-/**
- * A simple consumer.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6712 $
- */
-public class TestPortletInvoker implements PortletInvoker
-{
-
- /** . */
- private InterceptorStackFactory stackFactory;
-
- /** . */
- private PortletInvoker producer;
-
- /** . */
- private InvocationHandler handler = new InvocationHandler()
- {
- public Object invoke(Invocation invocation) throws Exception, InvocationException
- {
- PortletInvocation portletInvocation = (PortletInvocation)invocation;
- try
- {
- portletInvocation.setHandler(null);
- return producer.invoke(portletInvocation);
- }
- finally
- {
- portletInvocation.setHandler(this);
- }
- }
- };
-
- public InterceptorStackFactory getStackFactory()
- {
- return stackFactory;
- }
-
- public void setStackFactory(InterceptorStackFactory stackFactory)
- {
- this.stackFactory = stackFactory;
- }
-
- public PortletInvoker getProducer()
- {
- return producer;
- }
-
- public void setProducer(PortletInvoker producer)
- {
- this.producer = producer;
- }
-
- public Set<Portlet> getPortlets() throws PortletInvokerException
- {
- return producer.getPortlets();
- }
-
- public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
- {
- return producer.getPortlet(portletContext);
- }
-
- public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
- {
- InvocationHandler prevHandler = invocation.getHandler();
- try
- {
- invocation.setHandler(handler);
- return
(PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
- }
- catch (Exception e)
- {
- if (e instanceof PortletInvokerException)
- {
- throw(PortletInvokerException)e;
- }
- else if (e instanceof RuntimeException)
- {
- throw(RuntimeException)e;
- }
- else
- {
- throw new PortletInvokerException(e);
- }
- }
- finally
- {
- invocation.setHandler(prevHandler);
- }
- }
-
- public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public List<DestroyCloneFailure> destroyClones(List<PortletContext>
portletContexts) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java
(from rev 9777,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/TestPortletInvoker.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -0,0 +1,158 @@
+/******************************************************************************
+ * 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.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.common.invocation.InterceptorStackFactory;
+import org.jboss.portal.common.invocation.InvocationHandler;
+import org.jboss.portal.common.invocation.Invocation;
+import org.jboss.portal.common.invocation.InvocationException;
+
+import java.util.Set;
+import java.util.List;
+
+/**
+ * A simple consumer.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6712 $
+ */
+public class TestPortletInvoker implements PortletInvoker
+{
+
+ /** . */
+ private InterceptorStackFactory stackFactory;
+
+ /** . */
+ private PortletInvoker producer;
+
+ /** . */
+ private InvocationHandler handler = new InvocationHandler()
+ {
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
+ {
+ PortletInvocation portletInvocation = (PortletInvocation)invocation;
+ try
+ {
+ portletInvocation.setHandler(null);
+ return producer.invoke(portletInvocation);
+ }
+ finally
+ {
+ portletInvocation.setHandler(this);
+ }
+ }
+ };
+
+ public InterceptorStackFactory getStackFactory()
+ {
+ return stackFactory;
+ }
+
+ public void setStackFactory(InterceptorStackFactory stackFactory)
+ {
+ this.stackFactory = stackFactory;
+ }
+
+ public PortletInvoker getProducer()
+ {
+ return producer;
+ }
+
+ public void setProducer(PortletInvoker producer)
+ {
+ this.producer = producer;
+ }
+
+ public Set<Portlet> getPortlets() throws PortletInvokerException
+ {
+ return producer.getPortlets();
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ return producer.getPortlet(portletContext);
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
+ {
+ InvocationHandler prevHandler = invocation.getHandler();
+ try
+ {
+ invocation.setHandler(handler);
+ return
(PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
+ }
+ catch (Exception e)
+ {
+ if (e instanceof PortletInvokerException)
+ {
+ throw(PortletInvokerException)e;
+ }
+ else if (e instanceof RuntimeException)
+ {
+ throw(RuntimeException)e;
+ }
+ else
+ {
+ throw new PortletInvokerException(e);
+ }
+ }
+ finally
+ {
+ invocation.setHandler(prevHandler);
+ }
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public List<DestroyCloneFailure> destroyClones(List<PortletContext>
portletContexts) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java 2008-02-05
15:38:52 UTC (rev 9777)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java 2008-02-05
15:46:21 UTC (rev 9778)
@@ -26,10 +26,10 @@
import org.jboss.portal.portlet.controller.PageNavigationalState;
import org.jboss.portal.portlet.controller.PortletController;
import org.jboss.portal.portlet.controller.response.ControllerResponse;
-import org.jboss.portal.portlet.test.controller2.Renderer;
-import org.jboss.portal.portlet.test.controller2.ControllerResponseRendererFactory;
-import org.jboss.portal.portlet.test.controller2.PortletControllerContextImpl;
-import org.jboss.portal.portlet.test.controller2.PageRenderer;
+import org.jboss.portal.portlet.test.controller.Renderer;
+import org.jboss.portal.portlet.test.controller.ControllerResponseRendererFactory;
+import org.jboss.portal.portlet.test.controller.PortletControllerContextImpl;
+import org.jboss.portal.portlet.test.controller.PageRenderer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
Modified:
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-02-05
15:38:52 UTC (rev 9777)
+++
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-02-05
15:46:21 UTC (rev 9778)
@@ -70,7 +70,7 @@
</bean>
<!-- The consumer portlet invoker -->
- <bean name="ConsumerPortletInvoker"
class="org.jboss.portal.portlet.test.controller2.TestPortletInvoker">
+ <bean name="ConsumerPortletInvoker"
class="org.jboss.portal.portlet.test.controller.TestPortletInvoker">
<property name="producer"><inject
bean="ProducerPortletInvoker"/></property>
<property name="stackFactory"><inject
bean="ConsumerStackFactory"/></property>
</bean>
Modified:
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-02-05
15:38:52 UTC (rev 9777)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-02-05
15:46:21 UTC (rev 9778)
@@ -58,7 +58,7 @@
</bean>
<!-- The consumer portlet invoker -->
- <bean name="ConsumerPortletInvoker"
class="org.jboss.portal.portlet.test.controller2.TestPortletInvoker">
+ <bean name="ConsumerPortletInvoker"
class="org.jboss.portal.portlet.test.controller.TestPortletInvoker">
<property name="producer"><inject
bean="ProducerPortletInvoker"/></property>
<property name="stackFactory"><inject
bean="ConsumerStackFactory"/></property>
</bean>