CMIS 如何通过它的 objectId 获取文档 [英] CMIS how to fetch a document by it's objectId

查看:22
本文介绍了CMIS 如何通过它的 objectId 获取文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试使用 CMIS 查询从 alfresco 获取文档,而我所拥有的只是对象 ID 我尝试了以下操作,但它返回了错误请求"


i'm trying to fetch document from alfresco using CMIS queries and all i have is there object id i tried the following but it returned 'bad request'

SELECT * FROM cmis:document where cmis:objectId = workspace://SpacesStore/89332e83-1a43-41fe-ba8d-2facdf317d05   


我很抱歉我忘了提到我正在使用带有 javascript 的 CMIS谢谢你 .


I apologize i forgot to mention that i'm using CMIS with javascript Thank you .

推荐答案

当您拥有 ID 时,无需使用查询,您可以直接从会话对象中获取它.

When you have the ID you don't need to use a query you can get it directly from the session object.

通常对于 Java,您可以执行以下操作:

Typically for Java you can do something like this :

CmisObject cmisObject = session.getObject(id);

if (cmisObject instanceof Document) {
    Document document = (Document) cmisObject;
} else if (cmisObject instanceof Folder) {
    Folder folder = (Folder) cmisDocument;
} 

这篇关于CMIS 如何通过它的 objectId 获取文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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