Working with Alfresco aspects
Alfresco has two types of classes that can be used to classify content, types and aspects. A node in Alfresco (that is, a CMIS object) can have one and only one type set but zero or more aspects applied. We have seen in a number of examples how we can set the basic CMIS types and custom types for a document or folder object. To manage the aspects for an object in Alfresco, we can use CMIS secondary types, as Alfresco exposes any aspects that are set on an object as secondary types. This will work if you are running Alfresco 4.2.e Community, Alfresco 4.2.0 Enterprise, or newer versions. With earlier versions, you have to use a special Alfresco OpenCMIS extension to manage aspects. We will look at both.
Using secondary types to manage aspects
When we want to manage aspects via secondary types, we will just use standard OpenCMIS library functions like we have done so far to manage properties. Secondary object types are managed in a specific multivalued property named...