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


Java ChildAssociationRef.setNthSibling方法代码示例

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


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

示例1: getCachedChildren

import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
private List<ChildAssociationRef> getCachedChildren(
        Map<NodeRef, List<ChildAssociationRef>> childAssociationsSinceFlush, NodeRef nodeRef, boolean bulkLoad)
{
    List <ChildAssociationRef> children = childAssociationsSinceFlush.get(nodeRef);

    // Cache the children in case there are many paths to the same node
    if (children == null)
    {
        children = nodeService.getChildAssocs(nodeRef, RegexQNamePattern.MATCH_ALL, RegexQNamePattern.MATCH_ALL, bulkLoad);
        for (ChildAssociationRef childRef : children)
        {
            // We don't want index numbers in generated paths
            childRef.setNthSibling(-1);                
        }
        childAssociationsSinceFlush.put(nodeRef, children);
    }
    return children;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:ADMLuceneIndexerImpl.java

示例2: createIndexedPath

import org.alfresco.service.cmr.repository.ChildAssociationRef; //导入方法依赖的package包/类
/**
 * Helper to convert a path into an indexed path which uniquely identifies a node
 * 
 * @param nodeRef NodeRef
 * @param path Path
 * @return Path
 */
private Path createIndexedPath(NodeRef nodeRef, Path path)
{
    // Add indexes for same name siblings
    // TODO: Look at more efficient approach
    for (int i = path.size() - 1; i >= 0; i--)
    {
        Path.Element pathElement = path.get(i);
        if (i > 0 && pathElement instanceof Path.ChildAssocElement)
        {
            int index = 1;  // for xpath index compatibility
            String searchPath = path.subPath(i).toPrefixString(namespaceService);
            List<NodeRef> siblings = searchService.selectNodes(nodeRef, searchPath, null, namespaceService, false);
            if (siblings.size() > 1)
            {
                ChildAssociationRef childAssoc = ((Path.ChildAssocElement)pathElement).getRef();
                NodeRef childRef = childAssoc.getChildRef();
                for (NodeRef sibling : siblings)
                {
                    if (sibling.equals(childRef))
                    {
                        childAssoc.setNthSibling(index);
                        break;
                    }
                    index++;
                }
            }
        }
    }
    
    return path;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:39,代码来源:ViewXMLExporter.java


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