I am currently using CMIS to create documents. I see lot of examples that update for aspect properties or custom properties on the document by updating the properties map and passing it to createDocument API
Do these documents need to have any aspect associated upfront before I set a custom property?
I am currently setting a custom property but I get the below error
ObjectId idOfCheckedOutDocument = currentDocument.checkOut(); pwc = (Document) session.getObject(idOfCheckedOutDocument); ByteArrayInputStream stream = new ByteArrayInputStream(newContent); ContentStream contentStream = session.getObjectFactory().createContentStream(documentName, Long.valueOf(newContent.length), mimeType, stream); ObjectId objectId = pwc.checkIn(true, properties, contentStream, "New version of document");
I had set the properties map with a custom property but I get the below exception . Is this because an aspect type s not associated to the document at some hierarchy?
Exception in thread "main" java.lang.IllegalArgumentException: Property 'myaspect:docStatus' is not valid for this type or one of the secondary types! at org.apache.chemistry.opencmis.client.runtime.repository.ObjectFactoryImpl.convertProperties(ObjectFactoryImpl.java:488) at org.apache.chemistry.opencmis.client.runtime.AbstractCmisObject.updateProperties(AbstractCmisObject.java:405)
What will happen if I have two secondary types with different namespace but the same property name. In the below example from the link that you have provided, the secondary type gets added with namespaceropertyname but when the property is set it is set without the namespace. So if I have two namespace custom1 and custom2 and they have property called classification, how do I set it in the properties for both these namespaces
Map<String, Object> properties = new HashMap<String, Object>();
// add the new secondary type
properties.put(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, secondaryTypes); // set secondary type property