Skip to content

Instantly share code, notes, and snippets.

@kylefernandadams
Last active August 29, 2015 14:17
Show Gist options
  • Save kylefernandadams/76e5eee8df9bae3b08d8 to your computer and use it in GitHub Desktop.
Save kylefernandadams/76e5eee8df9bae3b08d8 to your computer and use it in GitHub Desktop.
boolean includePropertyDefintions = true;
// Get Type Children for cmis:secondary types
ItemIterable<ObjectType> secondaryTypeIterable = session.getTypeChildren("cmis:secondary", includePropertyDefintions);
System.out.println("Total Aspect Count: " + secondaryTypeIterable.getTotalNumItems());
// Loop through secondary types
for(ObjectType secondaryObjectType : secondaryTypeIterable){
// Check if type id's contain my:customAspect
if(secondaryObjectType.getId().contains("my:customAspect")){
System.out.println("Found secondary type: " + secondaryObjectType.getDisplayName());
// Get Property Definition Map
Map<String, PropertyDefinition<?>> propertyDefinitionMap = secondaryObjectType.getPropertyDefinitions();
// Loop through Property Definition Map
for(Map.Entry<String, PropertyDefinition<?>> propertyDefinitionEntry : propertyDefinitionMap.entrySet()){
if(propertyDefinitionEntry.getKey().contains("my")){
// Check if the properties from the custom aspect
System.out.println("Property Definition Key: " + propertyDefinitionEntry.getKey());
System.out.println("Property Definition Value: " + propertyDefinitionEntry.getValue());
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment