本文整理汇总了Java中org.apache.chemistry.opencmis.client.api.Tree类的典型用法代码示例。如果您正苦于以下问题:Java Tree类的具体用法?Java Tree怎么用?Java Tree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Tree类属于org.apache.chemistry.opencmis.client.api包,在下文中一共展示了Tree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDescendants
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
public FolderNode getDescendants(String folderId, int depth)
{
Session session = getCMISSession();
CmisObject o = session.getObject(folderId);
if(o instanceof Folder)
{
Folder f = (Folder)o;
OperationContextImpl ctx = new OperationContextImpl();
List<Tree<FileableCmisObject>> res = f.getDescendants(depth, ctx);
FolderNode ret = (FolderNode)CMISNode.createNode(f);
for(Tree<FileableCmisObject> t : res)
{
addChildren(ret, t);
}
return ret;
}
else
{
throw new IllegalArgumentException("Folder does not exist or is not a folder");
}
}
示例2: addChildren
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
public void addChildren(FolderNode f, Tree<FileableCmisObject> t)
{
FileableCmisObject fco = t.getItem();
CMISNode child = CMISNode.createNode(fco);
if(child instanceof FolderNode)
{
f.addFolder((FolderNode)child);
for(Tree<FileableCmisObject> c : t.getChildren())
{
addChildren((FolderNode)child, c);
}
}
else
{
f.addNode(child);
}
}
示例3: getFolderTree
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
public List<Tree<FileableCmisObject>> getFolderTree(String folderId, int depth)
{
CmisObject o = session.getObject(folderId);
if(o instanceof Folder)
{
Folder f = (Folder)o;
OperationContextImpl ctx = new OperationContextImpl();
List<Tree<FileableCmisObject>> res = f.getFolderTree(depth, ctx);
return res;
}
else
{
throw new IllegalArgumentException("Object does not exist or is not a folder");
}
}
示例4: findTree
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
private Tree<FileableCmisObject> findTree(String nodeId, List<Tree<FileableCmisObject>> nodes)
{
Tree<FileableCmisObject> ret = null;
for(Tree<FileableCmisObject> tree : nodes)
{
FileableCmisObject item = tree.getItem();
// compare only the "bare" object id i.e. without the version suffix
if(getBareObjectId(nodeId).equals(getBareObjectId(item.getId())))
{
ret = tree;
break;
}
}
return ret;
}
示例5: doGetFolderTreeSize
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
private static long doGetFolderTreeSize(Tree<FileableCmisObject> pTree) {
long lLngSize = 0;
FileableCmisObject lCurCmisObject = pTree.getItem();
if (lCurCmisObject instanceof Document) {
long lLngCurSize = ((Document) lCurCmisObject).getContentStreamLength();
if (lLngCurSize > -1) {
lLngSize += lLngCurSize;
}
mLog.debug("---------- Dimensione di " + lCurCmisObject.getName() + ": " + lLngCurSize);
} else {
for (Tree<FileableCmisObject> tree : pTree.getChildren()) {
lLngSize += doGetFolderTreeSize(tree);
}
mLog.debug("------ Dimensione totale contenuto di " + lCurCmisObject.getName() + ": " + lLngSize);
}
return lLngSize;
}
示例6: addChildren
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
public void addChildren(FolderNode f, Tree<FileableCmisObject> t)
{
FileableCmisObject fco = t.getItem();
CMISNode child = CMISNode.createNode(fco);
if(child instanceof FolderNode)
{
f.addFolder((FolderNode)child);
for(Tree<FileableCmisObject> c : t.getChildren())
{
addChildren((FolderNode)child, c);
}
}
else
{
f.addNode(child);
}
}
示例7: getDescendants
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
public FolderNode getDescendants(String folderId, int depth)
{
Session session = getCMISSession();
CmisObject o = session.getObject(folderId);
if(o instanceof Folder)
{
Folder f = (Folder)o;
OperationContextImpl ctx = new OperationContextImpl();
List<Tree<FileableCmisObject>> res = f.getDescendants(depth, ctx);
FolderNode ret = (FolderNode)CMISNode.createNode(f);
for(Tree<FileableCmisObject> t : res)
{
addChildren(ret, t);
}
return ret;
}
else
{
throw new IllegalArgumentException("Folder does not exist or is not a folder");
}
}
示例8: getFolderTree
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
public List<Tree<FileableCmisObject>> getFolderTree(String folderId, int depth)
{
CmisObject o = session.getObject(folderId);
if(o instanceof Folder)
{
Folder f = (Folder)o;
OperationContextImpl ctx = new OperationContextImpl();
List<Tree<FileableCmisObject>> res = f.getFolderTree(depth, ctx);
return res;
}
else
{
throw new IllegalArgumentException("Object does not exist or is not a folder");
}
}
示例9: addType
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
/**
* Helper for {@link #getCreatableTypes(Session, String)}.
*/
private static void addType(List<Tree<ObjectType>> types,
List<ObjectType> resultList) {
for (Tree<ObjectType> tt : types) {
if (tt.getItem() != null) {
boolean isCreatable = (tt.getItem().isCreatable() == null ? true
: tt.getItem().isCreatable().booleanValue());
if (isCreatable) {
resultList.add(tt.getItem());
}
addType(tt.getChildren(), resultList);
}
}
}
示例10: getFolderTreeSize
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
public static long getFolderTreeSize(Session pSession, String pStrNodeRef) {
mLog.debug("ENTER getFolderSize(pFolder)");
long lLngSize = 0;
Folder lFolder = getFolderById(pSession, pStrNodeRef);
for (Tree<FileableCmisObject> tree : lFolder.getDescendants(-1)) {
lLngSize += doGetFolderTreeSize(tree);
}
mLog.debug("--- Dimensione totale contenuto di " + lFolder.getName() + ": " + lLngSize);
mLog.debug("EXIT getFolderSize(pFolder)");
return lLngSize;
}
示例11: doGetTypesTreeLeaves
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
private static void doGetTypesTreeLeaves(List<Tree<ObjectType>> pTypesTree, List<ObjectType> pLeaves) {
for (Tree<ObjectType> tree : pTypesTree) {
List<Tree<ObjectType>> lChildren = tree.getChildren();
if (lChildren.isEmpty()) {
pLeaves.add(tree.getItem());
} else {
doGetTypesTreeLeaves(lChildren, pLeaves);
}
}
}
示例12: getTypes
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
@Override
public List<TreeNodeDTO<EditorType>> getTypes() {
List<TreeNodeDTO<EditorType>> nodes = new ArrayList<>();
for (Tree<ObjectType> tree : cmisProxy.getSession().getTypeDescendants(null, -1, true)) {
nodes.add(fillWith(tree));
}
return nodes;
}
示例13: fillWith
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
private TreeNodeDTO<EditorType> fillWith(Tree<ObjectType> tree) {
TreeNodeDTO<EditorType> treeNodeDTO = new TreeNodeDTO<>(new EditorType(tree.getItem()));
List<TreeNodeDTO<EditorType>> children = new ArrayList<>();
for (Tree<ObjectType> t : tree.getChildren()) {
children.add(fillWith(t));
}
treeNodeDTO.setChildren(children);
return treeNodeDTO;
}
示例14: getTreeView
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
@Override
public List<TreeNodeDTO<FolderDTO>> getTreeView(FolderDTO fromNode) {
List<Tree<FileableCmisObject>> temp = this.cmisProxy
.getSession()
.getRootFolder()
.getFolderTree(-1);
if (temp.isEmpty()) {
return Collections.emptyList();
} else {
return temp.stream()
.map(this::fillObjectTree)
.collect(Collectors.toList());
}
}
示例15: fillObjectTree
import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
private TreeNodeDTO<FolderDTO> fillObjectTree(Tree<FileableCmisObject> tree) {
FolderDTO dto = new FolderDTO();
dto.setObjectID(tree.getItem().getId());
dto.setName(tree.getItem().getName());
dto.setPath(tree.getItem().getPaths().get(0));
TreeNodeDTO<FolderDTO> node = new TreeNodeDTO<>(dto);
node.setChildren(tree.getChildren()
.stream()
.map(this::fillObjectTree)
.collect(Collectors.toList()));
return node;
}