chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1186527 [1/2] - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src: main/java/org/apache/chemistry/opencmis/inmemory/types/ test/java/org/apache/chemistry/opencmis/inmemory/ test/java/org/apache/c...
Date Wed, 19 Oct 2011 22:01:34 GMT
Author: jens
Date: Wed Oct 19 22:01:31 2011
New Revision: 1186527

URL: http://svn.apache.org/viewvc?rev=1186527&view=rev
Log:
pass updatibility flag on property definition creattion, some cleanupos in type creation

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DocumentTypeCreationHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclPermissionsTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/MultiFilingTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersioningTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryTestDataCreator.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.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/types/DefaultTypeSystemCreator.java?rev=1186527&r1=1186526&r2=1186527&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.java Wed Oct 19 22:01:31 2011
@@ -29,6 +29,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.enums.Updatability;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.ChoiceImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyDateTimeDefinitionImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyDecimalDefinitionImpl;
@@ -70,7 +71,7 @@ public class DefaultTypeSystemCreator im
 
     /**
      * Create root types and a collection of sample types.
-     *
+     * 
      * @return typesMap a map filled with created types
      */
     private static List<TypeDefinition> buildTypesList() {
@@ -140,60 +141,67 @@ public class DefaultTypeSystemCreator im
         Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
 
         PropertyDefinition<Boolean> prop = PropertyCreationHelper.createBooleanDefinition("BooleanProp",
-                "Sample Boolean Property");
+                "Sample Boolean Property", Updatability.READWRITE);
         propertyDefinitions.put(prop.getId(), prop);
 
         prop = PropertyCreationHelper.createBooleanMultiDefinition("BooleanPropMV",
-                "Sample Boolean multi-value Property");
+                "Sample Boolean multi-value Property", Updatability.READWRITE);
         propertyDefinitions.put(prop.getId(), prop);
 
         PropertyDateTimeDefinitionImpl prop2 = PropertyCreationHelper.createDateTimeDefinition("DateTimeProp",
-                "Sample DateTime Property");
+                "Sample DateTime Property", Updatability.READWRITE);
         propertyDefinitions.put(prop2.getId(), prop2);
 
         prop2 = PropertyCreationHelper.createDateTimeMultiDefinition("DateTimePropMV",
-                "Sample DateTime multi-value Property");
+                "Sample DateTime multi-value Property", Updatability.READWRITE);
         propertyDefinitions.put(prop2.getId(), prop2);
 
         PropertyDecimalDefinitionImpl prop3 = PropertyCreationHelper.createDecimalDefinition("DecimalProp",
-                "Sample Decimal Property");
+                "Sample Decimal Property", Updatability.READWRITE);
         propertyDefinitions.put(prop3.getId(), prop3);
 
-        prop3 = PropertyCreationHelper.createDecimalMultiDefinition("DecimalPropMV", "Sample Decimal multi-value Property");
+        prop3 = PropertyCreationHelper.createDecimalMultiDefinition("DecimalPropMV",
+                "Sample Decimal multi-value Property", Updatability.READWRITE);
         propertyDefinitions.put(prop3.getId(), prop3);
 
         PropertyHtmlDefinitionImpl prop4 = PropertyCreationHelper.createHtmlDefinition("HtmlProp",
-                "Sample Html Property");
+                "Sample Html Property", Updatability.READWRITE);
         propertyDefinitions.put(prop4.getId(), prop4);
 
-        prop4 = PropertyCreationHelper.createHtmlMultiDefinition("HtmlPropMV", "Sample Html multi-value Property");
+        prop4 = PropertyCreationHelper.createHtmlMultiDefinition("HtmlPropMV", "Sample Html multi-value Property",
+                Updatability.READWRITE);
         propertyDefinitions.put(prop4.getId(), prop4);
 
-        PropertyIdDefinitionImpl prop5 = PropertyCreationHelper.createIdDefinition("IdProp", "Sample Id Property");
+        PropertyIdDefinitionImpl prop5 = PropertyCreationHelper.createIdDefinition("IdProp", "Sample Id Property",
+                Updatability.READWRITE);
         propertyDefinitions.put(prop5.getId(), prop5);
 
-        prop5 = PropertyCreationHelper.createIdMultiDefinition("IdPropMV", "Sample Id Html multi-value Property");
+        prop5 = PropertyCreationHelper.createIdMultiDefinition("IdPropMV", "Sample Id Html multi-value Property",
+                Updatability.READWRITE);
         propertyDefinitions.put(prop5.getId(), prop5);
 
         PropertyIntegerDefinitionImpl prop6 = PropertyCreationHelper.createIntegerDefinition("IntProp",
-                "Sample Int Property");
+                "Sample Int Property", Updatability.READWRITE);
         propertyDefinitions.put(prop6.getId(), prop6);
 
-        prop6 = PropertyCreationHelper.createIntegerMultiDefinition("IntPropMV", "Sample Int multi-value Property");
+        prop6 = PropertyCreationHelper.createIntegerMultiDefinition("IntPropMV", "Sample Int multi-value Property",
+                Updatability.READWRITE);
         propertyDefinitions.put(prop6.getId(), prop6);
 
         PropertyStringDefinitionImpl prop7 = PropertyCreationHelper.createStringDefinition("StringProp",
-                "Sample String Property");
+                "Sample String Property", Updatability.READWRITE);
         propertyDefinitions.put(prop7.getId(), prop7);
 
-        PropertyUriDefinitionImpl prop8 = PropertyCreationHelper.createUriDefinition("UriProp", "Sample Uri Property");
+        PropertyUriDefinitionImpl prop8 = PropertyCreationHelper.createUriDefinition("UriProp", "Sample Uri Property",
+                Updatability.READWRITE);
         propertyDefinitions.put(prop8.getId(), prop8);
 
-        prop8 = PropertyCreationHelper.createUriMultiDefinition("UriPropMV", "Sample Uri multi-value Property");
+        prop8 = PropertyCreationHelper.createUriMultiDefinition("UriPropMV", "Sample Uri multi-value Property",
+                Updatability.READWRITE);
         propertyDefinitions.put(prop8.getId(), prop8);
 
         PropertyStringDefinitionImpl prop9 = PropertyCreationHelper.createStringDefinition("PickListProp",
-                "Sample Pick List Property");
+                "Sample Pick List Property", Updatability.READWRITE);
         List<Choice<String>> choiceList = new ArrayList<Choice<String>>();
         ChoiceImpl<String> elem = new ChoiceImpl<String>();
         elem.setValue(Collections.singletonList("red"));
@@ -236,19 +244,19 @@ public class DefaultTypeSystemCreator im
 
         propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
         PropertyStringDefinitionImpl propTop = PropertyCreationHelper.createStringDefinition("StringPropTopLevel",
-                "Sample String Property");
+                "Sample String Property", Updatability.READWRITE);
         propertyDefinitions.put(propTop.getId(), propTop);
         cmisDocTypeTopLevel.setPropertyDefinitions(propertyDefinitions);
 
         propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
         PropertyStringDefinitionImpl propLevel1 = PropertyCreationHelper.createStringDefinition("StringPropLevel1",
-                "String Property Level 1");
+                "String Property Level 1", Updatability.READWRITE);
         propertyDefinitions.put(propLevel1.getId(), propLevel1);
         cmisDocTypeLevel1.setPropertyDefinitions(propertyDefinitions);
 
         propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
         PropertyStringDefinitionImpl propLevel2 = PropertyCreationHelper.createStringDefinition("StringPropLevel2",
-                "String Property Level 2");
+                "String Property Level 2", Updatability.READWRITE);
         propertyDefinitions.put(propLevel2.getId(), propLevel2);
         cmisDocTypeLevel2.setPropertyDefinitions(propertyDefinitions);
 
@@ -266,7 +274,7 @@ public class DefaultTypeSystemCreator im
         propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
 
         PropertyStringDefinitionImpl prop1 = PropertyCreationHelper.createStringDefinition("VersionedStringProp",
-                "Sample String Property");
+                "Sample String Property", Updatability.WHENCHECKEDOUT);
         propertyDefinitions.put(prop1.getId(), prop1);
 
         cmisVersionedType.addCustomPropertyDefinitions(propertyDefinitions);

Modified: 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/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DocumentTypeCreationHelper.java?rev=1186527&r1=1186526&r2=1186527&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DocumentTypeCreationHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DocumentTypeCreationHelper.java Wed Oct 19 22:01:31 2011
@@ -84,46 +84,37 @@ public class DocumentTypeCreationHelper 
     public static void setBasicPropertyDefinitions(Map<String, PropertyDefinition<?>> propertyDefinitions) {
 
         PropertyStringDefinitionImpl propS = PropertyCreationHelper.createStringDefinition(PropertyIds.NAME,
-                "CMIS Name Property");
-        propS.setUpdatability(Updatability.READWRITE);
+                "CMIS Name Property", Updatability.READWRITE);
         propS.setIsRequired(true);
         propertyDefinitions.put(propS.getId(), propS);
 
         PropertyIdDefinitionImpl propId = PropertyCreationHelper.createIdDefinition(PropertyIds.OBJECT_ID,
-                "CMIS Object Id Property");
-        propId.setUpdatability(Updatability.READONLY);
+                "CMIS Object Id Property", Updatability.READONLY);
         propertyDefinitions.put(propId.getId(), propId);
 
-        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.OBJECT_TYPE_ID, "CMIS Object Type Id Property");
-        propId.setUpdatability(Updatability.ONCREATE);
+        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.OBJECT_TYPE_ID, "CMIS Object Type Id Property", Updatability.ONCREATE);
         propId.setIsRequired(true);
         propertyDefinitions.put(propId.getId(), propId);
 
-        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.BASE_TYPE_ID, "CMIS Base Type Id Property");
-        propId.setUpdatability(Updatability.READONLY);
+        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.BASE_TYPE_ID, "CMIS Base Type Id Property", Updatability.READONLY);
         propertyDefinitions.put(propId.getId(), propId);
 
-        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CREATED_BY, "CMIS Created By Property");
-        propS.setUpdatability(Updatability.READONLY);
+        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CREATED_BY, "CMIS Created By Property", Updatability.READONLY);
         propertyDefinitions.put(propS.getId(), propS);
 
         PropertyDateTimeDefinitionImpl propD = PropertyCreationHelper.createDateTimeDefinition(
-                PropertyIds.CREATION_DATE, "CMIS Creation Date Property");
-        propD.setUpdatability(Updatability.READONLY);
+                PropertyIds.CREATION_DATE, "CMIS Creation Date Property", Updatability.READONLY);
         propertyDefinitions.put(propD.getId(), propD);
 
         propS = PropertyCreationHelper.createStringDefinition(PropertyIds.LAST_MODIFIED_BY,
-                "CMIS Last Modified By Property");
-        propS.setUpdatability(Updatability.READONLY);
+                "CMIS Last Modified By Property", Updatability.READONLY);
         propertyDefinitions.put(propS.getId(), propS);
 
         propD = PropertyCreationHelper.createDateTimeDefinition(PropertyIds.LAST_MODIFICATION_DATE,
-                "CMIS Last Modification Date Property");
-        propD.setUpdatability(Updatability.READONLY);
+                "CMIS Last Modification Date Property", Updatability.READONLY);
         propertyDefinitions.put(propD.getId(), propD);
 
-        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CHANGE_TOKEN, "CMIS Change Token Property");
-        propS.setUpdatability(Updatability.READONLY);
+        propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CHANGE_TOKEN, "CMIS Change Token Property", Updatability.READONLY);
         propertyDefinitions.put(propS.getId(), propS);
     }
 
@@ -131,74 +122,60 @@ public class DocumentTypeCreationHelper 
 
         setBasicPropertyDefinitions(propertyDefinitions);
         PropertyBooleanDefinitionImpl propB = PropertyCreationHelper.createBooleanDefinition(PropertyIds.IS_IMMUTABLE,
-                "CMIS Is Immutable Property");
-        propB.setUpdatability(Updatability.READONLY);
+                "CMIS Is Immutable Property", Updatability.READONLY);
         propertyDefinitions.put(propB.getId(), propB);
 
         propB = PropertyCreationHelper.createBooleanDefinition(PropertyIds.IS_LATEST_VERSION,
-                "CMIS Is Latest Version Property");
-        propB.setUpdatability(Updatability.READONLY);
+                "CMIS Is Latest Version Property", Updatability.READONLY);
         propertyDefinitions.put(propB.getId(), propB);
 
         propB = PropertyCreationHelper.createBooleanDefinition(PropertyIds.IS_MAJOR_VERSION,
-                "CMIS Is Major Version Property");
-        propB.setUpdatability(Updatability.READONLY);
+                "CMIS Is Major Version Property", Updatability.READONLY);
         propertyDefinitions.put(propB.getId(), propB);
 
         propB = PropertyCreationHelper.createBooleanDefinition(PropertyIds.IS_LATEST_MAJOR_VERSION,
-                "CMIS Is Latest Major Version Property");
-        propB.setUpdatability(Updatability.READONLY);
+                "CMIS Is Latest Major Version Property", Updatability.READONLY);
         propertyDefinitions.put(propB.getId(), propB);
 
         PropertyStringDefinitionImpl propS = PropertyCreationHelper.createStringDefinition(PropertyIds.VERSION_LABEL,
-                "CMIS Version Label Property");
-        propS.setUpdatability(Updatability.READONLY);
+                "CMIS Version Label Property", Updatability.READONLY);
         propertyDefinitions.put(propS.getId(), propS);
 
         PropertyIdDefinitionImpl propId = PropertyCreationHelper.createIdDefinition(PropertyIds.VERSION_SERIES_ID,
-                "CMIS Version Series Id Property");
-        propId.setUpdatability(Updatability.READONLY);
+                "CMIS Version Series Id Property", Updatability.READONLY);
         propertyDefinitions.put(propId.getId(), propId);
 
         propB = PropertyCreationHelper.createBooleanDefinition(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT,
-                "CMIS Is Version Series Checked Out Property");
-        propB.setUpdatability(Updatability.READONLY);
+                "CMIS Is Version Series Checked Out Property", Updatability.READONLY);
         propertyDefinitions.put(propB.getId(), propB);
 
         propS = PropertyCreationHelper.createStringDefinition(PropertyIds.VERSION_SERIES_CHECKED_OUT_BY,
-                "CMIS Version Series Checked Out By Property");
-        propS.setUpdatability(Updatability.READONLY);
+                "CMIS Version Series Checked Out By Property", Updatability.READONLY);
         propertyDefinitions.put(propS.getId(), propS);
 
         propId = PropertyCreationHelper.createIdDefinition(PropertyIds.VERSION_SERIES_CHECKED_OUT_ID,
-                "CMIS Version Series Checked Out Id Property");
-        propId.setUpdatability(Updatability.READONLY);
+                "CMIS Version Series Checked Out Id Property", Updatability.READONLY);
         propertyDefinitions.put(propId.getId(), propId);
 
         propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CHECKIN_COMMENT,
-                "CMIS Checkin Comment Property");
-        propS.setUpdatability(Updatability.READONLY); // Note: spec says
+                "CMIS Checkin Comment Property", Updatability.READONLY);
         // read-only, because
         // not set as property
         propertyDefinitions.put(propS.getId(), propS);
 
         PropertyIntegerDefinitionImpl propI = PropertyCreationHelper.createIntegerDefinition(
-                PropertyIds.CONTENT_STREAM_LENGTH, "CMIS Content Stream Length Property");
-        propI.setUpdatability(Updatability.READONLY);
+                PropertyIds.CONTENT_STREAM_LENGTH, "CMIS Content Stream Length Property", Updatability.READONLY);
         propertyDefinitions.put(propI.getId(), propI);
 
         propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CONTENT_STREAM_MIME_TYPE,
-                "CMIS Content Stream Mime Type Property");
-        propS.setUpdatability(Updatability.READONLY);
+                "CMIS Content Stream Mime Type Property", Updatability.READONLY);
         propertyDefinitions.put(propS.getId(), propS);
 
         propS = PropertyCreationHelper.createStringDefinition(PropertyIds.CONTENT_STREAM_FILE_NAME,
-                "CMIS Content Stream File Name Property");
-        propS.setUpdatability(Updatability.READONLY);
+                "CMIS Content Stream File Name Property", Updatability.READONLY);
         propertyDefinitions.put(propS.getId(), propS);
 
-        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.CONTENT_STREAM_ID, "CMIS Stream Id Property");
-        propId.setUpdatability(Updatability.READONLY);
+        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.CONTENT_STREAM_ID, "CMIS Stream Id Property", Updatability.READONLY);
         propertyDefinitions.put(propId.getId(), propId);
 
     }
@@ -207,19 +184,16 @@ public class DocumentTypeCreationHelper 
 
         setBasicPropertyDefinitions(propertyDefinitions);
         PropertyIdDefinitionImpl propId = PropertyCreationHelper.createIdDefinition(PropertyIds.PARENT_ID,
-                "CMIS Parent Id Property");
-        propId.setUpdatability(Updatability.READONLY);
+                "CMIS Parent Id Property", Updatability.READONLY);
         propertyDefinitions.put(propId.getId(), propId);
 
         propId = PropertyCreationHelper.createIdDefinition(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS,
-                "CMIS Allowed Childe Object Type Ids Property");
-        propId.setUpdatability(Updatability.READONLY);
+                "CMIS Allowed Childe Object Type Ids Property", Updatability.READONLY);
         propId.setCardinality(Cardinality.MULTI);
         propertyDefinitions.put(propId.getId(), propId);
 
         PropertyStringDefinitionImpl propS = PropertyCreationHelper.createStringDefinition(PropertyIds.PATH,
-                "CMIS Path Property");
-        propS.setUpdatability(Updatability.READONLY);
+                "CMIS Path Property", Updatability.READONLY);
         propertyDefinitions.put(propS.getId(), propS);
 
     }
@@ -228,7 +202,7 @@ public class DocumentTypeCreationHelper 
 
         setBasicPropertyDefinitions(propertyDefinitions);
         PropertyStringDefinitionImpl propS = PropertyCreationHelper.createStringDefinition(PropertyIds.POLICY_TEXT,
-                "CMIS Policy Text Property");
+                "CMIS Policy Text Property", Updatability.READONLY);
         propS.setIsRequired(true);
         propertyDefinitions.put(propS.getId(), propS);
     }
@@ -237,11 +211,11 @@ public class DocumentTypeCreationHelper 
 
         setBasicPropertyDefinitions(propertyDefinitions);
         PropertyIdDefinitionImpl propId = PropertyCreationHelper.createIdDefinition(PropertyIds.SOURCE_ID,
-                "CMIS Source Id Property");
+                "CMIS Source Id Property", Updatability.READONLY);
         propId.setIsRequired(true);
         propertyDefinitions.put(propId.getId(), propId);
 
-        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.TARGET_ID, "CMIS Target Id Property");
+        propId = PropertyCreationHelper.createIdDefinition(PropertyIds.TARGET_ID, "CMIS Target Id Property", Updatability.READONLY);
         propId.setIsRequired(true);
         propertyDefinitions.put(propId.getId(), propId);
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.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/types/InMemoryDocumentTypeDefinition.java?rev=1186527&r1=1186526&r2=1186527&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java Wed Oct 19 22:01:31 2011
@@ -78,12 +78,6 @@ public class InMemoryDocumentTypeDefinit
         DocumentTypeCreationHelper.mergePropertyDefinitions(getPropertyDefinitions(), propertyDefinitions);
     }
 
-    // public void setProperties() {
-    // Map<String, PropertyDefinition<?>> propertyDefinitions = new
-    // HashMap<String, PropertyDefinition<?>>();
-    // this.setPropertyDefinitions(propertyDefinitions);
-    // }
-
     private void init(String id, String displayName) {
         if (!NameValidator.isValidId(id)) {
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_ID);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.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/types/PropertyCreationHelper.java?rev=1186527&r1=1186526&r2=1186527&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java Wed Oct 19 22:01:31 2011
@@ -78,7 +78,7 @@ import org.apache.commons.logging.LogFac
 
 /**
  * @author Jens
- *
+ * 
  */
 public class PropertyCreationHelper {
 
@@ -87,99 +87,105 @@ public class PropertyCreationHelper {
     private PropertyCreationHelper() {
     }
 
-    public static PropertyBooleanDefinitionImpl createBooleanDefinition(String id, String displayName) {
+    public static PropertyBooleanDefinitionImpl createBooleanDefinition(String id, String displayName, Updatability upd) {
         PropertyBooleanDefinitionImpl prop = new PropertyBooleanDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.BOOLEAN, displayName, Cardinality.SINGLE);
+        createStandardDefinition(prop, id, PropertyType.BOOLEAN, displayName, Cardinality.SINGLE, upd);
         return prop;
     }
 
-    public static PropertyBooleanDefinitionImpl createBooleanMultiDefinition(String id, String displayName) {
+    public static PropertyBooleanDefinitionImpl createBooleanMultiDefinition(String id, String displayName,
+            Updatability upd) {
         PropertyBooleanDefinitionImpl prop = new PropertyBooleanDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.BOOLEAN, displayName, Cardinality.MULTI);
+        createStandardDefinition(prop, id, PropertyType.BOOLEAN, displayName, Cardinality.MULTI, upd);
         return prop;
     }
 
-    public static PropertyDateTimeDefinitionImpl createDateTimeDefinition(String id, String displayName) {
+    public static PropertyDateTimeDefinitionImpl createDateTimeDefinition(String id, String displayName,
+            Updatability upd) {
         PropertyDateTimeDefinitionImpl prop = new PropertyDateTimeDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.DATETIME, displayName, Cardinality.SINGLE);
+        createStandardDefinition(prop, id, PropertyType.DATETIME, displayName, Cardinality.SINGLE, upd);
         return prop;
     }
 
-    public static PropertyDateTimeDefinitionImpl createDateTimeMultiDefinition(String id, String displayName) {
+    public static PropertyDateTimeDefinitionImpl createDateTimeMultiDefinition(String id, String displayName,
+            Updatability upd) {
         PropertyDateTimeDefinitionImpl prop = new PropertyDateTimeDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.DATETIME, displayName, Cardinality.MULTI);
+        createStandardDefinition(prop, id, PropertyType.DATETIME, displayName, Cardinality.MULTI, upd);
         return prop;
     }
 
-    public static PropertyDecimalDefinitionImpl createDecimalDefinition(String id, String displayName) {
+    public static PropertyDecimalDefinitionImpl createDecimalDefinition(String id, String displayName, Updatability upd) {
         PropertyDecimalDefinitionImpl prop = new PropertyDecimalDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.DECIMAL, displayName, Cardinality.SINGLE);
+        createStandardDefinition(prop, id, PropertyType.DECIMAL, displayName, Cardinality.SINGLE, upd);
         return prop;
     }
 
-    public static PropertyDecimalDefinitionImpl createDecimalMultiDefinition(String id, String displayName) {
+    public static PropertyDecimalDefinitionImpl createDecimalMultiDefinition(String id, String displayName,
+            Updatability upd) {
         PropertyDecimalDefinitionImpl prop = new PropertyDecimalDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.DECIMAL, displayName, Cardinality.MULTI);
+        createStandardDefinition(prop, id, PropertyType.DECIMAL, displayName, Cardinality.MULTI, upd);
         return prop;
     }
 
-    public static PropertyHtmlDefinitionImpl createHtmlDefinition(String id, String displayName) {
+    public static PropertyHtmlDefinitionImpl createHtmlDefinition(String id, String displayName, Updatability upd) {
         PropertyHtmlDefinitionImpl prop = new PropertyHtmlDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.HTML, displayName, Cardinality.SINGLE);
+        createStandardDefinition(prop, id, PropertyType.HTML, displayName, Cardinality.SINGLE, upd);
         return prop;
     }
 
-    public static PropertyHtmlDefinitionImpl createHtmlMultiDefinition(String id, String displayName) {
+    public static PropertyHtmlDefinitionImpl createHtmlMultiDefinition(String id, String displayName, Updatability upd) {
         PropertyHtmlDefinitionImpl prop = new PropertyHtmlDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.HTML, displayName, Cardinality.MULTI);
+        createStandardDefinition(prop, id, PropertyType.HTML, displayName, Cardinality.MULTI, upd);
         return prop;
     }
 
-    public static PropertyIdDefinitionImpl createIdDefinition(String id, String displayName) {
+    public static PropertyIdDefinitionImpl createIdDefinition(String id, String displayName, Updatability upd) {
         PropertyIdDefinitionImpl prop = new PropertyIdDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.ID, displayName, Cardinality.SINGLE);
+        createStandardDefinition(prop, id, PropertyType.ID, displayName, Cardinality.SINGLE, upd);
         return prop;
     }
 
-    public static PropertyIdDefinitionImpl createIdMultiDefinition(String id, String displayName) {
+    public static PropertyIdDefinitionImpl createIdMultiDefinition(String id, String displayName, Updatability upd) {
         PropertyIdDefinitionImpl prop = new PropertyIdDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.ID, displayName, Cardinality.MULTI);
+        createStandardDefinition(prop, id, PropertyType.ID, displayName, Cardinality.MULTI, upd);
         return prop;
     }
 
-    public static PropertyIntegerDefinitionImpl createIntegerDefinition(String id, String displayName) {
+    public static PropertyIntegerDefinitionImpl createIntegerDefinition(String id, String displayName, Updatability upd) {
         PropertyIntegerDefinitionImpl prop = new PropertyIntegerDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.INTEGER, displayName, Cardinality.SINGLE);
+        createStandardDefinition(prop, id, PropertyType.INTEGER, displayName, Cardinality.SINGLE, upd);
         return prop;
     }
 
-    public static PropertyIntegerDefinitionImpl createIntegerMultiDefinition(String id, String displayName) {
+    public static PropertyIntegerDefinitionImpl createIntegerMultiDefinition(String id, String displayName,
+            Updatability upd) {
         PropertyIntegerDefinitionImpl prop = new PropertyIntegerDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.INTEGER, displayName, Cardinality.MULTI);
+        createStandardDefinition(prop, id, PropertyType.INTEGER, displayName, Cardinality.MULTI, upd);
         return prop;
     }
 
-    public static PropertyStringDefinitionImpl createStringDefinition(String id, String displayName) {
+    public static PropertyStringDefinitionImpl createStringDefinition(String id, String displayName, Updatability upd) {
         PropertyStringDefinitionImpl prop = new PropertyStringDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.STRING, displayName, Cardinality.SINGLE);
+        createStandardDefinition(prop, id, PropertyType.STRING, displayName, Cardinality.SINGLE, upd);
         return prop;
     }
 
-    public static PropertyStringDefinitionImpl createStringMultiDefinition(String id, String displayName) {
+    public static PropertyStringDefinitionImpl createStringMultiDefinition(String id, String displayName,
+            Updatability upd) {
         PropertyStringDefinitionImpl prop = new PropertyStringDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.STRING, displayName, Cardinality.MULTI);
+        createStandardDefinition(prop, id, PropertyType.STRING, displayName, Cardinality.MULTI, upd);
         return prop;
     }
 
-    public static PropertyUriDefinitionImpl createUriDefinition(String id, String displayName) {
+    public static PropertyUriDefinitionImpl createUriDefinition(String id, String displayName, Updatability upd) {
         PropertyUriDefinitionImpl prop = new PropertyUriDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.URI, displayName, Cardinality.SINGLE);
+        createStandardDefinition(prop, id, PropertyType.URI, displayName, Cardinality.SINGLE, upd);
         return prop;
     }
 
-    public static PropertyUriDefinitionImpl createUriMultiDefinition(String id, String displayName) {
+    public static PropertyUriDefinitionImpl createUriMultiDefinition(String id, String displayName, Updatability upd) {
         PropertyUriDefinitionImpl prop = new PropertyUriDefinitionImpl();
-        createStandardDefinition(prop, id, PropertyType.URI, displayName, Cardinality.MULTI);
+        createStandardDefinition(prop, id, PropertyType.URI, displayName, Cardinality.MULTI, upd);
         return prop;
     }
 
@@ -199,7 +205,8 @@ public class PropertyCreationHelper {
         prop.setDefaultValue(Collections.singletonList(defVal));
     }
 
-    public static Properties getPropertiesFromObject(StoredObject so, TypeDefinition td, List<String> requestedIds, boolean fillOptionalPropertyData) {
+    public static Properties getPropertiesFromObject(StoredObject so, TypeDefinition td, List<String> requestedIds,
+            boolean fillOptionalPropertyData) {
         // build properties collection
 
         BindingsObjectFactory objectFactory = new BindingsObjectFactoryImpl();
@@ -213,11 +220,11 @@ public class PropertyCreationHelper {
                         + " is unknown");
             } else {
                 String baseTypeId = td.getBaseTypeId().value();
-                properties.put(PropertyIds.BASE_TYPE_ID, objectFactory.createPropertyIdData(PropertyIds.BASE_TYPE_ID,
-                        baseTypeId));
+                properties.put(PropertyIds.BASE_TYPE_ID,
+                        objectFactory.createPropertyIdData(PropertyIds.BASE_TYPE_ID, baseTypeId));
             }
         }
-        
+
         // fill not-set properties from type definition (as spec requires)
         Map<String, PropertyDefinition<?>> propDefs = td.getPropertyDefinitions();
         for (PropertyDefinition<?> propDef : propDefs.values()) {
@@ -225,11 +232,10 @@ public class PropertyCreationHelper {
                 properties.put(propDef.getId(), getEmptyValue(propDef));
         }
 
-
-        
         List<PropertyData<?>> propertiesList = new ArrayList<PropertyData<?>>(properties.values());
 
-        if (fillOptionalPropertyData) {  // add query name, local name, display name
+        if (fillOptionalPropertyData) { // add query name, local name, display
+                                        // name
             fillOptionalPropertyData(td, propertiesList);
         }
 
@@ -253,12 +259,11 @@ public class PropertyCreationHelper {
                         + " is unknown");
             } else {
                 String baseTypeId = td.getBaseTypeId().value();
-                properties.put(PropertyIds.BASE_TYPE_ID, objectFactory.createPropertyIdData(PropertyIds.BASE_TYPE_ID,
-                        baseTypeId));
+                properties.put(PropertyIds.BASE_TYPE_ID,
+                        objectFactory.createPropertyIdData(PropertyIds.BASE_TYPE_ID, baseTypeId));
             }
         }
 
-
         Map<String, PropertyData<?>> mappedProperties = new HashMap<String, PropertyData<?>>();
         if (requestedIds.containsKey("*")) {
             for (Map.Entry<String, PropertyData<?>> prop : properties.entrySet()) {
@@ -266,7 +271,9 @@ public class PropertyCreationHelper {
                 String queryName = td.getPropertyDefinitions().get(prop.getKey()).getQueryName();
                 String localName = td.getPropertyDefinitions().get(prop.getKey()).getLocalName();
                 String displayName = td.getPropertyDefinitions().get(prop.getKey()).getDisplayName();
-                AbstractPropertyData<?> ad = (AbstractPropertyData<?>) prop.getValue(); // a bit dirty
+                AbstractPropertyData<?> ad = (AbstractPropertyData<?>) prop.getValue(); // a
+                                                                                        // bit
+                                                                                        // dirty
                 ad.setQueryName(queryName);
                 ad.setLocalName(localName);
                 ad.setDisplayName(displayName);
@@ -278,7 +285,9 @@ public class PropertyCreationHelper {
                 String queryNameOrAlias = requestedIds.get(prop.getKey());
                 String localName = td.getPropertyDefinitions().get(prop.getKey()).getLocalName();
                 String displayName = td.getPropertyDefinitions().get(prop.getKey()).getDisplayName();
-                AbstractPropertyData<?> ad = (AbstractPropertyData<?>) prop.getValue(); // a bit dirty
+                AbstractPropertyData<?> ad = (AbstractPropertyData<?>) prop.getValue(); // a
+                                                                                        // bit
+                                                                                        // dirty
                 ad.setQueryName(queryNameOrAlias);
                 ad.setLocalName(localName);
                 ad.setDisplayName(displayName);
@@ -289,7 +298,7 @@ public class PropertyCreationHelper {
         BindingsObjectFactory objFactory = new BindingsObjectFactoryImpl();
         for (Entry<String, String> funcEntry : requestedFuncs.entrySet()) {
             PropertyInteger pi = objFactory.createPropertyIntegerData(funcEntry.getKey(), BigInteger.valueOf(100));
-              // fixed dummy value
+            // fixed dummy value
             mappedProperties.put(funcEntry.getValue(), pi);
         }
 
@@ -297,7 +306,7 @@ public class PropertyCreationHelper {
         return props;
     }
 
-   public static ObjectData getObjectData(TypeDefinition typeDef, StoredObject so, String filter, String user,
+    public static ObjectData getObjectData(TypeDefinition typeDef, StoredObject so, String filter, String user,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             Boolean includePolicyIds, Boolean includeACL, ExtensionsData extension) {
 
@@ -313,10 +322,10 @@ public class PropertyCreationHelper {
 
         // fill output object
         if (null != includeAllowableActions && includeAllowableActions) {
-        	AllowableActions allowableActions = so.getAllowableActions(user);
+            AllowableActions allowableActions = so.getAllowableActions(user);
             od.setAllowableActions(allowableActions);
         }
-        
+
         if (null != includeACL && includeACL) {
             Acl acl = so instanceof DocumentVersion ? ((DocumentVersion) so).getParentDocument().getAcl() : so.getAcl();
             od.setAcl(acl);
@@ -352,14 +361,15 @@ public class PropertyCreationHelper {
 
         // fill output object
         if (null != includeAllowableActions && includeAllowableActions) {
-        	 //     AllowableActions allowableActions = DataObjectCreator.fillAllowableActions(so, user);
-        	AllowableActions allowableActions = so.getAllowableActions(user);
+            // AllowableActions allowableActions =
+            // DataObjectCreator.fillAllowableActions(so, user);
+            AllowableActions allowableActions = so.getAllowableActions(user);
             od.setAllowableActions(allowableActions);
         }
 
         od.setAcl(so.getAcl());
         od.setIsExactAcl(true);
-        
+
         if (null != includeRelationships && includeRelationships != IncludeRelationships.NONE) {
             od.setRelationships(DataObjectCreator.fillRelationships(includeRelationships, so, user));
         }
@@ -375,7 +385,7 @@ public class PropertyCreationHelper {
 
     // internal helpers
     private static void createStandardDefinition(AbstractPropertyDefinition<?> prop, String id, PropertyType propType,
-            String displayName, Cardinality card) {
+            String displayName, Cardinality card, Updatability upd) {
 
         if (!NameValidator.isValidId(id)) {
             if (!NameValidator.isValidId(id)) {
@@ -389,7 +399,7 @@ public class PropertyCreationHelper {
         } else {
             prop.setDisplayName(displayName);
         }
-        prop.setDescription( "This is a " + prop.getDisplayName() + " property.");
+        prop.setDescription("This is a " + prop.getDisplayName() + " property.");
         prop.setLocalName(id);
         prop.setLocalNamespace("local");
         prop.setQueryName(id);
@@ -400,7 +410,7 @@ public class PropertyCreationHelper {
         prop.setIsRequired(false);
         prop.setIsOrderable(true);
         prop.setPropertyType(propType);
-        prop.setUpdatability(Updatability.READWRITE);
+        prop.setUpdatability(upd);
     }
 
     private static void fillOptionalPropertyData(TypeDefinition td, List<PropertyData<?>> properties) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclPermissionsTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclPermissionsTest.java?rev=1186527&r1=1186526&r2=1186527&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclPermissionsTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclPermissionsTest.java Wed Oct 19 22:01:31 2011
@@ -738,7 +738,7 @@ public class AclPermissionsTest extends 
 	{
 		// starts with call context TestUser
 		switchCallContext("TestAdmin");
-		String docId = createDocumentWithAcls("doc",  fRootFolderId, UnitTestTypeSystemCreator.VERSION_DOCUMENT_TYPE_ID,
+		String docId = createDocumentWithAcls("doc",  fRootFolderId, UnitTestTypeSystemCreator.VERSIONED_TYPE,
 		        VersioningState.MAJOR, standardAcl, defaultAcl);
 	
 		// TestUser has no permission at all
@@ -935,9 +935,9 @@ public class AclPermissionsTest extends 
 	{
         LOG.debug("start test checkVisibleObjects()...");
 		switchCallContext("TestAdmin");
-		String docId = createDocumentWithAcls("doc",  fRootFolderId, UnitTestTypeSystemCreator.VERSION_DOCUMENT_TYPE_ID,
+		String docId = createDocumentWithAcls("doc",  fRootFolderId, UnitTestTypeSystemCreator.VERSIONED_TYPE,
 				VersioningState.MAJOR, standardAcl, defaultAcl);
-		String docId2 = createDocumentWithAcls("doc2",  fRootFolderId, UnitTestTypeSystemCreator.VERSION_DOCUMENT_TYPE_ID,
+		String docId2 = createDocumentWithAcls("doc2",  fRootFolderId, UnitTestTypeSystemCreator.VERSIONED_TYPE,
 		        VersioningState.MAJOR, addAcl, defaultAcl);
 		String folderId = createFolderWithAcls("folder", fRootFolderId, "cmis:folder", 
 				standardAcl, defaultAcl);
@@ -950,10 +950,10 @@ public class AclPermissionsTest extends 
 		String subFolderId2 = createFolderWithAcls("subFolder2", folderId2, "cmis:folder", 
 				addAcl, null);
         LOG.debug("checkVisibleObjects(): subFolderId2 is: " + subFolderId2);
-		String subDocId = createDocumentWithAcls("subDoc",  folderId2, UnitTestTypeSystemCreator.VERSION_DOCUMENT_TYPE_ID,
+		String subDocId = createDocumentWithAcls("subDoc",  folderId2, UnitTestTypeSystemCreator.VERSIONED_TYPE,
 		        VersioningState.MAJOR, null, testUserAcl);
         LOG.debug("checkVisibleObjects(): subDocId is: " + subDocId);
-		String subDocId2 = createDocumentWithAcls("subDoc2", folderId2, UnitTestTypeSystemCreator.VERSION_DOCUMENT_TYPE_ID,
+		String subDocId2 = createDocumentWithAcls("subDoc2", folderId2, UnitTestTypeSystemCreator.VERSIONED_TYPE,
 		        VersioningState.MAJOR, addAcl, null);
         LOG.debug("checkVisibleObjects(): subDocId2 is: " + subDocId2);
 		String noAclDocId2 = createDocumentWithAcls("noAclDoc2", fRootFolderId, "ComplexType",
@@ -1224,7 +1224,7 @@ public class AclPermissionsTest extends 
 	        VersioningState versioningState = VersioningState.MAJOR;
 	        String id = null;
 	        Map<String, String> properties = new HashMap<String, String>();
-	        id = fCreator.createDocument(name, UnitTestTypeSystemCreator.VERSION_DOCUMENT_TYPE_ID, folderId,
+	        id = fCreator.createDocument(name, UnitTestTypeSystemCreator.VERSIONED_TYPE, folderId,
 	                versioningState, properties);
 
 	        return id;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/MultiFilingTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/MultiFilingTest.java?rev=1186527&r1=1186526&r2=1186527&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/MultiFilingTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/MultiFilingTest.java Wed Oct 19 22:01:31 2011
@@ -281,7 +281,7 @@ public class MultiFilingTest extends Abs
 
     private String createVersionedDocument() {
 
-        return createDocument(UNFILED_DOC_NAME, null, UnitTestTypeSystemCreator.VERSION_DOCUMENT_TYPE_ID,
+        return createDocument(UNFILED_DOC_NAME, null, UnitTestTypeSystemCreator.VERSIONED_TYPE,
                 VersioningState.MAJOR, true);
 
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java?rev=1186527&r1=1186526&r2=1186527&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java Wed Oct 19 22:01:31 2011
@@ -48,6 +48,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.Action;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
+import org.apache.chemistry.opencmis.commons.enums.Updatability;
 import org.apache.chemistry.opencmis.commons.enums.VersioningState;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisContentAlreadyExistsException;
@@ -1123,13 +1124,13 @@ public class ObjectServiceTest extends A
             // document and folder type
             Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
             PropertyStringDefinitionImpl prop = PropertyCreationHelper.createStringDefinition(
-                    TEST_DOCUMENT_STRING_PROP_ID, "Sample Doc String Property");
+                    TEST_DOCUMENT_STRING_PROP_ID, "Sample Doc String Property", Updatability.READWRITE);
             propertyDefinitions.put(prop.getId(), prop);
             cmisDocumentType.addCustomPropertyDefinitions(propertyDefinitions);
 
             propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
             prop = PropertyCreationHelper.createStringDefinition(TEST_FOLDER_STRING_PROP_ID,
-                    "Sample Folder String Property");
+                    "Sample Folder String Property", Updatability.READWRITE);
             propertyDefinitions.put(prop.getId(), prop);
             cmisFolderType.addCustomPropertyDefinitions(propertyDefinitions);
 
@@ -1150,13 +1151,13 @@ public class ObjectServiceTest extends A
                             .getRootDocumentType());
             Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
             PropertyStringDefinitionImpl prop = PropertyCreationHelper.createStringDefinition(
-                    TEST_DOCUMENT_MY_STRING_PROP_ID, "My String Property");
+                    TEST_DOCUMENT_MY_STRING_PROP_ID, "My String Property", Updatability.READWRITE);
             prop.setIsRequired(false);
             prop.setMaxLength(BigInteger.valueOf(20)); // max len to 20
             propertyDefinitions.put(prop.getId(), prop);
 
             PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(
-                    TEST_DOCUMENT_MY_INT_PROP_ID, "My Integer Property");
+                    TEST_DOCUMENT_MY_INT_PROP_ID, "My Integer Property", Updatability.READWRITE);
             prop2.setIsRequired(true);
             prop2.setMinValue(BigInteger.valueOf(-10000));
             prop2.setMaxValue(BigInteger.valueOf(10000));
@@ -1170,12 +1171,12 @@ public class ObjectServiceTest extends A
                     TEST_INHERITED_CUSTOM_DOCUMENT_TYPE_ID, "My Custom Document Type", baseType);
             Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
             PropertyStringDefinitionImpl prop = PropertyCreationHelper.createStringDefinition(
-                    TEST_DOCUMENT_MY_SUB_STRING_PROP_ID, "Subtype String Property");
+                    TEST_DOCUMENT_MY_SUB_STRING_PROP_ID, "Subtype String Property", Updatability.READWRITE);
             prop.setIsRequired(false);
             propertyDefinitions.put(prop.getId(), prop);
 
             PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(
-                    TEST_DOCUMENT_MY_SUB_INT_PROP_ID, "Subtype");
+                    TEST_DOCUMENT_MY_SUB_INT_PROP_ID, "Subtype", Updatability.READWRITE);
             prop2.setIsRequired(true);
             propertyDefinitions.put(prop2.getId(), prop2);
             cmisDocumentType.addCustomPropertyDefinitions(propertyDefinitions);
@@ -1188,21 +1189,21 @@ public class ObjectServiceTest extends A
                     .getRootDocumentType());
             Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
             PropertyStringDefinitionImpl prop = PropertyCreationHelper.createStringMultiDefinition(
-                    TEST_DOCUMENT_MY_MULTI_STRING_PROP_ID, "Test Multi String Property");
+                    TEST_DOCUMENT_MY_MULTI_STRING_PROP_ID, "Test Multi String Property", Updatability.READWRITE);
             prop.setIsRequired(false);
             List<String> defValS = new ArrayList<String>() {{ add("Apache"); add("CMIS"); }};
             prop.setDefaultValue(defValS);
             propertyDefinitions.put(prop.getId(), prop);
 
             PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(
-                    TEST_DOCUMENT_MY_INT_PROP_ID, "Test Integer Property");
+                    TEST_DOCUMENT_MY_INT_PROP_ID, "Test Integer Property", Updatability.READWRITE);
             prop2.setIsRequired(false);
             List<BigInteger> defVal = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
             prop2.setDefaultValue(defVal);
             propertyDefinitions.put(prop2.getId(), prop2);
 
             PropertyIntegerDefinitionImpl prop3 = PropertyCreationHelper.createIntegerDefinition(
-                    TEST_DOCUMENT_MY_INT_PROP_ID_MANDATORY_DEFAULT, "Test Integer Property Mandatory default");
+                    TEST_DOCUMENT_MY_INT_PROP_ID_MANDATORY_DEFAULT, "Test Integer Property Mandatory default", Updatability.READWRITE);
             prop3.setIsRequired(true);
             List<BigInteger> defVal2 = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
             prop3.setDefaultValue(defVal2);
@@ -1219,21 +1220,21 @@ public class ObjectServiceTest extends A
                     getRootFolderType());
             Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
             PropertyStringDefinitionImpl prop = PropertyCreationHelper.createStringMultiDefinition(
-                    TEST_FOLDER_MY_MULTI_STRING_PROP_ID, "Test Multi String Property");
+                    TEST_FOLDER_MY_MULTI_STRING_PROP_ID, "Test Multi String Property", Updatability.READWRITE);
             prop.setIsRequired(false);
             List<String> defValS = new ArrayList<String>() {{ add("Apache"); add("CMIS"); }};
             prop.setDefaultValue(defValS);
             propertyDefinitions.put(prop.getId(), prop);
 
             PropertyIntegerDefinitionImpl prop2 = PropertyCreationHelper.createIntegerDefinition(
-                    TEST_FOLDER_MY_INT_PROP_ID, "Test Integer Property");
+                    TEST_FOLDER_MY_INT_PROP_ID, "Test Integer Property", Updatability.READWRITE);
             prop2.setIsRequired(false);
             List<BigInteger> defVal = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
             prop2.setDefaultValue(defVal);
             propertyDefinitions.put(prop2.getId(), prop2);
 
             PropertyIntegerDefinitionImpl prop3 = PropertyCreationHelper.createIntegerDefinition(
-                    TEST_FOLDER_MY_INT_PROP_ID_MANDATORY_DEFAULT, "Test Integer Property Mandatory default");
+                    TEST_FOLDER_MY_INT_PROP_ID_MANDATORY_DEFAULT, "Test Integer Property Mandatory default", Updatability.READWRITE);
             prop3.setIsRequired(true);
             List<BigInteger> defVal2 = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
             prop3.setDefaultValue(defVal2);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceTest.java?rev=1186527&r1=1186526&r2=1186527&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceTest.java Wed Oct 19 22:01:31 2011
@@ -121,7 +121,7 @@ public class RepositoryServiceTest exten
     @Override
     @Before
     public void setUp() {
-        super.setTypeCreatorClass(RepositoryTestTypeSystemCreator.class.getName());
+        super.setTypeCreatorClass(UnitTestTypeSystemCreator.class.getName());
         super.setUp();
     }
 
@@ -156,7 +156,7 @@ public class RepositoryServiceTest exten
         log.info("starting testTypeDefinition() ...");
         String repositoryId = getRepositoryId();
         String typeId = "MyDocType1";
-        TypeDefinition ref = RepositoryTestTypeSystemCreator.getTypeById(typeId);
+        TypeDefinition ref = UnitTestTypeSystemCreator.getTypeById(typeId);
         TypeDefinition type = fRepSvc.getTypeDefinition(repositoryId, typeId, null);
         assertEquals(ref.getId(), type.getId());
         assertEquals(ref.getDescription(), type.getDescription());
@@ -183,7 +183,7 @@ public class RepositoryServiceTest exten
         log.info("Repository " + repositoryId + " contains " + types.size() + " type(s).");
 
         // check that we got all types
-        int expectedSize = RepositoryTestTypeSystemCreator.getTypesList().size()
+        int expectedSize = UnitTestTypeSystemCreator.getTypesList().size()
                 + DocumentTypeCreationHelper.getDefaultTypes().size();
         int totalSize = getRecursiveSize(types);
 
@@ -229,7 +229,7 @@ public class RepositoryServiceTest exten
         }
 
         int totalSize = getRecursiveSize(types);
-        assertEquals(4, totalSize); // all RepositoryTestTypeSystemCreator types
+        assertEquals(5, totalSize); // all RepositoryTestTypeSystemCreator types
         // minus one in level two plus cmis.docment
         assertFalse(containsTypeByIdRecursive(BaseTypeId.CMIS_DOCUMENT.value(), types));
         assertFalse(containsTypeByIdRecursive(BaseTypeId.CMIS_FOLDER.value(), types));
@@ -237,7 +237,7 @@ public class RepositoryServiceTest exten
         assertTrue(containsTypeByIdRecursive("MyDocType1", types));
         assertTrue(containsTypeByIdRecursive("MyDocType2", types));
 
-        assertFalse(containsTypeByIdRecursive(RepositoryTestTypeSystemCreator.LEVEL2_TYPE, types));
+        assertFalse(containsTypeByIdRecursive(UnitTestTypeSystemCreator.LEVEL2_TYPE, types));
 
         for (TypeDefinitionContainer type : types) {
             assertNotNull(type);
@@ -441,7 +441,7 @@ public class RepositoryServiceTest exten
         log.info("");
         log.info("starting testInheritedProperties()...");
         String repositoryId = getRepositoryId();
-        String typeId = RepositoryTestTypeSystemCreator.TOPLEVEL_TYPE;
+        String typeId = UnitTestTypeSystemCreator.TOPLEVEL_TYPE;
 
         // get top level type
         TypeDefinition typeContainer = fRepSvc.getTypeDefinition(repositoryId, typeId, null);
@@ -454,7 +454,7 @@ public class RepositoryServiceTest exten
         containsAllBasePropertyDefinitions(typeContainer);
 
         // get level 1 type
-        typeId = RepositoryTestTypeSystemCreator.LEVEL1_TYPE;
+        typeId = UnitTestTypeSystemCreator.LEVEL1_TYPE;
         typeContainer = fRepSvc.getTypeDefinition(repositoryId, typeId, null);
         assertNotNull(typeContainer);
         propDefMap = typeContainer.getPropertyDefinitions();
@@ -466,7 +466,7 @@ public class RepositoryServiceTest exten
         containsAllBasePropertyDefinitions(typeContainer);
 
         // get level 2 type
-        typeId = RepositoryTestTypeSystemCreator.LEVEL2_TYPE;
+        typeId = UnitTestTypeSystemCreator.LEVEL2_TYPE;
         typeContainer = fRepSvc.getTypeDefinition(repositoryId, typeId, null);
         assertNotNull(typeContainer);
         propDefMap = typeContainer.getPropertyDefinitions();
@@ -576,219 +576,219 @@ public class RepositoryServiceTest exten
         return size;
     }
 
-    public static class RepositoryTestTypeSystemCreator implements TypeCreator {
-
-        public static final String COMPLEX_TYPE = "ComplexType";
-        public static final String TOPLEVEL_TYPE = "DocumentTopLevel";
-        public static final String LEVEL1_TYPE = "DocumentLevel1";
-        public static final String LEVEL2_TYPE = "DocumentLevel2";
-
-        public static final List<TypeDefinition> singletonTypes = buildTypesList();
-
-        public List<TypeDefinition> createTypesList() {
-            return singletonTypes;
-        }
-
-        private static List<TypeDefinition> buildTypesList() {
-            List<TypeDefinition> typesList = new LinkedList<TypeDefinition>();
-
-            InMemoryDocumentTypeDefinition cmisType1 = new InMemoryDocumentTypeDefinition("MyDocType1",
-                    "My Type 1 Level 1", InMemoryDocumentTypeDefinition.getRootDocumentType());
-            typesList.add(cmisType1);
-
-            InMemoryDocumentTypeDefinition cmisType2 = new InMemoryDocumentTypeDefinition("MyDocType2",
-                    "My Type 2 Level 1", InMemoryDocumentTypeDefinition.getRootDocumentType());
-            typesList.add(cmisType2);
-
-            InMemoryDocumentTypeDefinition cmisType11 = new InMemoryDocumentTypeDefinition("MyDocType1.1",
-                    "My Type 3 Level 2", cmisType1);
-            typesList.add(cmisType11);
-
-            InMemoryDocumentTypeDefinition cmisType111 = new InMemoryDocumentTypeDefinition("MyDocType1.1.1",
-                    "My Type 4 Level 3", cmisType11);
-            typesList.add(cmisType111);
-
-            InMemoryDocumentTypeDefinition cmisType112 = new InMemoryDocumentTypeDefinition("MyDocType1.1.2",
-                    "My Type 5 Level 3", cmisType11);
-            typesList.add(cmisType112);
-
-            InMemoryDocumentTypeDefinition cmisType12 = new InMemoryDocumentTypeDefinition("MyDocType1.2",
-                    "My Type 6 Level 2", cmisType1);
-            typesList.add(cmisType12);
-
-            InMemoryDocumentTypeDefinition cmisType21 = new InMemoryDocumentTypeDefinition("MyDocType2.1",
-                    "My Type 7 Level 2", cmisType2);
-            typesList.add(cmisType21);
-
-            InMemoryDocumentTypeDefinition cmisType22 = new InMemoryDocumentTypeDefinition("MyDocType2.2",
-                    "My Type 8 Level 2", cmisType2);
-            typesList.add(cmisType22);
-            InMemoryDocumentTypeDefinition cmisType23 = new InMemoryDocumentTypeDefinition("MyDocType2.3",
-                    "My Type 9 Level 2", cmisType2);
-            typesList.add(cmisType23);
-            InMemoryDocumentTypeDefinition cmisType24 = new InMemoryDocumentTypeDefinition("MyDocType2.4",
-                    "My Type 10 Level 2", cmisType2);
-            typesList.add(cmisType24);
-            InMemoryDocumentTypeDefinition cmisType25 = new InMemoryDocumentTypeDefinition("MyDocType2.5",
-                    "My Type 11 Level 2", cmisType2);
-            typesList.add(cmisType25);
-
-            InMemoryDocumentTypeDefinition cmisType26 = new InMemoryDocumentTypeDefinition("MyDocType2.6",
-                    "My Type 12 Level 2", cmisType2);
-            typesList.add(cmisType26);
-            InMemoryDocumentTypeDefinition cmisType27 = new InMemoryDocumentTypeDefinition("MyDocType2.7",
-                    "My Type 13 Level 2", cmisType2);
-            typesList.add(cmisType27);
-            InMemoryDocumentTypeDefinition cmisType28 = new InMemoryDocumentTypeDefinition("MyDocType2.8",
-                    "My Type 14 Level 2", cmisType2);
-            typesList.add(cmisType28);
-            InMemoryDocumentTypeDefinition cmisType29 = new InMemoryDocumentTypeDefinition("MyDocType2.9",
-                    "My Type 15 Level 2", cmisType2);
-            typesList.add(cmisType29);
-
-            // create a complex type with properties
-            InMemoryDocumentTypeDefinition cmisComplexType = new InMemoryDocumentTypeDefinition(COMPLEX_TYPE,
-                    "Complex type with properties, Level 1", InMemoryDocumentTypeDefinition.getRootDocumentType());
-
-            // create a boolean property definition
-
-            Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
-
-            PropertyDefinition<Boolean> prop = PropertyCreationHelper.createBooleanDefinition("BooleanProp",
-                    "Sample Boolean Property");
-            propertyDefinitions.put(prop.getId(), prop);
-
-            prop = PropertyCreationHelper.createBooleanMultiDefinition("BooleanPropMV",
-                    "Sample Boolean multi-value Property");
-            propertyDefinitions.put(prop.getId(), prop);
-
-            PropertyDateTimeDefinitionImpl prop2 = PropertyCreationHelper.createDateTimeDefinition("DateTimeProp",
-                    "Sample DateTime Property");
-            propertyDefinitions.put(prop2.getId(), prop2);
-
-            prop2 = PropertyCreationHelper.createDateTimeMultiDefinition("DateTimePropMV",
-                    "Sample DateTime multi-value Property");
-            propertyDefinitions.put(prop2.getId(), prop2);
-
-            PropertyDecimalDefinitionImpl prop3 = PropertyCreationHelper.createDecimalDefinition("DecimalProp",
-                    "Sample Decimal Property");
-            propertyDefinitions.put(prop3.getId(), prop3);
-
-            prop3 = PropertyCreationHelper.createDecimalDefinition("DecimalPropMV",
-                    "Sample Decimal multi-value Property");
-            propertyDefinitions.put(prop3.getId(), prop3);
-
-            PropertyHtmlDefinitionImpl prop4 = PropertyCreationHelper.createHtmlDefinition("HtmlProp",
-                    "Sample Html Property");
-            propertyDefinitions.put(prop4.getId(), prop4);
-
-            prop4 = PropertyCreationHelper.createHtmlDefinition("HtmlPropMV", "Sample Html multi-value Property");
-            propertyDefinitions.put(prop4.getId(), prop4);
-
-            PropertyIdDefinitionImpl prop5 = PropertyCreationHelper.createIdDefinition("IdProp", "Sample Id Property");
-            propertyDefinitions.put(prop5.getId(), prop5);
-
-            prop5 = PropertyCreationHelper.createIdDefinition("IdPropMV", "Sample Id Html multi-value Property");
-            propertyDefinitions.put(prop5.getId(), prop5);
-
-            PropertyIntegerDefinitionImpl prop6 = PropertyCreationHelper.createIntegerDefinition("IntProp",
-                    "Sample Int Property");
-            propertyDefinitions.put(prop6.getId(), prop6);
-
-            prop6 = PropertyCreationHelper.createIntegerDefinition("IntPropMV", "Sample Int multi-value Property");
-            propertyDefinitions.put(prop6.getId(), prop6);
-
-            PropertyStringDefinitionImpl prop7 = PropertyCreationHelper.createStringDefinition("StringProp",
-                    "Sample String Property");
-            propertyDefinitions.put(prop7.getId(), prop7);
-
-            PropertyUriDefinitionImpl prop8 = PropertyCreationHelper.createUriDefinition("UriProp",
-                    "Sample Uri Property");
-            propertyDefinitions.put(prop8.getId(), prop8);
-
-            prop8 = PropertyCreationHelper.createUriDefinition("UriPropMV", "Sample Uri multi-value Property");
-            propertyDefinitions.put(prop8.getId(), prop8);
-
-            PropertyStringDefinitionImpl prop9 = PropertyCreationHelper.createStringDefinition("PickListProp",
-                    "Sample Pick List Property");
-            List<Choice<String>> choiceList = new ArrayList<Choice<String>>();
-            ChoiceImpl<String> elem = new ChoiceImpl<String>();
-            elem.setValue(Collections.singletonList("red"));
-            choiceList.add(elem);
-            elem = new ChoiceImpl<String>();
-            elem.setValue(Collections.singletonList("green"));
-            choiceList.add(elem);
-            elem = new ChoiceImpl<String>();
-            elem.setValue(Collections.singletonList("blue"));
-            choiceList.add(elem);
-            elem = new ChoiceImpl<String>();
-            elem.setValue(Collections.singletonList("black"));
-            choiceList.add(elem);
-            prop9.setChoices(choiceList);
-            prop9.setDefaultValue(Collections.singletonList("blue"));
-
-            /*
-             * try short form: / PropertyCreationHelper.addElemToPicklist(prop9,
-             * "red"); PropertyCreationHelper.addElemToPicklist(prop9, "green");
-             * PropertyCreationHelper.addElemToPicklist(prop9, "blue");
-             * PropertyCreationHelper.addElemToPicklist(prop9, "black");
-             * PropertyCreationHelper.setDefaultValue(prop9, "blue"); /
-             */
-
-            cmisComplexType.addCustomPropertyDefinitions(propertyDefinitions);
-
-            // add type to types collection
-            typesList.add(cmisComplexType);
-
-            // create a type hierarchy with inherited properties
-            InMemoryDocumentTypeDefinition cmisDocTypeTopLevel = new InMemoryDocumentTypeDefinition(TOPLEVEL_TYPE,
-                    "Document type with properties, Level 1", InMemoryDocumentTypeDefinition.getRootDocumentType());
-
-            InMemoryDocumentTypeDefinition cmisDocTypeLevel1 = new InMemoryDocumentTypeDefinition(LEVEL1_TYPE,
-                    "Document type with inherited properties, Level 2", cmisDocTypeTopLevel);
-
-            InMemoryDocumentTypeDefinition cmisDocTypeLevel2 = new InMemoryDocumentTypeDefinition(LEVEL2_TYPE,
-                    "Document type with inherited properties, Level 3", cmisDocTypeLevel1);
-
-            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
-            PropertyStringDefinitionImpl propTop = PropertyCreationHelper.createStringDefinition("StringPropTopLevel",
-                    "Sample String Property");
-            propertyDefinitions.put(propTop.getId(), propTop);
-            cmisDocTypeTopLevel.addCustomPropertyDefinitions(propertyDefinitions);
-
-            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
-            PropertyStringDefinitionImpl propLevel1 = PropertyCreationHelper.createStringDefinition("StringPropLevel1",
-                    "String Property Level 1");
-            propertyDefinitions.put(propLevel1.getId(), propLevel1);
-            cmisDocTypeLevel1.addCustomPropertyDefinitions(propertyDefinitions);
-
-            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
-            PropertyStringDefinitionImpl propLevel2 = PropertyCreationHelper.createStringDefinition("StringPropLevel2",
-                    "String Property Level 2");
-            propertyDefinitions.put(propLevel2.getId(), propLevel2);
-            cmisDocTypeLevel2.addCustomPropertyDefinitions(propertyDefinitions);
-
-            // add type to types collection
-            typesList.add(cmisDocTypeTopLevel);
-            typesList.add(cmisDocTypeLevel1);
-            typesList.add(cmisDocTypeLevel2);
-
-            return typesList;
-        }
-
-        public static List<TypeDefinition> getTypesList() {
-            return singletonTypes;
-        }
-
-        public static TypeDefinition getTypeById(String typeId) {
-            for (TypeDefinition typeDef : singletonTypes) {
-                if (typeDef.getId().equals(typeId)) {
-                    return typeDef;
-                }
-            }
-            return null;
-        }
-
-    }
+//    public static class RepositoryTestTypeSystemCreator implements TypeCreator {
+//
+//        public static final String COMPLEX_TYPE = "ComplexType";
+//        public static final String TOPLEVEL_TYPE = "DocumentTopLevel";
+//        public static final String LEVEL1_TYPE = "DocumentLevel1";
+//        public static final String LEVEL2_TYPE = "DocumentLevel2";
+//
+//        public static final List<TypeDefinition> singletonTypes = buildTypesList();
+//
+//        public List<TypeDefinition> createTypesList() {
+//            return singletonTypes;
+//        }
+//
+//        private static List<TypeDefinition> buildTypesList() {
+//            List<TypeDefinition> typesList = new LinkedList<TypeDefinition>();
+//
+//            InMemoryDocumentTypeDefinition cmisType1 = new InMemoryDocumentTypeDefinition("MyDocType1",
+//                    "My Type 1 Level 1", InMemoryDocumentTypeDefinition.getRootDocumentType());
+//            typesList.add(cmisType1);
+//
+//            InMemoryDocumentTypeDefinition cmisType2 = new InMemoryDocumentTypeDefinition("MyDocType2",
+//                    "My Type 2 Level 1", InMemoryDocumentTypeDefinition.getRootDocumentType());
+//            typesList.add(cmisType2);
+//
+//            InMemoryDocumentTypeDefinition cmisType11 = new InMemoryDocumentTypeDefinition("MyDocType1.1",
+//                    "My Type 3 Level 2", cmisType1);
+//            typesList.add(cmisType11);
+//
+//            InMemoryDocumentTypeDefinition cmisType111 = new InMemoryDocumentTypeDefinition("MyDocType1.1.1",
+//                    "My Type 4 Level 3", cmisType11);
+//            typesList.add(cmisType111);
+//
+//            InMemoryDocumentTypeDefinition cmisType112 = new InMemoryDocumentTypeDefinition("MyDocType1.1.2",
+//                    "My Type 5 Level 3", cmisType11);
+//            typesList.add(cmisType112);
+//
+//            InMemoryDocumentTypeDefinition cmisType12 = new InMemoryDocumentTypeDefinition("MyDocType1.2",
+//                    "My Type 6 Level 2", cmisType1);
+//            typesList.add(cmisType12);
+//
+//            InMemoryDocumentTypeDefinition cmisType21 = new InMemoryDocumentTypeDefinition("MyDocType2.1",
+//                    "My Type 7 Level 2", cmisType2);
+//            typesList.add(cmisType21);
+//
+//            InMemoryDocumentTypeDefinition cmisType22 = new InMemoryDocumentTypeDefinition("MyDocType2.2",
+//                    "My Type 8 Level 2", cmisType2);
+//            typesList.add(cmisType22);
+//            InMemoryDocumentTypeDefinition cmisType23 = new InMemoryDocumentTypeDefinition("MyDocType2.3",
+//                    "My Type 9 Level 2", cmisType2);
+//            typesList.add(cmisType23);
+//            InMemoryDocumentTypeDefinition cmisType24 = new InMemoryDocumentTypeDefinition("MyDocType2.4",
+//                    "My Type 10 Level 2", cmisType2);
+//            typesList.add(cmisType24);
+//            InMemoryDocumentTypeDefinition cmisType25 = new InMemoryDocumentTypeDefinition("MyDocType2.5",
+//                    "My Type 11 Level 2", cmisType2);
+//            typesList.add(cmisType25);
+//
+//            InMemoryDocumentTypeDefinition cmisType26 = new InMemoryDocumentTypeDefinition("MyDocType2.6",
+//                    "My Type 12 Level 2", cmisType2);
+//            typesList.add(cmisType26);
+//            InMemoryDocumentTypeDefinition cmisType27 = new InMemoryDocumentTypeDefinition("MyDocType2.7",
+//                    "My Type 13 Level 2", cmisType2);
+//            typesList.add(cmisType27);
+//            InMemoryDocumentTypeDefinition cmisType28 = new InMemoryDocumentTypeDefinition("MyDocType2.8",
+//                    "My Type 14 Level 2", cmisType2);
+//            typesList.add(cmisType28);
+//            InMemoryDocumentTypeDefinition cmisType29 = new InMemoryDocumentTypeDefinition("MyDocType2.9",
+//                    "My Type 15 Level 2", cmisType2);
+//            typesList.add(cmisType29);
+//
+//            // create a complex type with properties
+//            InMemoryDocumentTypeDefinition cmisComplexType = new InMemoryDocumentTypeDefinition(COMPLEX_TYPE,
+//                    "Complex type with properties, Level 1", InMemoryDocumentTypeDefinition.getRootDocumentType());
+//
+//            // create a boolean property definition
+//
+//            Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
+//
+//            PropertyDefinition<Boolean> prop = PropertyCreationHelper.createBooleanDefinition("BooleanProp",
+//                    "Sample Boolean Property");
+//            propertyDefinitions.put(prop.getId(), prop);
+//
+//            prop = PropertyCreationHelper.createBooleanMultiDefinition("BooleanPropMV",
+//                    "Sample Boolean multi-value Property");
+//            propertyDefinitions.put(prop.getId(), prop);
+//
+//            PropertyDateTimeDefinitionImpl prop2 = PropertyCreationHelper.createDateTimeDefinition("DateTimeProp",
+//                    "Sample DateTime Property");
+//            propertyDefinitions.put(prop2.getId(), prop2);
+//
+//            prop2 = PropertyCreationHelper.createDateTimeMultiDefinition("DateTimePropMV",
+//                    "Sample DateTime multi-value Property");
+//            propertyDefinitions.put(prop2.getId(), prop2);
+//
+//            PropertyDecimalDefinitionImpl prop3 = PropertyCreationHelper.createDecimalDefinition("DecimalProp",
+//                    "Sample Decimal Property");
+//            propertyDefinitions.put(prop3.getId(), prop3);
+//
+//            prop3 = PropertyCreationHelper.createDecimalDefinition("DecimalPropMV",
+//                    "Sample Decimal multi-value Property");
+//            propertyDefinitions.put(prop3.getId(), prop3);
+//
+//            PropertyHtmlDefinitionImpl prop4 = PropertyCreationHelper.createHtmlDefinition("HtmlProp",
+//                    "Sample Html Property");
+//            propertyDefinitions.put(prop4.getId(), prop4);
+//
+//            prop4 = PropertyCreationHelper.createHtmlDefinition("HtmlPropMV", "Sample Html multi-value Property");
+//            propertyDefinitions.put(prop4.getId(), prop4);
+//
+//            PropertyIdDefinitionImpl prop5 = PropertyCreationHelper.createIdDefinition("IdProp", "Sample Id Property");
+//            propertyDefinitions.put(prop5.getId(), prop5);
+//
+//            prop5 = PropertyCreationHelper.createIdDefinition("IdPropMV", "Sample Id Html multi-value Property");
+//            propertyDefinitions.put(prop5.getId(), prop5);
+//
+//            PropertyIntegerDefinitionImpl prop6 = PropertyCreationHelper.createIntegerDefinition("IntProp",
+//                    "Sample Int Property");
+//            propertyDefinitions.put(prop6.getId(), prop6);
+//
+//            prop6 = PropertyCreationHelper.createIntegerDefinition("IntPropMV", "Sample Int multi-value Property");
+//            propertyDefinitions.put(prop6.getId(), prop6);
+//
+//            PropertyStringDefinitionImpl prop7 = PropertyCreationHelper.createStringDefinition("StringProp",
+//                    "Sample String Property");
+//            propertyDefinitions.put(prop7.getId(), prop7);
+//
+//            PropertyUriDefinitionImpl prop8 = PropertyCreationHelper.createUriDefinition("UriProp",
+//                    "Sample Uri Property");
+//            propertyDefinitions.put(prop8.getId(), prop8);
+//
+//            prop8 = PropertyCreationHelper.createUriDefinition("UriPropMV", "Sample Uri multi-value Property");
+//            propertyDefinitions.put(prop8.getId(), prop8);
+//
+//            PropertyStringDefinitionImpl prop9 = PropertyCreationHelper.createStringDefinition("PickListProp",
+//                    "Sample Pick List Property");
+//            List<Choice<String>> choiceList = new ArrayList<Choice<String>>();
+//            ChoiceImpl<String> elem = new ChoiceImpl<String>();
+//            elem.setValue(Collections.singletonList("red"));
+//            choiceList.add(elem);
+//            elem = new ChoiceImpl<String>();
+//            elem.setValue(Collections.singletonList("green"));
+//            choiceList.add(elem);
+//            elem = new ChoiceImpl<String>();
+//            elem.setValue(Collections.singletonList("blue"));
+//            choiceList.add(elem);
+//            elem = new ChoiceImpl<String>();
+//            elem.setValue(Collections.singletonList("black"));
+//            choiceList.add(elem);
+//            prop9.setChoices(choiceList);
+//            prop9.setDefaultValue(Collections.singletonList("blue"));
+//
+//            /*
+//             * try short form: / PropertyCreationHelper.addElemToPicklist(prop9,
+//             * "red"); PropertyCreationHelper.addElemToPicklist(prop9, "green");
+//             * PropertyCreationHelper.addElemToPicklist(prop9, "blue");
+//             * PropertyCreationHelper.addElemToPicklist(prop9, "black");
+//             * PropertyCreationHelper.setDefaultValue(prop9, "blue"); /
+//             */
+//
+//            cmisComplexType.addCustomPropertyDefinitions(propertyDefinitions);
+//
+//            // add type to types collection
+//            typesList.add(cmisComplexType);
+//
+//            // create a type hierarchy with inherited properties
+//            InMemoryDocumentTypeDefinition cmisDocTypeTopLevel = new InMemoryDocumentTypeDefinition(TOPLEVEL_TYPE,
+//                    "Document type with properties, Level 1", InMemoryDocumentTypeDefinition.getRootDocumentType());
+//
+//            InMemoryDocumentTypeDefinition cmisDocTypeLevel1 = new InMemoryDocumentTypeDefinition(LEVEL1_TYPE,
+//                    "Document type with inherited properties, Level 2", cmisDocTypeTopLevel);
+//
+//            InMemoryDocumentTypeDefinition cmisDocTypeLevel2 = new InMemoryDocumentTypeDefinition(LEVEL2_TYPE,
+//                    "Document type with inherited properties, Level 3", cmisDocTypeLevel1);
+//
+//            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
+//            PropertyStringDefinitionImpl propTop = PropertyCreationHelper.createStringDefinition("StringPropTopLevel",
+//                    "Sample String Property");
+//            propertyDefinitions.put(propTop.getId(), propTop);
+//            cmisDocTypeTopLevel.addCustomPropertyDefinitions(propertyDefinitions);
+//
+//            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
+//            PropertyStringDefinitionImpl propLevel1 = PropertyCreationHelper.createStringDefinition("StringPropLevel1",
+//                    "String Property Level 1");
+//            propertyDefinitions.put(propLevel1.getId(), propLevel1);
+//            cmisDocTypeLevel1.addCustomPropertyDefinitions(propertyDefinitions);
+//
+//            propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
+//            PropertyStringDefinitionImpl propLevel2 = PropertyCreationHelper.createStringDefinition("StringPropLevel2",
+//                    "String Property Level 2");
+//            propertyDefinitions.put(propLevel2.getId(), propLevel2);
+//            cmisDocTypeLevel2.addCustomPropertyDefinitions(propertyDefinitions);
+//
+//            // add type to types collection
+//            typesList.add(cmisDocTypeTopLevel);
+//            typesList.add(cmisDocTypeLevel1);
+//            typesList.add(cmisDocTypeLevel2);
+//
+//            return typesList;
+//        }
+//
+//        public static List<TypeDefinition> getTypesList() {
+//            return singletonTypes;
+//        }
+//
+//        public static TypeDefinition getTypeById(String typeId) {
+//            for (TypeDefinition typeDef : singletonTypes) {
+//                if (typeDef.getId().equals(typeId)) {
+//                    return typeDef;
+//                }
+//            }
+//            return null;
+//        }
+//
+//    }
 
 }



Mime
View raw message