Deepak Talape
Deepak Talape

Reputation: 997

How to Update Document properties using CMIS

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...

Upvotes: 2

Views: 2232

Answers (1)

Yagami Light
Yagami Light

Reputation: 1796

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

Upvotes: 4

Related Questions