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

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

问题描述

我想从露天仓库中检索所有文档内容。所以任何人都可以帮助我,如何使用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.

首先,不要做选择*,除非您实际上需要存储库具有的每个属性。那是一个潜在的性能问题。

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从露天仓库中检索所有文档内容并分离文档类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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