How to Update Document properties using CMIS

浪子不回头ぞ 提交于 2019-12-01 09:54:38

问题


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



来源:https://stackoverflow.com/questions/39363131/how-to-update-document-properties-using-cmis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!