jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r931481 - in /jackrabbit/sandbox/jackrabbit-spi2cmis: ./ src/main/java/org/apache/jackrabbit/spi2cmis/ src/test/java/org/apache/jackrabbit/spi2cmis/
Date Wed, 07 Apr 2010 09:41:50 GMT
Author: mduerig
Date: Wed Apr  7 09:41:50 2010
New Revision: 931481

URL: http://svn.apache.org/viewvc?rev=931481&view=rev
Log:
- Updated to recent version of Chemistry and Jackrabbit
- Updatred readme
- Added null guard

Modified:
    jackrabbit/sandbox/jackrabbit-spi2cmis/README.txt
    jackrabbit/sandbox/jackrabbit-spi2cmis/src/main/java/org/apache/jackrabbit/spi2cmis/CmisRepositoryService.java
    jackrabbit/sandbox/jackrabbit-spi2cmis/src/test/java/org/apache/jackrabbit/spi2cmis/AbstractTestCase.java
    jackrabbit/sandbox/jackrabbit-spi2cmis/src/test/java/org/apache/jackrabbit/spi2cmis/ReadTest.java

Modified: jackrabbit/sandbox/jackrabbit-spi2cmis/README.txt
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi2cmis/README.txt?rev=931481&r1=931480&r2=931481&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi2cmis/README.txt (original)
+++ jackrabbit/sandbox/jackrabbit-spi2cmis/README.txt Wed Apr  7 09:41:50 2010
@@ -22,10 +22,15 @@ Features
   documents are mapped to the JCR nt:file type and CMIS folders
   are mapped to the JCR nt:folder type. 
 
-* Interoperable with Apache Chemistry's CMIS implementation, Nuxeo's 
-  CMIS demo at http://cmis.demo.nuxeo.org/nuxeo/site/cmis/repository 
-  and with Alfresco's CMIS Repository at 
-  http://cmis.alfresco.com/service/cmis.    
+* Tested with the following CMIS server implementations:
+ 
+    - Apache Chemistry's CMIS implementation
+    
+    - Day Software's CMIS Repository at http://cmis.day.com/cmis/repository
+    
+    - Nuxeo's CMIS demo at http://cmis.demo.nuxeo.org/nuxeo/site/cmis/repository
+    
+    - Alfresco's CMIS Repository at http://cmis.alfresco.com/service/cmis
 
 
 Not (yet) implemented
@@ -54,11 +59,9 @@ of the spi2cmis module.  
 
 Patches and dependencies
 ------------------------
-* Apache Jackrabbit 2.0 Revision: 919059
+* Apache Jackrabbit SNAPSHOT-2.1, Revision: 931459
+  https://svn.apache.org/repos/asf/jackrabbit/branches/2.1
 
-* Apache Chemistry Revision: 921293
-
-* CMIS-151 (https://issues.apache.org/jira/browse/CMIS-151)
-  This patch is required for some features to work properly
-    
- 
\ No newline at end of file
+* Apache Chemistry SNAPSHOT-0.5, Revision: 931458
+  https://svn.apache.org/repos/asf/incubator/chemistry/trunk/chemistry
+  
\ No newline at end of file

Modified: jackrabbit/sandbox/jackrabbit-spi2cmis/src/main/java/org/apache/jackrabbit/spi2cmis/CmisRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi2cmis/src/main/java/org/apache/jackrabbit/spi2cmis/CmisRepositoryService.java?rev=931481&r1=931480&r2=931481&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi2cmis/src/main/java/org/apache/jackrabbit/spi2cmis/CmisRepositoryService.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi2cmis/src/main/java/org/apache/jackrabbit/spi2cmis/CmisRepositoryService.java
Wed Apr  7 09:41:50 2010
@@ -400,7 +400,7 @@ public class CmisRepositoryService exten
                 QValue[] values;
                 try {
                     ContentStream content = parentCmisObject.getContentStream(null);
-                    values = qValue(content.getStream(), factory);
+                    values = qValue(content == null ? Streams.emptyInStream() : content.getStream(),
factory);
                 }
                 catch (UnsupportedOperationException e) {
                     // todo fix: Remove when SimpleObject#getContentStream is implemented

Modified: jackrabbit/sandbox/jackrabbit-spi2cmis/src/test/java/org/apache/jackrabbit/spi2cmis/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi2cmis/src/test/java/org/apache/jackrabbit/spi2cmis/AbstractTestCase.java?rev=931481&r1=931480&r2=931481&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi2cmis/src/test/java/org/apache/jackrabbit/spi2cmis/AbstractTestCase.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi2cmis/src/test/java/org/apache/jackrabbit/spi2cmis/AbstractTestCase.java
Wed Apr  7 09:41:50 2010
@@ -46,7 +46,8 @@ public abstract class AbstractTestCase e
 //            parameters = simpleParameters();
 //            parameters = nuxeoParameters();
 //            parameters = alfrescoParameters();
-            parameters = chemistryParameters();
+//            parameters = chemistryParameters();
+            parameters = dayParameters();
             parameters.put(
                     Jcr2spiRepositoryFactory.PARAM_REPOSITORY_SERVICE_FACTORY,
                     Spi2cmisRepositoryServiceFactory.class.getName());
@@ -70,6 +71,7 @@ public abstract class AbstractTestCase e
         parameters.put("paths.node", new String[] { "/folder 1/folder 2" });
         parameters.put("paths.property", new String[] { "/folder 1/folder 2/title" });
         parameters.put("paths.binary", new String[] { "/folder 1/folder 2/doc 3/jcr:content/jcr:data"
});
+        parameters.put("traversal.depth", 3);
         return parameters;
     }
 
@@ -83,6 +85,7 @@ public abstract class AbstractTestCase e
         parameters.put("paths.node", new String[] { "/default-domain/workspaces/demo-workspace"
});
         parameters.put("paths.property", new String[] { "/default-domain/workspaces/demo-workspace/dc:title"
});
         parameters.put("paths.binary", new String[] { });
+        parameters.put("traversal.depth", 3);
         return parameters;
     }
 
@@ -96,6 +99,7 @@ public abstract class AbstractTestCase e
         parameters.put("paths.node", new String[] { "/Sites/Franki/d2.txt" });
         parameters.put("paths.property", new String[] { "/Sites/Franki/d2.txt/cmis:name"
});
         parameters.put("paths.binary", new String[] { "/Sites/Franki/d2.txt/jcr:content/jcr:data"
});
+        parameters.put("traversal.depth", 3);
         return parameters;
     }
 
@@ -109,6 +113,21 @@ public abstract class AbstractTestCase e
         parameters.put("paths.node", new String[] { "/folder 1/folder 2" });
         parameters.put("paths.property", new String[] { "/folder 1/folder 2/title" });
         parameters.put("paths.binary", new String[] { "/folder 1/folder 2/doc 3/jcr:content/jcr:data"
});
+        parameters.put("traversal.depth", 3);
+        return parameters;
+    }
+
+    @SuppressWarnings("unused")
+    private static Map<String, Object> dayParameters() {
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        parameters.put(Spi2cmisRepositoryServiceFactory.PARAM_CMIS_REPOSITORY_URL,
+                "http://cmis.day.com/cmis/repository");
+        parameters.put(Spi2cmisRepositoryServiceFactory.PARAM_CMIS_USERNAME, "admin");
+        parameters.put(Spi2cmisRepositoryServiceFactory.PARAM_CMIS_PASSWORD, "admin");
+        parameters.put("paths.node", new String[] { "/apps/crx/bar.png" });
+        parameters.put("paths.property", new String[] { "/apps/crx/bar.png/cmis:contentStreamLength"
});
+        parameters.put("paths.binary", new String[] { "/apps/crx/bar.png/jcr:content/jcr:data"
});
+        parameters.put("traversal.depth", 3);
         return parameters;
     }
 

Modified: jackrabbit/sandbox/jackrabbit-spi2cmis/src/test/java/org/apache/jackrabbit/spi2cmis/ReadTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi2cmis/src/test/java/org/apache/jackrabbit/spi2cmis/ReadTest.java?rev=931481&r1=931480&r2=931481&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi2cmis/src/test/java/org/apache/jackrabbit/spi2cmis/ReadTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi2cmis/src/test/java/org/apache/jackrabbit/spi2cmis/ReadTest.java
Wed Apr  7 09:41:50 2010
@@ -100,7 +100,7 @@ public class ReadTest extends AbstractTe
             for (String path : paths) {
                 Node node = session.getNode(path);
                 assertEquals(path, node.getPath());
-                dumpNode(node, false);
+                dumpNode(node, 0);
             }
         }
         finally {
@@ -143,12 +143,13 @@ public class ReadTest extends AbstractTe
 
     public void testTraverse() throws RepositoryException {
         String paths[] = { "/" };
+        int depth = (Integer) parameters.get("traversal.depth");
 
         Session session = login();
         try {
             for (String path : paths) {
                 Node node = session.getNode(path);
-                dumpNode(node, true);
+                dumpNode(node, depth);
             }
         }
         finally {
@@ -158,7 +159,7 @@ public class ReadTest extends AbstractTe
 
     // -----------------------------------------------------< private >---
 
-    private static void dumpNode(Node node, boolean recursive) throws RepositoryException
{
+    private static void dumpNode(Node node, int depth) throws RepositoryException {
         NodeType nt = node.getPrimaryNodeType();
         NodeDefinition nd = node.getDefinition();
         System.out.println(node.getPath() + ": " + nt.getName() + " (" + nd.getName() + ")");
@@ -166,8 +167,8 @@ public class ReadTest extends AbstractTe
         dumpProperties(node);
 
         NodeIterator nodes = node.getNodes();
-        while (recursive && nodes.hasNext()) {
-            dumpNode(nodes.nextNode(), recursive);
+        while (depth > 0 && nodes.hasNext()) {
+            dumpNode(nodes.nextNode(), --depth);
         }
     }
 



Mime
View raw message