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


Java Path.iterator方法代码示例

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


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

示例1: buildXPath

import org.alfresco.service.cmr.repository.Path; //导入方法依赖的package包/类
private String buildXPath(Path path)
{
    StringBuilder pathBuffer = new StringBuilder(64);
    for (Iterator<Path.Element> elit = path.iterator(); elit.hasNext(); /**/)
    {
        Path.Element element = elit.next();
        if (!(element instanceof Path.ChildAssocElement))
        {
            throw new IndexerException("Confused path: " + path);
        }
        Path.ChildAssocElement cae = (Path.ChildAssocElement) element;
        if (cae.getRef().getParentRef() != null)
        {
            pathBuffer.append("/");
            pathBuffer.append(getPrefix(cae.getRef().getQName().getNamespaceURI()));
            pathBuffer.append(ISO9075.encode(cae.getRef().getQName().getLocalName()));
        }
    }
    return pathBuffer.toString();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:LuceneCategoryServiceImpl.java

示例2: getParents

import org.alfresco.service.cmr.repository.Path; //导入方法依赖的package包/类
private ArrayList<NodeRef> getParents(Path path)
{
    ArrayList<NodeRef> parentsInDepthOrderStartingWithSelf = new ArrayList<NodeRef>(8);
    for (Iterator<Path.Element> elit = path.iterator(); elit.hasNext(); /**/)
    {
        Path.Element element = elit.next();
        if (!(element instanceof Path.ChildAssocElement))
        {
            throw new IndexerException("Confused path: " + path);
        }
        Path.ChildAssocElement cae = (Path.ChildAssocElement) element;
        parentsInDepthOrderStartingWithSelf.add(0, tenantService.getName(cae.getRef().getChildRef()));

    }
    return parentsInDepthOrderStartingWithSelf;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:ADMLuceneIndexerImpl.java

示例3: isSystemPath

import org.alfresco.service.cmr.repository.Path; //导入方法依赖的package包/类
private boolean isSystemPath(NodeRef parentNodeRef, String filename)
{
    boolean ret = false;
    Path path = nodeService.getPath(parentNodeRef);

    Iterator<Element> it = path.iterator();
    while(it.hasNext())
    {
        Path.ChildAssocElement elem = (Path.ChildAssocElement)it.next();
        QName qname = elem.getRef().getQName();
        if(qname != null && systemPaths.isFiltered(qname.getLocalName()))
        {
            ret = true;
            break;
        }
    }

    return ret;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:FilenameFilteringInterceptor.java

示例4: onHiddenPath

import org.alfresco.service.cmr.repository.Path; //导入方法依赖的package包/类
/**
 * Checks whether the node is on a hidden path
 *
 * @param nodeRef NodeRef
 * @return the matching filter, or null if no match
 */
public HiddenFileInfo onHiddenPath(NodeRef nodeRef)
{
    HiddenFileInfo ret = null;
    // TODO would be nice to check each part of the path in turn, bailing out if a match is found
    Path path = nodeService.getPath(nodeRef);
    nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);

    Iterator<Element> it = path.iterator();
    while(it.hasNext())
    {
        Path.ChildAssocElement elem = (Path.ChildAssocElement)it.next();
        QName qname = elem.getRef().getQName();
        if(qname != null)
        {
            ret = isHidden(qname.getLocalName());
            if(ret != null)
            {
                break;
            }
        }
    }

    return ret;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:31,代码来源:HiddenAspect.java

示例5: getAncestors

import org.alfresco.service.cmr.repository.Path; //导入方法依赖的package包/类
private ArrayList<NodeRef> getAncestors(Path path)
{
    ArrayList<NodeRef> ancestors = new ArrayList<NodeRef>(8);
    for (Iterator<Path.Element> elit = path.iterator(); elit.hasNext(); /**/)
    {
        Path.Element element = elit.next();
        if (!(element instanceof Path.ChildAssocElement))
        {
            throw new IndexerException("Confused path: " + path);
        }
        Path.ChildAssocElement cae = (Path.ChildAssocElement) element;
        NodeRef parentRef = cae.getRef().getParentRef();
        if(parentRef != null)
        {
            ancestors.add(0, parentRef);
        }

    }
    return ancestors;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:21,代码来源:NodesMetaDataGet.java

示例6: getSiteName

import org.alfresco.service.cmr.repository.Path; //导入方法依赖的package包/类
public static String getSiteName(Path path) {
  //Fetching Path and preparing for rendering
  Iterator<Path.Element> pathIter = path.iterator();

  //Scan the Path to find the Alfresco Site name
  boolean siteFound = false;
  while(pathIter.hasNext()) {
    String pathElement = pathIter.next().getElementString();
    //Stripping out namespace from PathElement
    int firstChar = pathElement.lastIndexOf('}');
    if (firstChar > 0) {
      pathElement = pathElement.substring(firstChar+1);
    }
    if (pathElement.equals("sites")) {
      siteFound = true;
    } else if (siteFound) {
      return pathElement;
    }
  }
  return null;
}
 
开发者ID:Alfresco,项目名称:alfresco-indexer,代码行数:22,代码来源:Utils.java

示例7: findMatch

import org.alfresco.service.cmr.repository.Path; //导入方法依赖的package包/类
private HiddenFileInfo findMatch(NodeRef nodeRef)
{
    HiddenFileInfo ret = null;
    Path path = null;
    String name = null;

    OUTER: for(HiddenFileInfo filter : filters)
    {
        if (Client.cmis.equals(FileFilterMode.getClient()) && filter instanceof ConfigurableHiddenFileInfo)
        {
            if (((ConfigurableHiddenFileInfo) filter).isCmisDisableHideConfig())
            {
                continue;
            }
        }
    	if(filter.cascadeHiddenAspect() || filter.cascadeIndexControlAspect())
    	{
    		if(path == null)
    		{
    			path = nodeService.getPath(nodeRef);
    		}

            // TODO would be nice to check each part of the path in turn, bailing out if a match is found
            Iterator<Element> it = path.iterator();
            while(it.hasNext())
            {
                Path.ChildAssocElement elem = (Path.ChildAssocElement)it.next();
                QName qname = elem.getRef().getQName();
                if(qname != null)
                {
        			if(filter.isHidden(qname.getLocalName()))
        			{
        				ret = filter;
                        break OUTER;
                    }
                }
    		}
    	}
    	else
    	{
    		if(name == null)
    		{
    			name = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
    		}

         if(filter.isHidden(name))
         {
         	ret = filter;
         	break;
         }
    	}
    }

    return ret;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:56,代码来源:HiddenAspect.java


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