Search in sources :

Example 6 with TypeDefinitionFactory

use of org.apache.chemistry.opencmis.server.support.TypeDefinitionFactory in project structr by structr.

the class CMISRepositoryService method getItemTypeDefinition.

private MutableItemTypeDefinition getItemTypeDefinition(final String typeId, final boolean includePropertyDefinitions, final boolean baseType) {
    final TypeDefinitionFactory factory = TypeDefinitionFactory.newInstance();
    final MutableItemTypeDefinition def = factory.createItemTypeDefinition(CmisVersion.CMIS_1_1, baseType ? null : BaseTypeId.CMIS_ITEM.value());
    def.setIsCreatable(false);
    initializeExtendedType(def, typeId);
    if (!includePropertyDefinitions) {
        def.removeAllPropertyDefinitions();
    }
    return def;
}
Also used : MutableItemTypeDefinition(org.apache.chemistry.opencmis.commons.definitions.MutableItemTypeDefinition) TypeDefinitionFactory(org.apache.chemistry.opencmis.server.support.TypeDefinitionFactory)

Example 7 with TypeDefinitionFactory

use of org.apache.chemistry.opencmis.server.support.TypeDefinitionFactory in project structr by structr.

the class CMISRepositoryService method getPolicyTypeDefinition.

private MutablePolicyTypeDefinition getPolicyTypeDefinition(final String typeId, final boolean includePropertyDefinitions, final boolean baseType) {
    final TypeDefinitionFactory factory = TypeDefinitionFactory.newInstance();
    final MutablePolicyTypeDefinition def = factory.createPolicyTypeDefinition(CmisVersion.CMIS_1_1, baseType ? null : BaseTypeId.CMIS_POLICY.value());
    def.setIsCreatable(false);
    initializeExtendedType(def, typeId);
    if (!includePropertyDefinitions) {
        def.removeAllPropertyDefinitions();
    }
    return def;
}
Also used : TypeDefinitionFactory(org.apache.chemistry.opencmis.server.support.TypeDefinitionFactory) MutablePolicyTypeDefinition(org.apache.chemistry.opencmis.commons.definitions.MutablePolicyTypeDefinition)

Aggregations

TypeDefinitionFactory (org.apache.chemistry.opencmis.server.support.TypeDefinitionFactory)7 LinkedList (java.util.LinkedList)1 Choice (org.apache.chemistry.opencmis.commons.definitions.Choice)1 MutableDocumentTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableDocumentTypeDefinition)1 MutableFolderTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableFolderTypeDefinition)1 MutableItemTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableItemTypeDefinition)1 MutablePolicyTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutablePolicyTypeDefinition)1 MutablePropertyDefinition (org.apache.chemistry.opencmis.commons.definitions.MutablePropertyDefinition)1 MutableRelationshipTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableRelationshipTypeDefinition)1 MutableSecondaryTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableSecondaryTypeDefinition)1 Cardinality (org.apache.chemistry.opencmis.commons.enums.Cardinality)1 PropertyType (org.apache.chemistry.opencmis.commons.enums.PropertyType)1 Updatability (org.apache.chemistry.opencmis.commons.enums.Updatability)1 GraphObject (org.structr.core.GraphObject)1