result.setSupportsUnfiling(capabilities.isCapabilityUnfiling());
result.setSupportsVersionSpecificFiling(capabilities.isCapabilityVersionSpecificFiling());
if (capabilities.getCapabilityCreatablePropertyTypes() != null) {
CmisCreatablePropertyTypesType creatablePropertyTypes = capabilities.getCapabilityCreatablePropertyTypes();
CreatablePropertyTypesImpl target = new CreatablePropertyTypesImpl();
result.setCreatablePropertyTypes(target);
if (isNotEmpty(creatablePropertyTypes.getCanCreate())) {
Set<PropertyType> propertyTypeSet = EnumSet.noneOf(PropertyType.class);
target.setCanCreate(propertyTypeSet);
for (EnumPropertyType propType : creatablePropertyTypes.getCanCreate()) {
PropertyType propertyType = convert(PropertyType.class, propType);
if (propertyType != null) {
propertyTypeSet.add(propertyType);
}
}
}
convertExtension(creatablePropertyTypes, target);
}
if (capabilities.getCapabilityNewTypeSettableAttributes() != null) {
CmisNewTypeSettableAttributes newTypeSettableAttributes = capabilities
.getCapabilityNewTypeSettableAttributes();
NewTypeSettableAttributesImpl target = new NewTypeSettableAttributesImpl();
result.setNewTypeSettableAttributes(target);
target.setCanSetId(newTypeSettableAttributes.isId());
target.setCanSetLocalName(newTypeSettableAttributes.isLocalName());
target.setCanSetLocalNamespace(newTypeSettableAttributes.isLocalNamespace());
target.setCanSetDisplayName(newTypeSettableAttributes.isDisplayName());
target.setCanSetQueryName(newTypeSettableAttributes.isQueryName());
target.setCanSetDescription(newTypeSettableAttributes.isDescription());
target.setCanSetCreatable(newTypeSettableAttributes.isCreatable());
target.setCanSetFileable(newTypeSettableAttributes.isFileable());
target.setCanSetQueryable(newTypeSettableAttributes.isQueryable());
target.setCanSetFulltextIndexed(newTypeSettableAttributes.isFulltextIndexed());
target.setCanSetIncludedInSupertypeQuery(newTypeSettableAttributes.isIncludedInSupertypeQuery());
target.setCanSetControllablePolicy(newTypeSettableAttributes.isControllablePolicy());
target.setCanSetControllableAcl(newTypeSettableAttributes.isControllableACL());
convertExtension(newTypeSettableAttributes, target);
}
// handle extensions