当前位置: 首页>>代码示例>>Java>>正文


Java ItemIterable.getHasMoreItems方法代码示例

本文整理汇总了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;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:31,代码来源:CMISSessionFacade.java

示例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;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:33,代码来源:CMISSessionFacade.java

示例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;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:37,代码来源:RecursiveTreeWalker.java


注:本文中的org.apache.chemistry.opencmis.client.api.ItemIterable.getHasMoreItems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。