chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r1001658 - in /incubator/chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ chemistry-opencmis-server/chemistry-opencmis-server-inm...
Date Mon, 27 Sep 2010 10:18:56 GMT
Author: fguillaume
Date: Mon Sep 27 10:18:55 2010
New Revision: 1001658

URL: http://svn.apache.org/viewvc?rev=1001658&view=rev
Log:
Fix root getObjectParents

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyNavigationIT.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java?rev=1001658&r1=1001657&r2=1001658&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java
Mon Sep 27 10:18:55 2010
@@ -260,7 +260,8 @@ public class NavigationServiceImpl exten
         String link = loadLink(repositoryId, objectId, Constants.REL_UP, Constants.MEDIATYPE_FEED);
 
         if (link == null) {
-            throwLinkException(repositoryId, objectId, Constants.REL_UP, Constants.MEDIATYPE_FEED);
+            // root and unfiled objects have no UP link
+            return result;
         }
 
         UrlBuilder url = new UrlBuilder(link);

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java?rev=1001658&r1=1001657&r2=1001658&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
Mon Sep 27 10:18:55 2010
@@ -250,7 +250,7 @@ public class InMemoryObjectServiceImpl e
         LOG.debug("start deleteObject()");
         checkStandardParameters(repositoryId, objectId);
         ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
-        LOG.info("delete object for id: " + objectId);
+        LOG.debug("delete object for id: " + objectId);
 
         // check if it is the root folder
         if (objectId.equals(objectStore.getRootFolder().getId()))
@@ -630,7 +630,7 @@ public class InMemoryObjectServiceImpl e
             objectId.setValue(so.getId()); // might have a new id
             if (null != changeToken) {
                 String changeTokenVal = so.getChangeToken();
-                LOG.info("updateProperties(), new change token is: " + changeTokenVal);
+                LOG.debug("updateProperties(), new change token is: " + changeTokenVal);
                 changeToken.setValue(changeTokenVal);
             }
         }
@@ -811,7 +811,7 @@ public class InMemoryObjectServiceImpl e
 
         // create folder
         try {
-            LOG.info("get folder for id: " + folderId);
+            LOG.debug("get folder for id: " + folderId);
             so = fs.getObjectById(folderId);
         } catch (Exception e) {
             throw new CmisObjectNotFoundException("Failed to retrieve folder.", e);
@@ -849,7 +849,7 @@ public class InMemoryObjectServiceImpl e
         String sourceId = sourceFolder.getId();
         String targetId = targetFolder.getId();
         while (targetId != null) {
-            // log.info("comparing source id " + sourceId + " with predecessor "
+            // log.debug("comparing source id " + sourceId + " with predecessor "
             // +
             // targetId);
             if (targetId.equals(sourceId))

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyNavigationIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyNavigationIT.java?rev=1001658&r1=1001657&r2=1001658&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyNavigationIT.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyNavigationIT.java
Mon Sep 27 10:18:55 2010
@@ -18,6 +18,7 @@
  */
 package org.apache.chemistry.opencmis.fit.runtime;
 
+import java.util.Collections;
 import java.util.List;
 
 import junit.framework.Assert;
@@ -26,6 +27,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.api.FileableCmisObject;
 import org.apache.chemistry.opencmis.client.api.Folder;
 import org.apache.chemistry.opencmis.client.api.ItemIterable;
+import org.apache.chemistry.opencmis.client.api.Property;
 import org.apache.chemistry.opencmis.client.api.Tree;
 import org.junit.Test;
 
@@ -198,4 +200,20 @@ public abstract class AbstractReadOnlyNa
         CmisObject firstObject = pl.iterator().next();
         Assert.assertNotNull(firstObject);
     }
+
+    @Test
+    public void rootParent() {
+        Folder root = session.getRootFolder();
+        Assert.assertNotNull(root);
+        Assert.assertNotNull(root.getName());
+        Assert.assertNotNull(root.getId());
+        Assert.assertNotNull(root.getType());
+        List<Property<?>> props = root.getProperties();
+        Assert.assertNotNull(props);
+        Assert.assertTrue(props.size() > 0);
+        Assert.assertEquals("/", root.getPath());
+        Assert.assertEquals(Collections.singletonList("/"), root.getPaths());
+        Assert.assertNull(root.getFolderParent());
+        Assert.assertEquals(Collections.emptyList(), root.getParents());
+    }
 }



Mime
View raw message