chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1059666 - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-server: chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/ chemistry-opencmis-server-support/src/main/java/org/apache/chemistry...
Date Sun, 16 Jan 2011 21:04:25 GMT
Author: jens
Date: Sun Jan 16 21:04:25 2011
New Revision: 1059666

URL: http://svn.apache.org/viewvc?rev=1059666&view=rev
Log:
small bug fix: make cmis:name a required property

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DocumentTypeCreationHelper.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DocumentTypeCreationHelper.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DocumentTypeCreationHelper.java?rev=1059666&r1=1059665&r2=1059666&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DocumentTypeCreationHelper.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DocumentTypeCreationHelper.java
Sun Jan 16 21:04:25 2011
@@ -83,6 +83,7 @@ public class DocumentTypeCreationHelper 
         PropertyStringDefinitionImpl propS = PropertyCreationHelper.createStringDefinition(PropertyIds.NAME,
                 "CMIS Name Property");
         propS.setUpdatability(Updatability.READWRITE);
+        propS.setIsRequired(true);
         propertyDefinitions.put(propS.getId(), propS);
 
         PropertyIdDefinitionImpl propId = PropertyCreationHelper.createIdDefinition(PropertyIds.OBJECT_ID,

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java?rev=1059666&r1=1059665&r2=1059666&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
Sun Jan 16 21:04:25 2011
@@ -241,6 +241,10 @@ public class TypeValidator {
             String propertyId = prop.getId();
             BaseTypeId baseTypeId = typeDef.getBaseTypeId();
 
+            // check that all mandatory attributes are present
+            if (checkMandatory && propDefsRequired.contains(propertyId))
+                propDefsRequired.remove(propertyId);
+
             if (isSystemProperty(baseTypeId, propertyId))
                 continue; // ignore system properties for validation
 
@@ -249,10 +253,6 @@ public class TypeValidator {
                 throw new CmisConstraintException("Unknown property " + propertyId + " in
type " + typeDef.getId());
             }
 
-            // check that all mandatory attributes are present
-            if (checkMandatory && propDefsRequired.contains(propertyId))
-                propDefsRequired.remove(propertyId);
-
             // check all type specific constraints:
             PropertyDefinition<T> propDef = getPropertyDefinition(typeDef, propertyId);
             PropertyValidator<T> validator = createPropertyValidator(propDef);



Mime
View raw message