mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.1 to HEAD
13270: Additional items from CHK-6464 as pointed out by Will. 13271: SiteService Build fix. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13592 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -770,18 +770,28 @@ public class SiteServiceImpl implements SiteService, SiteModel
|
||||
{
|
||||
final String cacheKey = this.tenantAdminService.getCurrentUserDomain() + '_' + shortName;
|
||||
NodeRef siteNodeRef = this.siteNodeRefs.get(cacheKey);
|
||||
if (siteNodeRef == null)
|
||||
if (siteNodeRef != null)
|
||||
{
|
||||
NodeRef siteRoot = getSiteParent(shortName);
|
||||
|
||||
// the site "short name" directly maps to the cm:name property
|
||||
siteNodeRef = this.nodeService.getChildByName(siteRoot, ContentModel.ASSOC_CONTAINS, shortName);
|
||||
|
||||
// cache the result if found - null results will be requeried to ensure new sites are found later
|
||||
if (siteNodeRef != null)
|
||||
{
|
||||
this.siteNodeRefs.put(cacheKey, siteNodeRef);
|
||||
}
|
||||
// test for existance - and remove from cache if no longer exists
|
||||
if (!this.nodeService.exists(siteNodeRef))
|
||||
{
|
||||
this.siteNodeRefs.remove(cacheKey);
|
||||
siteNodeRef = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// not in cache - find and store
|
||||
NodeRef siteRoot = getSiteParent(shortName);
|
||||
|
||||
// the site "short name" directly maps to the cm:name property
|
||||
siteNodeRef = this.nodeService.getChildByName(siteRoot, ContentModel.ASSOC_CONTAINS, shortName);
|
||||
|
||||
// cache the result if found - null results will be requeried to ensure new sites are found later
|
||||
if (siteNodeRef != null)
|
||||
{
|
||||
this.siteNodeRefs.put(cacheKey, siteNodeRef);
|
||||
}
|
||||
}
|
||||
return siteNodeRef;
|
||||
}
|
||||
|
Reference in New Issue
Block a user