mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
93983: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud) 93851: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.1) 93802: Fix for MNT-13198 BM-0012: Run v420b1494_01: (CMIS) GetSites is Slow - use hasSite to check for existence and fix person lookup case sensitivity configuration git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@95023 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1212,21 +1212,24 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
|
|||||||
final Set<String> siteNames = new TreeSet<String>();
|
final Set<String> siteNames = new TreeSet<String>();
|
||||||
|
|
||||||
// MNT-13198 - use the bridge table
|
// MNT-13198 - use the bridge table
|
||||||
Set<String> containingAuthorities = authorityService.getContainingAuthorities(AuthorityType.GROUP, userName, false);
|
String actualUserName = personService.getUserIdentifier(userName);
|
||||||
for(String authority : containingAuthorities)
|
if(actualUserName != null)
|
||||||
{
|
{
|
||||||
if (siteNames.size() < maxResults)
|
Set<String> containingAuthorities = authorityService.getContainingAuthorities(AuthorityType.GROUP, actualUserName, false);
|
||||||
|
for(String authority : containingAuthorities)
|
||||||
{
|
{
|
||||||
String siteName = resolveSite(authority);
|
if (siteNames.size() < maxResults)
|
||||||
// MNT-10836 fix, after MNT-10109 we should also check site existence
|
|
||||||
// A simple exists check would be better than getting the site properties etc - profiling suggests x2 faster
|
|
||||||
if ((siteName != null) && (getSite(siteName) != null))
|
|
||||||
{
|
{
|
||||||
siteNames.add(siteName);
|
String siteName = resolveSite(authority);
|
||||||
|
// MNT-10836 fix, after MNT-10109 we should also check site existence
|
||||||
|
// A simple exists check would be better than getting the site properties etc - profiling suggests x2 faster
|
||||||
|
if ((siteName != null) && hasSite(siteName))
|
||||||
|
{
|
||||||
|
siteNames.add(siteName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (siteNames.isEmpty())
|
if (siteNames.isEmpty())
|
||||||
{
|
{
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
Reference in New Issue
Block a user