Author: sohil.shah(a)jboss.com
Date: 2007-11-13 07:55:26 -0500 (Tue, 13 Nov 2007)
New Revision: 8899
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/ajax/
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/ajax/HostedModeProxy.java
Removed:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/HostedModeProxy.java
Modified:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/Portal.gwt.xml
Log:
refactoring
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/ajax/HostedModeProxy.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/ajax/HostedModeProxy.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/ajax/HostedModeProxy.java 2007-11-13
12:55:26 UTC (rev 8899)
@@ -0,0 +1,88 @@
+/******************************************************************************
+ * 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.test.ajax;
+
+import java.io.ByteArrayInputStream;
+
+import javax.servlet.http.HttpServletRequest;
+
+import com.google.gwt.user.client.rpc.SerializationException;
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.PostMethodWebRequest;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
+
+/**
+ * This is a RPC Proxy Service that is used only during development. This lets the GWT
client-side agent integrate with the Portal server while running in
+ * Hosted Mode. It is very efficient to debug/develop client side GWT code in Hosted
Mode.
+ *
+ * This service is never deployed in a production setting and Portal components *do not*
have any compile time or run time dependency on this Proxy.
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class HostedModeProxy extends RemoteServiceServlet
+{
+ /**
+ *
+ */
+ public String processCall(String input) throws SerializationException
+ {
+ try
+ {
+ String response = null;
+
+ HttpServletRequest request = this.getThreadLocalRequest();
+
+ //Setup the conversation with the portal server
+ WebConversation wc = null;
+ if(request.getSession().getAttribute("conversation") != null)
+ {
+ wc =
(WebConversation)request.getSession().getAttribute("conversation");
+ }
+ else
+ {
+ wc = new WebConversation();
+ request.getSession().setAttribute("conversation", wc);
+ }
+
+ //Proxy this rpc request over to the Portal server
+ WebRequest post = new PostMethodWebRequest(
+ "http://localhost:8080/portal-uiserver/portalrpc",
+ new ByteArrayInputStream(input.getBytes()),
+ "text/plain; charset=utf-8"
+ );
+ WebResponse webResponse = wc.getResponse(post);
+ response = webResponse.getText();
+
+ return response;
+ }
+ catch(Exception e)
+ {
+ throw new SerializationException(e);
+ }
+ }
+}
Deleted:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/HostedModeProxy.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/HostedModeProxy.java 2007-11-13
12:03:49 UTC (rev 8898)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/ajax/HostedModeProxy.java 2007-11-13
12:55:26 UTC (rev 8899)
@@ -1,88 +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.uiserver.service.ajax;
-
-import java.io.ByteArrayInputStream;
-
-import javax.servlet.http.HttpServletRequest;
-
-import com.google.gwt.user.client.rpc.SerializationException;
-import com.google.gwt.user.server.rpc.RemoteServiceServlet;
-
-import com.meterware.httpunit.WebConversation;
-import com.meterware.httpunit.PostMethodWebRequest;
-import com.meterware.httpunit.WebRequest;
-import com.meterware.httpunit.WebResponse;
-
-
-/**
- * This is a RPC Proxy Service that is used only during development. This lets the GWT
client-side agent integrate with the Portal server while running in
- * Hosted Mode. It is very efficient to debug/develop client side GWT code in Hosted
Mode.
- *
- * This service is never deployed in a production setting and Portal components *do not*
have any compile time or run time dependency on this Proxy.
- *
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public class HostedModeProxy extends RemoteServiceServlet
-{
- /**
- *
- */
- public String processCall(String input) throws SerializationException
- {
- try
- {
- String response = null;
-
- HttpServletRequest request = this.getThreadLocalRequest();
-
- //Setup the conversation with the portal server
- WebConversation wc = null;
- if(request.getSession().getAttribute("conversation") != null)
- {
- wc =
(WebConversation)request.getSession().getAttribute("conversation");
- }
- else
- {
- wc = new WebConversation();
- request.getSession().setAttribute("conversation", wc);
- }
-
- //Proxy this rpc request over to the Portal server
- WebRequest post = new PostMethodWebRequest(
- "http://localhost:8080/portal-uiserver/portalrpc",
- new ByteArrayInputStream(input.getBytes()),
- "text/plain; charset=utf-8"
- );
- WebResponse webResponse = wc.getResponse(post);
- response = webResponse.getText();
-
- return response;
- }
- catch(Exception e)
- {
- throw new SerializationException(e);
- }
- }
-}
Modified:
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/Portal.gwt.xml
===================================================================
---
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/Portal.gwt.xml 2007-11-13
12:03:49 UTC (rev 8898)
+++
branches/UIServer/uiserver/src/resources/client/ajax/src/org/jboss/portal/uiserver/ajax/Portal.gwt.xml 2007-11-13
12:55:26 UTC (rev 8899)
@@ -8,5 +8,5 @@
<entry-point class="org.jboss.portal.uiserver.ajax.client.Portal"/>
<!-- RPC related configuration. This is used only in Hosted Mode -->
- <servlet path="/portalrpc"
class="org.jboss.portal.uiserver.service.ajax.HostedModeProxy"/>
+ <servlet path="/portalrpc"
class="org.jboss.portal.presentation.test.ajax.HostedModeProxy"/>
</module>