Package org.apache.chemistry.opencmis.inmemory.storedobj.api

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.TypeManagerCreatable


        if (null == typeDefsFileName)
            LOG.info("No file name for type definitions given, no types will be created.");
        else {
            TypeManager typeManager = storeManager.getTypeManager(repositoryId);
            if (typeManager instanceof TypeManagerCreatable) {
                TypeManagerCreatable tmc = (TypeManagerCreatable) typeManager;
                importTypesFromFile(tmc, typeDefsFileName);
            } else {
                LOG.warn("Type Definitions are configured in XML file but type manager cannot create types. Type definitions are ignored.");
            }
        }
View Full Code Here


        if (null == typeDefsFileName)
            LOG.info("No file name for type definitions given, no types will be created.");
        else {
            TypeManager typeManager = storeManager.getTypeManager(repositoryId);
            if (typeManager instanceof TypeManagerCreatable) {
                TypeManagerCreatable tmc = (TypeManagerCreatable) typeManager;
                importTypesFromFile(tmc, typeDefsFileName);
            } else {
                LOG.warn("Type Definitions are configured in XML file but type manager cannot create types. Type definitions are ignored.");
            }
        }
View Full Code Here

        }
        return tdcClone;
    }

    public TypeManagerCreatable getTypeManager(String repositoryId) {
        TypeManagerCreatable typeManager = fMapRepositoryToTypeManager.get(repositoryId);
        return typeManager;
    }
View Full Code Here

        if (null == typeDefsFileName)
            LOG.info("No file name for type definitions given, no types will be created.");
        else {
            TypeManager typeManager = storeManager.getTypeManager(repositoryId);
            if (typeManager instanceof TypeManagerCreatable) {
                TypeManagerCreatable tmc = (TypeManagerCreatable) typeManager;
                importTypesFromFile(tmc, typeDefsFileName);
            } else {
                LOG.warn("Type Definitions are configured in XML file but type manager cannot create types. Type definitions are ignored.");
            }
        }
View Full Code Here

        }
        return tdcClone;
    }

    public TypeManagerCreatable getTypeManager(String repositoryId) {
        TypeManagerCreatable typeManager = fMapRepositoryToTypeManager.get(repositoryId);
        return typeManager;
    }
View Full Code Here

    public TypeDefinition createType(String repositoryId, TypeDefinition type, ExtensionsData extension) {

        if (null == repositoryId)
            throw new CmisInvalidArgumentException("Repository id may not be null");

        TypeManagerCreatable typeManager = fStoreManager.getTypeManager(repositoryId);
        if (null == typeManager)
            throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
       
        TypeValidator.checkType(typeManager, type);
        TypeValidator.checkProperties(typeManager, type.getPropertyDefinitions().values());
       
        typeManager.addTypeDefinition(type);
        return type;
    }
View Full Code Here

        return type;
    }

    public TypeDefinition updateType(String repositoryId, TypeDefinition type, ExtensionsData extension) {
        String typeId = type.getId();
        TypeManagerCreatable typeManager = fStoreManager.getTypeManager(repositoryId);
        if (null == typeManager)
            throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
       
        TypeDefinitionContainer typeDefC = typeManager.getTypeById(typeId);
        if (null == typeDefC)
            throw new CmisInvalidArgumentException("Cannot update type unknown type id: " + typeId);

        typeManager.updateTypeDefinition(type);
        return type;
    }
View Full Code Here

        return type;
    }

    public void deleteType(String repositoryId, String typeId, ExtensionsData extension) {
       
        TypeManagerCreatable typeManager = fStoreManager.getTypeManager(repositoryId);
        if (null == typeManager)
            throw new CmisInvalidArgumentException("Unknown repository " + repositoryId);
       
        TypeDefinitionContainer typeDefC = typeManager.getTypeById(typeId);
        if (null == typeDefC)
            throw new CmisInvalidArgumentException("Cannot delete type unknown type id: " + typeId);

        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
        if (objectStore.isTypeInUse(typeId)) {
            throw new CmisInvalidArgumentException("type definition " + typeId + " cannot be deleted, type is in use.");           
        }
       
        typeManager.deleteTypeDefinition(typeId);       
    }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.inmemory.storedobj.api.TypeManagerCreatable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.