chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1063307 - /incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/
Date Tue, 25 Jan 2011 14:57:45 GMT
Author: jens
Date: Tue Jan 25 14:57:45 2011
New Revision: 1063307

URL: http://svn.apache.org/viewvc?rev=1063307&view=rev
Log:
add type mutability to type definitions

Modified:
    incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java
    incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.java
    incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryPolicyTypeDefinition.java
    incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryRelationshipTypeDefinition.java

Modified: incubator/chemistry/opencmis-cmis11/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/incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java?rev=1063307&r1=1063306&r2=1063307&view=diff
==============================================================================
--- incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java
(original)
+++ incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java
Tue Jan 25 14:57:45 2011
@@ -27,6 +27,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.ContentStreamAllowed;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.DocumentTypeDefinitionImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeMutabilityCapabilitiesImpl;
 import org.apache.chemistry.opencmis.inmemory.NameValidator;
 
 /**
@@ -45,7 +46,7 @@ public class InMemoryDocumentTypeDefinit
 
     /* This constructor is just for creating the root document */
     public InMemoryDocumentTypeDefinition() {
-        init(BaseTypeId.CMIS_DOCUMENT.value(), "CMIS Document");
+        init(BaseTypeId.CMIS_DOCUMENT.value(), "CMIS Document", false);
         setParentTypeId(null);
         // set base properties
         Map<String, PropertyDefinition<?>> props = getPropertyDefinitions();
@@ -53,13 +54,13 @@ public class InMemoryDocumentTypeDefinit
     }
 
     public InMemoryDocumentTypeDefinition(String id, String displayName) {
-        init(id, displayName);
+        init(id, displayName, true);
         setParentTypeId(DOCUMENT_TYPE.getId());
     }
 
     public InMemoryDocumentTypeDefinition(String id, String displayName, InMemoryDocumentTypeDefinition
parentType) {
         // get root type
-        init(id, displayName);
+        init(id, displayName, true);
         if (parentType != null)
             setBaseTypeId(parentType.getBaseTypeId());
         else
@@ -85,7 +86,7 @@ public class InMemoryDocumentTypeDefinit
     // this.setPropertyDefinitions(propertyDefinitions);
     // }
 
-    private void init(String id, String displayName) {
+    private void init(String id, String displayName, boolean createAndDeletable) {
         if (!NameValidator.isValidId(id))
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_ID);
 
@@ -107,6 +108,12 @@ public class InMemoryDocumentTypeDefinit
         setIsIncludedInSupertypeQuery(true);
         setIsQueryable(false);
 
+        TypeMutabilityCapabilitiesImpl caps = new TypeMutabilityCapabilitiesImpl();
+        caps.setSupportsCreate(createAndDeletable);
+        caps.setSupportsUpdate(false);
+        caps.setSupportsDelete(createAndDeletable);
+        super.setTypeMutability(caps);
+        
         Map<String, PropertyDefinition<?>> props = new HashMap<String, PropertyDefinition<?>>();
         setPropertyDefinitions(props); // set initial empty set of properties
 

Modified: incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.java?rev=1063307&r1=1063306&r2=1063307&view=diff
==============================================================================
--- incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.java
(original)
+++ incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.java
Tue Jan 25 14:57:45 2011
@@ -26,6 +26,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.FolderTypeDefinitionImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeMutabilityCapabilitiesImpl;
 import org.apache.chemistry.opencmis.inmemory.NameValidator;
 
 public class InMemoryFolderTypeDefinition extends FolderTypeDefinitionImpl {
@@ -39,7 +40,7 @@ public class InMemoryFolderTypeDefinitio
 
     /* This constructor is just for creating the root document */
     public InMemoryFolderTypeDefinition() {
-        init(BaseTypeId.CMIS_FOLDER.value(), "CMIS Folder");
+        init(BaseTypeId.CMIS_FOLDER.value(), "CMIS Folder", false);
         setParentTypeId(null);
         // set base properties
         Map<String, PropertyDefinition<?>> props = getPropertyDefinitions();
@@ -47,13 +48,13 @@ public class InMemoryFolderTypeDefinitio
     }
 
     public InMemoryFolderTypeDefinition(String id, String displayName) {
-        init(id, displayName);
+        init(id, displayName, true);
         setParentTypeId(FOLDER_TYPE.getId());
     }
 
     public InMemoryFolderTypeDefinition(String id, String displayName, InMemoryFolderTypeDefinition
parentType) {
         // get root type
-        init(id, displayName);
+        init(id, displayName, true);
         if (parentType != null)
             setBaseTypeId(parentType.getBaseTypeId());
         else
@@ -73,7 +74,7 @@ public class InMemoryFolderTypeDefinitio
         DocumentTypeCreationHelper.mergePropertyDefinitions(getPropertyDefinitions(), propertyDefinitions);
     }
 
-    private void init(String id, String displayName) {
+    private void init(String id, String displayName, boolean createAndDeletable) {
         if (!NameValidator.isValidId(id))
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
 
@@ -95,6 +96,12 @@ public class InMemoryFolderTypeDefinitio
         setIsIncludedInSupertypeQuery(true);
         setIsQueryable(false);
 
+        TypeMutabilityCapabilitiesImpl caps = new TypeMutabilityCapabilitiesImpl();
+        caps.setSupportsCreate(createAndDeletable);
+        caps.setSupportsUpdate(createAndDeletable);
+        caps.setSupportsDelete(createAndDeletable);
+        super.setTypeMutability(caps);
+        
         Map<String, PropertyDefinition<?>> props = new HashMap<String, PropertyDefinition<?>>();
         setPropertyDefinitions(props); // set initial empty set of properties
     }

Modified: incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryPolicyTypeDefinition.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryPolicyTypeDefinition.java?rev=1063307&r1=1063306&r2=1063307&view=diff
==============================================================================
--- incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryPolicyTypeDefinition.java
(original)
+++ incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryPolicyTypeDefinition.java
Tue Jan 25 14:57:45 2011
@@ -26,6 +26,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.PolicyTypeDefinitionImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeMutabilityCapabilitiesImpl;
 import org.apache.chemistry.opencmis.inmemory.NameValidator;
 
 public class InMemoryPolicyTypeDefinition extends PolicyTypeDefinitionImpl {
@@ -39,7 +40,7 @@ public class InMemoryPolicyTypeDefinitio
 
     /* This constructor is just for creating the root document */
     public InMemoryPolicyTypeDefinition() {
-        init(BaseTypeId.CMIS_POLICY.value(), "CMIS Policy");
+        init(BaseTypeId.CMIS_POLICY.value(), "CMIS Policy", false);
         setParentTypeId(null);
 
         Map<String, PropertyDefinition<?>> props = getPropertyDefinitions();
@@ -47,13 +48,13 @@ public class InMemoryPolicyTypeDefinitio
     }
 
     public InMemoryPolicyTypeDefinition(String id, String displayName) {
-        init(id, displayName);
+        init(id, displayName, true);
         setParentTypeId(POLICY_TYPE.getId());
     }
 
     public InMemoryPolicyTypeDefinition(String id, String displayName, InMemoryPolicyTypeDefinition
parentType) {
         // get root type
-        init(id, displayName);
+        init(id, displayName, true);
         if (parentType != null)
             setBaseTypeId(parentType.getBaseTypeId());
         else
@@ -73,7 +74,7 @@ public class InMemoryPolicyTypeDefinitio
         DocumentTypeCreationHelper.mergePropertyDefinitions(getPropertyDefinitions(), propertyDefinitions);
     }
 
-    private void init(String id, String displayName) {
+    private void init(String id, String displayName, boolean createAndDeletable) {
         if (!NameValidator.isValidId(id))
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
 
@@ -95,6 +96,12 @@ public class InMemoryPolicyTypeDefinitio
         setIsIncludedInSupertypeQuery(true);
         setIsQueryable(false);
 
+        TypeMutabilityCapabilitiesImpl caps = new TypeMutabilityCapabilitiesImpl();
+        caps.setSupportsCreate(createAndDeletable);
+        caps.setSupportsUpdate(createAndDeletable);
+        caps.setSupportsDelete(createAndDeletable);
+        super.setTypeMutability(caps);
+        
         // set base properties
         Map<String, PropertyDefinition<?>> props = new HashMap<String, PropertyDefinition<?>>();
         setPropertyDefinitions(props); // set initial empty set of properties

Modified: incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryRelationshipTypeDefinition.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryRelationshipTypeDefinition.java?rev=1063307&r1=1063306&r2=1063307&view=diff
==============================================================================
--- incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryRelationshipTypeDefinition.java
(original)
+++ incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryRelationshipTypeDefinition.java
Tue Jan 25 14:57:45 2011
@@ -26,6 +26,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.RelationshipTypeDefinitionImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeMutabilityCapabilitiesImpl;
 import org.apache.chemistry.opencmis.inmemory.NameValidator;
 
 public class InMemoryRelationshipTypeDefinition extends RelationshipTypeDefinitionImpl {
@@ -39,7 +40,7 @@ public class InMemoryRelationshipTypeDef
 
     /* This constructor is just for creating the root document */
     public InMemoryRelationshipTypeDefinition() {
-        init(BaseTypeId.CMIS_RELATIONSHIP.value(), "CMIS Relation");
+        init(BaseTypeId.CMIS_RELATIONSHIP.value(), "CMIS Relation", false);
         setParentTypeId(null);
 
         Map<String, PropertyDefinition<?>> props = getPropertyDefinitions();
@@ -47,14 +48,14 @@ public class InMemoryRelationshipTypeDef
     }
 
     public InMemoryRelationshipTypeDefinition(String id, String displayName) {
-        init(id, displayName);
+        init(id, displayName, true);
         setParentTypeId(RELATIONSHIP_TYPE.getId());
     }
 
     public InMemoryRelationshipTypeDefinition(String id, String displayName,
             InMemoryRelationshipTypeDefinition parentType) {
         // get root type
-        init(id, displayName);
+        init(id, displayName, true);
         if (parentType != null)
             setBaseTypeId(parentType.getBaseTypeId());
         else
@@ -74,7 +75,7 @@ public class InMemoryRelationshipTypeDef
         DocumentTypeCreationHelper.mergePropertyDefinitions(getPropertyDefinitions(), propertyDefinitions);
     }
 
-    private void init(String id, String displayName) {
+    private void init(String id, String displayName, boolean createAndDeletable) {
         if (!NameValidator.isValidId(id))
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
 
@@ -96,6 +97,12 @@ public class InMemoryRelationshipTypeDef
         setIsIncludedInSupertypeQuery(true);
         setIsQueryable(false);
 
+        TypeMutabilityCapabilitiesImpl caps = new TypeMutabilityCapabilitiesImpl();
+        caps.setSupportsCreate(createAndDeletable);
+        caps.setSupportsUpdate(createAndDeletable);
+        caps.setSupportsDelete(createAndDeletable);
+        super.setTypeMutability(caps);
+        
         // relationship specifics
         setAllowedSourceTypes(null);
         setAllowedTargetTypes(null);



Mime
View raw message