jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r739211 - in /jackrabbit/sandbox/spi: ./ spi2davex/ spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/ spi2davex/src/test/java/org/apache/jackrabbit/spi/spi2davex/
Date Fri, 30 Jan 2009 09:06:04 GMT
Author: angela
Date: Fri Jan 30 09:06:04 2009
New Revision: 739211

URL: http://svn.apache.org/viewvc?rev=739211&view=rev
Log:
- JCR-1958: Enhanced JCR remoting (work in progress)

Removed:
    jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/JSONHandler.java
    jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/JSONParser.java
    jackrabbit/sandbox/spi/spi2davex/src/test/java/org/apache/jackrabbit/spi/spi2davex/DummyJSONHandler.java
    jackrabbit/sandbox/spi/spi2davex/src/test/java/org/apache/jackrabbit/spi/spi2davex/JSONParserTest.java
Modified:
    jackrabbit/sandbox/spi/pom.xml
    jackrabbit/sandbox/spi/spi2davex/pom.xml
    jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/ItemInfoJSONHandler.java
    jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/RepositoryServiceImpl.java
    jackrabbit/sandbox/spi/spi2davex/src/test/java/org/apache/jackrabbit/spi/spi2davex/TestAll.java

Modified: jackrabbit/sandbox/spi/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/pom.xml?rev=739211&r1=739210&r2=739211&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/pom.xml (original)
+++ jackrabbit/sandbox/spi/pom.xml Fri Jan 30 09:06:04 2009
@@ -303,12 +303,6 @@
         <version>1.4</version>
         <scope>test</scope>
       </dependency>
-      <dependency>
-        <groupId>org.json</groupId>
-        <artifactId>json</artifactId>
-        <version>20070829</version>
-        <scope>test</scope>
-      </dependency>
     </dependencies>
   </dependencyManagement>
 </project>

Modified: jackrabbit/sandbox/spi/spi2davex/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/spi2davex/pom.xml?rev=739211&r1=739210&r2=739211&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/spi2davex/pom.xml (original)
+++ jackrabbit/sandbox/spi/spi2davex/pom.xml Fri Jan 30 09:06:04 2009
@@ -131,11 +131,6 @@
             <artifactId>commons-httpclient</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.json</groupId>
-            <artifactId>json</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>

Modified: jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/ItemInfoJSONHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/ItemInfoJSONHandler.java?rev=739211&r1=739210&r2=739211&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/ItemInfoJSONHandler.java
(original)
+++ jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/ItemInfoJSONHandler.java
Fri Jan 30 09:06:04 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.spi.spi2davex;
 
+import org.apache.jackrabbit.commons.json.JsonHandler;
 import org.apache.jackrabbit.spi.ChildInfo;
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.Name;
@@ -42,9 +43,9 @@
 /**
  * <code>ItemInfoJSONHandler</code>...
  */
-class ItemInfoJSONHandler implements JSONHandler {
+class ItemInfoJsonHandler implements JsonHandler {
 
-    private static Logger log = LoggerFactory.getLogger(ItemInfoJSONHandler.class);
+    private static Logger log = LoggerFactory.getLogger(ItemInfoJsonHandler.class);
 
     private static final int SPECIAL_JSON_PAIR = Integer.MAX_VALUE;
 
@@ -63,7 +64,7 @@
     private Stack nodeInfos = new Stack();
     private PropertyInfoImpl mvPropInfo;
 
-    ItemInfoJSONHandler(NamePathResolver resolver, NodeInfo nInfo,
+    ItemInfoJsonHandler(NamePathResolver resolver, NodeInfo nInfo,
                         String rootURI,
                         QValueFactoryImpl vFactory,
                         PathFactory pFactory,

Modified: jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/RepositoryServiceImpl.java?rev=739211&r1=739210&r2=739211&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/spi/spi2davex/src/main/java/org/apache/jackrabbit/spi/spi2davex/RepositoryServiceImpl.java
Fri Jan 30 09:06:04 2009
@@ -25,6 +25,8 @@
 import org.apache.commons.httpclient.methods.multipart.Part;
 import org.apache.commons.httpclient.methods.multipart.PartBase;
 import org.apache.commons.httpclient.methods.multipart.StringPart;
+import org.apache.jackrabbit.commons.json.JsonParser;
+import org.apache.jackrabbit.commons.json.JsonUtil;
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.spi.Batch;
 import org.apache.jackrabbit.spi.ItemId;
@@ -263,8 +265,8 @@
                 NamePathResolver resolver = getNamePathResolver(sessionInfo);
                 NodeInfoImpl nInfo = new NodeInfoImpl(nodeId, path);
 
-                ItemInfoJSONHandler handler = new ItemInfoJSONHandler(resolver, nInfo, getRootURI(sessionInfo),
getQValueFactory(sessionInfo), getPathFactory(), getIdFactory());
-                JSONParser ps = new JSONParser(handler);
+                ItemInfoJsonHandler handler = new ItemInfoJsonHandler(resolver, nInfo, getRootURI(sessionInfo),
getQValueFactory(sessionInfo), getPathFactory(), getIdFactory());
+                JsonParser ps = new JsonParser(handler);
                 ps.parse(method.getResponseBodyAsStream(), method.getResponseCharSet());
 
                 Iterator it = handler.getItemInfos();
@@ -492,12 +494,12 @@
 
             StringWriter wr = new StringWriter();
             wr.write('{');
-            wr.write(getJSONKey(JcrConstants.JCR_PRIMARYTYPE));
-            wr.write(Text.getJSONString(getNamePathResolver(sessionInfo).getJCRName(nodetypeName)));
+            wr.write(getJsonKey(JcrConstants.JCR_PRIMARYTYPE));
+            wr.write(JsonUtil.getJsonString(getNamePathResolver(sessionInfo).getJCRName(nodetypeName)));
             if (uuid != null) {
                 wr.write(',');
-                wr.write(getJSONKey(JcrConstants.JCR_UUID));
-                wr.write(Text.getJSONString(uuid));
+                wr.write(getJsonKey(JcrConstants.JCR_UUID));
+                wr.write(JsonUtil.getJsonString(uuid));
             }
             wr.write('}');
             appendDiff(SYMBOL_ADD_NODE, jcrPath, wr.toString());
@@ -626,7 +628,7 @@
             String jcrPropPath = resolver.getJCRPath(propPath);
             clearPreviousSetProperty(jcrPropPath);
 
-            String strValue = getJSONString(value);
+            String strValue = getJsonString(value);
             appendDiff(SYMBOL_SET_PROPERTY, jcrPropPath, strValue);
             if (strValue == null) {
                 addPart(jcrPropPath, value, resolver);
@@ -640,7 +642,7 @@
 
             StringBuffer strVal = new StringBuffer("[");
             for (int i = 0; i < values.length; i++) {
-                String str = getJSONString(values[i]);
+                String str = getJsonString(values[i]);
                 if (str == null) {
                     addPart(jcrPropPath, values[i], resolver);
                 } else {
@@ -714,15 +716,15 @@
             }
         }
 
-        private String getJSONKey(String str) {
-            return Text.getJSONString(str) + ":";
+        private String getJsonKey(String str) {
+            return JsonUtil.getJsonString(str) + ":";
         }
 
-        private String getJSONString(QValue value) throws RepositoryException {
+        private String getJsonString(QValue value) throws RepositoryException {
             String str;
             switch (value.getType()) {
                 case PropertyType.STRING:
-                    str = Text.getJSONString(value.getString());
+                    str = JsonUtil.getJsonString(value.getString());
                     break;
                 case PropertyType.BOOLEAN:
                 case PropertyType.LONG:

Modified: jackrabbit/sandbox/spi/spi2davex/src/test/java/org/apache/jackrabbit/spi/spi2davex/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/spi2davex/src/test/java/org/apache/jackrabbit/spi/spi2davex/TestAll.java?rev=739211&r1=739210&r2=739211&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/spi2davex/src/test/java/org/apache/jackrabbit/spi/spi2davex/TestAll.java
(original)
+++ jackrabbit/sandbox/spi/spi2davex/src/test/java/org/apache/jackrabbit/spi/spi2davex/TestAll.java
Fri Jan 30 09:06:04 2009
@@ -34,8 +34,6 @@
         suite.addTestSuite(ReadTest.class);
         suite.addTestSuite(BatchTest.class);
 
-        // impl specific tests
-        suite.addTestSuite(JSONParserTest.class);
         return suite;
     }
 }
\ No newline at end of file



Mime
View raw message