Author: fmui
Date: Wed May 12 11:31:12 2010
New Revision: 943449

URL: http://svn.apache.org/viewvc?rev=943449&view=rev
Log:
CMIS-206: Document.checkIn accepts null properties

Modified:
    
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/CmisBindingFactory.java
    
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java
    
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentSessionImpl.java
    
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/PersistentObjectFactoryImpl.java

Modified: 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/CmisBindingFactory.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/CmisBindingFactory.java?rev=943449&r1=943448&r2=943449&view=diff
==============================================================================
--- 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/CmisBindingFactory.java
 (original)
+++ 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/CmisBindingFactory.java
 Wed May 12 11:31:12 2010
@@ -36,8 +36,6 @@ public final class CmisBindingFactory {
     public static final String BINDING_SPI_WEBSERVICES = 
"org.apache.chemistry.opencmis.client.bindings.spi.webservices.CmisWebServicesSpi";
     /** Default CMIS local binding SPI implementation */
     public static final String BINDING_SPI_LOCAL = 
"org.apache.chemistry.opencmis.client.bindings.spi.local.CmisLocalSpi";
-    /** CMIS In Memory binding SPI implementation (for testing only!) */
-    public static final String BINDING_SPI_INMEMORY = 
"org.apache.chemistry.opencmis.inmemory.clientprovider.CmisInMemorySpiFactory";
 
     /** Standard authentication provider class */
     public static final String STANDARD_AUTHENTICATION_PROVIDER = 
"org.apache.chemistry.opencmis.client.bindings.spi.StandardAuthenticationProvider";

Modified: 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java?rev=943449&r1=943448&r2=943449&view=diff
==============================================================================
--- 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java
 (original)
+++ 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java
 Wed May 12 11:31:12 2010
@@ -87,6 +87,10 @@ public class PersistentFolderImpl extend
     public Document createDocument(Map<String, ?> properties, ContentStream 
contentStream,
             VersioningState versioningState, List<Policy> policies, List<Ace> 
addAces, List<Ace> removeAces,
             OperationContext context) {
+        if ((properties == null) || (properties.isEmpty())) {
+            throw new IllegalArgumentException("Properties must not be 
empty!");
+        }
+        
         String objectId = getObjectId();
 
         ObjectFactory of = getObjectFactory();
@@ -174,6 +178,10 @@ public class PersistentFolderImpl extend
      */
     public Folder createFolder(Map<String, ?> properties, List<Policy> 
policies, List<Ace> addAces,
             List<Ace> removeAces, OperationContext context) {
+        if ((properties == null) || (properties.isEmpty())) {
+            throw new IllegalArgumentException("Properties must not be 
empty!");
+        }
+        
         String objectId = getObjectId();
 
         ObjectFactory of = getObjectFactory();
@@ -205,6 +213,10 @@ public class PersistentFolderImpl extend
      */
     public Policy createPolicy(Map<String, ?> properties, List<Policy> 
policies, List<Ace> addAces,
             List<Ace> removeAces, OperationContext context) {
+        if ((properties == null) || (properties.isEmpty())) {
+            throw new IllegalArgumentException("Properties must not be 
empty!");
+        }
+        
         String objectId = getObjectId();
 
         ObjectFactory of = getObjectFactory();

Modified: 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentSessionImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentSessionImpl.java?rev=943449&r1=943448&r2=943449&view=diff
==============================================================================
--- 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentSessionImpl.java
 (original)
+++ 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentSessionImpl.java
 Wed May 12 11:31:12 2010
@@ -33,11 +33,11 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.api.Document;
 import org.apache.chemistry.opencmis.client.api.ExtensionHandler;
 import org.apache.chemistry.opencmis.client.api.Folder;
+import org.apache.chemistry.opencmis.client.api.ItemIterable;
 import org.apache.chemistry.opencmis.client.api.ObjectFactory;
 import org.apache.chemistry.opencmis.client.api.ObjectId;
 import org.apache.chemistry.opencmis.client.api.ObjectType;
 import org.apache.chemistry.opencmis.client.api.OperationContext;
-import org.apache.chemistry.opencmis.client.api.ItemIterable;
 import org.apache.chemistry.opencmis.client.api.Policy;
 import org.apache.chemistry.opencmis.client.api.QueryResult;
 import org.apache.chemistry.opencmis.client.api.Session;
@@ -46,8 +46,8 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.runtime.cache.CacheImpl;
 import 
org.apache.chemistry.opencmis.client.runtime.repository.PersistentObjectFactoryImpl;
 import org.apache.chemistry.opencmis.client.runtime.util.AbstractPageFetch;
-import org.apache.chemistry.opencmis.client.runtime.util.ContainerImpl;
 import org.apache.chemistry.opencmis.client.runtime.util.CollectionIterable;
+import org.apache.chemistry.opencmis.client.runtime.util.ContainerImpl;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.api.Ace;
 import org.apache.chemistry.opencmis.commons.api.CmisBinding;
@@ -340,7 +340,9 @@ public class PersistentSessionImpl imple
 
     /*
      * (non-Javadoc)
-     * @see 
org.apache.chemistry.opencmis.client.api.Session#createOperationContext()
+     * 
+     * @see
+     * 
org.apache.chemistry.opencmis.client.api.Session#createOperationContext()
      */
     public OperationContext createOperationContext() {
         return new OperationContextImpl();
@@ -495,6 +497,8 @@ public class PersistentSessionImpl imple
      * 
      * 
      * 
+     * 
+     * 
      * 
@seeorg.apache.opencmis.client.api.Session#getRootFolder(org.apache.opencmis
      * .client.api. OperationContext)
      */
@@ -718,6 +722,9 @@ public class PersistentSessionImpl imple
         if ((folderId != null) && (folderId.getId() == null)) {
             throw new IllegalArgumentException("Folder Id must be set!");
         }
+        if ((properties == null) || (properties.isEmpty())) {
+            throw new IllegalArgumentException("Properties must not be 
empty!");
+        }
 
         String newId = 
getBinding().getObjectService().createDocument(getRepositoryId(),
                 objectFactory.convertProperties(properties, null, 
CREATE_UPDATABILITY),
@@ -744,10 +751,6 @@ public class PersistentSessionImpl imple
      */
     public ObjectId createDocumentFromSource(ObjectId source, Map<String, ?> 
properties, ObjectId folderId,
             VersioningState versioningState, List<Policy> policies, List<Ace> 
addAces, List<Ace> removeAces) {
-        if ((folderId != null) && (folderId.getId() == null)) {
-            throw new IllegalArgumentException("Folder Id must be set!");
-        }
-
         // get the type of the source document
         ObjectType type = null;
         if (source instanceof CmisObject) {
@@ -785,6 +788,9 @@ public class PersistentSessionImpl imple
         if ((folderId != null) && (folderId.getId() == null)) {
             throw new IllegalArgumentException("Folder Id must be set!");
         }
+        if ((properties == null) || (properties.isEmpty())) {
+            throw new IllegalArgumentException("Properties must not be 
empty!");
+        }
 
         String newId = 
getBinding().getObjectService().createFolder(getRepositoryId(),
                 objectFactory.convertProperties(properties, null, 
CREATE_UPDATABILITY),
@@ -810,6 +816,9 @@ public class PersistentSessionImpl imple
         if ((folderId != null) && (folderId.getId() == null)) {
             throw new IllegalArgumentException("Folder Id must be set!");
         }
+        if ((properties == null) || (properties.isEmpty())) {
+            throw new IllegalArgumentException("Properties must not be 
empty!");
+        }
 
         String newId = 
getBinding().getObjectService().createPolicy(getRepositoryId(),
                 objectFactory.convertProperties(properties, null, 
CREATE_UPDATABILITY),
@@ -832,6 +841,10 @@ public class PersistentSessionImpl imple
      */
     public ObjectId createRelationship(Map<String, ?> properties, List<Policy> 
policies, List<Ace> addAces,
             List<Ace> removeAces) {
+        if ((properties == null) || (properties.isEmpty())) {
+            throw new IllegalArgumentException("Properties must not be 
empty!");
+        }
+
         String newId = 
getBinding().getObjectService().createRelationship(getRepositoryId(),
                 objectFactory.convertProperties(properties, null, 
CREATE_UPDATABILITY),
                 objectFactory.convertPolicies(policies), 
objectFactory.convertAces(addAces),

Modified: 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/PersistentObjectFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/PersistentObjectFactoryImpl.java?rev=943449&r1=943448&r2=943449&view=diff
==============================================================================
--- 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/PersistentObjectFactoryImpl.java
 (original)
+++ 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/PersistentObjectFactoryImpl.java
 Wed May 12 11:31:12 2010
@@ -363,7 +363,7 @@ public class PersistentObjectFactoryImpl
     public Properties convertProperties(Map<String, ?> properties, ObjectType 
type, Set<Updatability> updatabilityFilter) {
         // check input
         if (properties == null) {
-            throw new IllegalArgumentException("Properties must be set!");
+            return null;
         }
 
         // get the type


Reply via email to