I'd like to list all properties attached to a cmis object such as cmis:document
. The idea is to return properties name, id, description just like it is done in opencmis-workbench
Any idea I could get the same result?
UPDATE: Thanks to @Florian Müller, I found a solution:
String myType = "cmis:document";
ObjectType type = session.getTypeDefinition(myType);
Map<String, PropertyDefinition<?>> propertyDefinitions = type.getPropertyDefinitions();
propertyDefinitions.each { name, value ->
println "name = ${name}, value = ${value.getDisplayName()}"
}
Here is a simple code sample:
It only covers the primary type. If you want all properties, you have to iterate over secondary types as well.