How to Update Document properties using CMIS

2020-03-29 18:58发布

问题:

I have one external web application through that i connected to alfresco repository using CMIS.

I am already able to upload document in to repository or able to download n view document.

Now my requirement is, I have to Update Specific Documents Properties.

So can any one please provide sample code or steps to update document properties Using CMIS.

Thanks in Advance...

回答1:

try this worked fine for me

Session session = getSession(serverUrl, username, password);
Document targetFile = (Document) session.getObject(path);
Map<String, Object> properties = new HashMap<>();
properties.put(PropertyIds.NAME, name);
targetFile.updateProperties(properties);

In my example you only have to replace name with whatever you want

Hope that helped you