如何使用 CMIS 更新文档属性 [英] How to Update Document properties using CMIS

查看:26
本文介绍了如何使用 CMIS 更新文档属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个外部 Web 应用程序,通过它我使用 CMIS 连接到 alfresco 存储库.

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

我已经能够将文档上传到存储库或能够下载 n 查看文档.

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.

请提供示例代码或使用 CMIS 更新文档属性的步骤.

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

提前致谢...

推荐答案

试试这个对我来说很好用

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);

在我的示例中,您只需将 name 替换为您想要的任何内容

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

希望对你有帮助

这篇关于如何使用 CMIS 更新文档属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆