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