Search in sources :

Example 1 with TypeDefinitionContainerImpl

use of org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeDefinitionContainerImpl in project structr by structr.

the class CMISRepositoryService method getTypeDefinitionContainer.

private TypeDefinitionContainer getTypeDefinitionContainer(final TypeDefinition typeDefinition, final Boolean includePropertyDefinitions) {
    final TypeDefinitionContainerImpl result = new TypeDefinitionContainerImpl();
    final List<TypeDefinitionContainer> list = new LinkedList<>();
    result.setTypeDefinition(typeDefinition);
    result.setChildren(list);
    final String typeId = typeDefinition.getId();
    final BaseTypeId baseTypeId = getBaseTypeId(typeId);
    if (baseTypeId != null) {
        for (final TypeDefinition child : getBaseTypeChildren(baseTypeId, includePropertyDefinitions)) {
            list.add(getTypeDefinitionContainer(child, includePropertyDefinitions));
        }
    } else {
        for (final TypeDefinition child : getTypeChildren(typeDefinition.getId(), includePropertyDefinitions)) {
            list.add(getTypeDefinitionContainer(child, includePropertyDefinitions));
        }
    }
    return result;
}
Also used : TypeDefinitionContainerImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeDefinitionContainerImpl) BaseTypeId(org.apache.chemistry.opencmis.commons.enums.BaseTypeId) TypeDefinitionContainer(org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer) LinkedList(java.util.LinkedList) MutableTypeDefinition(org.apache.chemistry.opencmis.commons.definitions.MutableTypeDefinition) MutablePolicyTypeDefinition(org.apache.chemistry.opencmis.commons.definitions.MutablePolicyTypeDefinition) MutableRelationshipTypeDefinition(org.apache.chemistry.opencmis.commons.definitions.MutableRelationshipTypeDefinition) MutableFolderTypeDefinition(org.apache.chemistry.opencmis.commons.definitions.MutableFolderTypeDefinition) TypeDefinition(org.apache.chemistry.opencmis.commons.definitions.TypeDefinition) MutableDocumentTypeDefinition(org.apache.chemistry.opencmis.commons.definitions.MutableDocumentTypeDefinition) MutableSecondaryTypeDefinition(org.apache.chemistry.opencmis.commons.definitions.MutableSecondaryTypeDefinition) MutableItemTypeDefinition(org.apache.chemistry.opencmis.commons.definitions.MutableItemTypeDefinition)

Aggregations

LinkedList (java.util.LinkedList)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 MutableRelationshipTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableRelationshipTypeDefinition)1 MutableSecondaryTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableSecondaryTypeDefinition)1 MutableTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableTypeDefinition)1 TypeDefinition (org.apache.chemistry.opencmis.commons.definitions.TypeDefinition)1 TypeDefinitionContainer (org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer)1 BaseTypeId (org.apache.chemistry.opencmis.commons.enums.BaseTypeId)1 TypeDefinitionContainerImpl (org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeDefinitionContainerImpl)1