mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
. Optimize ApplicationScriptUtils.toJSON() - threadlocal cache for namespace resolution to avoid DD access, smarter retrieval of cm:person properties - 40% quicker or more in some cases
. Convert short qnames to long qnames in our templates to avoid DD access to resolve full qnames . Optimize out N+1 queries from calling RatingService.getRating() unless the document has at least one Like (which is available in the rolled up property already present on the node) - up to 99% quicker when building "Likes" JSON structure...! . Added new optimized method to FileFolderService to retrieve a cm:name based path - only the String for each path element not the full FileInfo structure for each (avoid full getProperties() - 70% quicker to build webdav URL overall before/after to retrieve doclist2 script (8x concurrent threads x25 repeats etc.) Before: 1030ms After: 645ms Also improves original doclist script (used by dashlets) and single node retrievals. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@47448 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -839,6 +839,36 @@ public class FileFolderServiceImplTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public void testGetNameOnlyPath() throws Exception
|
||||
{
|
||||
FileInfo fileInfo = getByName(NAME_L1_FILE_A, false);
|
||||
assertNotNull(fileInfo);
|
||||
NodeRef nodeRef = fileInfo.getNodeRef();
|
||||
|
||||
List<String> infoPaths = fileFolderService.getNameOnlyPath(workingRootNodeRef, nodeRef);
|
||||
assertEquals("Not enough elements", 2, infoPaths.size());
|
||||
assertEquals("First level incorrent", NAME_L0_FOLDER_A, infoPaths.get(0));
|
||||
assertEquals("Second level incorrent", NAME_L1_FILE_A, infoPaths.get(1));
|
||||
|
||||
// pass in a null root and make sure that it still works
|
||||
infoPaths = fileFolderService.getNameOnlyPath(null, nodeRef);
|
||||
assertEquals("Not enough elements", 3, infoPaths.size());
|
||||
assertEquals("First level incorrent", workingRootNodeRef.getId(), infoPaths.get(0));
|
||||
assertEquals("Second level incorrent", NAME_L0_FOLDER_A, infoPaths.get(1));
|
||||
assertEquals("Third level incorrent", NAME_L1_FILE_A, infoPaths.get(2));
|
||||
|
||||
// check that a non-aligned path is detected
|
||||
NodeRef startRef = getByName(NAME_L0_FOLDER_B, true).getNodeRef();
|
||||
try
|
||||
{
|
||||
fileFolderService.getNameOnlyPath(startRef, nodeRef);
|
||||
fail("Failed to detect non-aligned path from root to target node");
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
public void testGetNamePathDoesNotReturnPathContainingNonLeafFileNode() throws Exception
|
||||
{
|
||||
|
Reference in New Issue
Block a user