Author: julien(a)jboss.com
Date: 2007-04-05 17:05:42 -0400 (Thu, 05 Apr 2007)
New Revision: 6929
Added:
trunk/build/ide/intellij/idea60/modules/web/
trunk/build/ide/intellij/idea60/modules/web/web.iml
trunk/server/src/main/org/jboss/portal/web/
trunk/server/src/main/org/jboss/portal/web/jboss/
trunk/server/src/main/org/jboss/portal/web/jboss/JBossWebContext.java
trunk/theme/src/bin/test/theme-test-war/WEB-INF/
trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-layouts.xml
trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-renderSet.xml
trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-themes.xml
trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java
trunk/web/
trunk/web/build.bat
trunk/web/build.sh
trunk/web/build.xml
trunk/web/src/
trunk/web/src/main/
trunk/web/src/main/org/
trunk/web/src/main/org/jboss/
trunk/web/src/main/org/jboss/portal/
trunk/web/src/main/org/jboss/portal/web/
trunk/web/src/main/org/jboss/portal/web/RequestDispatchCallback.java
trunk/web/src/main/org/jboss/portal/web/ServletContextDispatcher.java
trunk/web/src/main/org/jboss/portal/web/spi/
trunk/web/src/main/org/jboss/portal/web/spi/ServletContainerContext.java
trunk/web/src/resources/
Removed:
trunk/portlet-server/src/main/org/jboss/portal/web/jboss/
trunk/portlet/src/main/org/jboss/portal/web/spi/RequestDispatchCallback.java
trunk/portlet/src/main/org/jboss/portal/web/spi/ServletContainerContext.java
trunk/theme/src/bin/test/theme-test-war/themes/renaissance/
Modified:
trunk/build/ide/intellij/idea60/modules/core/core.iml
trunk/build/ide/intellij/idea60/modules/theme/theme.iml
trunk/core/build.xml
trunk/core/src/main/org/jboss/portal/core/controller/Controller.java
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicResponseHandler.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/portlet-server/build.xml
trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml
trunk/portlet/build.xml
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
trunk/server/build.xml
trunk/server/src/main/org/jboss/portal/server/Server.java
trunk/server/src/main/org/jboss/portal/server/impl/ServerImpl.java
trunk/server/src/resources/portal-server-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml
trunk/theme/build.xml
trunk/theme/src/bin/test/theme-test-war/layouts/generic/index.jsp
trunk/theme/src/bin/test/theme-test-war/layouts/generic/maximized.jsp
trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java
trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java
trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java
trunk/theme/src/main/org/jboss/portal/theme/page/PageRendition.java
trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java
trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java
trunk/theme/src/main/org/jboss/portal/theme/tag/ThemeTagHandler.java
trunk/tools/etc/buildfragments/modules.ent
trunk/wsrp/build.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
extract the servlet container spi into a 'web' module. it will probably contains
different implementations in the future
Modified: trunk/build/ide/intellij/idea60/modules/core/core.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/core/core.iml 2007-04-05 17:49:53 UTC (rev
6928)
+++ trunk/build/ide/intellij/idea60/modules/core/core.iml 2007-04-05 21:05:42 UTC (rev
6929)
@@ -269,6 +269,7 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module" module-name="web" />
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: trunk/build/ide/intellij/idea60/modules/theme/theme.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/theme/theme.iml 2007-04-05 17:49:53 UTC (rev
6928)
+++ trunk/build/ide/intellij/idea60/modules/theme/theme.iml 2007-04-05 21:05:42 UTC (rev
6929)
@@ -96,6 +96,7 @@
</library>
</orderEntry>
<orderEntry type="module" module-name="jems" />
+ <orderEntry type="module" module-name="web" />
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Added: trunk/build/ide/intellij/idea60/modules/web/web.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/web/web.iml (rev 0)
+++ trunk/build/ide/intellij/idea60/modules/web/web.iml 2007-04-05 21:05:42 UTC (rev
6929)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../web">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../web/src/main"
isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/servlet-api.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-04-05 17:49:53 UTC (rev 6928)
+++ trunk/core/build.xml 2007-04-05 21:05:42 UTC (rev 6929)
@@ -122,6 +122,7 @@
<path id="dependentmodule.classpath">
<path refid="jboss.portal-format.classpath"/>
<path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-web.classpath"/>
<path refid="jboss.portal-server.classpath"/>
<path refid="jboss.portal-registration.classpath"/>
<path refid="jboss.portal-portlet.classpath"/>
@@ -319,6 +320,7 @@
<fileset dir="${build.lib}"
includes="jboss-portlet-api-lib.jar"/>
<fileset dir="${jboss.portal-format.root}/lib"
includes="portal-format-lib.jar"/>
<fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
+ <fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${jboss.portal-bridge.root}/lib"
includes="portal-bridge-lib.jar"/>
<fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-lib.jar"/>
<fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-lib.jar"/>
Modified: trunk/core/src/main/org/jboss/portal/core/controller/Controller.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/Controller.java 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/core/src/main/org/jboss/portal/core/controller/Controller.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -37,6 +37,7 @@
import org.jboss.portal.server.ServerException;
import org.jboss.portal.server.ServerURL;
import org.jboss.portal.server.request.URLContext;
+import org.jboss.portal.web.spi.ServletContainerContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -81,6 +82,9 @@
/** . */
protected ResponseHandler responseHandler;
+ /** . */
+ protected ServletContainerContext servletContainerContext;
+
public ContentRendererRegistry getContentRendererRegistry()
{
return contentRendererRegistry;
@@ -181,6 +185,11 @@
this.responseHandler = responseHandler;
}
+ public ServletContainerContext getServletContainerContext()
+ {
+ return servletContainerContext;
+ }
+
public final void handle(ServerInvocation invocation) throws ServerException
{
// Invoke the chain that creates the initial command
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-04-05
17:49:53 UTC (rev 6928)
+++
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -52,6 +52,7 @@
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.WindowState;
import org.jboss.portal.Mode;
+import org.jboss.portal.web.ServletContextDispatcher;
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.theme.impl.render.dynamic.response.UpdatePageLocationResponse;
import org.jboss.portal.theme.impl.render.dynamic.response.UpdatePageStateResponse;
@@ -297,7 +298,8 @@
MarkupInfo markupInfo =
(MarkupInfo)invocation.getResponse().getContentInfo();
//
- RenderContext renderContext = layout.getRenderContext(markupInfo,
invocation);
+ ServletContextDispatcher dispatcher = new
ServletContextDispatcher(invocation.getServerContext().getClientRequest(),
invocation.getServerContext().getClientResponse(),
controllerContext.getController().getServletContainerContext());
+ RenderContext renderContext = layout.getRenderContext(markupInfo,
dispatcher);
// Should push region context as well
renderContext.setAttribute(DynaConstants.AJAX_WINDOW_ENABLED,
Boolean.TRUE);
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicResponseHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicResponseHandler.java 2007-04-05
17:49:53 UTC (rev 6928)
+++
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicResponseHandler.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -43,6 +43,8 @@
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectResponseHandler;
import org.jboss.portal.core.model.portal.command.RenderPageCommand;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.common.util.MarkupInfo;
import javax.servlet.ServletException;
import java.io.IOException;
@@ -113,7 +115,9 @@
{
public void sendResponse(ServerInvocationContext ctx) throws IOException,
ServletException
{
- rendition.render(invocation);
+ ServletContextDispatcher dispatcher = new
ServletContextDispatcher(invocation.getServerContext().getClientRequest(),
invocation.getServerContext().getClientResponse(),
invocation.getRequest().getServer().getServletContainerContext());
+ MarkupInfo markupInfo =
(MarkupInfo)invocation.getResponse().getContentInfo();
+ rendition.render(markupInfo, dispatcher);
}
};
}
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-04-05
21:05:42 UTC (rev 6929)
@@ -1020,6 +1020,9 @@
<depends
optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ <depends
+ optional-attribute-name="ServletContainerContext"
+
proxy-type="attribute">portal:service=ServletContainerContext</depends>
</mbean>
<!-- -->
Modified: trunk/portlet/build.xml
===================================================================
--- trunk/portlet/build.xml 2007-04-05 17:49:53 UTC (rev 6928)
+++ trunk/portlet/build.xml 2007-04-05 21:05:42 UTC (rev 6929)
@@ -108,6 +108,7 @@
<call target="configure-modules"/>
<path id="dependentmodule.classpath">
<path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-web.classpath"/>
<path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-test.classpath"/>
</path>
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-04-05
17:49:53 UTC (rev 6928)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -27,7 +27,7 @@
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.web.spi.ServletContainerContext;
-import org.jboss.portal.web.spi.RequestDispatchCallback;
+import org.jboss.portal.web.RequestDispatchCallback;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -73,7 +73,7 @@
private static final RequestDispatchCallback callback = new RequestDispatchCallback()
{
- public Object doCallback(HttpServletRequest req, HttpServletResponse resp, Object
handback) throws Exception
+ public Object doCallback(ServletContext dispatchedServletContext,
HttpServletRequest req, HttpServletResponse resp, Object handback) throws Exception
{
PortletInvocation invocation = (PortletInvocation)handback;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java 2007-04-05
17:49:53 UTC (rev 6928)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -24,7 +24,7 @@
import org.jboss.portal.portlet.spi.RequestContext;
import org.jboss.portal.web.spi.ServletContainerContext;
-import org.jboss.portal.web.spi.RequestDispatchCallback;
+import org.jboss.portal.web.RequestDispatchCallback;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -78,6 +78,6 @@
public Object dispatch(ServletContainerContext scc, ServletContext targetCtx,
RequestDispatchCallback callback, Object handback) throws Exception
{
- return scc.dispatch(req, resp, targetCtx, callback, handback);
+ return scc.include(targetCtx, req, resp, callback, handback);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -23,10 +23,8 @@
package org.jboss.portal.portlet.spi;
import org.jboss.portal.web.spi.ServletContainerContext;
-import org.jboss.portal.web.spi.RequestDispatchCallback;
+import org.jboss.portal.web.RequestDispatchCallback;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletContext;
/**
Deleted: trunk/portlet/src/main/org/jboss/portal/web/spi/RequestDispatchCallback.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/web/spi/RequestDispatchCallback.java 2007-04-05
17:49:53 UTC (rev 6928)
+++
trunk/portlet/src/main/org/jboss/portal/web/spi/RequestDispatchCallback.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -1,46 +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.web.spi;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Callback contract.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface RequestDispatchCallback
-{
- /**
- * Called by the runtime context when request dispatching has been done.
- *
- * @param dispatchedRequest the dispatched request
- * @param dispatchedResponse the dispatched response
- * @param handback the handback object provided to the dispatched
- * @return any object
- * @throws Exception any exception
- */
- Object doCallback(HttpServletRequest dispatchedRequest, HttpServletResponse
dispatchedResponse, Object handback) throws Exception;
-}
Deleted: trunk/portlet/src/main/org/jboss/portal/web/spi/ServletContainerContext.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/web/spi/ServletContainerContext.java 2007-04-05
17:49:53 UTC (rev 6928)
+++
trunk/portlet/src/main/org/jboss/portal/web/spi/ServletContainerContext.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -1,54 +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.web.spi;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.ServletContext;
-
-/**
- * Defines the service provider interface that a servlet container offers.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface ServletContainerContext
-{
- /**
- * Generic detyped request dispatch to a servlet context.
- *
- * @param request the request valid in the current servlet context
- * @param response the response valid in the current servlet context
- * @param targetServletContext the target servlet context to dispatch to
- * @param callback the callback to perform after the dispatch operation
- * @param handback the handback object to provide
- * @return any object
- * @throws Exception any exception
- */
- Object dispatch(
- HttpServletRequest request,
- HttpServletResponse response,
- ServletContext targetServletContext,
- RequestDispatchCallback callback,
- Object handback) throws Exception;
-}
Modified: trunk/portlet-server/build.xml
===================================================================
--- trunk/portlet-server/build.xml 2007-04-05 17:49:53 UTC (rev 6928)
+++ trunk/portlet-server/build.xml 2007-04-05 21:05:42 UTC (rev 6929)
@@ -108,6 +108,7 @@
<call target="configure-modules"/>
<path id="dependentmodule.classpath">
<path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-web.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-security.classpath"/>
<path refid="jboss.portal-server.classpath"/>
@@ -203,8 +204,10 @@
<fileset dir="${jboss.portal-security.root}/lib"
includes="portal-security-lib.jar"/>
<fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-lib.jar"/>
<fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-test-framework-lib.jar"/>
+ <fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${jboss.portlet-api.root}/lib"
includes="portlet-api-lib.jar"/>
<fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
+ <fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${junit.junit.lib}"
includes="junit.jar"/>
<fileset dir="${build.lib}"
includes="portal-portlet-server-lib.jar"/>
<fileset dir="${build.lib}" includes="test.war"/>
@@ -228,6 +231,7 @@
<fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-test-framework-lib.jar"/>
<fileset dir="${jboss.portal-portlet.root}/lib"
includes="test-info.jar"/>
<fileset dir="${jboss.portal-portlet.root}/lib"
includes="test-info.war"/>
+ <fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${jboss.portal-server.lib}"
includes="test-agent.war"/>
<fileset dir="${build.lib}"
includes="portal-portlet-server-lib.jar"/>
<fileset dir="${build.resources}/test/info/test-info-sar"/>
Modified: trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml 2007-04-05
21:05:42 UTC (rev 6929)
@@ -54,15 +54,6 @@
<depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
</mbean>
- <!-- Runtime context for running portlet container -->
- <mbean
- code="org.jboss.portal.web.jboss.JBossWebContext"
- name="portal:service=ServletContainerContext"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
-
<!-- Server stack -->
<mbean
code="org.jboss.portal.server.aspects.server.LocaleInterceptor"
@@ -339,6 +330,15 @@
<attribute name="ConfigLocation">conf/config.xml</attribute>
</mbean>
+ <!-- Runtime context for running portlet container -->
+ <mbean
+ code="org.jboss.portal.web.jboss.JBossWebContext"
+ name="portal:service=ServletContainerContext"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
<!-- Server -->
<mbean
code="org.jboss.portal.server.impl.ServerImpl"
@@ -347,6 +347,7 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ <depends optional-attribute-name="ServletContainerContext"
proxy-type="attribute">portal:service=ServletContainerContext</depends>
</mbean>
<!-- Server deployer -->
Modified: trunk/server/build.xml
===================================================================
--- trunk/server/build.xml 2007-04-05 17:49:53 UTC (rev 6928)
+++ trunk/server/build.xml 2007-04-05 21:05:42 UTC (rev 6929)
@@ -113,6 +113,7 @@
<call target="configure-modules"/>
<path id="dependentmodule.classpath">
<path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-web.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-test.classpath"/>
</path>
@@ -197,6 +198,7 @@
<fileset dir="${jboss.portal-test.root}/lib"
includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib"
includes="portal-jems-lib.jar"/>
+ <fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${build.lib}"
includes="test-agent.war"/>
<fileset dir="${build.lib}"
includes="portal-server-lib.jar"/>
<fileset dir="${build.lib}"
includes="portal-server-test-lib.jar"/>
@@ -217,6 +219,7 @@
<fileset dir="${junit.junit.lib}"
includes="junit.jar"/>
<fileset dir="${jboss.portal-test.root}/lib"
includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
+ <fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib"
includes="portal-jems-lib.jar"/>
<fileset dir="${build.lib}"
includes="test-agent.war"/>
<fileset dir="${build.lib}"
includes="portal-server-lib.jar"/>
@@ -232,6 +235,7 @@
<fileset dir="${junit.junit.lib}"
includes="junit.jar"/>
<fileset dir="${jboss.portal-test.root}/lib"
includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
+ <fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib"
includes="portal-jems-lib.jar"/>
<fileset dir="${build.lib}"
includes="test-agent.war"/>
<fileset dir="${build.lib}"
includes="portal-server-lib.jar"/>
@@ -245,6 +249,7 @@
<fileset dir="${jboss.portal-test.root}/lib"
includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib"
includes="portal-jems-lib.jar"/>
+ <fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${build.lib}"
includes="test-agent.war"/>
<fileset dir="${build.lib}"
includes="portal-server-lib.jar"/>
<fileset dir="${build.lib}"
includes="portal-server-test-lib.jar"/>
Modified: trunk/server/src/main/org/jboss/portal/server/Server.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/Server.java 2007-04-05 17:49:53 UTC (rev
6928)
+++ trunk/server/src/main/org/jboss/portal/server/Server.java 2007-04-05 21:05:42 UTC (rev
6929)
@@ -24,6 +24,7 @@
import org.jboss.portal.common.util.Version;
import org.jboss.portal.server.config.ServerConfig;
+import org.jboss.portal.web.spi.ServletContainerContext;
/**
* The portal server.
@@ -33,9 +34,24 @@
*/
public interface Server
{
- /** Return the config of this server. */
+ /**
+ * Returns the config of this server.
+ *
+ * @return the config
+ **/
ServerConfig getConfig();
- /** Return the server version. */
+ /**
+ * Return the server version.
+ *
+ * @return the version
+ */
Version getVersion();
+
+ /**
+ * Returns the servlet container context of the server.
+ *
+ * @return the servlet container context
+ */
+ ServletContainerContext getServletContainerContext();
}
Modified: trunk/server/src/main/org/jboss/portal/server/impl/ServerImpl.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/impl/ServerImpl.java 2007-04-05 17:49:53
UTC (rev 6928)
+++ trunk/server/src/main/org/jboss/portal/server/impl/ServerImpl.java 2007-04-05 21:05:42
UTC (rev 6929)
@@ -26,6 +26,7 @@
import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.Server;
import org.jboss.portal.server.config.ServerConfig;
+import org.jboss.portal.web.spi.ServletContainerContext;
/**
* Should bootstrap the microcontainer in the (near) future.
@@ -35,9 +36,13 @@
*/
public class ServerImpl implements Server
{
+
/** The global server config. */
private ServerConfig config;
+ /** . */
+ private ServletContainerContext servletContainerContext;
+
public ServerConfig getConfig()
{
return config;
@@ -52,4 +57,14 @@
{
return PortalConstants.VERSION;
}
+
+ public ServletContainerContext getServletContainerContext()
+ {
+ return servletContainerContext;
+ }
+
+ public void setServletContainerContext(ServletContainerContext
servletContainerContext)
+ {
+ this.servletContainerContext = servletContainerContext;
+ }
}
Added: trunk/server/src/main/org/jboss/portal/web/jboss/JBossWebContext.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/web/jboss/JBossWebContext.java
(rev 0)
+++ trunk/server/src/main/org/jboss/portal/web/jboss/JBossWebContext.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -0,0 +1,144 @@
+/******************************************************************************
+ * 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.web.jboss;
+
+import org.jboss.portal.server.servlet.CommandServlet;
+import org.jboss.portal.server.servlet.ServletCommand;
+import org.jboss.portal.web.spi.ServletContainerContext;
+import org.jboss.portal.web.RequestDispatchCallback;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+
+/**
+ * JBossWeb implementation of the spi.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossWebContext implements ServletContainerContext
+{
+
+ /** . */
+ private static final ThreadLocal localResponse = new ThreadLocal();
+
+ public Object include(
+ ServletContext targetServletContext,
+ HttpServletRequest req,
+ HttpServletResponse resp,
+ RequestDispatchCallback callback,
+ Object handback) throws Exception
+ {
+ try
+ {
+ //
+ ServletCommand cmd = new InvokeNextCommand(targetServletContext, callback,
handback);
+
+ //
+ CommandServlet.include(req, resp, cmd, targetServletContext);
+
+ // Rethrow any InvocationException
+ Object response = localResponse.get();
+
+ //
+ if (response instanceof Exception)
+ {
+ throw (Exception)response;
+ }
+ else
+ {
+ return response;
+ }
+ }
+ catch (IOException e)
+ {
+ throw e;
+ }
+ catch (ServletException e)
+ {
+ // Unwrap underlying exception if any
+ Throwable t = e.getRootCause();
+
+ //
+ if (t instanceof Error)
+ {
+ // Rethrow any error
+ throw(Error)t;
+ }
+ else if (t instanceof RuntimeException)
+ {
+ throw (RuntimeException)t;
+ }
+ else if (t instanceof Exception)
+ {
+ throw (Exception)t;
+ }
+ else
+ {
+ throw e;
+ }
+ }
+ finally
+ {
+ localResponse.set(null);
+ }
+ }
+
+ public static class InvokeNextCommand implements ServletCommand
+ {
+
+ /** . */
+ private final ServletContext servletContext;
+
+ /** . */
+ private final RequestDispatchCallback invocation;
+
+ /** . */
+ private final Object handback;
+
+ public InvokeNextCommand(ServletContext servletContext, RequestDispatchCallback
invocation, Object handback)
+ {
+ this.servletContext = servletContext;
+ this.invocation = invocation;
+ this.handback = handback;
+ }
+
+ public void execute(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
+ {
+ try
+ {
+ Object response = invocation.doCallback(servletContext, req, resp,
handback);
+
+ //
+ localResponse.set(response);
+ }
+ catch (Exception e)
+ {
+ localResponse.set(e);
+ }
+ }
+ }
+}
Modified: trunk/server/src/resources/portal-server-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/portal-server-sar/META-INF/jboss-service.xml 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/server/src/resources/portal-server-sar/META-INF/jboss-service.xml 2007-04-05
21:05:42 UTC (rev 6929)
@@ -33,6 +33,15 @@
<attribute name="ConfigLocation">conf/config.xml</attribute>
</mbean>
+ <!-- Runtime context for running portlet container -->
+ <mbean
+ code="org.jboss.portal.web.jboss.JBossWebContext"
+ name="portal:service=ServletContainerContext"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
<!-- Server -->
<mbean
code="org.jboss.portal.server.impl.ServerImpl"
@@ -41,6 +50,7 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ <depends optional-attribute-name="ServletContainerContext"
proxy-type="attribute">portal:service=ServletContainerContext</depends>
</mbean>
<!-- Server deployer -->
Modified: trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml 2007-04-05
21:05:42 UTC (rev 6929)
@@ -54,6 +54,15 @@
</mbean>
+ <!-- Runtime context for running portlet container -->
+ <mbean
+ code="org.jboss.portal.web.jboss.JBossWebContext"
+ name="portal:service=ServletContainerContext"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
<!-- Server -->
<mbean
code="org.jboss.portal.server.impl.ServerImpl"
@@ -62,6 +71,7 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ <depends optional-attribute-name="ServletContainerContext"
proxy-type="attribute">portal:service=ServletContainerContext</depends>
</mbean>
<!-- Server stack -->
Modified: trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml 2007-04-05
17:49:53 UTC (rev 6928)
+++
trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml 2007-04-05
21:05:42 UTC (rev 6929)
@@ -53,6 +53,15 @@
<attribute name="ConfigLocation">conf/config.xml</attribute>
</mbean>
+ <!-- Runtime context for running portlet container -->
+ <mbean
+ code="org.jboss.portal.web.jboss.JBossWebContext"
+ name="portal:service=ServletContainerContext"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
<!-- Server -->
<mbean
code="org.jboss.portal.server.impl.ServerImpl"
@@ -61,6 +70,7 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ <depends optional-attribute-name="ServletContainerContext"
proxy-type="attribute">portal:service=ServletContainerContext</depends>
</mbean>
<!-- Server stack -->
Modified: trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml 2007-04-05
17:49:53 UTC (rev 6928)
+++
trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml 2007-04-05
21:05:42 UTC (rev 6929)
@@ -53,6 +53,15 @@
<attribute name="ConfigLocation">conf/config.xml</attribute>
</mbean>
+ <!-- Runtime context for running portlet container -->
+ <mbean
+ code="org.jboss.portal.web.jboss.JBossWebContext"
+ name="portal:service=ServletContainerContext"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
<!-- Server -->
<mbean
code="org.jboss.portal.server.impl.ServerImpl"
@@ -61,6 +70,7 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ <depends optional-attribute-name="ServletContainerContext"
proxy-type="attribute">portal:service=ServletContainerContext</depends>
</mbean>
<!-- Server stack -->
Modified: trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml 2007-04-05
21:05:42 UTC (rev 6929)
@@ -53,6 +53,15 @@
<attribute name="ConfigLocation">conf/config.xml</attribute>
</mbean>
+ <!-- Runtime context for running portlet container -->
+ <mbean
+ code="org.jboss.portal.web.jboss.JBossWebContext"
+ name="portal:service=ServletContainerContext"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
<!-- Server -->
<mbean
code="org.jboss.portal.server.impl.ServerImpl"
@@ -61,6 +70,7 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ <depends optional-attribute-name="ServletContainerContext"
proxy-type="attribute">portal:service=ServletContainerContext</depends>
</mbean>
<!-- Server stack -->
Modified: trunk/theme/build.xml
===================================================================
--- trunk/theme/build.xml 2007-04-05 17:49:53 UTC (rev 6928)
+++ trunk/theme/build.xml 2007-04-05 21:05:42 UTC (rev 6929)
@@ -109,6 +109,7 @@
<path id="dependentmodule.classpath">
<path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-web.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-server.classpath"/>
<path refid="jboss.portal-portlet.classpath"/>
Added: trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-layouts.xml
===================================================================
--- trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-layouts.xml
(rev 0)
+++ trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-layouts.xml 2007-04-05 21:05:42
UTC (rev 6929)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<layouts>
+ <layout>
+ <name>generic</name>
+ <uri>/layouts/generic/index.jsp</uri>
+ <uri state="maximized">/layouts/generic/maximized.jsp</uri>
+ <regions>
+ <region name="left"/>
+ <region name="center"/>
+ <region name="navigation"/>
+ </regions>
+ </layout>
+</layouts>
Added: trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-renderSet.xml
===================================================================
--- trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-renderSet.xml
(rev 0)
+++ trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-renderSet.xml 2007-04-05
21:05:42 UTC (rev 6929)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portal-renderSet>
+ <renderSet name="divRenderer">
+ <set content-type="text/html">
+ <ajax-enabled>true</ajax-enabled>
+
<region-renderer>org.jboss.portal.theme.impl.render.div.DivRegionRenderer</region-renderer>
+
<window-renderer>org.jboss.portal.theme.impl.render.div.DivWindowRenderer</window-renderer>
+
<portlet-renderer>org.jboss.portal.theme.impl.render.div.DivPortletRenderer</portlet-renderer>
+
<decoration-renderer>org.jboss.portal.theme.impl.render.div.DivDecorationRenderer</decoration-renderer>
+ </set>
+ </renderSet>
+ <renderSet name="emptyRenderer">
+ <set content-type="text/html">
+ <ajax-enabled>true</ajax-enabled>
+
<region-renderer>org.jboss.portal.theme.impl.render.empty.EmptyRegionRenderer</region-renderer>
+
<window-renderer>org.jboss.portal.theme.impl.render.empty.EmptyWindowRenderer</window-renderer>
+
<portlet-renderer>org.jboss.portal.theme.impl.render.empty.EmptyPortletRenderer</portlet-renderer>
+
<decoration-renderer>org.jboss.portal.theme.impl.render.empty.EmptyDecorationRenderer</decoration-renderer>
+ </set>
+ </renderSet>
+ <renderSet name="ajaxDivRenderer">
+ <set content-type="text/html">
+ <ajax-enabled>true</ajax-enabled>
+
<region-renderer>org.jboss.portal.theme.impl.render.div.DivRegionRenderer</region-renderer>
+
<window-renderer>org.jboss.portal.theme.impl.render.div.DivWindowRenderer</window-renderer>
+
<portlet-renderer>org.jboss.portal.theme.impl.render.div.DivPortletRenderer</portlet-renderer>
+
<decoration-renderer>org.jboss.portal.theme.impl.render.div.DivDecorationRenderer</decoration-renderer>
+ </set>
+ </renderSet>
+ <renderSet name="ajaxEmptyRenderer">
+ <set content-type="text/html">
+ <ajax-enabled>true</ajax-enabled>
+
<region-renderer>org.jboss.portal.theme.impl.render.empty.EmptyRegionRenderer</region-renderer>
+
<window-renderer>org.jboss.portal.theme.impl.render.empty.EmptyWindowRenderer</window-renderer>
+
<portlet-renderer>org.jboss.portal.theme.impl.render.empty.EmptyPortletRenderer</portlet-renderer>
+
<decoration-renderer>org.jboss.portal.theme.impl.render.empty.EmptyDecorationRenderer</decoration-renderer>
+ </set>
+ </renderSet>
+</portal-renderSet>
Added: trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-themes.xml
===================================================================
--- trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-themes.xml
(rev 0)
+++ trunk/theme/src/bin/test/theme-test-war/WEB-INF/portal-themes.xml 2007-04-05 21:05:42
UTC (rev 6929)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<themes>
+ <theme>
+ <name>empty</name>
+ </theme>
+</themes>
\ No newline at end of file
Modified: trunk/theme/src/bin/test/theme-test-war/layouts/generic/index.jsp
===================================================================
--- trunk/theme/src/bin/test/theme-test-war/layouts/generic/index.jsp 2007-04-05 17:49:53
UTC (rev 6928)
+++ trunk/theme/src/bin/test/theme-test-war/layouts/generic/index.jsp 2007-04-05 21:05:42
UTC (rev 6929)
@@ -1,147 +1,24 @@
-<%@ page import="org.jboss.portal.server.PortalConstants" %>
<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title><%= PortalConstants.VERSION.toString() %></title>
<meta http-equiv="Content-Type" content="text/html;"/>
- <!-- to correct the unsightly Flash of Unstyled Content. -->
- <script type="text/javascript"></script>
- <!-- inject the theme; default to the renaissance theme if nothing is selected for
the portal or the page -->
- <p:theme themeName='renaissance'/>
- <!-- insert header content that was possibly set by portlets on the page -->
- <!-- Script.aculo.us libraries -->
- <script type='text/javascript'
src='js/portal/prototype.js'></script>
- <script type='text/javascript'
src='js/portal/scriptaculous.js'></script>
- <script type='text/javascript'
src='js/portal/dragdrop.js'></script>
-
- <!-- JSUnit library -->
- <script language="JavaScript" type="text/javascript"
src="jsunit/app/jsUnitCore.js"></script>
-
- <!-- JSUnit Test Cases -->
- <script language="JavaScript" type="text/javascript">
- function setUp()
- {
- inform("setup");
- Sortable.create("regionA",
{dropOnEmpty:true,tag:'div',containment:["regionA","regionB"],constraint:false,
ghosting: false});
- Sortable.create("regionB",
{dropOnEmpty:true,tag:'div',containment:["regionA","regionB"],constraint:false,
ghosting: false});
- }
- function tearDown()
- {
- inform("teardown");
- Sortable.destroy("regionA");
- Sortable.destroy("regionB");
- }
- function testAJAXCall()
- {
- inform("testAJAXCall");
- windowID = 'WindowA_2';
- fromPos = '2';
- fromRegion = 'regionA';
- toPos = '1';
- toRegion = 'regionB';
-
- var options = {
- method: 'post',
- postBody: 'action=windowmove&windowID=' + windowID +
'&fromPos=' + fromPos + '&fromRegion=' + fromRegion +
'&toPos=' + toPos + '&toRegion=' + toRegion,
- onSuccess: function(t)
- {
- },
- onComplete: function(t)
- {
- assertEquals("AJAX Servlet response is incorrect",
'windowmove', document.getElementById("resp"));
- },
- on404: function(t)
- {
- fail("Unable to contact server for testing, 404");
- },
- onFailure: function(t)
- {
- fail("Unable to complete transaction.");
- },
- onLoading: function(t)
- {
- }
- }
-
- var url = "http://localhost:8080/test/testajax";
- new Ajax.Updater('resp', url, options);
- }
- function testSortableSwapRegions()
- {
- inform("testSortableSwapRegions");
-
- // TODO: need to hook in to scriptaculous APIs to test region-to-region window
placement.
- }
- function testSortableSequence()
- {
- inform("testSortableSequence");
-
- var a = Sortable.sequence("regionA");
- var b = Sortable.sequence("regionB");
-
- Sortable.setSequence('regionA', ['0','1','2']);
- Sortable.setSequence('regionB', ['0','1','2']);
-
- // Test regionA sequence
- assertEquals("RegionA sequence incorrect", a[0],
Sortable.sequence("regionA")[0]);
- assertEquals("RegionA sequence incorrect", a[1],
Sortable.sequence("regionA")[1]);
- assertEquals("RegionA sequence incorrect", a[2],
Sortable.sequence("regionA")[2]);
-
- // Test regionB sequence
- assertEquals("RegionB sequence incorrect", b[0],
Sortable.sequence("regionB")[0]);
- assertEquals("RegionB sequence incorrect", b[1],
Sortable.sequence("regionB")[1]);
- assertEquals("RegionB sequence incorrect", b[2],
Sortable.sequence("regionB")[2]);
-
- // Shuffle and test regionA sequence
- Sortable.setSequence('regionA', ['2','1','0']);
-
- assertEquals("RegionA sequence (post-shuffle) incorrect", a[2],
Sortable.sequence("regionA")[0]);
- assertEquals("RegionA sequence (post-shuffle) incorrect", a[1],
Sortable.sequence("regionA")[1]);
- assertEquals("RegionA sequence (post-shuffle) incorrect", a[0],
Sortable.sequence("regionA")[2]);
-
- // Shuffle and test regionB sequence
- Sortable.setSequence('regionB', ['1','0','2']);
- assertEquals("RegionB sequence (post-shuffle) incorrect", b[1],
Sortable.sequence("regionB")[0]);
- assertEquals("RegionB sequence (post-shuffle) incorrect", b[0],
Sortable.sequence("regionB")[1]);
- assertEquals("RegionB sequence (post-shuffle) incorrect", b[2],
Sortable.sequence("regionB")[2]);
- }
- </script>
+ <p:theme themeName="renaissance"/>
+ <p:headerContent/>
</head>
-
<body id="body">
+<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>
<div id="portal-container">
<div id="sizer">
<div id="expander">
- <div id="logoName"></div>
- <table border="0" cellpadding="0"
cellspacing="0" id="header-container">
- <tr>
- <td align="center" valign="top"
id="header">
-
- <!-- Utility controls -->
- <p:region regionName='UtilityNavigation'
regionID='UtilityNavigation'/>
-
- <!-- navigation tabs and such -->
- <div id="spacer"></div>
- </td>
- </tr>
- </table>
<div id="content-container">
- <!-- insert the content of the 'left' region of the page, and
assign the css selector id 'regionA' -->
<p:region regionName='left' regionID='regionA'/>
- <!-- insert the content of the 'center' region of the page, and
assign the css selector id 'regionB' -->
<p:region regionName='center' regionID='regionB'/>
- <hr class="cleaner"/>
</div>
</div>
</div>
</div>
-
-<!-- for ajax callback jsunit tests -->
-<div id="resp"></div>
-
-<script type='text/javascript'
src='js/portal/event.js'></script>
-
+<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>
</body>
</html>
Modified: trunk/theme/src/bin/test/theme-test-war/layouts/generic/maximized.jsp
===================================================================
--- trunk/theme/src/bin/test/theme-test-war/layouts/generic/maximized.jsp 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/theme/src/bin/test/theme-test-war/layouts/generic/maximized.jsp 2007-04-05
21:05:42 UTC (rev 6929)
@@ -1,42 +1,23 @@
-<%@ page import="org.jboss.portal.server.PortalConstants"%>
<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title><%= PortalConstants.VERSION.toString() %></title>
<meta http-equiv="Content-Type" content="text/html;"/>
- <!-- to correct the unsightly Flash of Unstyled Content. -->
- <script type="text/javascript"></script>
- <!-- use the Nphalanx theme if nothing else was defined for the portal or the page
-->
- <p:theme themeName='Nphalanx'/>
- <!-- inject header content that was generated by the portlets on the requested page
-->
+ <p:theme themeName="renaissance"/>
<p:headerContent/>
</head>
-
<body id="body">
-<div id="portal-container"><div id="sizer"><div
id="expander">
- <div id="logoName"></div>
- <table border="0" cellpadding="0" cellspacing="0"
id="header-container">
- <tr>
- <td align="center" valign="top"
id="header">
- <p:region regionName='navigation'
regionID='navigation'/>
- <div id="spacer"></div>
- </td>
- </tr>
- </table>
- <div id="content-container">
- <!-- Note: this construct assumes that the 'maximizedRegion' layout
strategy was chosen for the layout, page or portal -->
- <!-- the 'maximizedRegion' strategy assigns the maximized portlet to the
'maximized' region -->
- <p:region regionName='maximized'
regionID='regionMaximized'/>
- <hr class="cleaner"/>
-
- <div id="footer-container"
class="portal-copyright">Powered by
- <a class="portal-copyright"
href="http://www.jboss.com/products/jbossportal">JBoss
Portal</a><br>
- <span id="ThemeBy"></span>
+<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>
+<div id="portal-container">
+ <div id="sizer">
+ <div id="expander">
+ <div id="content-container">
+ <p:region regionName='maximized'
regionID='regionMaximized'/>
+ </div>
</div>
</div>
-
-</div></div></div>
+</div>
+<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>
</body>
</html>
Added: trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java
(rev 0)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/TestServlet.java 2007-04-05 21:05:42
UTC (rev 6929)
@@ -0,0 +1,149 @@
+/******************************************************************************
+ * 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.test.theme;
+
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.theme.ThemeService;
+import org.jboss.portal.theme.PageService;
+import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.PortalTheme;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.page.PageResult;
+import org.jboss.portal.theme.page.WindowContext;
+import org.jboss.portal.theme.page.WindowResult;
+import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
+import org.jboss.portal.theme.render.PortalRenderSet;
+import org.jboss.portal.theme.render.RenderContext;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.server.ServerRequest;
+import org.jboss.portal.test.theme.tmp.servlet.TestThemeServlet;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import java.io.IOException;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+
+/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
+
+public class TestServlet extends HttpServlet
+{
+
+ /**
+ * Generates a portal page with windows, using the theme api.
+ */
+ protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
+ {
+ try
+ {
+ proceed(request, response);
+ }
+ catch (Exception e)
+ {
+ throw new ServletException(e);
+ }
+ }
+
+ public void proceed(HttpServletRequest request, HttpServletResponse response) throws
Exception
+ {
+ MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+
+ // Get services
+ LayoutService layoutService = (LayoutService)MBeanProxy.get(LayoutService.class,
new ObjectName("portal:service=LayoutService"), mbeanServer);
+ ThemeService themeService = (ThemeService)MBeanProxy.get(ThemeService.class, new
ObjectName("portal:service=ThemeService"), mbeanServer);
+
+ PortalRenderSet renderSet = layoutService.getRenderSet("divRenderer",
MediaType.HTML);
+ PortalLayout layout = layoutService.getLayout("generic", true);
+ PortalTheme theme = themeService.getTheme("empty", true);
+
+ // Build a page structure
+ PageResult pageRenderCtx = new PageResult("test_page");
+
+ //
+ pageRenderCtx.getPageProperties().put(DynaConstants.JAVASCRIPT_BASE,
"/portal-ajax");
+ pageRenderCtx.getPageProperties().put(DynaConstants.ASYNC_SERVER_URL,
"http://localhost:8080/portal-ajax/ajax");
+
+ //
+ pageRenderCtx.getPortalProperties().put(ThemeConstants.PORTAL_PROP_THEME,
theme.getThemeInfo().getName());
+ pageRenderCtx.getPortalProperties().put(ThemeConstants.PORTAL_PROP_RENDERSET,
renderSet.getName());
+ pageRenderCtx.getPortalProperties().put(ThemeConstants.PORTAL_PROP_LAYOUT,
layout.getLayoutInfo().getName());
+ pageRenderCtx.setLayoutState(null);
+ pageRenderCtx.setLayoutURI(layout.getLayoutInfo().getURI("maximized"));
+
+ //
+ for (int i = 0; i < 2; i++)
+ {
+ WindowContext wCtx = new WindowContext("WindowA_" + i,
"WindowA_" + i, "left", i, createWindowMarkup("WindowA_" + i
+ " Title", "<p>WindowA_" + i + "
Content</p>"));
+ pageRenderCtx.addWindowContext(wCtx);
+ }
+ for (int i = 0; i < 2; i++)
+ {
+ WindowContext wCtx = new WindowContext("WindowB_" + i,
"WindowB_" + i, "center", i, createWindowMarkup("WindowB_" +
i + " Title", "<p>WindowB_" + i + "
Content</p>"));
+ pageRenderCtx.addWindowContext(wCtx);
+ }
+
+ //
+ MarkupInfo markupInfo = new MarkupInfo(MediaType.HTML, "utf-8");
+ RenderContext renderCtx = layout.getRenderContext(markupInfo, null);
+
+// //
+// ServerRequest serverRequest = new ServerRequest(null);
+//
+// // pageresult obj
+// PageResult pageResult = new PageResult(TEST_PAGE_NAME, pageProps, portalProps);
+// pageResult.setLayoutURI(layout.getLayoutInfo().getURI());
+// pageResult.setTheme(theme);
+//
+// // set the renderctx and req/res attr
+//// RenderContext renderCtx = new RenderContext(layout, markupInfo, pageResult);
+//// response.setContentType(renderCtx.getContentType().toString());
+//// response.setCharacterEncoding(renderCtx.getCharset());
+//// request.setAttribute(LayoutConstants.ATTR_RENDERCONTEXT, renderCtx);
+//// request.setAttribute(LayoutConstants.ATTR_PAGE, pageResult);
+//// request.setAttribute(ThemeConstants.ATTR_THEME, theme);
+//
+// //
+//// LayoutDispatcher dispatcher1 = new LayoutDispatcher(renderCtx, request,
response, pageResult);
+//// dispatcher1.include();
+ }
+
+ /**
+ * Generates the WindowResult for our windowcontext
+ *
+ * @param sTitle
+ * @param sContent
+ * @return window markup result
+ */
+ private WindowResult createWindowMarkup(String sTitle, String sContent)
+ {
+ return new WindowResult(sTitle, sContent, Collections.EMPTY_MAP, new HashMap(),
null, null, null, null);
+ }
+}
Modified: trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java 2007-04-05 17:49:53
UTC (rev 6928)
+++ trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java 2007-04-05 21:05:42
UTC (rev 6929)
@@ -22,13 +22,15 @@
******************************************************************************/
package org.jboss.portal.theme;
-import org.jboss.logging.Logger;
import org.jboss.portal.server.servlet.FilterCommand;
import org.jboss.portal.theme.render.RenderContext;
import org.jboss.portal.theme.render.PageRenderContext;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.web.RequestDispatchCallback;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
+import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
@@ -42,13 +44,9 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public final class LayoutDispatcher
+public final class LayoutDispatcher implements RequestDispatchCallback
{
- private static final Logger log = Logger.getLogger(LayoutDispatcher.class);
-
- private final HttpServletRequest request;
- private final HttpServletResponse response;
private final PageRenderContext markupResult;
private final RenderContext renderContext;
private final String layoutURI;
@@ -60,22 +58,12 @@
*/
public LayoutDispatcher(
RenderContext renderContext,
- HttpServletRequest request,
- HttpServletResponse response,
PageRenderContext result,
String layoutURI,
LayoutInfo layoutInfo)
throws IllegalArgumentException
{
- if (request == null)
- {
- throw new IllegalArgumentException("No null request allowed here");
- }
- if (response == null)
- {
- throw new IllegalArgumentException("No null response allowed here");
- }
if (result == null)
{
throw new IllegalArgumentException("No null response allowed here");
@@ -90,8 +78,6 @@
throw new IllegalArgumentException("No null layout allowed here");
}
- this.request = request;
- this.response = response;
this.markupResult = result;
this.renderContext = renderContext;
this.layoutURI = layoutURI;
@@ -102,25 +88,33 @@
{
try
{
+ ServletContextDispatcher dispatcher = renderContext.getDispatcher();
+ dispatcher.include(layoutInfo.getServletContext(), this, null);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public Object doCallback(ServletContext dispatchedServletContext, HttpServletRequest
dispatchedRequest, HttpServletResponse dispatchedResponse, Object handback) throws
Exception
+ {
+ try
+ {
// Set charset and content type on the response
- response.setContentType(renderContext.getContentType().toString());
- response.setCharacterEncoding(renderContext.getCharset());
+ dispatchedResponse.setContentType(renderContext.getContentType().toString());
+ dispatchedResponse.setCharacterEncoding(renderContext.getCharset());
- RequestDispatcher dispatcher =
layoutInfo.getServletContext().getRequestDispatcher(layoutURI);
+ //
+ RequestDispatcher dispatcher =
dispatchedServletContext.getRequestDispatcher(layoutURI);
- log.debug("got request dispatcher for layout resource: " + (dispatcher
!= null));
- if (dispatcher == null)
- {
- throw new IOException("No dispatcher found for : " +
layoutInfo.getName() + " [" + layoutURI + "]");
- }
-
//
- request.setAttribute(LayoutConstants.ATTR_RENDERCONTEXT, renderContext);
- request.setAttribute(FilterCommand.REQ_ATT_KEY, this);
- request.setAttribute(LayoutConstants.ATTR_PAGE, markupResult);
+ dispatchedRequest.setAttribute(LayoutConstants.ATTR_RENDERCONTEXT,
renderContext);
+ dispatchedRequest.setAttribute(FilterCommand.REQ_ATT_KEY, this);
+ dispatchedRequest.setAttribute(LayoutConstants.ATTR_PAGE, markupResult);
- // This request returns a context path which is the one of the war file in which
the target is
- HttpServletRequest wrapper = new HttpServletRequestWrapper(request)
+ //
+ HttpServletRequest requestWrapper = new
HttpServletRequestWrapper(dispatchedRequest)
{
public String getContextPath()
{
@@ -128,24 +122,16 @@
}
};
-
- dispatcher.include(wrapper, response);
-
- log.debug("done with the layout");
+ //
+ dispatcher.include(requestWrapper, dispatchedResponse);
}
finally
{
- request.removeAttribute(LayoutConstants.ATTR_PAGE);
- request.removeAttribute(LayoutConstants.ATTR_RENDERCONTEXT);
+ dispatchedRequest.removeAttribute(LayoutConstants.ATTR_PAGE);
+ dispatchedRequest.removeAttribute(LayoutConstants.ATTR_RENDERCONTEXT);
}
- }
-// private static void writeResponse(RenderContext renderCtx, HttpServletResponse
response)
-// throws IOException
-// {
-// Writer out = response.getWriter();
-// out.write(renderCtx.getMarkupFragment().toString());
-// out.flush();
-// Tools.safeClose(out);
-// }
+ //
+ return null;
+ }
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java 2007-04-05 17:49:53 UTC
(rev 6928)
+++ trunk/theme/src/main/org/jboss/portal/theme/PortalLayout.java 2007-04-05 21:05:42 UTC
(rev 6929)
@@ -26,13 +26,14 @@
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.theme.render.RenderContext;
import org.jboss.portal.theme.render.PageRenderer;
+import org.jboss.portal.web.ServletContextDispatcher;
/**
* Implementation of a <code>PortalLayout</code>. <p>An instance of
this class represents the meta data of a portal
* layout.</p>
*
* @author <a href="mailto:mholzner@novell.com">Martin
Holzner</a>.
- * @version <tt>$Revision$</tt> // * @see
org.jboss.portal.theme.LayoutService
+ * @version <tt>$Revision$</tt>
*/
public abstract class PortalLayout
{
@@ -65,5 +66,5 @@
return serviceInfo;
}
- public abstract RenderContext getRenderContext(MarkupInfo markupInfo, ServerInvocation
invocation);
+ public abstract RenderContext getRenderContext(MarkupInfo markupInfo,
ServletContextDispatcher dispatcher);
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-04-05 17:49:53
UTC (rev 6928)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-04-05 21:05:42
UTC (rev 6929)
@@ -23,7 +23,6 @@
package org.jboss.portal.theme.impl;
-import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.theme.LayoutDispatcher;
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.page.PageResult;
@@ -35,11 +34,10 @@
import org.jboss.portal.theme.render.RenderException;
import org.jboss.portal.theme.render.RendererFactory;
import org.jboss.portal.WindowState;
+import org.jboss.portal.web.ServletContextDispatcher;
import org.jboss.portal.common.util.MarkupInfo;
import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Iterator;
@@ -53,13 +51,12 @@
public final class JSPLayout extends PortalLayout implements PageRenderer
{
- public RenderContext getRenderContext(MarkupInfo markupInfo, ServerInvocation
invocation)
+ public RenderContext getRenderContext(MarkupInfo markupInfo, ServletContextDispatcher
dispatcher)
{
- //
RendererFactory factory = new RendererFactoryImpl(this, serviceInfo, info);
//
- return new RenderContext(factory, invocation, markupInfo);
+ return new RenderContext(factory, dispatcher, markupInfo);
}
public void render(RenderContext renderContext, PageRenderContext prc) throws
RenderException
@@ -119,16 +116,8 @@
try
{
- ServerInvocation invocation = renderContext.getServerInvocation();
- HttpServletRequest httpRequest =
invocation.getServerContext().getClientRequest();
- HttpServletResponse httpResponse =
invocation.getServerContext().getClientResponse();
- LayoutDispatcher dispatcher = new LayoutDispatcher(
- renderContext,
- httpRequest,
- httpResponse,
- prc,
- pageResult.getLayoutURI(),
- getLayoutInfo());
+
+ LayoutDispatcher dispatcher = new LayoutDispatcher(renderContext, prc,
pageResult.getLayoutURI(), getLayoutInfo());
dispatcher.include();
}
catch (IOException e)
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/PageRendition.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/PageRendition.java 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/PageRendition.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -22,17 +22,15 @@
******************************************************************************/
package org.jboss.portal.theme.page;
-import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.theme.PageService;
-import org.jboss.portal.theme.page.PageResult;
import org.jboss.portal.theme.render.RenderContext;
import org.jboss.portal.theme.render.RenderException;
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.web.ServletContextDispatcher;
import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
@@ -51,7 +49,10 @@
/** . */
private PageService pageService;
- public PageRendition(PortalLayout layout, PageResult markupResult, PageService
pageService)
+ public PageRendition(
+ PortalLayout layout,
+ PageResult markupResult,
+ PageService pageService)
{
this.layout = layout;
this.pageResult = markupResult;
@@ -59,31 +60,22 @@
}
/** Performs the page rendition. */
- public void render(ServerInvocation invocation) throws IOException, ServletException
+ public void render(MarkupInfo markupInfo, ServletContextDispatcher dispatcher) throws
IOException, ServletException
{
//
- HttpServletRequest clientRequest =
invocation.getServerContext().getClientRequest();
+ RenderContext renderContext = layout.getRenderContext(markupInfo, dispatcher);
-
//
-
-
try
{
-
// Place a reference to the theme service into the request so that the theme tag
can get to a theme via a theme
// name (specified as tag attribute); this is useful if no theme was defined for
the portal or the page
- clientRequest.setAttribute(ThemeConstants.ATTR_THEMESERVER,
pageService.getThemeService());
- clientRequest.setAttribute(ThemeConstants.ATTR_THEME, pageResult.getTheme());
- clientRequest.setAttribute(ThemeConstants.ATTR_THEMERESULT,
pageResult.getThemeResult());
+ renderContext.setAttribute(ThemeConstants.ATTR_THEMESERVER,
pageService.getThemeService());
+ renderContext.setAttribute(ThemeConstants.ATTR_THEME, pageResult.getTheme());
+ renderContext.setAttribute(ThemeConstants.ATTR_THEMERESULT,
pageResult.getThemeResult());
- MarkupInfo markupInfo = (MarkupInfo)invocation.getResponse().getContentInfo();
-
- RenderContext renderContext = layout.getRenderContext(markupInfo, invocation);
-
-
+ //
renderContext.render(pageResult);
-
}
catch (RenderException e)
{
@@ -91,7 +83,9 @@
}
finally
{
- clientRequest.removeAttribute(ThemeConstants.ATTR_THEMESERVER);
+ renderContext.setAttribute(ThemeConstants.ATTR_THEMESERVER, null);
+ renderContext.setAttribute(ThemeConstants.ATTR_THEME, null);
+ renderContext.setAttribute(ThemeConstants.ATTR_THEMERESULT, null);
}
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java 2007-04-05 17:49:53
UTC (rev 6928)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java 2007-04-05 21:05:42
UTC (rev 6929)
@@ -84,11 +84,16 @@
this.pageProperties = pageProperties == null ? new HashMap() : pageProperties;
this.portalProperties = portalProperties == null ? new HashMap() :
portalProperties;
- results = new HashMap(5);
- windowContexts = new HashMap(5);
- regions = new HashMap(5);
+ this.results = new HashMap(5);
+ this.windowContexts = new HashMap(5);
+ this.regions = new HashMap(5);
}
+ public PageResult(String pageName)
+ {
+ this(pageName, new HashMap(), new HashMap());
+ }
+
public ThemeResult getThemeResult()
{
return themeResult;
Modified: trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/RenderContext.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -24,7 +24,7 @@
import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.web.ServletContextDispatcher;
import java.util.ArrayList;
import java.util.Map;
@@ -42,11 +42,10 @@
{
/** . */
-// private PortalRenderSet renderSet;
private RendererFactory rendererFactory;
/** . */
- private ServerInvocation serverInvocation;
+ private ServletContextDispatcher dispatcher;
/** . */
private StringBuffer markup;
@@ -66,14 +65,14 @@
*/
public RenderContext(
RendererFactory rendererFactory,
- ServerInvocation serverInvocation,
+ ServletContextDispatcher dispatcher,
MarkupInfo markupInfo)
{
if (rendererFactory == null)
{
throw new IllegalArgumentException("no renderer factory provided");
}
- if (serverInvocation == null)
+ if (dispatcher == null)
{
throw new IllegalArgumentException("no server invocation provided");
}
@@ -83,16 +82,16 @@
}
this.rendererFactory = rendererFactory;
- this.serverInvocation = serverInvocation;
+ this.dispatcher = dispatcher;
this.markupInfo = markupInfo;
this.stack = new ArrayList(6);
this.markup = new StringBuffer();
this.attributes = new HashMap();
}
- public ServerInvocation getServerInvocation()
+ public ServletContextDispatcher getDispatcher()
{
- return serverInvocation;
+ return dispatcher;
}
public StringBuffer getMarkupFragment()
Modified: trunk/theme/src/main/org/jboss/portal/theme/tag/ThemeTagHandler.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/tag/ThemeTagHandler.java 2007-04-05
17:49:53 UTC (rev 6928)
+++ trunk/theme/src/main/org/jboss/portal/theme/tag/ThemeTagHandler.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -27,6 +27,8 @@
import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.theme.ThemeResult;
import org.jboss.portal.theme.ThemeServiceInfo;
+import org.jboss.portal.theme.LayoutConstants;
+import org.jboss.portal.theme.render.RenderContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
@@ -78,8 +80,10 @@
PageContext app = (PageContext)getJspContext();
HttpServletRequest request = (HttpServletRequest)app.getRequest();
- ThemeResult result =
(ThemeResult)request.getAttribute(ThemeConstants.ATTR_THEMERESULT);
+ RenderContext renderContext =
(RenderContext)request.getAttribute(LayoutConstants.ATTR_RENDERCONTEXT);
+ ThemeResult result =
(ThemeResult)renderContext.getAttribute(ThemeConstants.ATTR_THEMERESULT);
+
// was the result already prepared for us (in the MarkupCommand)?
if (result != null)
{
@@ -94,7 +98,7 @@
else
{
// no, then perhaps the theme was provided
- PortalTheme theme =
(PortalTheme)request.getAttribute(ThemeConstants.ATTR_THEME);
+ PortalTheme theme =
(PortalTheme)renderContext.getAttribute(ThemeConstants.ATTR_THEME);
if (theme == null && getThemeName() != null &&
!"".equals(getThemeName()))
{
// if there is no theme in the request, see if we have one via a tag
attribute
@@ -103,8 +107,9 @@
{
log.trace("requested theme not found. Is there a theme attribute in
the tag ? " + getThemeName());
}
+
// but in order to get the theme for the provided name, we need the theme
service
- ThemeServiceInfo themeServer =
(ThemeServiceInfo)request.getAttribute(ThemeConstants.ATTR_THEMESERVER);
+ ThemeServiceInfo themeServer =
(ThemeServiceInfo)renderContext.getAttribute(ThemeConstants.ATTR_THEMESERVER);
if (themeServer == null)
{
Modified: trunk/tools/etc/buildfragments/modules.ent
===================================================================
--- trunk/tools/etc/buildfragments/modules.ent 2007-04-05 17:49:53 UTC (rev 6928)
+++ trunk/tools/etc/buildfragments/modules.ent 2007-04-05 21:05:42 UTC (rev 6929)
@@ -9,6 +9,13 @@
<pathelement
path="${jboss.portal-common.lib}/portal-common-lib.jar"/>
</path>
+ <!-- web -->
+ <property name="jboss.portal-web.root"
value="${project.root}/web/output"/>
+ <property name="jboss.portal-web.lib"
value="${jboss.portal-web.root}/lib"/>
+ <path id="jboss.portal-web.classpath">
+ <pathelement path="${jboss.portal-web.lib}/portal-web-lib.jar"/>
+ </path>
+
<!-- test -->
<property name="jboss.portal-test.root"
value="${project.root}/test/output"/>
<property name="jboss.portal-test.lib"
value="${jboss.portal-test.root}/lib"/>
Added: trunk/web/build.bat
===================================================================
--- trunk/web/build.bat (rev 0)
+++ trunk/web/build.bat 2007-04-05 21:05:42 UTC (rev 6929)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 1140 2005-11-25 23:38:58Z julien $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: trunk/web/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/web/build.sh
===================================================================
--- trunk/web/build.sh (rev 0)
+++ trunk/web/build.sh 2007-04-05 21:05:42 UTC (rev 6929)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 1140 2005-11-25 23:38:58Z julien $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools'
module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: trunk/web/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/web/build.xml
===================================================================
--- trunk/web/build.xml (rev 0)
+++ trunk/web/build.xml 2007-04-05 21:05:42 UTC (rev 6929)
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM
"../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM
"../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!-- $Id: build.xml 5448 2006-10-13 19:29:17Z chris.laprun(a)jboss.com $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at
http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and
|-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable"
depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="sun.servlet.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-common.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="output"
+ description="Generate all target output."
+ depends="compile">
+ <mkdir dir="${build.lib}"/>
+
+ <!-- portal-web.jar -->
+ <jar jarfile="${build.lib}/portal-web-lib.jar">
+ <fileset dir="${build.classes}"/>
+ </jar>
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
+
+</project>
Property changes on: trunk/web/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/web/src/main/org/jboss/portal/web/RequestDispatchCallback.java
===================================================================
--- trunk/web/src/main/org/jboss/portal/web/RequestDispatchCallback.java
(rev 0)
+++ trunk/web/src/main/org/jboss/portal/web/RequestDispatchCallback.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletContext;
+
+/**
+ * Callback contract.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface RequestDispatchCallback
+{
+ /**
+ * Called by the runtime context when request dispatching has been done.
+ *
+ * @param dispatchedServletContext the dispatched servlet context
+ * @param dispatchedRequest the dispatched request
+ * @param dispatchedResponse the dispatched response
+ * @param handback the handback object provided to the dispatched @return any object
+ * @throws Exception any exception
+ */
+ Object doCallback(
+ ServletContext dispatchedServletContext,
+ HttpServletRequest dispatchedRequest,
+ HttpServletResponse dispatchedResponse,
+ Object handback) throws Exception;
+}
Added: trunk/web/src/main/org/jboss/portal/web/ServletContextDispatcher.java
===================================================================
--- trunk/web/src/main/org/jboss/portal/web/ServletContextDispatcher.java
(rev 0)
+++ trunk/web/src/main/org/jboss/portal/web/ServletContextDispatcher.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.web;
+
+import org.jboss.portal.web.spi.ServletContainerContext;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Encapsulate dispatching functionnality into a single class so it is easy to
+ * pass it as an argment to a framework that neeeds a dispatcher to just a
+ * servlet context and does not care about the underlying spi or request/response.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServletContextDispatcher
+{
+
+ /** . */
+ private final HttpServletRequest request;
+
+ /** . */
+ private final HttpServletResponse response;
+
+ /** . */
+ private final ServletContainerContext containerContext;
+
+ public ServletContextDispatcher(HttpServletRequest request, HttpServletResponse
response, ServletContainerContext containerContext)
+ {
+ this.request = request;
+ this.response = response;
+ this.containerContext = containerContext;
+ }
+
+ public Object include(
+ ServletContext targetServletContext,
+ RequestDispatchCallback callback,
+ Object handback) throws Exception
+ {
+ return containerContext.include(targetServletContext, request, response, callback,
handback);
+ }
+
+}
Added: trunk/web/src/main/org/jboss/portal/web/spi/ServletContainerContext.java
===================================================================
--- trunk/web/src/main/org/jboss/portal/web/spi/ServletContainerContext.java
(rev 0)
+++ trunk/web/src/main/org/jboss/portal/web/spi/ServletContainerContext.java 2007-04-05
21:05:42 UTC (rev 6929)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.web.spi;
+
+import org.jboss.portal.web.RequestDispatchCallback;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletContext;
+
+/**
+ * Defines the service provider interface that a servlet container offers.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ServletContainerContext
+{
+ /**
+ * Generic detyped request dispatch to a servlet context using the include mechanism.
+ *
+ * @param targetServletContext the target servlet context to dispatch to
+ * @param request the request valid in the current servlet context
+ * @param response the response valid in the current servlet context
+ * @param callback the callback to perform after the dispatch operation
+ * @param handback the handback object to provide
+ * @return any object
+ * @throws Exception any exception
+ */
+ Object include(
+ ServletContext targetServletContext, HttpServletRequest request,
+ HttpServletResponse response,
+ RequestDispatchCallback callback,
+ Object handback) throws Exception;
+}
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2007-04-05 17:49:53 UTC (rev 6928)
+++ trunk/wsrp/build.xml 2007-04-05 21:05:42 UTC (rev 6929)
@@ -475,6 +475,7 @@
includes="portal-portlet-lib.jar,
portal-portlet-test-lib.jar"/>
<fileset dir="${jboss.portal-portlet-server.root}/lib"
includes="portal-portlet-server-lib.jar"/>
+ <fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${jboss.portal-portlet-federation.root}/lib"
includes="portal-portlet-federation-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib"
includes="portal-registration-lib.jar"/>
<fileset dir="${jboss.portal-test.lib}"
includes="portal-test-lib.jar"/>
@@ -535,6 +536,7 @@
<fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-lib.jar"/>
<fileset dir="${jboss.portal-portlet-server.root}/lib"
includes="portal-portlet-server-lib.jar"/>
+ <fileset dir="${jboss.portal-web.root}/lib"
includes="portal-web-lib.jar"/>
<fileset dir="${jboss.portal-portlet-federation.root}/lib"
includes="portal-portlet-federation-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib"
includes="portal-registration-lib.jar"/>
<fileset dir="${jboss.portal-test.lib}"
includes="portal-test-lib.jar"/>
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-04-05
17:49:53 UTC (rev 6928)
+++
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-04-05
21:05:42 UTC (rev 6929)
@@ -44,15 +44,6 @@
<attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
- <!-- Runtime context for running portlet container -->
- <mbean
- code="org.jboss.portal.web.jboss.JBossWebContext"
- name="portal:service=ServletContainerContext"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
-
<!-- Webapp registry -->
<mbean
code="org.jboss.portal.portlet.impl.container.PortletApplicationRegistryImpl"