On 3/14/06, Joe Walker <[EMAIL PROTECTED]> wrote:
So I'm attaching a patch to Rife Trunk that keeps you in sync.

Or at least I would have done if I had my wits about me.

Joe.
 

Index: 
C:/Share/joe/uwyn/rife/src/framework/com/uwyn/rife/engine/elements/DwrServiceDeployer.java
===================================================================
--- 
C:/Share/joe/uwyn/rife/src/framework/com/uwyn/rife/engine/elements/DwrServiceDeployer.java
  (revision 3102)
+++ 
C:/Share/joe/uwyn/rife/src/framework/com/uwyn/rife/engine/elements/DwrServiceDeployer.java
  (working copy)
@@ -23,6 +23,8 @@
 import javax.xml.parsers.ParserConfigurationException;
 import org.xml.sax.SAXException;
 import uk.ltd.getahead.dwr.create.NewCreator;
+import uk.ltd.getahead.dwr.dwrp.ConverterManager;
+import uk.ltd.getahead.dwr.dwrp.DefaultConverterManager;
 
 public class DwrServiceDeployer extends ElementDeployer
 {
Index: 
C:/Share/joe/uwyn/rife/src/framework/com/uwyn/rife/engine/elements/DwrRifeProcessor.java
===================================================================
--- 
C:/Share/joe/uwyn/rife/src/framework/com/uwyn/rife/engine/elements/DwrRifeProcessor.java
    (revision 3102)
+++ 
C:/Share/joe/uwyn/rife/src/framework/com/uwyn/rife/engine/elements/DwrRifeProcessor.java
    (working copy)
@@ -7,25 +7,22 @@
  */
 package com.uwyn.rife.engine.elements;
 
-import uk.ltd.getahead.dwr.*;
-
-import com.uwyn.rife.engine.ElementSupport;
-import com.uwyn.rife.tools.StringUtils;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
+import java.io.*;
 import java.util.HashMap;
 import java.util.Map;
+
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletResponse;
-import uk.ltd.getahead.dwr.servlet.HtmlConstants;
+
+import uk.ltd.getahead.dwr.*;
+import uk.ltd.getahead.dwr.servlet.HttpConstants;
 import uk.ltd.getahead.dwr.util.JavascriptUtil;
 import uk.ltd.getahead.dwr.util.LocalUtil;
 import uk.ltd.getahead.dwr.util.Logger;
-import uk.ltd.getahead.dwr.util.RequestParser;
 
+import com.uwyn.rife.engine.ElementSupport;
+import com.uwyn.rife.tools.StringUtils;
+
 public class DwrRifeProcessor
 {
     /**
@@ -85,6 +82,11 @@
      */
     private Remoter mRemoter = null;
        
+    /**
+     * The bean to marshall remote parameters
+     */
+    private Marshaller mMarshaller = null;
+    
     public void handle(final ElementSupport element) throws IOException, 
ServletException
     {
        String webapp_root_url = 
StringUtils.stripFromEnd(element.getWebappRootUrl(), "/");
@@ -106,7 +108,7 @@
             path_info.equals(HtmlConstants.PATH_ROOT) ||
             path_info.startsWith(HtmlConstants.FILE_INDEX))
         {
-            reply = mDebugPageGenerator.generateIndexPage(webapp_root_url, 
element_url);
+            reply = mDebugPageGenerator.generateIndexPage(webapp_root_url + 
element_url);
         }
         else if (path_info.startsWith(HtmlConstants.PATH_TEST))
         {
@@ -114,7 +116,7 @@
             scriptName = LocalUtil.replace(scriptName, 
HtmlConstants.PATH_TEST, HtmlConstants.BLANK);
             scriptName = LocalUtil.replace(scriptName, 
HtmlConstants.PATH_ROOT, HtmlConstants.BLANK);
                        
-            reply = mDebugPageGenerator.generateTestPage(webapp_root_url, 
element_url, scriptName);
+            reply = mDebugPageGenerator.generateTestPage(webapp_root_url + 
element_url, scriptName);
         }
         else if (path_info.startsWith(HtmlConstants.PATH_INTERFACE))
         {
@@ -127,7 +129,6 @@
         }
         else if (path_info.startsWith(HtmlConstants.PATH_EXEC))
         {
-            RequestParser requestParser = new RequestParser();
                        HttpRequest request = new HttpRequest() {
                                
                                public String getMethod()
@@ -146,9 +147,19 @@
                                }
                        };
                        
-            Calls calls = requestParser.parseRequest(request);
-                       
-            reply = mRemoter.execute(calls);
+            try
+            {
+                Calls calls = mMarshaller.marshallInbound(request);
+                Replies replies = mRemoter.execute(calls);
+                reply = mMarshaller.marshallOutbound(replies);
+            }
+            catch (MarshallException ex)
+            {
+                // Not totally sure what you'd want to do here. A conversion
+                // exception is probably because we were asked to configure
+                // something that we don't have permission for.
+                throw new ServletException(ex);
+            }
         }
         else if (path_info.equalsIgnoreCase(HtmlConstants.FILE_ENGINE))
         {
@@ -160,11 +171,6 @@
             doFile(element, HtmlConstants.FILE_UTIL, HtmlConstants.MIME_JS);
             return;
         }
-        else if (path_info.equalsIgnoreCase(HtmlConstants.FILE_DEPRECATED))
-        {
-            doFile(element, HtmlConstants.FILE_DEPRECATED, 
HtmlConstants.MIME_JS);
-            return;
-        }
         else
         {
             LOG.warn("Page not found (" + path_info + "). In debug/test mode 
try viewing /[WEB-APP]/dwr/"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -235,8 +241,8 @@
         }
                
         element.setContentType(mimeType);
-        element.setDateHeader(HtmlConstants.HEADER_LAST_MODIFIED, 
SERVLET_CONTAINER_START_TIME);
-        element.setHeader(HtmlConstants.HEADER_ETAG, ETAG);
+        element.setDateHeader(HttpConstants.HEADER_LAST_MODIFIED, 
SERVLET_CONTAINER_START_TIME);
+        element.setHeader(HttpConstants.HEADER_ETAG, ETAG);
                
         element.print(output + "\n");
     }
@@ -254,13 +260,13 @@
             return false;
         }
                
-        long modifiedSince = 
element.getDateHeader(HtmlConstants.HEADER_IF_MODIFIED);
+        long modifiedSince = 
element.getDateHeader(HttpConstants.HEADER_IF_MODIFIED);
         if (modifiedSince != -1)
         {
             // Browsers are only accurate to the second
             modifiedSince -= modifiedSince % 1000;
         }
-        String givenEtag = element.getHeader(HtmlConstants.HEADER_IF_NONE);
+        String givenEtag = element.getHeader(HttpConstants.HEADER_IF_NONE);
                
         // Deal with missing etags
         if (givenEtag == null)
@@ -342,8 +348,17 @@
     {
         mRemoter = remoter;
     }
-       
+
     /**
+     * Setter for the marshaller
+     * @param marshaller
+     */
+    public void setMarshaller(Marshaller marshaller)
+    {
+        mMarshaller = marshaller;
+    }
+
+    /**
      *
      * @param debugPageGenerator
      */
Index: 
C:/Share/joe/uwyn/rife/src/framework/com/uwyn/rife/engine/elements/DwrService.java
===================================================================
--- 
C:/Share/joe/uwyn/rife/src/framework/com/uwyn/rife/engine/elements/DwrService.java
  (revision 3102)
+++ 
C:/Share/joe/uwyn/rife/src/framework/com/uwyn/rife/engine/elements/DwrService.java
  (working copy)
@@ -13,6 +13,7 @@
 import com.uwyn.rife.tools.StringUtils;
 import java.util.Properties;
 import uk.ltd.getahead.dwr.DebugPageGenerator;
+import uk.ltd.getahead.dwr.HtmlConstants;
 
 public class DwrService extends Element
 {
@@ -32,22 +33,21 @@
 
                        if (isEmbedded())
                        {
-                               String webapp_root_url = 
StringUtils.stripFromEnd(getWebappRootUrl(), "/");
-                               String element_url = getElementInfo().getUrl();
+                               String dwr_root = 
StringUtils.stripFromEnd(getWebappRootUrl(), "/")+getElementInfo().getUrl();
 
                                DebugPageGenerator debug = 
(DebugPageGenerator)deployer.getContainer().getBean(DebugPageGenerator.class.getName());
 
                                Properties props = getEmbedProperties();
                                for (String name : 
StringUtils.split(props.getProperty("names"), ","))
                                {
-                                       print("<script type=\"text/javascript\" 
src=\""+debug.generateInterfaceUrl(webapp_root_url, element_url, 
name.trim())+"\"> </script>\n");
+                                       print("<script type=\"text/javascript\" 
src=\""+debug.generateInterfaceUrl(dwr_root, name.trim())+"\"> </script>\n");
                                }
-                               
-                               print("<script type=\"text/javascript\" 
src=\""+debug.generateEngineUrl(webapp_root_url, element_url)+"\"> 
</script>\n");
-                               
+
+                               print("<script type=\"text/javascript\" 
src=\""+debug.generateEngineUrl(dwr_root) + "\"> </script>\n");
+
                                if 
(Convert.toBoolean(props.getProperty("includeUtil"), false))
                                {
-                                       print("<script type=\"text/javascript\" 
src=\""+debug.generateUtilUrl(webapp_root_url, element_url)+"\"> </script>\n");
+                                       print("<script type=\"text/javascript\" 
src=\""+debug.generateLibraryUrl(dwr_root, HtmlConstants.FILE_UTIL)+"\"> 
</script>\n");
                                }
                        }
                        else
@@ -69,4 +69,3 @@
         }
        }
 }
-
Index: C:/Share/joe/uwyn/rife/.classpath
===================================================================
--- C:/Share/joe/uwyn/rife/.classpath   (revision 3102)
+++ C:/Share/joe/uwyn/rife/.classpath   (working copy)
@@ -3,7 +3,7 @@
        <classpathentry excluding="**/.DS_Store|**/.svn/*" kind="src" 
path="src/bsfsupport"/>
        <classpathentry excluding="**/.DS_Store|**/.svn/*" kind="src" 
path="src/framework"/>
        <classpathentry excluding="**/.DS_Store|**/.svn/*" 
output="build/unittests" kind="src" path="src/unittests"/>
-       <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-1.5.0"/>
        <classpathentry kind="lib" path="programs/gui/config"/>
        <classpathentry kind="lib" path="programs/unittests/config"/>
        <classpathentry kind="lib" path="programs/unittests/data"/>
@@ -30,7 +30,7 @@
        <classpathentry kind="lib" path="lib/oraclejdbc14-10.2.0.1.0.jar"/>
        <classpathentry kind="lib" path="lib/ognl-2.6.7.jar"/>
        <classpathentry kind="lib" path="lib/nekohtml-0.9.5.jar"/>
-       <classpathentry kind="lib" 
path="lib/mysql-connector-java-3.1.10-bin.jar"/>
+       <classpathentry kind="lib" 
path="lib/mysql-connector-java-3.1.12-bin.jar"/>
        <classpathentry kind="lib" path="lib/mlibwrapper_jai-1.1.2.jar"/>
        <classpathentry kind="lib" path="lib/mckoidb-1.0.3.jar"/>
        <classpathentry kind="lib" path="lib/junit-3.8.1.jar"/>
 </classpath>
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to