Search in sources :

Example 11 with TypeDefinition

use of org.apache.chemistry.opencmis.commons.definitions.TypeDefinition 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

TypeDefinition (org.apache.chemistry.opencmis.commons.definitions.TypeDefinition)11 LinkedList (java.util.LinkedList)4 MutableDocumentTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableDocumentTypeDefinition)4 MutableFolderTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableFolderTypeDefinition)4 MutableItemTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableItemTypeDefinition)4 MutablePolicyTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutablePolicyTypeDefinition)4 MutableRelationshipTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableRelationshipTypeDefinition)4 MutableSecondaryTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableSecondaryTypeDefinition)4 MutableTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.MutableTypeDefinition)4 CmisTestResult (org.apache.chemistry.opencmis.tck.CmisTestResult)4 HashMap (java.util.HashMap)3 DateTimeFormat (org.apache.chemistry.opencmis.commons.enums.DateTimeFormat)3 CmisInvalidArgumentException (org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException)3 CmisObjectNotFoundException (org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException)3 CmisRuntimeException (org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException)3 JSONObject (org.apache.chemistry.opencmis.commons.impl.json.JSONObject)3 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 Document (org.apache.chemistry.opencmis.client.api.Document)2 Folder (org.apache.chemistry.opencmis.client.api.Folder)2