You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by je...@apache.org on 2013/07/01 18:17:48 UTC

svn commit: r1498544 - in /chemistry/opencmis/branches/inmemory-refactoring/src: main/java/org/apache/chemistry/opencmis/inmemory/ main/java/org/apache/chemistry/opencmis/inmemory/server/ test/java/org/apache/chemistry/opencmis/inmemory/

Author: jens
Date: Mon Jul  1 16:17:47 2013
New Revision: 1498544

URL: http://svn.apache.org/r1498544
Log:
InMemory: Minor bugfixes and typos

Modified:
    chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
    chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
    chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java

Modified: chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java?rev=1498544&r1=1498543&r2=1498544&view=diff
==============================================================================
--- chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java (original)
+++ chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java Mon Jul  1 16:17:47 2013
@@ -405,9 +405,9 @@ public class TypeValidator {
 
     private static void checkBaseAndParentType(TypeManager tm, TypeDefinition td) {
         if (null == td.getBaseTypeId()) 
-            throw new CmisInvalidArgumentException("You canno create a type without a base type id: " + td.getId());
+            throw new CmisInvalidArgumentException("You cannot create a type without a base type id: " + td.getId());
         if (null == td.getParentTypeId()) 
-            throw new CmisInvalidArgumentException("You canno create a type without a parent type id: " + td.getId());
+            throw new CmisInvalidArgumentException("You cannot create a type without a parent type id: " + td.getId());
         
     }
 

Modified: chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java?rev=1498544&r1=1498543&r2=1498544&view=diff
==============================================================================
--- chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java (original)
+++ chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java Mon Jul  1 16:17:47 2013
@@ -571,7 +571,7 @@ public class InMemoryObjectServiceImpl e
 
         if (changeToken != null && changeToken.getValue() != null
                 && Long.valueOf(so.getChangeToken()) > Long.valueOf(changeToken.getValue())) {
-            throw new CmisUpdateConflictException("updateProperties failed: changeToken does not match");
+            throw new CmisUpdateConflictException("setContentStream failed: changeToken does not match");
         }
 
         if (!(so instanceof Document || so instanceof VersionedDocument || so instanceof DocumentVersion)) {
@@ -665,12 +665,17 @@ public class InMemoryObjectServiceImpl e
 
                 PropertyData<?> value = properties.getProperties().get(key);
                 PropertyDefinition<?> propDef = typeDef.getPropertyDefinitions().get(key);
-                if (null == propDef && cmis11) {
-                    TypeDefinition typeDefSecondary = getSecondaryTypeDefinition(repositoryId, secondaryTypeIds, key);
-                    if (null == typeDefSecondary)
-                        throw new CmisInvalidArgumentException("Cannot update property " + key
-                                + ": not contained in type");
-                    propDef = typeDefSecondary.getPropertyDefinitions().get(key);
+                if (null == propDef) {
+                    if (cmis11) {
+                        TypeDefinition typeDefSecondary = getSecondaryTypeDefinition(repositoryId, secondaryTypeIds, key);
+                        if (null == typeDefSecondary)
+                            throw new CmisInvalidArgumentException("Cannot update property " + key
+                                    + ": not contained in type");
+                        propDef = typeDefSecondary.getPropertyDefinitions().get(key);
+                    } else {
+                        throw new CmisInvalidArgumentException("Unknown property " + key
+                                + ": not contained in type");                        
+                    }
                 }
 
                 if (value.getValues() == null || value.getFirstValue() == null) {

Modified: chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java?rev=1498544&r1=1498543&r2=1498544&view=diff
==============================================================================
--- chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java (original)
+++ chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java Mon Jul  1 16:17:47 2013
@@ -196,7 +196,7 @@ public class UnitTestTypeSystemCreator i
                 "Sample Html Property", Updatability.READONLY);
         propertyDefinitions.put(prop4.getId(), prop4);
 
-        prop4 = PropertyCreationHelper.createHtmlDefinition(PROP_ID_HTML_MULTI_VALUE, "Sample Html multi-value Property", Updatability.READONLY);
+        prop4 = PropertyCreationHelper.createHtmlMultiDefinition(PROP_ID_HTML_MULTI_VALUE, "Sample Html multi-value Property", Updatability.READONLY);
         propertyDefinitions.put(prop4.getId(), prop4);
 
         PropertyIdDefinitionImpl prop5 = PropertyCreationHelper.createIdDefinition(PROP_ID_ID, "Sample Id Property", Updatability.READONLY);