Package org.apache.chemistry.opencmis.commons.enums

Examples of org.apache.chemistry.opencmis.commons.enums.BaseTypeId


    }

    // --- properties ---

    public ObjectType getBaseType() {
        BaseTypeId baseTypeId = getBaseTypeId();
        if (baseTypeId == null) {
            return null;
        }

        return getSession().getTypeDefinition(baseTypeId.value());
    }
View Full Code Here


        AbstractTypeDefinition result = null;

        String id = getString(json, JSON_TYPE_ID);

        // find base type
        BaseTypeId baseType = getEnum(json, JSON_TYPE_BASE_ID, BaseTypeId.class);
        if (baseType == null) {
            throw new CmisInvalidArgumentException("Invalid base type: " + id);
        }

        switch (baseType) {
View Full Code Here

        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId);
        if (typeDefC == null)
            throw new CmisInvalidArgumentException("Cannot create object, a type with id " + typeId + " is unknown");

        // check if the given type is a document type
        BaseTypeId typeBaseId = typeDefC.getTypeDefinition().getBaseTypeId();
        StoredObject so = null;
        String user = context.getUsername();
        if (typeBaseId.equals(InMemoryDocumentTypeDefinition.getRootDocumentType().getBaseTypeId())) {
            so = createDocumentIntern(repositoryId, properties, folderId, contentStream, versioningState, null, null,
                    null, null, user);
        } else if (typeBaseId.equals(InMemoryFolderTypeDefinition.getRootFolderType().getBaseTypeId())) {
            so = createFolderIntern(repositoryId, properties, folderId, null, null, null, null, user);
        } else if (typeBaseId.equals(InMemoryPolicyTypeDefinition.getRootPolicyType().getBaseTypeId())) {
            so = createPolicyIntern(repositoryId, properties, folderId, null, null, null, null);
        } else if (typeBaseId.equals(InMemoryRelationshipTypeDefinition.getRootRelationshipType().getBaseTypeId())) {
            so = createRelationshipIntern(repositoryId, properties, null, null, null, null);
        } else
            LOG.error("The type contains an unknown base object id, object can't be created");

        // Make a call to getObject to convert the resulting id into an
View Full Code Here

        List<String> propDefsRequired = getMandatoryPropDefs(typeDef.getPropertyDefinitions());

        for (PropertyData<?> prop : properties.getProperties().values()) {
            String propertyId = prop.getId();
            BaseTypeId baseTypeId = typeDef.getBaseTypeId();

            if (isSystemProperty(baseTypeId, propertyId))
                continue; // ignore system properties for validation

            // Check if all properties are known in the type
View Full Code Here

        if (typeDefC == null) {
            throw new CmisInvalidArgumentException("Cannot create object, a type with id " + typeId + " is unknown");
        }

        // check if the given type is a document type
        BaseTypeId typeBaseId = typeDefC.getTypeDefinition().getBaseTypeId();
        StoredObject so = null;
        if (typeBaseId.equals(InMemoryDocumentTypeDefinition.getRootDocumentType().getBaseTypeId())) {
            so = createDocumentIntern(context, repositoryId, properties, folderId, contentStream, versioningState, null, null,
                    null, null);
        } else if (typeBaseId.equals(InMemoryFolderTypeDefinition.getRootFolderType().getBaseTypeId())) {
            so = createFolderIntern(context, repositoryId, properties, folderId, null, null, null, null);
        } else if (typeBaseId.equals(InMemoryPolicyTypeDefinition.getRootPolicyType().getBaseTypeId())) {
            so = createPolicyIntern(context, repositoryId, properties, folderId, null, null, null, null);
        } else if (typeBaseId.equals(InMemoryRelationshipTypeDefinition.getRootRelationshipType().getBaseTypeId())) {
            so = createRelationshipIntern(context, repositoryId, properties, null, null, null, null);
        } else if (typeBaseId.equals(InMemoryItemTypeDefinition.getRootItemType().getBaseTypeId())) {
            so = createItemIntern(context, repositoryId, properties, folderId, null, null, null, null);
        } else {
            LOG.error("The type contains an unknown base object id, object can't be created");
        }
View Full Code Here

        List<String> propDefsRequired = getMandatoryPropDefs(typeDef.getPropertyDefinitions());

        if(properties != null) {
            for (PropertyData<?> prop : properties.getProperties().values()) {
                String propertyId = prop.getId();
                BaseTypeId baseTypeId = typeDef.getBaseTypeId();

                // check that all mandatory attributes are present
                if (checkMandatory && propDefsRequired.contains(propertyId)) {
                    propDefsRequired.remove(propertyId);
                }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.enums.BaseTypeId

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.