Author: hqm
Date: 2007-06-18 13:52:37 -0700 (Mon, 18 Jun 2007)
New Revision: 5456

Added:
   
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/utils/LZDeleteMethod.java
   
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/utils/LZPutMethod.java
   openlaszlo/branches/legals/test/lfc/data/testput.lzx
Modified:
   openlaszlo/branches/legals/WEB-INF/lps/schema/lzx.rnc
   
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/data/HTTPDataSource.java
   openlaszlo/branches/legals/test/lfc/data/alldata.lzx
Log:
Change 20070617-hqm-2 by [EMAIL PROTECTED] on 2007-06-17 08:45:30 EDT
    in /cygdrive/c/users/hqm/openlaszlo/legals4
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: support for PUT and DELETE methods in LPS proxy

New Features:

Bugs Fixed:

Technical Reviewer: josh (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
    

Tests:

test/lfc/data/alldata.lzx




Modified: openlaszlo/branches/legals/WEB-INF/lps/schema/lzx.rnc
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/schema/lzx.rnc       2007-06-18 
20:19:04 UTC (rev 5455)
+++ openlaszlo/branches/legals/WEB-INF/lps/schema/lzx.rnc       2007-06-18 
20:52:37 UTC (rev 5456)
@@ -684,7 +684,7 @@
   [lza:since="1.1"]
   attribute ontimeout {script}? &
   ## HTTP request method = post | get
-  attribute querytype {"get" | "post" | "GET" | "POST"}?
+  attribute querytype {"get" | "post" | "GET" | "POST" | "put" | "PUT" | 
"delete" | "DELETE"}?
 
 anyXML = mixed {
     element * {

Modified: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/data/HTTPDataSource.java
===================================================================
--- 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/data/HTTPDataSource.java
   2007-06-18 20:19:04 UTC (rev 5455)
+++ 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/data/HTTPDataSource.java
   2007-06-18 20:52:37 UTC (rev 5456)
@@ -3,7 +3,7 @@
  * 
****************************************************************************/
 
 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2006 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * J_LZ_COPYRIGHT_END *********************************************************/
 
@@ -29,6 +29,8 @@
 import org.openlaszlo.utils.LZHttpUtils;
 import org.openlaszlo.utils.LZGetMethod;
 import org.openlaszlo.utils.LZPostMethod;
+import org.openlaszlo.utils.LZPutMethod;
+import org.openlaszlo.utils.LZDeleteMethod;
 import org.openlaszlo.utils.FileUtils;
 import org.openlaszlo.server.LPS;
 import org.apache.oro.text.regex.*;
@@ -329,13 +331,24 @@
             }
     
             boolean isPost = false;
+            mLogger.debug("reqtype = "+reqType);
     
             if (reqType != null && reqType.equals("POST")) {
                 request = new LZPostMethod();
                 request.setRequestHeader("Content-Type",
                                          
"application/x-www-form-urlencoded;charset=UTF-8");
                 isPost = true;
+                mLogger.debug("setting POST req method");
+            } else if (reqType != null && reqType.equals("PUT")) {
+                request = new LZPutMethod();
+                // todo [hqm 2007] treat PUT like POST? 
+                isPost = true;
+                mLogger.debug("setting PUT req method");
+            } else if (reqType != null && reqType.equals("DELETE")) {
+                request = new LZDeleteMethod();
+                mLogger.debug("setting DELETE req method");
             } else {
+                mLogger.debug("setting GET (default) req method");
                 request = new LZGetMethod();
             }
 
@@ -415,7 +428,7 @@
                     if (query.startsWith(postbodyparam)) {
                         // Get the unescaped query string
                         String v = 
uri.getQuery().substring(postbodyparam.length());
-                        ((LZPostMethod)request).setRequestBody(v);
+                        ((EntityEnclosingMethod)request).setRequestBody(v);
                     } else {
                         StringTokenizer st = new StringTokenizer(query, "&");
                         while (st.hasMoreTokens()) {

Added: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/utils/LZDeleteMethod.java


Property changes on: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/utils/LZDeleteMethod.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/utils/LZPutMethod.java


Property changes on: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/utils/LZPutMethod.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: openlaszlo/branches/legals/test/lfc/data/alldata.lzx
===================================================================
--- openlaszlo/branches/legals/test/lfc/data/alldata.lzx        2007-06-18 
20:19:04 UTC (rev 5455)
+++ openlaszlo/branches/legals/test/lfc/data/alldata.lzx        2007-06-18 
20:52:37 UTC (rev 5456)
@@ -19,6 +19,7 @@
     <include href="testsetheaders.lzx"/>
     <include href="testsetheaders-solo.lzx"/>
     <include href="testrawpost.lzx"/>
+    <include href="testput.lzx"/>
     <include href="testrawpost-solo.lzx"/>
     <include href="testheaderresponse.lzx"/>
     <include href="testclientcachebreaker.lzx"/>
@@ -40,6 +41,7 @@
         <TestSetHeaders/>
         <TestSetHeadersSOLO/>
         <TestRawPost/>
+        <TestPut/>
         <TestRawPostSOLO/>
         <TestResponseHeaders/>
 

Added: openlaszlo/branches/legals/test/lfc/data/testput.lzx


Property changes on: openlaszlo/branches/legals/test/lfc/data/testput.lzx
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to