本文整理汇总了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");
}
}
示例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");
}
}
示例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();
}