• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Tree类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.chemistry.opencmis.client.api.Tree的典型用法代码示例。如果您正苦于以下问题:Java Tree类的具体用法?Java Tree怎么用?Java Tree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Tree类属于org.apache.chemistry.opencmis.client.api包,在下文中一共展示了Tree类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:25,代码来源:PublicApiClient.java


示例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);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:19,代码来源:PublicApiClient.java


示例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");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:17,代码来源:PublicApiClient.java


示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:18,代码来源:FolderNode.java


示例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;
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:21,代码来源:AlfrescoHelper.java


示例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);
	}
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:19,代码来源:PublicApiClient.java


示例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");
	}
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:25,代码来源:PublicApiClient.java


示例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");
	}
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:17,代码来源:PublicApiClient.java


示例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);
		}
	}
}
 
开发者ID:fmui,项目名称:ApacheChemistryInAction,代码行数:19,代码来源:CMISHelper.java


示例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;
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:14,代码来源:AlfrescoHelper.java


示例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);
		}
	}
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:13,代码来源:AlfrescoHelper.java


示例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;
}
 
开发者ID:empt-ak,项目名称:meditor,代码行数:11,代码来源:CmisTypeServiceImpl.java


示例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;
}
 
开发者ID:empt-ak,项目名称:meditor,代码行数:13,代码来源:CmisTypeServiceImpl.java


示例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());
  }
}
 
开发者ID:empt-ak,项目名称:meditor,代码行数:16,代码来源:CmisServiceImpl.java


示例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;
}
 
开发者ID:empt-ak,项目名称:meditor,代码行数:16,代码来源:CmisServiceImpl.java


示例16: getCreatableTypes

import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
/**
 * Returns the creatable descendants types of the given type.
 */
public static List<ObjectType> getCreatableTypes(Session session,
		String rootTypeId) {
	List<ObjectType> result = new ArrayList<ObjectType>();

	// get the root type
	ObjectType rootType = null;
	try {
		rootType = session.getTypeDefinition(rootTypeId);
	} catch (CmisObjectNotFoundException e) {
		return result; // empty
	}

	// get the descendants and add the creatable subtypes
	List<Tree<ObjectType>> types = session.getTypeDescendants(
			rootTypeId, -1, false);
	addType(types, result);

	// finally, add the root type, if it is creatable
	boolean isCreatable = (rootType.isCreatable() == null ? true
			: rootType.isCreatable().booleanValue());
	if (isCreatable) {
		result.add(rootType);
	}

	// sort the list by display name
	Collections.sort(result, new Comparator<ObjectType>() {
		public int compare(ObjectType ot1, ObjectType ot2) {
			return ot1.getDisplayName().compareTo(ot2.getDisplayName());
		}
	});

	return result;
}
 
开发者ID:fmui,项目名称:ApacheChemistryInAction,代码行数:37,代码来源:CMISHelper.java


示例17: getTypeDescendants

import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
public List<Tree<ObjectType>> getTypeDescendants(String typeId, int depth, boolean includePropertyDefinitions)
{
    List<Tree<ObjectType>> res = session.getTypeDescendants(typeId, depth, includePropertyDefinitions);
    return res;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:6,代码来源:PublicApiClient.java


示例18: getTypesTree

import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
/**
 * Recupera l'albero dei tipi documento a partire da un determinato tipo base.
 * <p>
 * Il recupero dei tipi può essere limitato nella profondità.
 * <p>
 * L'albero è senza radice, perciò di fatto è una lista di alberi (ovvero gli alberi sottostanti
 * i figli diretti del tipo base).
 * 
 * @param pSession
 *            la sessione da usare.
 * @param pStrBaseType
 *            il tipo base da cui far partire la ricerca.
 * @param pIntDepth
 *            la profondità massima dell'albero. Deve essere un valore maggiore di 0, o -1 per
 *            una profondità illimitata.
 * @param pBlnIncludeProperties
 *            se {@code true} il risultato comprenderà anche il dettaglio della definizione
 *            delle proprietà.
 * 
 * @return L'albero dei tipi documento.
 */
public static List<Tree<ObjectType>> getTypesTree(Session pSession, String pStrBaseType, int pIntDepth,
        boolean pBlnIncludeProperties) {
	mLog.debug("START getTypesTree(String, int, boolean)");

	List<Tree<ObjectType>> lTypeTree = null;
	try {
		// XXX: Sono dati tendenzialmente stabili, si usa la cache: corretto?
		lTypeTree = pSession.getTypeDescendants(pStrBaseType, pIntDepth, pBlnIncludeProperties);

	} catch (CmisObjectNotFoundException e) {
		// Niente: il tipo non esiste e si restituisce null
		mLog.info("Tipo base '{}' non trovato", pStrBaseType);
	}

	mLog.debug("END getTypesTree(String, int, boolean)");
	return lTypeTree;
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:39,代码来源:AlfrescoHelper.java


示例19: getTypeDescendants

import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
public List<Tree<ObjectType>> getTypeDescendants(String typeId, int depth, boolean includePropertyDefinitions)
{
	List<Tree<ObjectType>> res = session.getTypeDescendants(typeId, depth, includePropertyDefinitions);
	return res;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:6,代码来源:PublicApiClient.java


示例20: getTypesTreeLeaves

import org.apache.chemistry.opencmis.client.api.Tree; //导入依赖的package包/类
/**
 * Recupera la lista dei tipi documento finali a partire da un determinato tipo base.
 * <p>
 * I tipi documento restituiti sono le foglie dell'albero dei tipi discendenti dal tipo base
 * specificato, ovvero i suoi ultimi discendenti.
 * 
 * @param pSession
 *            la sessione da usare.
 * @param pStrBaseType
 *            il tipo base da cui far partire la ricerca.
 * @param pBlnIncludeProperties
 *            se {@code true} il risultato comprenderà anche il dettaglio della definizione
 *            delle proprietà.
 * 
 * @return La lista dei tipi documento.
 */
public static List<ObjectType> getTypesTreeLeaves(Session pSession, String pStrBaseType,
        boolean pBlnIncludeProperties) {
	mLog.debug("START getTypesTreeLeaves(String, int, boolean)");

	List<ObjectType> lLeaves = new LinkedList<ObjectType>();

	List<Tree<ObjectType>> lTypesTree = getTypesTree(pSession, pStrBaseType, -1, pBlnIncludeProperties);
	doGetTypesTreeLeaves(lTypesTree, lLeaves);

	mLog.debug("END getTypesTreeLeaves(String, int, boolean)");
	return lLeaves;
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:29,代码来源:AlfrescoHelper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AroundTimeout类代码示例发布时间:2022-05-22
下一篇:
Java Cluster类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap