chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1521745 - in /chemistry/opencmis/trunk/chemistry-opencmis-server: chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/ chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmem...
Date Wed, 11 Sep 2013 06:38:48 GMT
Author: jens
Date: Wed Sep 11 06:38:47 2013
New Revision: 1521745

URL: http://svn.apache.org/r1521745
Log:
Extend the TypeManager interface by additional methods (optional) for type mutability.

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeManagerImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoreManager.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeManager.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeManagerImpl.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/TypeManagerImpl.java?rev=1521745&r1=1521744&r2=1521745&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeManagerImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeManagerImpl.java
Wed Sep 11 06:38:47 2013
@@ -32,9 +32,9 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractPropertyDefinition;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeDefinitionContainerImpl;
-import org.apache.chemistry.opencmis.inmemory.storedobj.api.TypeManagerCreatable;
 import org.apache.chemistry.opencmis.inmemory.types.DocumentTypeCreationHelper;
 import org.apache.chemistry.opencmis.inmemory.types.TypeUtil;
+import org.apache.chemistry.opencmis.server.support.TypeManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
  * Class that manages a type system for a repository types can be added, the
  * inheritance can be managed and type can be retrieved for a given type id.
  */
-public class TypeManagerImpl implements TypeManagerCreatable {
+public class TypeManagerImpl implements TypeManager {
 
     private static final Logger LOG = LoggerFactory.getLogger(TypeManagerImpl.class.getName());
     /**

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.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/server/InMemoryRepositoryServiceImpl.java?rev=1521745&r1=1521744&r2=1521745&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
Wed Sep 11 06:38:47 2013
@@ -37,7 +37,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.inmemory.TypeValidator;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
-import org.apache.chemistry.opencmis.inmemory.storedobj.api.TypeManagerCreatable;
+import org.apache.chemistry.opencmis.server.support.TypeManager;
 
 public class InMemoryRepositoryServiceImpl extends InMemoryAbstractServiceImpl {
 
@@ -148,7 +148,7 @@ public class InMemoryRepositoryServiceIm
             throw new CmisInvalidArgumentException("Repository id may not be null");
         }
 
-        TypeManagerCreatable typeManager = fStoreManager.getTypeManager(repositoryId);
+        TypeManager typeManager = fStoreManager.getTypeManager(repositoryId);
         if (null == typeManager) {
             throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
         }
@@ -162,7 +162,7 @@ public class InMemoryRepositoryServiceIm
 
     public TypeDefinition updateType(String repositoryId, TypeDefinition type, ExtensionsData
extension) {
         String typeId = type.getId();
-        TypeManagerCreatable typeManager = fStoreManager.getTypeManager(repositoryId);
+        TypeManager typeManager = fStoreManager.getTypeManager(repositoryId);
         if (null == typeManager) {
             throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
         }
@@ -178,7 +178,7 @@ public class InMemoryRepositoryServiceIm
 
     public void deleteType(String repositoryId, String typeId, ExtensionsData extension)
{
 
-        TypeManagerCreatable typeManager = fStoreManager.getTypeManager(repositoryId);
+        TypeManager typeManager = fStoreManager.getTypeManager(repositoryId);
         if (null == typeManager) {
             throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.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/server/InMemoryServiceFactoryImpl.java?rev=1521745&r1=1521744&r2=1521745&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java
Wed Sep 11 06:38:47 2013
@@ -58,10 +58,10 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.ConfigurationSettings;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
-import org.apache.chemistry.opencmis.inmemory.storedobj.api.TypeManagerCreatable;
 import org.apache.chemistry.opencmis.inmemory.storedobj.impl.StoreManagerFactory;
 import org.apache.chemistry.opencmis.inmemory.storedobj.impl.StoreManagerImpl;
 import org.apache.chemistry.opencmis.server.support.CmisServiceWrapper;
+import org.apache.chemistry.opencmis.server.support.TypeManager;
 import org.apache.chemistry.opencmis.util.repository.ObjectGenerator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -241,14 +241,14 @@ public class InMemoryServiceFactoryImpl 
         if (null == typeDefsFileName) {
             LOG.info("No file name for type definitions given, no types will be created.");
         } else {
-            TypeManagerCreatable typeManager = storeManager.getTypeManager(repositoryId);
-            TypeManagerCreatable tmc = (TypeManagerCreatable) typeManager;
+            TypeManager typeManager = storeManager.getTypeManager(repositoryId);
+            TypeManager tmc = typeManager;
             importTypesFromFile(tmc, typeDefsFileName);
         }
         return created;
     }
 
-    private void importTypesFromFile(TypeManagerCreatable tmc, String typeDefsFileName) {
+    private void importTypesFromFile(TypeManager tmc, String typeDefsFileName) {
 
         BufferedInputStream stream = null;
         TypeDefinition typeDef = null;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoreManager.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/storedobj/api/StoreManager.java?rev=1521745&r1=1521744&r2=1521745&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoreManager.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoreManager.java
Wed Sep 11 06:38:47 2013
@@ -27,6 +27,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.spi.BindingsObjectFactory;
+import org.apache.chemistry.opencmis.server.support.TypeManager;
 
 /**
  * interface to a repository implementation. This interface is the entry point
@@ -159,7 +160,7 @@ public interface StoreManager {
      *            id of repository
      * @return type manager for this repository or null if repository is unknown
      */
-    TypeManagerCreatable getTypeManager(String repositoryId);
+    TypeManager getTypeManager(String repositoryId);
 
     /**
      * Get information if a repository supports single filing.

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.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/storedobj/impl/StoreManagerImpl.java?rev=1521745&r1=1521744&r2=1521745&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
Wed Sep 11 06:38:47 2013
@@ -53,7 +53,6 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractTypeDefinition;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.AclCapabilitiesDataImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.BindingsObjectFactoryImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.CreatablePropertyTypesImpl;
@@ -71,7 +70,6 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.CmisServiceValidator;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
-import org.apache.chemistry.opencmis.inmemory.storedobj.api.TypeManagerCreatable;
 import org.apache.chemistry.opencmis.server.support.TypeDefinitionFactory;
 import org.apache.chemistry.opencmis.server.support.TypeManager;
 
@@ -546,8 +544,8 @@ public class StoreManagerImpl implements
     }
 
     @Override
-    public TypeManagerCreatable getTypeManager(String repositoryId) {
-        TypeManagerCreatable typeManager = fMapRepositoryToTypeManager.get(repositoryId);
+    public TypeManager getTypeManager(String repositoryId) {
+        TypeManager typeManager = fMapRepositoryToTypeManager.get(repositoryId);
         return typeManager;
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java?rev=1521745&r1=1521744&r2=1521745&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java
Wed Sep 11 06:38:47 2013
@@ -36,6 +36,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.PropertyType;
 import org.apache.chemistry.opencmis.commons.enums.Updatability;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException;
 import org.apache.chemistry.opencmis.commons.impl.WSConverter;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractPropertyDefinition;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractTypeDefinition;
@@ -466,4 +467,16 @@ public class JcrTypeManager implements T
         return result;
     }
 
+    public void addTypeDefinition(TypeDefinition typeDefinition, boolean addInheritedProperties)
{
+        throw new CmisNotSupportedException("Method not implemented.");
+    }
+
+    public void updateTypeDefinition(TypeDefinition typeDefinition) {
+        throw new CmisNotSupportedException("Method not implemented.");
+    }
+
+    public void deleteTypeDefinition(String typeId) {
+        throw new CmisNotSupportedException("Method not implemented.");
+    }
+
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeManager.java?rev=1521745&r1=1521744&r2=1521745&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeManager.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeManager.java
Wed Sep 11 06:38:47 2013
@@ -46,6 +46,7 @@ public interface TypeManager {
 
     /**
      * return a list of all types known in this repository
+     * Note: This method is not needed for the query parser.
      * 
      * @return
      *      list of type definitions
@@ -55,6 +56,7 @@ public interface TypeManager {
     /**
      * return a list of the root types as defined in the CMIS spec (for
      * document, folder, policy and relationship
+     * Note: This method is not needed for the query parser.
      * 
      * @return
      *      list of type definitions
@@ -73,4 +75,34 @@ public interface TypeManager {
      */
     String getPropertyIdForQueryName(TypeDefinition typeDefinition, String propQueryName);
 
+    /**
+     * Add a type to the type system. Add all properties from inherited types,
+     * add type to children of parent types.
+     * Note: This method is not needed for the query parser.
+     * 
+     * @param typeDefinition
+     *            new type to add
+     * @param addInheritedProperties
+     *            add properties from supertype to type definition
+     */
+    void addTypeDefinition(TypeDefinition typeDefinition, boolean addInheritedProperties);
+
+    /**
+     * Modify an existing type definition.
+     * Note: This method is not needed for the query parser.
+     * 
+     * @param typeDefinition
+     *            type to be modified
+     */
+    void updateTypeDefinition(TypeDefinition typeDefinition);
+
+    /**
+     * Delete a type from the type system. Delete will succeed only if type is
+     * not in use. Otherwise an exception is thrown.
+     * Note: This method is not needed for the query parser.
+     * 
+     * @param typeId
+     *            id of type to be deleted
+     */
+    void deleteTypeDefinition(String typeId);
 }
\ No newline at end of file



Mime
View raw message