chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1411550 [1/3] - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src: main/java/org/apache/chemistry/opencmis/inmemory/server/ main/resources/ test/java/org/apache/chemistry/opencmis/inmemory/
Date Tue, 20 Nov 2012 05:44:19 GMT
Author: jens
Date: Tue Nov 20 05:44:17 2012
New Revision: 1411550

URL: http://svn.apache.org/viewvc?rev=1411550&view=rev
Log:
InMemory: CMIS 1.1 add support for type mutability

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/resources/types.xml
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceMutabilityTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java?rev=1411550&r1=1411549&r2=1411550&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
Tue Nov 20 05:44:17 2012
@@ -145,7 +145,7 @@ public class InMemoryRepositoryServiceIm
         return result;
     }
 
-    public void createTypeDefinition(String repositoryId, Holder<TypeDefinition> type,
ExtensionsData extension) {
+    public TypeDefinition createType(String repositoryId, TypeDefinition type, ExtensionsData
extension) {
 
         if (null == repositoryId)
             throw new CmisInvalidArgumentException("Repository id may not be null");
@@ -154,15 +154,15 @@ public class InMemoryRepositoryServiceIm
         if (null == typeManager)
             throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
         
-        TypeDefinition td = type.getValue();
-        TypeValidator.checkType(typeManager, td);
-        TypeValidator.checkProperties(typeManager, td.getPropertyDefinitions().values());
+        TypeValidator.checkType(typeManager, type);
+        TypeValidator.checkProperties(typeManager, type.getPropertyDefinitions().values());
         
-        typeManager.addTypeDefinition(type.getValue());
+        typeManager.addTypeDefinition(type);
+        return type;
     }
 
-    public void updateTypeDefinition(String repositoryId, Holder<TypeDefinition> type,
ExtensionsData extension) {
-        String typeId = type.getValue().getId();
+    public TypeDefinition updateType(String repositoryId, TypeDefinition type, ExtensionsData
extension) {
+        String typeId = type.getId();
         TypeManagerCreatable typeManager = fStoreManager.getTypeManager(repositoryId);
         if (null == typeManager)
             throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
@@ -171,10 +171,11 @@ public class InMemoryRepositoryServiceIm
         if (null == typeDefC)
             throw new CmisInvalidArgumentException("Cannot update type unknown type id: "
+ typeId);
 
-        typeManager.updateTypeDefinition(type.getValue());
+        typeManager.updateTypeDefinition(type);
+        return type;
     }
 
-    public void deleteTypeDefinition(String repositoryId, String typeId, ExtensionsData extension)
{
+    public void deleteType(String repositoryId, String typeId, ExtensionsData extension)
{
         
         TypeManagerCreatable typeManager = fStoreManager.getTypeManager(repositoryId);
         if (null == typeManager)
@@ -185,10 +186,6 @@ public class InMemoryRepositoryServiceIm
             throw new CmisInvalidArgumentException("Cannot delete type unknown type id: "
+ typeId);
 
         TypeDefinition typeDef =  typeDefC.getTypeDefinition();
-        // TODO: re-enable when CMIS 1.1 is supported.
-//        if (!typeDef.getTypeMutability().supportsDelete()) {
-//            throw new CmisInvalidArgumentException("type definition " + typeId + " cannot
be deleted, deletion is not supported for type id " + typeId);            
-//        }
 
         ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
         if (objectStore.isTypeInUse(typeId)) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java?rev=1411550&r1=1411549&r2=1411550&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
Tue Nov 20 05:44:17 2012
@@ -112,6 +112,22 @@ public class InMemoryService extends Abs
         return fRepSvc.getTypeDefinition(getCallContext(), repositoryId, typeId, extension);
     }
 
+    
+    @Override
+    public TypeDefinition createType(String repositoryId, TypeDefinition type, ExtensionsData
extension) {
+        return fRepSvc.createType(repositoryId, type, extension);
+    }
+
+    @Override
+    public TypeDefinition updateType(String repositoryId, TypeDefinition type, ExtensionsData
extension) {
+        return fRepSvc.updateType(repositoryId, type, extension);
+    }
+
+    @Override
+    public void deleteType(String repositoryId, String typeId, ExtensionsData extension)
{
+        fRepSvc.deleteType(repositoryId, typeId, extension);
+    }
+
     @Override
     public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String
typeId, BigInteger depth,
             Boolean includePropertyDefinitions, ExtensionsData extension) {



Mime
View raw message