本文整理汇总了Java中org.alfresco.service.cmr.repository.Path.Element类的典型用法代码示例。如果您正苦于以下问题:Java Element类的具体用法?Java Element怎么用?Java Element使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Element类属于org.alfresco.service.cmr.repository.Path包,在下文中一共展示了Element类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSystemPath
import org.alfresco.service.cmr.repository.Path.Element; //导入依赖的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;
}
示例2: onHiddenPath
import org.alfresco.service.cmr.repository.Path.Element; //导入依赖的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;
}
示例3: resolveParentPath
import org.alfresco.service.cmr.repository.Path.Element; //导入依赖的package包/类
/**
*
* @param store StoreRef
* @param parentPath Path
* @return NodeRef
*/
private NodeRef resolveParentPath(StoreRef store, Path parentPath)
{
if (log.isDebugEnabled())
{
log.debug("Trying to resolve parent path " + parentPath);
}
NodeRef node = nodeService.getRootNode(store);
int index = 1;
while (index < parentPath.size())
{
Element element = parentPath.get(index++);
QName name = QName.createQName(element.getElementString());
List<ChildAssociationRef> children = nodeService.getChildAssocs(node, RegexQNamePattern.MATCH_ALL, name);
if (children.isEmpty())
{
if (log.isDebugEnabled())
{
log.debug("Failed to resolve path element " + element.getElementString());
}
return null;
}
if (log.isDebugEnabled())
{
log.debug("Resolved path element " + element.getElementString());
}
node = children.get(0).getChildRef();
}
return node;
}
示例4: newPath
import org.alfresco.service.cmr.repository.Path.Element; //导入依赖的package包/类
@SuppressWarnings("serial")
private Path newPath(Path parent, final String name)
{
Path path = new Path();
if (parent != null)
{
for(Path.Element element: parent)
{
path.append(element);
}
}
path.append(new Path.Element()
{
@Override
public String getElementString()
{
return name;
}
@Override
public Element getBaseNameElement(TenantService tenantService)
{
return this;
}
});
return path;
}
示例5: getBaseNameElement
import org.alfresco.service.cmr.repository.Path.Element; //导入依赖的package包/类
@Override
public Element getBaseNameElement(TenantService tenantService)
{
return new SimplePathElement(elementString);
}
示例6: findMatch
import org.alfresco.service.cmr.repository.Path.Element; //导入依赖的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;
}
示例7: lookupPathInfo
import org.alfresco.service.cmr.repository.Path.Element; //导入依赖的package包/类
@Override
public PathInfo lookupPathInfo(NodeRef nodeRefIn, ChildAssociationRef archivedParentAssoc)
{
List<ElementInfo> pathElements = new ArrayList<>();
Boolean isComplete = Boolean.TRUE;
final Path nodePath;
final int pathIndex;
if (archivedParentAssoc != null)
{
if (permissionService.hasPermission(archivedParentAssoc.getParentRef(), PermissionService.READ).equals(AccessStatus.ALLOWED)
&& nodeService.exists(archivedParentAssoc.getParentRef()))
{
nodePath = nodeService.getPath(archivedParentAssoc.getParentRef());
pathIndex = 1;// 1 => we want to include the given node in the path as well.
}
else
{
//We can't return a valid path
return null;
}
}
else
{
nodePath = nodeService.getPath(nodeRefIn);
pathIndex = 2; // 2 => as we don't want to include the given node in the path as well.
}
for (int i = nodePath.size() - pathIndex; i >= 0; i--)
{
Element element = nodePath.get(i);
if (element instanceof Path.ChildAssocElement)
{
ChildAssociationRef elementRef = ((Path.ChildAssocElement) element).getRef();
if (elementRef.getParentRef() != null)
{
NodeRef childNodeRef = elementRef.getChildRef();
if (permissionService.hasPermission(childNodeRef, PermissionService.READ) == AccessStatus.ALLOWED)
{
Serializable nameProp = nodeService.getProperty(childNodeRef, ContentModel.PROP_NAME);
String type = getNodeType(childNodeRef).toPrefixString(namespaceService);
Set<QName> aspects = nodeService.getAspects(childNodeRef);
List<String> aspectNames = mapFromNodeAspects(aspects, EXCLUDED_NS, EXCLUDED_ASPECTS);
pathElements.add(0, new ElementInfo(childNodeRef.getId(), nameProp.toString(), type, aspectNames));
}
else
{
// Just return the pathInfo up to the location where the user has access
isComplete = Boolean.FALSE;
break;
}
}
}
}
String pathStr = null;
if (pathElements.size() > 0)
{
StringBuilder sb = new StringBuilder(120);
for (PathInfo.ElementInfo e : pathElements)
{
sb.append("/").append(e.getName());
}
pathStr = sb.toString();
}
else
{
// There is no path element, so set it to null in order to be
// ignored by Jackson during serialisation
isComplete = null;
}
return new PathInfo(pathStr, isComplete, pathElements);
}
示例8: lookupPathInfo
import org.alfresco.service.cmr.repository.Path.Element; //导入依赖的package包/类
protected PathInfo lookupPathInfo(NodeRef nodeRefIn, ChildAssociationRef archivedParentAssoc)
{
List<ElementInfo> pathElements = new ArrayList<>();
Boolean isComplete = Boolean.TRUE;
final Path nodePath;
final int pathIndex;
if (archivedParentAssoc != null)
{
if (permissionService.hasPermission(archivedParentAssoc.getParentRef(), PermissionService.READ).equals(AccessStatus.ALLOWED)
&& nodeService.exists(archivedParentAssoc.getParentRef()))
{
nodePath = nodeService.getPath(archivedParentAssoc.getParentRef());
pathIndex = 1;// 1 => we want to include the given node in the path as well.
}
else
{
//We can't return a valid path
return null;
}
}
else
{
nodePath = nodeService.getPath(nodeRefIn);
pathIndex = 2; // 2 => as we don't want to include the given node in the path as well.
}
for (int i = nodePath.size() - pathIndex; i >= 0; i--)
{
Element element = nodePath.get(i);
if (element instanceof Path.ChildAssocElement)
{
ChildAssociationRef elementRef = ((Path.ChildAssocElement) element).getRef();
if (elementRef.getParentRef() != null)
{
NodeRef childNodeRef = elementRef.getChildRef();
if (permissionService.hasPermission(childNodeRef, PermissionService.READ) == AccessStatus.ALLOWED)
{
Serializable nameProp = nodeService.getProperty(childNodeRef, ContentModel.PROP_NAME);
pathElements.add(0, new ElementInfo(childNodeRef.getId(), nameProp.toString()));
}
else
{
// Just return the pathInfo up to the location where the user has access
isComplete = Boolean.FALSE;
break;
}
}
}
}
String pathStr = null;
if (pathElements.size() > 0)
{
StringBuilder sb = new StringBuilder(120);
for (PathInfo.ElementInfo e : pathElements)
{
sb.append("/").append(e.getName());
}
pathStr = sb.toString();
}
else
{
// There is no path element, so set it to null in order to be
// ignored by Jackson during serialisation
isComplete = null;
}
return new PathInfo(pathStr, isComplete, pathElements);
}