本文整理汇总了Java中org.apache.chemistry.opencmis.client.api.ItemIterable.getHasMoreItems方法的典型用法代码示例。如果您正苦于以下问题:Java ItemIterable.getHasMoreItems方法的具体用法?Java ItemIterable.getHasMoreItems怎么用?Java ItemIterable.getHasMoreItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.chemistry.opencmis.client.api.ItemIterable
的用法示例。
在下文中一共展示了ItemIterable.getHasMoreItems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pollWithQuery
import org.apache.chemistry.opencmis.client.api.ItemIterable; //导入方法依赖的package包/类
private int pollWithQuery(CMISConsumer cmisConsumer) throws Exception {
int count = 0;
int pageNumber = 0;
boolean finished = false;
ItemIterable<QueryResult> itemIterable = executeQuery(query);
while (!finished) {
ItemIterable<QueryResult> currentPage = itemIterable.skipTo(count).getPage();
LOG.debug("Processing page {}", pageNumber);
for (QueryResult item : currentPage) {
Map<String, Object> properties = CMISHelper.propertyDataToMap(item.getProperties());
Object objectTypeId = item.getPropertyValueById(PropertyIds.OBJECT_TYPE_ID);
InputStream inputStream = null;
if (readContent && CamelCMISConstants.CMIS_DOCUMENT.equals(objectTypeId)) {
inputStream = getContentStreamFor(item);
}
cmisConsumer.sendExchangeWithPropsAndBody(properties, inputStream);
count++;
if (count == readCount) {
finished = true;
break;
}
}
pageNumber++;
if (!currentPage.getHasMoreItems()) {
finished = true;
}
}
return count;
}
示例2: retrieveResult
import org.apache.chemistry.opencmis.client.api.ItemIterable; //导入方法依赖的package包/类
public List<Map<String, Object>> retrieveResult(Boolean retrieveContent, Integer readSize,
ItemIterable<QueryResult> itemIterable) {
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
boolean queryForContent = retrieveContent != null ? retrieveContent : readContent;
int documentsToRead = readSize != null ? readSize : readCount;
int count = 0;
int pageNumber = 0;
boolean finished = false;
while (!finished) {
ItemIterable<QueryResult> currentPage = itemIterable.skipTo(count).getPage();
LOG.debug("Processing page {}", pageNumber);
for (QueryResult item : currentPage) {
Map<String, Object> properties = CMISHelper.propertyDataToMap(item.getProperties());
if (queryForContent) {
InputStream inputStream = getContentStreamFor(item);
properties.put(CamelCMISConstants.CAMEL_CMIS_CONTENT_STREAM, inputStream);
}
result.add(properties);
count++;
if (count == documentsToRead) {
finished = true;
break;
}
}
pageNumber++;
if (!currentPage.getHasMoreItems()) {
finished = true;
}
}
return result;
}
示例3: processFolderRecursively
import org.apache.chemistry.opencmis.client.api.ItemIterable; //导入方法依赖的package包/类
int processFolderRecursively(Folder folder) throws Exception {
processFolderNode(folder);
OperationContext operationContext = cmisConsumer.createOperationContext();
operationContext.setMaxItemsPerPage(pageSize);
int count = 0;
int pageNumber = 0;
boolean finished = false;
ItemIterable<CmisObject> itemIterable = folder.getChildren(operationContext);
while (!finished) {
ItemIterable<CmisObject> currentPage = itemIterable.skipTo(count).getPage();
LOG.debug("Processing page {}", pageNumber);
for (CmisObject child : currentPage) {
if (CMISHelper.isFolder(child)) {
Folder childFolder = (Folder)child;
processFolderRecursively(childFolder);
} else {
processNonFolderNode(child, folder);
}
count++;
if (totalPolled == readCount) {
finished = true;
break;
}
}
pageNumber++;
if (!currentPage.getHasMoreItems()) {
finished = true;
}
}
return totalPolled;
}