use of org.apache.chemistry.opencmis.commons.enums.BaseTypeId 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;
}
use of org.apache.chemistry.opencmis.commons.enums.BaseTypeId in project structr by structr.
the class CMISRepositoryService method getTypeChildren.
@Override
public TypeDefinitionList getTypeChildren(String repositoryId, String typeId, Boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
// important: children are the direct children of a type, as opposed to the descendants
final CMISTypeDefinitionListWrapper results = new CMISTypeDefinitionListWrapper(maxItems, skipCount);
if (typeId != null) {
final BaseTypeId baseTypeId = getBaseTypeId(typeId);
if (baseTypeId != null) {
results.addAll(getBaseTypeChildren(baseTypeId, includePropertyDefinitions));
} else {
final Class type = StructrApp.getConfiguration().getNodeEntityClass(typeId);
if (type != null) {
results.addAll(getTypeChildren(typeId, includePropertyDefinitions));
} else {
throw new CmisObjectNotFoundException("Type with ID " + typeId + " does not exist");
}
}
} else {
results.add(getDocumentTypeDefinition(BaseTypeId.CMIS_DOCUMENT.value(), includePropertyDefinitions, true));
results.add(getFolderTypeDefinition(BaseTypeId.CMIS_FOLDER.value(), includePropertyDefinitions, true));
results.add(getItemTypeDefinition(BaseTypeId.CMIS_ITEM.value(), includePropertyDefinitions, true));
results.add(getPolicyTypeDefinition(BaseTypeId.CMIS_POLICY.value(), includePropertyDefinitions, true));
results.add(getRelationshipTypeDefinition(BaseTypeId.CMIS_RELATIONSHIP.value(), includePropertyDefinitions, true));
results.add(getSecondaryTypeDefinition(BaseTypeId.CMIS_SECONDARY.value(), includePropertyDefinitions, true));
}
return results;
}
Aggregations