Author: sohil.shah(a)jboss.com
Date: 2008-04-01 01:51:13 -0400 (Tue, 01 Apr 2008)
New Revision: 10446
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/ClientController.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocation.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocationContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocationHandler.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/ServerException.java
modules/presentation/trunk/presentation/src/main/resources/
modules/presentation/trunk/presentation/src/main/resources/war/
modules/presentation/trunk/presentation/src/main/resources/war/WEB-INF/
modules/presentation/trunk/presentation/src/main/resources/war/WEB-INF/web.xml
Modified:
modules/presentation/trunk/
modules/presentation/trunk/.classpath
modules/presentation/trunk/build/pom.xml
modules/presentation/trunk/presentation/pom.xml
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/PresentationContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/controller/AjaxUIController.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/controller/UIController.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/PresentationContextImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/ajax/entry/PortalEntryPoint.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/Processor.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/portal/MockPortalEntryPoint.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/portal/plugin/MainProcessor.java
Log:
removing dependency on the "org.jboss.portal.server" package
Property changes on: modules/presentation/trunk
___________________________________________________________________
Name: svn:ignore
+ bin
Modified: modules/presentation/trunk/.classpath
===================================================================
--- modules/presentation/trunk/.classpath 2008-04-01 05:27:23 UTC (rev 10445)
+++ modules/presentation/trunk/.classpath 2008-04-01 05:51:13 UTC (rev 10446)
@@ -66,11 +66,11 @@
<classpathentry kind="var"
path="M2_REPO/jboss/jboss-system/4.2.0.GA/jboss-system-4.2.0.GA.jar"/>
<classpathentry kind="var"
path="M2_REPO/org/jboss/jboss-test/1.0.4.GA/jboss-test-1.0.4.GA.jar"/>
<classpathentry kind="var"
path="M2_REPO/jboss/jbossas/core-libs/jboss-transaction/4.0.4.GA/jboss-transaction-4.0.4.GA.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/jboss/unit/jboss-unit/1.2.0.Beta2/jboss-unit-1.2.0.Beta2.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/jboss/unit/jboss-unit-mc/1.2.0.Beta2/jboss-unit-mc-1.2.0.Beta2.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/jboss/unit/jboss-unit-remote/1.2.0.Beta2/jboss-unit-remote-1.2.0.Beta2.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/jboss/unit/jboss-unit-tooling-ant/1.2.0.Beta2/jboss-unit-tooling-ant-1.2.0.Beta2.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/jboss/unit/jboss-unit-tooling-core/1.2.0.Beta2/jboss-unit-tooling-core-1.2.0.Beta2.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/unit/jboss-unit/1.2.0.SNAPSHOT/jboss-unit-1.2.0.SNAPSHOT.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/unit/jboss-unit-mc/1.2.0.SNAPSHOT/jboss-unit-mc-1.2.0.SNAPSHOT.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/unit/jboss-unit-remote/1.2.0.SNAPSHOT/jboss-unit-remote-1.2.0.SNAPSHOT.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/unit/jboss-unit-tooling-ant/1.2.0.SNAPSHOT/jboss-unit-tooling-ant-1.2.0.SNAPSHOT.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/unit/jboss-unit-tooling-core/1.2.0.SNAPSHOT/jboss-unit-tooling-core-1.2.0.SNAPSHOT.jar"/>
<classpathentry kind="var"
path="M2_REPO/org/jboss/jboss-vfs/2.0.0.Beta6/jboss-vfs-2.0.0.Beta6.jar"/>
<classpathentry kind="var"
path="M2_REPO/org/jboss/jbossxb/2.0.0.CR4/jbossxb-2.0.0.CR4.jar"/>
<classpathentry kind="var"
path="M2_REPO/jboss/jbossas/core-libs/jnpserver/4.0.4.GA/jnpserver-4.0.4.GA.jar"/>
@@ -101,5 +101,6 @@
<classpathentry kind="var"
path="M2_REPO/apache-xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
<classpathentry kind="var"
path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
<classpathentry kind="var"
path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/httpunit/httpunit/1.6/httpunit-1.6.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
Modified: modules/presentation/trunk/build/pom.xml
===================================================================
--- modules/presentation/trunk/build/pom.xml 2008-04-01 05:27:23 UTC (rev 10445)
+++ modules/presentation/trunk/build/pom.xml 2008-04-01 05:51:13 UTC (rev 10446)
@@ -35,11 +35,10 @@
<version.jboss.portal.common>1.2.0.Beta2</version.jboss.portal.common>
<version.jboss.portal.portlet>2.0.0.CR1</version.jboss.portal.portlet>
<version.jboss.portal.web>1.2.0.Beta2</version.jboss.portal.web>
- <version.jboss.unit>1.2.0.Beta2</version.jboss.unit>
+ <version.jboss.unit>1.2.0.SNAPSHOT</version.jboss.unit>
<!--
TODO: figure out how to handle this dependency since they are not mavenized yet
- <version.jboss.portal.server>1.0.1</version.jboss.portal.server>
<version.jboss.portal.jems>1.0.1</version.jboss.portal.jems>
-->
Modified: modules/presentation/trunk/presentation/pom.xml
===================================================================
--- modules/presentation/trunk/presentation/pom.xml 2008-04-01 05:27:23 UTC (rev 10445)
+++ modules/presentation/trunk/presentation/pom.xml 2008-04-01 05:51:13 UTC (rev 10446)
@@ -13,21 +13,26 @@
<dependencies>
<dependency>
- <groupId>sun-servlet</groupId>
- <artifactId>servlet-api</artifactId>
+ <groupId>sun-servlet</groupId>
+ <artifactId>servlet-api</artifactId>
</dependency>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>httpunit</groupId>
+ <artifactId>httpunit</artifactId>
+ </dependency>
<dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-user</artifactId>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
</dependency>
- <dependency>
+ <dependency>
<groupId>net.mygwt</groupId>
<artifactId>mygwt</artifactId>
</dependency>
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/PresentationContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/PresentationContext.java 2008-04-01
05:27:23 UTC (rev 10445)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/PresentationContext.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -25,7 +25,6 @@
import org.jboss.portal.presentation.protocol.ServerAction;
import org.jboss.portal.presentation.ajax.client.model.AjaxUIContext;
import org.jboss.portal.presentation.model.UIContext;
-import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.web.ServletContextDispatcher;
/**
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/controller/AjaxUIController.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/controller/AjaxUIController.java 2008-04-01
05:27:23 UTC (rev 10445)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/controller/AjaxUIController.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -35,12 +35,12 @@
import org.jboss.portal.presentation.server.PresentationServer;
import org.jboss.portal.presentation.server.ProcessorRequest;
import org.jboss.portal.presentation.server.ProcessorResponse;
+import org.jboss.portal.presentation.server.ServerException;
+import org.jboss.portal.presentation.invocation.PresentationInvocation;
+import org.jboss.portal.presentation.invocation.ClientController;
import org.jboss.portal.presentation.ajax.client.model.AjaxUIContext;
import org.jboss.portal.presentation.ajax.client.model.AjaxUIPage;
import org.jboss.portal.presentation.ajax.client.model.AjaxUIWindow;
-import org.jboss.portal.server.RequestController;
-import org.jboss.portal.server.ServerException;
-import org.jboss.portal.server.ServerInvocation;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -56,7 +56,7 @@
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
*/
-public class AjaxUIController implements RequestController
+public class AjaxUIController implements ClientController
{
/** . */
@@ -72,11 +72,11 @@
* handle is the entry point for handling an incoming Portal request. The request is
handed over
* from the Http Layer via the main Portal Servlet
*/
- public void handle(ServerInvocation invocation) throws ServerException
+ public void handle(PresentationInvocation invocation) throws ServerException
{
try
{
- HttpServletRequest request = invocation.getServerContext().getClientRequest();
+ HttpServletRequest request = invocation.getRequest();
/**
* TODO: decouple the implementation via factory pattern
@@ -109,11 +109,11 @@
* @param serverResponse
* @throws ServerException
*/
- private void handle(PresentationContext presentationContext, ServerResponse
serverResponse, ServerInvocation invocation) throws ServerException
+ private void handle(PresentationContext presentationContext, ServerResponse
serverResponse, PresentationInvocation invocation) throws ServerException
{
try
{
- HttpServletResponse response =
invocation.getServerContext().getClientResponse();
+ HttpServletResponse response = invocation.getResponse();
if(serverResponse instanceof ShowUIObjectResponse)
{
ShowUIObjectResponse show = (ShowUIObjectResponse)serverResponse;
@@ -132,7 +132,7 @@
* @param presentationContext
* @param targetId
*/
- private void render(ServerInvocation invocation,PresentationContext
presentationContext, String targetId)
+ private void render(PresentationInvocation invocation,PresentationContext
presentationContext, String targetId)
{
UIObject uiObject = presentationContext.getUIContext().getObject(targetId);
@@ -203,7 +203,7 @@
}
}
}
-
invocation.getServerContext().getClientRequest().setAttribute("uiObject",
clientPage);
+ invocation.getRequest().setAttribute("uiObject", clientPage);
}
}
@@ -245,12 +245,12 @@
/**
*
*/
- private ServerAction getServerAction(PresentationContext presentationContext,
ServerInvocation invocation)
+ private ServerAction getServerAction(PresentationContext presentationContext,
PresentationInvocation invocation)
{
ServerAction action = null;
//Process any window state change incoming requests
- action =
(ServerAction)invocation.getServerContext().getClientRequest().getAttribute("serverAction");
+ action =
(ServerAction)invocation.getRequest().getAttribute("serverAction");
//Just use ViewUIObject command for now until URL interpretation/mapping
//to ServiceAction is implemented
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/controller/UIController.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/controller/UIController.java 2008-04-01
05:27:23 UTC (rev 10445)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/controller/UIController.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -37,10 +37,9 @@
import org.jboss.portal.presentation.server.PresentationServer;
import org.jboss.portal.presentation.server.ProcessorRequest;
import org.jboss.portal.presentation.server.ProcessorResponse;
-import org.jboss.portal.server.RequestController;
-import org.jboss.portal.server.ServerException;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.server.impl.ServerInvocationContextImpl;
+import org.jboss.portal.presentation.server.ServerException;
+import org.jboss.portal.presentation.invocation.PresentationInvocation;
+import org.jboss.portal.presentation.invocation.ClientController;
import org.jboss.portal.web.WebRequest;
import javax.servlet.http.HttpServletRequest;
@@ -59,7 +58,7 @@
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
*/
-public class UIController implements RequestController
+public class UIController implements ClientController
{
/** . */
@@ -75,11 +74,11 @@
* handle is the entry point for handling an incoming Portal request. The request is
handed over
* from the Http Layer via the main Portal Servlet
*/
- public void handle(ServerInvocation invocation) throws ServerException
+ public void handle(PresentationInvocation invocation) throws ServerException
{
try
{
- HttpServletRequest request = invocation.getServerContext().getClientRequest();
+ HttpServletRequest request = invocation.getRequest();
/**
* TODO: decouple the implementation via factory pattern
@@ -112,11 +111,11 @@
* @param serverResponse
* @throws ServerException
*/
- private void handle(PresentationContext presentationContext, ServerResponse
serverResponse, ServerInvocation invocation) throws ServerException
+ private void handle(PresentationContext presentationContext, ServerResponse
serverResponse, PresentationInvocation invocation) throws ServerException
{
try
{
- HttpServletResponse response =
invocation.getServerContext().getClientResponse();
+ HttpServletResponse response = invocation.getResponse();
if(serverResponse instanceof ShowUIObjectResponse)
{
ShowUIObjectResponse show = (ShowUIObjectResponse)serverResponse;
@@ -175,10 +174,10 @@
/**
*
*/
- private ServerAction getServerAction(PresentationContext presentationContext,
ServerInvocation invocation)
+ private ServerAction getServerAction(PresentationContext presentationContext,
PresentationInvocation invocation)
{
- String requestPath = invocation.getServerContext().getPortalRequestPath();
- WebRequest webReq =
((ServerInvocationContextImpl)invocation.getContext()).getWebRequest();
+ String requestPath = invocation.getPortalRequestPath();
+ WebRequest webReq = invocation.getRequest();
Map queryParameters = webReq.getQueryParameterMap();
//
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/PresentationContextImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/PresentationContextImpl.java 2008-04-01
05:27:23 UTC (rev 10445)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/PresentationContextImpl.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -34,11 +34,7 @@
import org.jboss.portal.presentation.protocol.ServerAction;
import org.jboss.portal.presentation.protocol.UIObjectAction;
import org.jboss.portal.presentation.server.PresentationServer;
-import org.jboss.portal.server.AbstractServerURL;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.server.ServerURL;
-import org.jboss.portal.server.request.URLContext;
-import org.jboss.portal.server.request.URLFormat;
+import org.jboss.portal.presentation.invocation.PresentationInvocation;
import org.jboss.portal.web.ServletContainer;
import org.jboss.portal.web.ServletContextDispatcher;
import org.jboss.portal.web.impl.DefaultServletContainerFactory;
@@ -54,7 +50,7 @@
{
/** . */
- private ServerInvocation invocation = null;
+ private PresentationInvocation invocation = null;
/** . */
private PresentationServer presentationServer = null;
@@ -64,7 +60,7 @@
* @param presentationServer
* @param invocation
*/
- public PresentationContextImpl(PresentationServer presentationServer, ServerInvocation
invocation)
+ public PresentationContextImpl(PresentationServer presentationServer,
PresentationInvocation invocation)
{
this.invocation = invocation;
this.presentationServer = presentationServer;
@@ -75,7 +71,7 @@
*/
public UIContext getUIContext()
{
- HttpSession session =
this.invocation.getServerContext().getClientRequest().getSession();
+ HttpSession session = this.invocation.getRequest().getSession();
//Process the UIObjectContainer for this session
UIObjectContainer uiObjectContainer =
(UIObjectContainer)session.getAttribute(SessionConstants.serverModel);
@@ -102,7 +98,7 @@
{
AjaxUIContext uiContext = null;
- HttpServletRequest request =
this.invocation.getServerContext().getClientRequest();
+ HttpServletRequest request = this.invocation.getRequest();
uiContext =
(AjaxUIContext)request.getSession().getAttribute(SessionConstants.ajaxModel);
if(uiContext == null)
{
@@ -124,8 +120,8 @@
{
ServletContainer container =
DefaultServletContainerFactory.getInstance().getServletContainer();
return new ServletContextDispatcher(
- invocation.getServerContext().getClientRequest(),
- invocation.getServerContext().getClientResponse(),
+ invocation.getRequest(),
+ invocation.getResponse(),
container);
}
@@ -147,18 +143,20 @@
//
if (objectAction instanceof LinkActivation)
- {
- //StringBuffer portalRequestPath = new StringBuffer("/invoke");
- //createPath(target, portalRequestPath);
-
+ {
StringBuffer portalRequestPath = new StringBuffer();
portalRequestPath.append(targetId);
+ /*
ServerURL url = new AbstractServerURL();
url.setPortalRequestPath(portalRequestPath.toString());
LinkActivation linkActivation = (LinkActivation)objectAction;
url.getParameterMap().putAll(linkActivation.getQueryParameters());
return invocation.getServerContext().renderURL(url,
URLContext.newInstance(false, false), URLFormat.newInstance(false, true));
+ */
+ //TODO: render urls
+
+ return null;
}
else
{
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/ajax/entry/PortalEntryPoint.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/ajax/entry/PortalEntryPoint.java 2008-04-01
05:27:23 UTC (rev 10445)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/ajax/entry/PortalEntryPoint.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -19,17 +19,8 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.portal.common.invocation.InterceptorStackFactory;
-import org.jboss.portal.server.RequestControllerFactory;
-import org.jboss.portal.server.Server;
-import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.server.impl.ServerInvocationContextImpl;
-import org.jboss.portal.server.request.URLContext;
-import org.jboss.portal.server.ServerRequest;
-import org.jboss.portal.server.ServerResponse;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.server.RequestController;
-import org.jboss.portal.server.RequestControllerDispatcher;
import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.WebResponse;
import org.jboss.portal.presentation.ajax.client.service.PortalRPC;
import org.jboss.portal.presentation.ajax.client.model.AjaxUIObject;
@@ -37,10 +28,12 @@
import org.jboss.portal.presentation.ajax.client.protocol.AjaxShowUIObjectResponse;
import org.jboss.portal.presentation.protocol.GetActivation;
import org.jboss.portal.presentation.protocol.PostActivation;
+import org.jboss.portal.presentation.invocation.PresentationInvocation;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+
/**
* This serves as the Portal Entry Point for AJAX (Asynchronous) RPC calls being made by
the
* client-side Ajax agent of the Presentation Framework
@@ -53,19 +46,9 @@
/** The logger. */
private Logger log = Logger.getLogger(getClass());
- /**
- *
- */
- private RequestControllerFactory controllerFactory = null;
-
/** The interceptor stack. */
private InterceptorStackFactory interceptorStack = null;
- /**
- *
- */
- private Server portalServer = null;
-
/** Configure the as default servlet. */
public void init() throws ServletException
@@ -73,27 +56,15 @@
try
{
MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
-
- //Locate the request controller
- this.controllerFactory = (RequestControllerFactory)
MBeanProxy.get(RequestControllerFactory.class, new ObjectName(
- this.getInitParameter("controllerFactoryName")),
- mbeanServer);
-
+
//Locate the interceptor stack factory
this.interceptorStack = (InterceptorStackFactory)
MBeanProxy.get(InterceptorStackFactory.class, new ObjectName(
this.getInitParameter("interceptorStackFactoryName")),
- mbeanServer);
-
- //Locate the portal server
- this.portalServer = (Server) MBeanProxy.get(Server.class, new ObjectName(
- this.getInitParameter("portalServerName")),
- mbeanServer);
-
+ mbeanServer);
}
catch (Exception e)
- {
- this.controllerFactory = null;
- this.interceptorStack = null;
+ {
+ this.interceptorStack = null;
String msg = "Ajax Portal Entry point could not be created";
log.error(msg, e);
throw new UnavailableException(msg);
@@ -303,42 +274,13 @@
{
HttpServletRequest req = this.getThreadLocalRequest();
HttpServletResponse resp = this.getThreadLocalResponse();
- String requestURI = req.getRequestURI();
- String contextPath = req.getContextPath();
- String portalHost = req.getServerName();
- String portalRequestPath = requestURI.substring(contextPath.length());
- String portalContextPath = requestURI.substring(0, contextPath.length());
- URLContext urlContext = URLContext.newInstance(req.isSecure(), req.getRemoteUser()
!= null);
-
+
WebRequest webReq = new WebRequest(req);
-
- //
- ServerInvocationContext invocationCtx = new ServerInvocationContextImpl(
- req,
- resp,
- webReq,
- portalHost,
- portalRequestPath,
- portalContextPath,
- urlContext
- );
+ WebResponse webResp = new WebResponse(resp);
+ PresentationInvocation invocation = new PresentationInvocation(webReq, webResp);
- //
- ServerRequest request = new ServerRequest(invocationCtx);
- request.setServer(this.portalServer);
-
- //
- ServerResponse response = new ServerResponse(request, invocationCtx);
-
- //
- ServerInvocation invocation = new ServerInvocation(invocationCtx);
- invocation.setRequest(request);
- invocation.setResponse(response);
-
- //
- RequestController controller =
this.controllerFactory.createRequestController(invocation);
- invocation.setHandler(new RequestControllerDispatcher(controller));
-
+ //TODO: set the proper invocation handler here
+
invocation.invoke(this.interceptorStack.getInterceptorStack());
}
}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/ClientController.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/ClientController.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/ClientController.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.invocation;
+
+import org.jboss.portal.presentation.server.ServerException;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface ClientController
+{
+ /**
+ *
+ * @param invocation
+ * @throws ServerException
+ */
+ public void handle(PresentationInvocation invocation) throws ServerException;
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocation.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocation.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocation.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -0,0 +1,117 @@
+/******************************************************************************
+ * 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.presentation.invocation;
+
+import org.jboss.portal.common.invocation.Invocation;
+import org.jboss.portal.common.invocation.InvocationContext;
+
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.WebResponse;
+
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PresentationInvocation extends Invocation
+{
+ private InvocationContext context = null;
+ private WebRequest request = null;
+ private WebResponse response = null;
+
+ /**
+ *
+ * @param request
+ */
+ public PresentationInvocation(WebRequest request, WebResponse response)
+ {
+ this.request = request;
+ this.response = response;
+ this.context = new PresentationInvocationContext();
+ }
+
+ /**
+ *
+ */
+ public InvocationContext getContext() throws IllegalStateException
+ {
+ return this.context;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public WebRequest getRequest()
+ {
+ return this.request;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public WebResponse getResponse()
+ {
+ return this.response;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getPortalHost()
+ {
+ return this.request.getServerName();
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getPortalRequestPath()
+ {
+ String portalRequestPath = null;
+
+ String requestURI = request.getRequestURI();
+ String contextPath = request.getContextPath();
+ portalRequestPath = requestURI.substring(contextPath.length());
+
+ return portalRequestPath;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getPortalContextPath()
+ {
+ String portalContextPath = null;
+
+ String requestURI = request.getRequestURI();
+ String contextPath = request.getContextPath();
+ portalContextPath = requestURI.substring(0, contextPath.length());
+
+ return portalContextPath;
+ }
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocationContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocationContext.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocationContext.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * 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.presentation.invocation;
+
+import org.jboss.portal.common.invocation.AbstractInvocationContext;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PresentationInvocationContext extends AbstractInvocationContext
+{
+
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocationHandler.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocationHandler.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/invocation/PresentationInvocationHandler.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.invocation;
+
+import org.jboss.portal.common.invocation.Invocation;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.common.invocation.InvocationHandler;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PresentationInvocationHandler implements InvocationHandler
+{
+ /**
+ *
+ */
+ private ClientController clientController = null;
+
+ /**
+ *
+ * @param clientController
+ */
+ public PresentationInvocationHandler(ClientController clientController)
+ {
+ this.clientController = clientController;
+ }
+
+ /**
+ *
+ */
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
+ {
+ this.clientController.handle((PresentationInvocation)invocation);
+
+ return null;
+ }
+}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/Processor.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/Processor.java 2008-04-01
05:27:23 UTC (rev 10445)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/Processor.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.presentation.server;
-import org.jboss.portal.server.ServerException;
import org.jboss.portal.presentation.client.PresentationContext;
/**
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/ServerException.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/ServerException.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/ServerException.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.server;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 8784 $
+ */
+public class ServerException extends Exception
+{
+ public ServerException()
+ {
+ }
+
+ public ServerException(String message)
+ {
+ super(message);
+ }
+
+ public ServerException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public ServerException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Property changes on:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/ServerException.java
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/presentation/trunk/presentation/src/main/resources/war/WEB-INF/web.xml
===================================================================
--- modules/presentation/trunk/presentation/src/main/resources/war/WEB-INF/web.xml
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/resources/war/WEB-INF/web.xml 2008-04-01
05:51:13 UTC (rev 10446)
@@ -0,0 +1,58 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <!-- Add the GWT Client Filter to run the Portal in full Web 2.0 Ajax Mode. In
turn, to run in Classic Html Mode, turn this filter off -->
+ <filter>
+ <filter-name>GWTClientFilter</filter-name>
+
<filter-class>org.jboss.portal.presentation.impl.ajax.entry.GWTClientFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>GWTClientFilter</filter-name>
+ <servlet-name>PortalServletWithPathMapping</servlet-name>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>GWTClientFilter</filter-name>
+ <servlet-name>PortalServletWithDefaultServletMapping</servlet-name>
+ </filter-mapping>
+
+ <!-- Asynchronous service request processor -->
+ <servlet>
+ <servlet-name>AjaxPortalEntryPoint</servlet-name>
+
<servlet-class>org.jboss.portal.presentation.impl.ajax.entry.PortalEntryPoint</servlet-class>
+ <init-param>
+ <param-name>interceptorStackFactoryName</param-name>
+
<param-value>portal:service=InterceptorStackFactory,type=Server</param-value>
+ <description>The request controller factory for the portal
servlet</description>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>AjaxPortalEntryPoint</servlet-name>
+ <url-pattern>/portalrpc/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/portal/MockPortalEntryPoint.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/portal/MockPortalEntryPoint.java 2008-04-01
05:27:23 UTC (rev 10445)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/portal/MockPortalEntryPoint.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -19,17 +19,8 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.portal.common.invocation.InterceptorStackFactory;
-import org.jboss.portal.server.RequestControllerFactory;
-import org.jboss.portal.server.Server;
-import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.server.impl.ServerInvocationContextImpl;
-import org.jboss.portal.server.request.URLContext;
-import org.jboss.portal.server.ServerRequest;
-import org.jboss.portal.server.ServerResponse;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.server.RequestController;
-import org.jboss.portal.server.RequestControllerDispatcher;
import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.WebResponse;
import org.jboss.portal.presentation.ajax.client.service.PortalRPC;
import org.jboss.portal.presentation.ajax.client.model.AjaxUIObject;
@@ -37,6 +28,7 @@
import org.jboss.portal.presentation.ajax.client.protocol.AjaxShowUIObjectResponse;
import org.jboss.portal.presentation.protocol.GetActivation;
import org.jboss.portal.presentation.protocol.PostActivation;
+import org.jboss.portal.presentation.invocation.PresentationInvocation;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
@@ -53,28 +45,16 @@
/** The logger. */
private Logger log = Logger.getLogger(getClass());
- /**
- *
- */
- private RequestControllerFactory controllerFactory = null;
-
/** Configure the as default servlet. */
public void init() throws ServletException
{
try
{
- MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
-
- //Locate the request controller
- this.controllerFactory = (RequestControllerFactory)
MBeanProxy.get(RequestControllerFactory.class, new ObjectName(
- this.getInitParameter("controllerFactoryName")),
- mbeanServer);
-
+ MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
}
catch (Exception e)
{
- this.controllerFactory = null;
String msg = "Ajax Portal Entry point could not be created";
log.error(msg, e);
throw new UnavailableException(msg);
@@ -281,44 +261,16 @@
*
*/
private void callPortalServer() throws Exception
- {
+ {
HttpServletRequest req = this.getThreadLocalRequest();
HttpServletResponse resp = this.getThreadLocalResponse();
- String requestURI = req.getRequestURI();
- String contextPath = req.getContextPath();
- String portalHost = req.getServerName();
- String portalRequestPath = requestURI.substring(contextPath.length());
- String portalContextPath = requestURI.substring(0, contextPath.length());
- URLContext urlContext = URLContext.newInstance(req.isSecure(), req.getRemoteUser()
!= null);
-
+
WebRequest webReq = new WebRequest(req);
-
- //
- ServerInvocationContext invocationCtx = new ServerInvocationContextImpl(
- req,
- resp,
- webReq,
- portalHost,
- portalRequestPath,
- portalContextPath,
- urlContext
- );
+ WebResponse webResp = new WebResponse(resp);
+ PresentationInvocation invocation = new PresentationInvocation(webReq, webResp);
- //
- ServerRequest request = new ServerRequest(invocationCtx);
-
- //
- ServerResponse response = new ServerResponse(request, invocationCtx);
-
- //
- ServerInvocation invocation = new ServerInvocation(invocationCtx);
- invocation.setRequest(request);
- invocation.setResponse(response);
-
- //
- RequestController controller =
this.controllerFactory.createRequestController(invocation);
- invocation.setHandler(new RequestControllerDispatcher(controller));
-
+ //TODO: set the proper invocation handler here
+
invocation.invokeNext();
}
}
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/portal/plugin/MainProcessor.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/portal/plugin/MainProcessor.java 2008-04-01
05:27:23 UTC (rev 10445)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/portal/plugin/MainProcessor.java 2008-04-01
05:51:13 UTC (rev 10446)
@@ -29,7 +29,7 @@
import org.jboss.portal.web.Body;
-import org.jboss.portal.server.ServerException;
+import org.jboss.portal.presentation.server.ServerException;
import org.jboss.portal.presentation.server.Processor;
import org.jboss.portal.presentation.server.ProcessorRequest;