AnsweredAssumed Answered

Issues in setting secondary properties to a document using cmis 1.1

Question asked by azarfaiz on Nov 9, 2017
Latest reply on Nov 10, 2017 by azarfaiz

Hi

 

I am trying to add the secondary properties (title,description) programmatically to a document in Alfresco using CMIS 1.1.Below is the code snippet of the same.

 

properties.put(PropertyIds.NAME, fileName);
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,P:cm:titled");
properties.put(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, "P:cm:titled");
properties.put("cm:title", "test title");
properties.put("cm:description", "description of document");

 

The mentioned code results in successful upload of the document to the Alfresco site without any issues,but the title and description properties of the uploaded document were empty while checking in Alfresco UI.

 

Also I try setting the tags to a document as well.Tags were also empty while viewing the document in alfresco site.Below is the code snippet

 

document = parentFolder.createDocument(properties, contentStream, null);
AlfrescoDocument alfDoc = (AlfrescoDocument) document;
Map<String, Object> properties1 = new HashMap<String, Object>();
List<String> tags = new ArrayList<String>();
tags.add("cmisTag");
tags.add("testTag");
properties1.put("cm:taggable",tags);
alfDoc.updateProperties(properties1);

 

Kindly help me know what is wrong with the code.Thanks in advance.

Outcomes