mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Split of the template node functionality into new interface hierarchy and appropriate base classes impl.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5418 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -331,6 +331,20 @@ public class FileFolderServiceImpl implements FileFolderService
|
||||
}
|
||||
return childNodeRef;
|
||||
}
|
||||
|
||||
public NodeRef searchSimple(NodeRef contextNodeRef, String name, QName assocName)
|
||||
{
|
||||
NodeRef childNodeRef = nodeService.getChildByName(contextNodeRef, assocName, name);
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug(
|
||||
"Simple name search results: \n" +
|
||||
" parent: " + contextNodeRef + "\n" +
|
||||
" name: " + name + "\n" +
|
||||
" result: " + childNodeRef);
|
||||
}
|
||||
return childNodeRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see #search(NodeRef, String, boolean, boolean, boolean)
|
||||
@@ -822,12 +836,21 @@ public class FileFolderServiceImpl implements FileFolderService
|
||||
}
|
||||
// walk the folder tree first
|
||||
NodeRef parentNodeRef = rootNodeRef;
|
||||
StringBuilder currentPath = new StringBuilder(pathElements.size() * 20);
|
||||
StringBuilder currentPath = new StringBuilder(pathElements.size() << 4);
|
||||
int folderCount = pathElements.size() - 1;
|
||||
for (int i = 0; i < folderCount; i++)
|
||||
{
|
||||
String pathElement = pathElements.get(i);
|
||||
NodeRef folderNodeRef = searchSimple(parentNodeRef, pathElement);
|
||||
NodeRef folderNodeRef;
|
||||
if (i == 0 && rootNodeRef.equals(nodeService.getRootNode(rootNodeRef.getStoreRef())))
|
||||
{
|
||||
// store root nodes use a different assoc name to the immediate children
|
||||
folderNodeRef = searchSimple(parentNodeRef, pathElement, ContentModel.ASSOC_CHILDREN);
|
||||
}
|
||||
else
|
||||
{
|
||||
folderNodeRef = searchSimple(parentNodeRef, pathElement);
|
||||
}
|
||||
if (folderNodeRef == null)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(128);
|
||||
|
Reference in New Issue
Block a user