如何使用 Open CMIS 从 alfresco 存储库中检索所有文档内容并分离文档类型 [英] How to retrieve all document content from alfresco repository with seperation of document types using Open CMIS

查看:26
本文介绍了如何使用 Open CMIS 从 alfresco 存储库中检索所有文档内容并分离文档类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从 alfresco 存储库中检索所有文档内容.那么任何人都可以帮助我如何使用 CMIS 遍历存储库.在遍历时,我还想根据其类型将文档分开.

I Want to retrieve All document content from alfresco repository. So can anyone help me that how can i traverse the repository using CMIS. And while traversing i also want to separate the documents based on its type.

此时我可以通过指定路径来获取任何一个文档.但现在我的要求是遍历整个存储库并获取所有文档.

At this moment i am able to get any one document by specifying the path. but now my requirement is to traverse whole repository and get all the documents.

谁能帮我解决这个问题.还建议我遍历所有文件夹,然后按特定类型分隔"将是好方法或使用 CMIS 搜索特定类型的文档查询"将是很好的方法.

So can any one help me with this. Also suggest me that "Traversal of all folders and later separate by specific type" will be the good approach OR "Search specific type of document using CMIS query" will be the good approach.

提前致谢.

推荐答案

Yagami 的回答是一个好的开始,但还有一些需要补充的内容.

Yagami's answer is a good start, but there are a few things to add.

首先,除非您确实需要存储库拥有的每个属性,否则不要执行select *".这是一个潜在的性能问题.只要求你需要的东西.

First, do not do "select *" unless you actually need every single property the repository has. That is a potential performance problem. Only ask for what you need.

其次,您的评论之一谈到了按类型对结果进行细分.在 CMIS 中,类型有点像 SQL 表.因此,在您的情况下,您将使用三种自定义类型中的每一种作为 from 子句中的不同类型来执行三种不同的查询:

Second, one of your comments talks about segmenting results by type. In CMIS, a type is kind of like a SQL table. So in your case, you would do three different queries using each of your three custom types as a different type in the from clause:

select * from test:mainContract;
select * from test:subContract;
select * from test:royaltyStatement;

最后,除非您的存储库中只有少量文档,否则您几乎肯定会想要使用分页结果集.否则,您将只能返回服务器配置为返回的最大结果数.这可能不足以获得整个集合.

Finally, unless you have just a handful of documents in your repository, you are almost certainly going to want to use a paged result set. Otherwise, you will only get back the maximum number of results the server is configured to return. That may not be large enough to get the entire set.

有关显示分页结果集的示例,请参阅 Apache CMIS:分页查询结果

For an example showing paging the result set, see Apache CMIS: Paging query result

这篇关于如何使用 Open CMIS 从 alfresco 存储库中检索所有文档内容并分离文档类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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