chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r917601 - /incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
Date Mon, 01 Mar 2010 17:26:08 GMT
Author: jens
Date: Mon Mar  1 17:26:07 2010
New Revision: 917601

URL: http://svn.apache.org/viewvc?rev=917601&view=rev
Log:
Fix bug in getTypechildren: return only base types if type id param is null

Modified:
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java?rev=917601&r1=917600&r2=917601&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
Mon Mar  1 17:26:07 2010
@@ -81,21 +81,27 @@
     int max = maxItems == null ? -1 : maxItems.intValue();
       
     TypeDefinitionListImpl result = new TypeDefinitionListImpl();
-    List<TypeDefinitionContainer> children = getTypeDescendants(context, repositoryId,
typeId, 
+    List<TypeDefinitionContainer> children;
+    if (typeId == null) {
+      // spec says that base types must be returned in this case
+      children = fStoreManager.getRootTypes(repositoryId);
+    } else {    
+      children = getTypeDescendants(context, repositoryId, typeId, 
         BigInteger.valueOf(1), includePropertyDefinitions, null);
+    }
     result.setNumItems(BigInteger.valueOf(children.size()));
     result.setHasMoreItems(children.size() > max - skip);
     List<TypeDefinition> childrenTypes = new ArrayList<TypeDefinition>();
     ListIterator<TypeDefinitionContainer> it = children.listIterator(skip);
     if (max<0)
       max = children.size();
-    for (int i=0; i<max && it.hasNext(); i++)
+    for (int i=skip; i<max+skip && it.hasNext(); i++)
       childrenTypes.add(it.next().getTypeDefinition());
 
     result.setList(childrenTypes);      
     return result;
   }
-
+  
   public TypeDefinition getTypeDefinition(CallContext context, String repositoryId,
       String typeId, ExtensionsData extension) {
     



Mime
View raw message