AnsweredAssumed Answered

How to set metadata using OpenCMIS  createDocument ?

Question asked by invantix on Apr 16, 2012
Latest reply on Apr 17, 2012 by invantix
The document I am creating is actually a datalist item which has no content and only metadata.  I can create the item but I am not sure how to set the metadata.  I get an error when I try.

Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.NAME, name);
properties.put(PropertyIds.OBJECT_TYPE_ID, "D:mc:maintChit");

ObjectId docId = session.createDocument(properties,   

When I add the line properties.put("cm:description",description);  I get this error:

java.lang.IllegalArgumentException: Property 'cm:description' is neither an object type property nor an aspect property!
   at org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl.convertProperties(
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(

Thanks in advance to anyone who knows how to set metadata properties in OpenCmis.