Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

69948: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud)
      69866: Merged V4.2.2 to V4.2-BUG-FIX (V4.2.3)
         69863: Fix edge-case read-only server browsing of sites that require the tagscope aspect (MNT-11310)
         69864 (RECORD-ONLY): Removed deep svn:mergeinfo
         69865 (RECORD-ONLY): Undo r69863 (MNT-11310) as incorrect branch


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@70464 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-05-16 20:08:47 +00:00
parent 9898a4c200
commit 81d2356496

View File

@@ -2860,26 +2860,31 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
final NodeRef container = containerTmp;
// Ensure the calendar container has the tag scope aspect applied to it
if(! taggingService.isTagScope(container))
if (!taggingService.isTagScope(container))
{
if(logger.isDebugEnabled())
{
logger.debug("Attaching tag scope to " + componentName + " " + container.toString() + " for " + siteShortName);
}
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Void>() {
public Void doWork() throws Exception
{
transactionService.getRetryingTransactionHelper().doInTransaction(
new RetryingTransactionCallback<Void>() {
public Void execute() throws Throwable {
// Add the tag scope aspect
taggingService.addTagScope(container);
return null;
}
}, false, true
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Void>()
{
public Void doWork() throws Exception
{
RetryingTransactionHelper txnHelper = transactionService.getRetryingTransactionHelper();
txnHelper.setForceWritable(true);
txnHelper.doInTransaction(
new RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
// Add the tag scope aspect
taggingService.addTagScope(container);
return null;
}
}, false, true
);
return null;
}
}
}, AuthenticationUtil.getSystemUserName());
}