mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/DEV/V4.1-BUG-FIX to HEAD
47670: ALF-18245 - BM-0013: Soak: Run 06: Search population of ScriptNode is expensive - Optimizations to improve the performance of the repository when retrieving the populating data needed for Share Search results - Additional service method to PersonService to allow retrieval of a person or null in a single operation - rather than exists() followed get() - Improvements to generate of full name strings for a Person - only retrieve minimum needed properties rather than allprops from cm:person - Improvements to generation of DisplayPath to avoid multiple permission checks git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@47674 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,10 +22,12 @@ import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.security.permissions.noop.PermissionServiceNOOPImpl;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.module.ModuleDetails;
|
||||
import org.alfresco.service.cmr.module.ModuleService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ScriptPagingDetails;
|
||||
@@ -40,10 +42,13 @@ import org.springframework.extensions.surf.util.ISO8601DateFormat;
|
||||
public class ScriptUtils extends BaseScopableProcessorExtension
|
||||
{
|
||||
private final static String NAMESPACE_BEGIN = "" + QName.NAMESPACE_BEGIN;
|
||||
|
||||
|
||||
/** Services */
|
||||
private ServiceRegistry services;
|
||||
|
||||
private NodeService unprotNodeService;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the service registry
|
||||
*
|
||||
@@ -54,6 +59,26 @@ public class ScriptUtils extends BaseScopableProcessorExtension
|
||||
this.services = services;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nodeService the NodeService to set
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.unprotNodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to return the cm:name display path for a node with minimum performance overhead.
|
||||
*
|
||||
* @param node ScriptNode
|
||||
* @return cm:name based human readable display path for the give node.
|
||||
*/
|
||||
public String displayPath(ScriptNode node)
|
||||
{
|
||||
return this.unprotNodeService.getPath(node.nodeRef).toDisplayPath(
|
||||
this.unprotNodeService, new PermissionServiceNOOPImpl());
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to pad a string with zero '0' characters to the required length
|
||||
*
|
||||
|
Reference in New Issue
Block a user