chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r923406 - in /incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub: AbstractAtomPubService.java RepositoryServiceImpl.java
Date Mon, 15 Mar 2010 19:42:51 GMT
Author: fmui
Date: Mon Mar 15 19:42:50 2010
New Revision: 923406

URL: http://svn.apache.org/viewvc?rev=923406&view=rev
Log:
CMIS-161: fixed

Modified:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/AbstractAtomPubService.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/RepositoryServiceImpl.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/AbstractAtomPubService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/AbstractAtomPubService.java?rev=923406&r1=923405&r2=923406&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/AbstractAtomPubService.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/AbstractAtomPubService.java
Mon Mar 15 19:42:50 2010
@@ -763,7 +763,6 @@ public class AbstractAtomPubService {
         }
         else if (element.getObject() instanceof CmisTypeDefinitionType) {
           result = convert((CmisTypeDefinitionType) element.getObject());
-          break;
         }
       }
     }

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/RepositoryServiceImpl.java?rev=923406&r1=923405&r2=923406&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/RepositoryServiceImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/RepositoryServiceImpl.java
Mon Mar 15 19:42:50 2010
@@ -30,8 +30,8 @@ import org.apache.opencmis.client.provid
 import org.apache.opencmis.client.provider.spi.atompub.objects.AtomFeed;
 import org.apache.opencmis.client.provider.spi.atompub.objects.AtomLink;
 import org.apache.opencmis.commons.api.ExtensionsData;
-import org.apache.opencmis.commons.api.TypeDefinitionContainer;
 import org.apache.opencmis.commons.api.TypeDefinition;
+import org.apache.opencmis.commons.api.TypeDefinitionContainer;
 import org.apache.opencmis.commons.api.TypeDefinitionList;
 import org.apache.opencmis.commons.exceptions.CmisObjectNotFoundException;
 import org.apache.opencmis.commons.impl.Constants;
@@ -61,8 +61,8 @@ public class RepositoryServiceImpl exten
    * (non-Javadoc)
    * 
    * @see
-   * org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfos(org.apache.opencmis.client.provider
-   * .ExtensionsData)
+   * org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfos(org.apache.opencmis
+   * .client.provider .ExtensionsData)
    */
   public List<RepositoryInfoData> getRepositoryInfos(ExtensionsData extension) {
     return getRepositoriesInternal(null);
@@ -149,22 +149,28 @@ public class RepositoryServiceImpl exten
       }
     }
 
+    result.setList(new ArrayList<TypeDefinition>(feed.getEntries().size()));
+
     // get the children
     if (!feed.getEntries().isEmpty()) {
-      result.setList(new ArrayList<TypeDefinition>(feed.getEntries().size()));
-
       for (AtomEntry entry : feed.getEntries()) {
         TypeDefinition child = null;
 
-        // walk through the entry
-        for (AtomElement element : entry.getElements()) {
-          if (element.getObject() instanceof AtomLink) {
-            addTypeLink(repositoryId, entry.getId(), (AtomLink) element.getObject());
-          }
-          else if (element.getObject() instanceof CmisTypeDefinitionType) {
-            child = convert((CmisTypeDefinitionType) element.getObject());
+        lockTypeLinks();
+        try {
+          // walk through the entry
+          for (AtomElement element : entry.getElements()) {
+            if (element.getObject() instanceof AtomLink) {
+              addTypeLink(repositoryId, entry.getId(), (AtomLink) element.getObject());
+            }
+            else if (element.getObject() instanceof CmisTypeDefinitionType) {
+              child = convert((CmisTypeDefinitionType) element.getObject());
+            }
           }
         }
+        finally {
+          unlockTypeLinks();
+        }
 
         if (child != null) {
           result.getList().add(child);
@@ -229,18 +235,25 @@ public class RepositoryServiceImpl exten
       List<TypeDefinitionContainer> childContainerList = new ArrayList<TypeDefinitionContainer>();
 
       // walk through the entry
-      for (AtomElement element : entry.getElements()) {
-        if (element.getObject() instanceof AtomLink) {
-          addTypeLink(repositoryId, entry.getId(), (AtomLink) element.getObject());
-        }
-        else if (element.getObject() instanceof CmisTypeDefinitionType) {
-          childContainer = new TypeDefinitionContainerImpl(convert((CmisTypeDefinitionType)
element
-              .getObject()));
-        }
-        else if (element.getObject() instanceof AtomFeed) {
-          addTypeDescendantsLevel(repositoryId, (AtomFeed) element.getObject(), childContainerList);
+      lockTypeLinks();
+      try {
+        for (AtomElement element : entry.getElements()) {
+          if (element.getObject() instanceof AtomLink) {
+            addTypeLink(repositoryId, entry.getId(), (AtomLink) element.getObject());
+          }
+          else if (element.getObject() instanceof CmisTypeDefinitionType) {
+            childContainer = new TypeDefinitionContainerImpl(
+                convert((CmisTypeDefinitionType) element.getObject()));
+          }
+          else if (element.getObject() instanceof AtomFeed) {
+            addTypeDescendantsLevel(repositoryId, (AtomFeed) element.getObject(),
+                childContainerList);
+          }
         }
       }
+      finally {
+        unlockTypeLinks();
+      }
 
       if (childContainer != null) {
         childContainer.setChildren(childContainerList);



Mime
View raw message