I'm working with a local instance of Alfresco CMS and I'm using the Apache Chemistry Java CMIS. Everything works well for browsing and creating objects, however I'm having a hard time adding metadata on documents.
There is an example on their source page code saying that you need to call updateProperties
on the CmisObject
. Unfortunately, this doesn't work, the exception I got stating: Property 'my:property' is not valid for this type or one of the secondary types
Do you know how can I add a custom property? Do I have to enhance the existing aspects collection and if so, how can I do it?
Thanks.
my:property seems to be a custom property, and should then be handled with a custom Alfresco aspect.
If you want to use Alfresco aspects, you will need the Alfresco OpenCMIS Extension
The following code fragment allows to use the Alfresco Extension with OpenCMIS:
The following code allows to create a new document with a custom property filled :
Custom properties should be defined in the repository and then you can try to set them in CMIS properties.