You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by se...@apache.org on 2008/11/07 14:47:42 UTC

svn commit: r712125 - in /turbine/core/branches/TURBINE_2_3_BRANCH: ./ src/java/org/apache/turbine/modules/screens/ src/java/org/apache/turbine/services/jsonrpc/ src/test/org/apache/turbine/services/jsonrpc/ xdocs/ xdocs/services/

Author: seade
Date: Fri Nov  7 05:47:28 2008
New Revision: 712125

URL: http://svn.apache.org/viewvc?rev=712125&view=rev
Log:
Reverse out previously committed patch to avoid delaying the release of turbine core 2.3.3.

Modified:
    turbine/core/branches/TURBINE_2_3_BRANCH/pom.xml
    turbine/core/branches/TURBINE_2_3_BRANCH/project.xml
    turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/modules/screens/JSONScreen.java
    turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/modules/screens/JSONSecureScreen.java
    turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/JSONProcessor.java
    turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/JsonRpcService.java
    turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/TurbineJsonRpc.java
    turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/TurbineJsonRpcService.java
    turbine/core/branches/TURBINE_2_3_BRANCH/src/test/org/apache/turbine/services/jsonrpc/JsonrpcServicelTest.java
    turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/changes.xml
    turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/services/index.xml
    turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/services/jsonrpc-service.xml

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/pom.xml
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/pom.xml?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/pom.xml (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/pom.xml Fri Nov  7 05:47:28 2008
@@ -39,7 +39,7 @@
   <groupId>org.apache.turbine</groupId>
   <artifactId>turbine</artifactId>
   <name>turbine-2</name>
-  <version>2.3.3-RC1</version>
+  <version>2.3.3-b1</version>
   <description>Turbine is a servlet based framework that allows experienced Java
     developers to quickly build secure web applications. Parts of Turbine
     can also be used independently of the web portion of Turbine as
@@ -516,9 +516,9 @@
 <!--        <configuration/>-->
 <!--      </plugin>-->
       <plugin>
-        <groupId>org.apache.torque</groupId>
-        <artifactId>torque-maven-plugin</artifactId>
-        <version>3.3</version>
+        <groupId>torque</groupId>
+        <artifactId>maven-torque-plugin</artifactId>
+        <version>3.2</version>
         <configuration/>
       </plugin>
       <plugin>
@@ -767,9 +767,9 @@
       <optional>true</optional>
     </dependency>
     <dependency>
-      <groupId>org.jabsorb</groupId>
-      <artifactId>jabsorb</artifactId>
-      <version>1.3</version>
+      <groupId>com.metaparadigm</groupId>
+      <artifactId>json-rpc</artifactId>
+      <version>1.0</version>
       <type>jar</type>
       <scope>compile</scope>
       <optional>true</optional>

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/project.xml
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/project.xml?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/project.xml (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/project.xml Fri Nov  7 05:47:28 2008
@@ -43,7 +43,7 @@
     well. In other words, we strive to make portions of Turbine easily
     available for use in other applications.
   </description>
-  <url>http://turbine.apache.org/turbine/turbine-2.3.3-rc1/</url>
+  <url>http://turbine.apache.org/turbine/turbine-2.3.3-rc1/index.html</url>
   <issueTrackingUrl>http://issues.apache.org/jira/browse/TRB</issueTrackingUrl>
   <siteAddress>people.apache.org</siteAddress>
   <siteDirectory>/www/turbine.apache.org/turbine/development/turbine-2.3/</siteDirectory>
@@ -644,20 +644,10 @@
       </properties>
     </dependency>
     <dependency>
-      <groupId>org.jabsorb</groupId>
-      <artifactId>jabsorb</artifactId>
-      <version>1.3</version>
-      <url>http://jabsorb.org/</url>
-      <type>jar</type>
-      <properties>
-      <war.bundle>true</war.bundle>
-      </properties>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-jcl</artifactId>
-      <version>1.0.1</version>
-      <url>http://slf4j.org/</url>
+      <groupId>com.metaparadigm</groupId>
+      <artifactId>json-rpc</artifactId>
+      <version>1.0</version>
+      <url>http://oss.metaparadigm.com/jsonrpc/</url>
       <type>jar</type>
       <properties>
       <war.bundle>true</war.bundle>

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/modules/screens/JSONScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/modules/screens/JSONScreen.java?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/modules/screens/JSONScreen.java (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/modules/screens/JSONScreen.java Fri Nov  7 05:47:28 2008
@@ -31,7 +31,7 @@
 import org.apache.turbine.services.jsonrpc.TurbineJsonRpc;
 import org.apache.turbine.util.RunData;
 
-import org.jabsorb.JSONRPCBridge;
+import com.metaparadigm.jsonrpc.JSONRPCBridge;
 
 /**
  * A Screen class for dealing with JSON-RPC requests.  Typically you would
@@ -69,7 +69,7 @@
  * }
  * </code>
  *
- * <p>This code is derived from the org.jabsorb.JSONRPCServlet
+ * <p>This code is derived from the com.metaparadigm.jsonrpc.JSONRPCServlet
  *
  * @author brad@folkens.com
  * @author <a href="mailto:seade@backstagetech.com.au">Scott Eade</a>
@@ -77,11 +77,7 @@
  */
 public class JSONScreen extends RawScreen
 {
-    /**
-     * Depending on your needs you may want to suffix this with the characterset
-     * thus: "application/json;charset=utf-8"
-     */
-    protected static final String JSONRPC_CONTENT_TYPE = "application/json";
+    protected static final String JSONRPC_CONTENT_TYPE = "text/plain";
 
     protected final static int BUFFER_SIZE = 4096;
 
@@ -111,13 +107,13 @@
         data.declareDirectResponse();
         HttpServletRequest request = data.getRequest();
         
-        String charset = request.getCharacterEncoding();
-        if(charset == null)
-        {
-            charset = data.getCharSet();
-        }
-        BufferedReader in = new BufferedReader(
-                new InputStreamReader(request.getInputStream(), charset));
+        //String charset = request.getCharacterEncoding();
+        //if(charset == null)
+        //{
+        //    charset = "UTF-8";
+        //}
+        //BufferedReader in = new BufferedReader(new InputStreamReader(request.getInputStream(), charset));
+        BufferedReader in = new BufferedReader(new InputStreamReader(request.getInputStream()));
 
         // Read the request
         CharArrayWriter cdata = new CharArrayWriter();
@@ -136,7 +132,7 @@
         Object json_res = TurbineJsonRpc.processCall(cdata, json_bridge, request);
 
         PrintWriter out = new PrintWriter(
-                new OutputStreamWriter(data.getResponse().getOutputStream(), charset));
+                new OutputStreamWriter(data.getResponse().getOutputStream()));
         out.print(json_res.toString());
         out.flush();
         out.close();

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/modules/screens/JSONSecureScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/modules/screens/JSONSecureScreen.java?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/modules/screens/JSONSecureScreen.java (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/modules/screens/JSONSecureScreen.java Fri Nov  7 05:47:28 2008
@@ -72,7 +72,7 @@
  * }
  * </code>
  *
- * @author <a href="mailto:seade@backstagetech.com.au">Scott Eade</a>
+ * @author <a href="mailto:seade@policypoint.net">Scott Eade</a>
  * @version $Id$
  */
 public abstract class JSONSecureScreen extends JSONScreen

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/JSONProcessor.java
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/JSONProcessor.java?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/JSONProcessor.java (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/JSONProcessor.java Fri Nov  7 05:47:28 2008
@@ -1,25 +1,7 @@
 package org.apache.turbine.services.jsonrpc;
 
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
 import java.io.CharArrayWriter;
+import java.text.ParseException;
 
 import javax.servlet.http.HttpServletRequest;
 
@@ -27,17 +9,10 @@
 import org.apache.commons.logging.LogFactory;
 import org.json.JSONArray;
 import org.json.JSONObject;
-import org.json.JSONException;
 
-import org.jabsorb.JSONRPCBridge;
-import org.jabsorb.JSONRPCResult;
+import com.metaparadigm.jsonrpc.JSONRPCBridge;
+import com.metaparadigm.jsonrpc.JSONRPCResult;
 
-/**
- * JSON call processor.
- *
- * @author <a href="mailto:seade@backstagetech.com.au">Scott Eade</a>
- * @version $Id$
- */
 public class JSONProcessor
 {
     /** Log. */
@@ -46,22 +21,17 @@
     public static Object processCall(CharArrayWriter cdata, JSONRPCBridge json_bridge, HttpServletRequest request)
     {
         // Process the request
-        String requestString = cdata.toString();
-        if (log.isDebugEnabled())
-        {
-            log.debug(".processCall() - requestString: " + requestString);
-        }
         JSONObject json_req = null;
         Object json_res = null;
         try
         {
-            json_req = new JSONObject(requestString);
+            json_req = new JSONObject(cdata.toString());
             if (log.isDebugEnabled())
             {
                 String methodName = (String) json_req.getString("method");
                 JSONArray arguments = json_req.getJSONArray("params");
                 
-                // A CallableReference it will have a non-zero objectID
+                // If this a CallableReference it will have a non-zero objectID
                 int object_id = json_req.optInt("objectID");
                 StringBuffer sb = new StringBuffer(".doprocessCall(): call ");
                 if (object_id != 0)
@@ -74,15 +44,15 @@
             //json_res = json_bridge.call(new Object[] {request}, object_id, methodName, arguments);
             json_res = json_bridge.call(new Object[] {request}, json_req);
         }
-        catch (JSONException e)
+        catch (ParseException e)
         {
-            log.error(".processCall() - can't parse call: " + requestString, e);
+            log.error(".processCall(): can't parse call: " + cdata, e);
             json_res = JSONRPCResult.MSG_ERR_PARSE;
         }
         // Write the response
         if (log.isDebugEnabled())
         {
-            log.debug(".processCall() - returning: " + json_res.toString());
+            log.debug(".processCall():  returns " + json_res.toString());
         }
         return json_res;
     }

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/JsonRpcService.java
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/JsonRpcService.java?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/JsonRpcService.java (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/JsonRpcService.java Fri Nov  7 05:47:28 2008
@@ -26,7 +26,7 @@
 
 import org.apache.turbine.services.Service;
 
-import org.jabsorb.JSONRPCBridge;
+import com.metaparadigm.jsonrpc.JSONRPCBridge;
 
 /**
  * The interface an JsonRpcService implements.

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/TurbineJsonRpc.java
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/TurbineJsonRpc.java?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/TurbineJsonRpc.java (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/TurbineJsonRpc.java Fri Nov  7 05:47:28 2008
@@ -26,7 +26,7 @@
 
 import org.apache.turbine.services.TurbineServices;
 
-import org.jabsorb.JSONRPCBridge;
+import com.metaparadigm.jsonrpc.JSONRPCBridge;
 
 /**
  * This is a static accessor class for {@link JsonRpcService}.

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/TurbineJsonRpcService.java
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/TurbineJsonRpcService.java?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/TurbineJsonRpcService.java (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/jsonrpc/TurbineJsonRpcService.java Fri Nov  7 05:47:28 2008
@@ -28,7 +28,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.turbine.services.TurbineBaseService;
 
-import org.jabsorb.JSONRPCBridge;
+import com.metaparadigm.jsonrpc.JSONRPCBridge;
 
 /**
  * This is a service that will respond to JSON-RPC calls.

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/src/test/org/apache/turbine/services/jsonrpc/JsonrpcServicelTest.java
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/src/test/org/apache/turbine/services/jsonrpc/JsonrpcServicelTest.java?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/src/test/org/apache/turbine/services/jsonrpc/JsonrpcServicelTest.java (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/src/test/org/apache/turbine/services/jsonrpc/JsonrpcServicelTest.java Fri Nov  7 05:47:28 2008
@@ -24,7 +24,7 @@
 
 import org.apache.turbine.test.BaseTurbineTest;
 
-import org.jabsorb.JSONRPCBridge;
+import com.metaparadigm.jsonrpc.JSONRPCBridge;
 
 
 public class JsonrpcServicelTest

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/changes.xml?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/changes.xml (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/changes.xml Fri Nov  7 05:47:28 2008
@@ -29,16 +29,6 @@
 <body>
   <release version="2.3.3" date="in SVN">
     <action type="fix" dev="seade">
-      Corrected JSONScreen to set the correct content type and to cater for
-      the response character set.
-    </action>
-    <action type="update" dev="seade">
-      Updated the JSON-RPC Service from
-      <a href="http://oss.metaparadigm.com/jsonrpc/">JSON-RPC-Java</a> to its
-      replacement, <a href="http://jabsorb.org">jabsorb</a>.  Applications
-      should update the related JavaScript files.
-    </action>
-    <action type="fix" dev="seade">
       Minor correction to intake.dtd - added missing fieldClass attribute
       to field element.
     </action>

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/services/index.xml
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/services/index.xml?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/services/index.xml (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/services/index.xml Fri Nov  7 05:47:28 2008
@@ -115,7 +115,7 @@
 <a href="jsonrpc-service.html">JSON-RPC Service</a>
 <br/>
 The JSON-RPC Service supports JavaScript to Java AJAX communications using
-<a href="http://jabsorb.org/">jabsorb</a>.
+<a href="http://oss.metaparadigm.com/jsonrpc/">JSON-RPC-Java</a>.
 </li>
 
 <li>

Modified: turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/services/jsonrpc-service.xml
URL: http://svn.apache.org/viewvc/turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/services/jsonrpc-service.xml?rev=712125&r1=712124&r2=712125&view=diff
==============================================================================
--- turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/services/jsonrpc-service.xml (original)
+++ turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/services/jsonrpc-service.xml Fri Nov  7 05:47:28 2008
@@ -32,7 +32,7 @@
 
 <p>
 The JSON-RPC Service supports JavaScript to Java AJAX communications using
-<a href="http://jabsorb.org/">jabsorb</a>.
+<a href="http://oss.metaparadigm.com/jsonrpc/">JSON-RPC-Java</a>.
 </p>
 
 </section>
@@ -152,7 +152,8 @@
 
 <p>
 In these pages you also need to include the JavaScript necessary to process the
-JSON calls - this file is available as part of the jabsorb distribution:
+JSON calls - this file is available as part of the JSON-RPC-Java distribution
+(it is included in the <code>webapps\jaonrpc</code> directory):
 </p>
 
 <source><![CDATA[