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


Java ItemIterable.getPage方法代码示例

本文整理汇总了Java中org.apache.chemistry.opencmis.client.api.ItemIterable.getPage方法的典型用法代码示例。如果您正苦于以下问题:Java ItemIterable.getPage方法的具体用法?Java ItemIterable.getPage怎么用?Java ItemIterable.getPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.chemistry.opencmis.client.api.ItemIterable的用法示例。


在下文中一共展示了ItemIterable.getPage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getChildren

import org.apache.chemistry.opencmis.client.api.ItemIterable; //导入方法依赖的package包/类
public FolderNode getChildren(String folderId, int skipCount, int maxItems)
{
    CmisObject o = session.getObject(folderId);
    if(o instanceof Folder)
    {
        Folder f = (Folder)o;
        FolderNode ret = (FolderNode)CMISNode.createNode(f);

        OperationContextImpl ctx = new OperationContextImpl();
        ItemIterable<CmisObject> res = f.getChildren(ctx);
        res.skipTo(skipCount);
        ItemIterable<CmisObject> l = res.getPage(maxItems);
        for(CmisObject c : l)
        {
            CMISNode child = null;
            if(c.getBaseType() instanceof FolderTypeDefinition)
            {
                child = (FolderNode)CMISNode.createNode(c);
                ret.addFolder((FolderNode)child);
            }
            else
            {
                child = CMISNode.createNode(c);
                ret.addNode(child);
            }
        }

        return ret;
    }
    else
    {
        throw new IllegalArgumentException("Folder does not exist or is not a folder");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:35,代码来源:PublicApiClient.java

示例2: getChildren

import org.apache.chemistry.opencmis.client.api.ItemIterable; //导入方法依赖的package包/类
public FolderNode getChildren(String folderId, int skipCount, int maxItems)
{
	CmisObject o = session.getObject(folderId);
	if(o instanceof Folder)
	{
		Folder f = (Folder)o;
		FolderNode ret = (FolderNode)CMISNode.createNode(f);

		OperationContextImpl ctx = new OperationContextImpl();
		ItemIterable<CmisObject> res = f.getChildren(ctx);
		res.skipTo(skipCount);
		ItemIterable<CmisObject> l = res.getPage(maxItems);
		for(CmisObject c : l)
		{
			CMISNode child = null;
			if(c.getBaseType() instanceof FolderTypeDefinition)
			{
				child = (FolderNode)CMISNode.createNode(c);
				ret.addFolder((FolderNode)child);
			}
			else
			{
				child = CMISNode.createNode(c);
				ret.addNode(child);
			}
		}

		return ret;
	}
	else
	{
		throw new IllegalArgumentException("Folder does not exist or is not a folder");
	}
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:35,代码来源:PublicApiClient.java

示例3: sendMessageForActionFind

import org.apache.chemistry.opencmis.client.api.ItemIterable; //导入方法依赖的package包/类
private String sendMessageForActionFind(String correlationID, String message, ParameterResolutionContext prc) throws SenderException, TimeOutException {
	Element queryElement = null;
	try {
		if (XmlUtils.isWellFormed(message, "query")) {
			queryElement = XmlUtils.buildElement(message);
		} else {
			queryElement = XmlUtils.buildElement("<query/>");
		}
	} catch (DomBuilderException e) {
		throw new SenderException(e);
	}
	String statement = XmlUtils.getChildTagAsString(queryElement, "statement");
	String maxItems = XmlUtils .getChildTagAsString(queryElement, "maxItems");
	String skipCount = XmlUtils.getChildTagAsString(queryElement, "skipCount");
	String searchAllVersions = XmlUtils.getChildTagAsString(queryElement, "searchAllVersions");

	String includeAllowableActions = XmlUtils.getChildTagAsString( queryElement, "includeAllowableActions");

	OperationContext operationContext = session.createOperationContext();
	if (StringUtils.isNotEmpty(maxItems)) {
		operationContext.setMaxItemsPerPage(Integer.parseInt(maxItems));
	}
	boolean sav = false;
	if (StringUtils.isNotEmpty(searchAllVersions)) {
		sav = Boolean.parseBoolean(searchAllVersions);
	}
	if (StringUtils.isNotEmpty(includeAllowableActions)) {
		operationContext.setIncludeAllowableActions(Boolean.parseBoolean(searchAllVersions));
	}
	ItemIterable<QueryResult> q = session.query(statement, sav, operationContext);
	if (StringUtils.isNotEmpty(skipCount)) {
		long sc = Long.parseLong(skipCount);
		q = q.skipTo(sc);
	}
	if (StringUtils.isNotEmpty(maxItems)) {
		q = q.getPage();
	}

	XmlBuilder cmisXml = new XmlBuilder("cmis");
	XmlBuilder rowsetXml = new XmlBuilder("rowset");
	for (QueryResult qResult : q) {
		XmlBuilder rowXml = new XmlBuilder("row");
		for (PropertyData<?> property : qResult.getProperties()) {
			rowXml.addSubElement(getPropertyXml(property));
		}
		rowsetXml.addSubElement(rowXml);
	}
	cmisXml.addSubElement(rowsetXml);
	return cmisXml.toXML();
}
 
开发者ID:ibissource,项目名称:iaf,代码行数:51,代码来源:CmisSender.java


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