chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1438615 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.java
Date Fri, 25 Jan 2013 17:45:40 GMT
Author: jens
Date: Fri Jan 25 17:45:40 2013
New Revision: 1438615

URL: http://svn.apache.org/viewvc?rev=1438615&view=rev
Log:
Add a secondary type by default to the InMemory server

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.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=1438615&r1=1438614&r2=1438615&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
Fri Jan 25 17:45:40 2013
@@ -48,6 +48,7 @@ public class DefaultTypeSystemCreator im
     public static final String ITEM_TYPE = "MyItemType";
     public static final String LEVEL1_TYPE = "DocumentLevel1";
     public static final String LEVEL2_TYPE = "DocumentLevel2";
+    public static final String SECONDARY_TYPE_ID = "MySecondaryType";
 
     /**
      * in the public interface of this class we return the singleton containing
@@ -298,6 +299,22 @@ public class DefaultTypeSystemCreator im
         cmisItemType.addCustomPropertyDefinitions(propertyDefinitions);
         // add type to types collection
         typesList.add(cmisItemType);
+        
+
+        InMemorySecondaryTypeDefinition cmisSecondaryType = new InMemorySecondaryTypeDefinition(SECONDARY_TYPE_ID,

+                "MySecondaryType");
+        // create a single String property definition
+        Map<String, PropertyDefinition<?>> secondaryPropertyDefinitions = new
HashMap<String, PropertyDefinition<?>>();
+        PropertyStringDefinitionImpl propS1 = PropertyCreationHelper.createStringDefinition("SecondaryStringProp",
+                "Secondary String Property", Updatability.READWRITE);
+        secondaryPropertyDefinitions.put(propS1.getId(), propS1);
+        PropertyIntegerDefinitionImpl propS2 = PropertyCreationHelper.createIntegerDefinition("SecondaryIntegerProp",
+                "Secondary Integer Property", Updatability.READWRITE);
+        propS2.setIsRequired(true);
+        secondaryPropertyDefinitions.put(propS2.getId(), propS2);
+        cmisSecondaryType.addCustomPropertyDefinitions(secondaryPropertyDefinitions);
+        // add type to types collection
+        typesList.add(cmisSecondaryType);
 
         return typesList;
     }



Mime
View raw message