mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
77202: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 74762: ACE-955 "Custom Content Models in Cloud" Fix Enterprise build tests, some tidy up git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78058 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -36,6 +36,8 @@ import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.repo.tenant.TenantUtil;
|
||||
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.repo.transaction.TransactionListenerAdapter;
|
||||
@@ -463,8 +465,7 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
|
||||
for (NodeRef nodeRef : pendingModels)
|
||||
{
|
||||
String tenantDomain = tenantService.getDomain(nodeRef.getStoreRef().getIdentifier());
|
||||
String tenantSystemUserName = tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), tenantDomain);
|
||||
systemTenants.add(tenantSystemUserName);
|
||||
systemTenants.add(tenantDomain);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,22 +477,21 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
|
||||
for (NodeRef nodeRef : pendingDeleteModels)
|
||||
{
|
||||
String tenantDomain = tenantService.getDomain(nodeRef.getStoreRef().getIdentifier());
|
||||
String tenantSystemUserName = tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), tenantDomain);
|
||||
systemTenants.add(tenantSystemUserName);
|
||||
systemTenants.add(tenantDomain);
|
||||
}
|
||||
}
|
||||
|
||||
if (systemTenants.size() > 0)
|
||||
{
|
||||
for (final String tenantSystemUserName : systemTenants)
|
||||
for (final String tenantName : systemTenants)
|
||||
{
|
||||
RetryingTransactionCallback<Void> work = new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||
return TenantUtil.runAsSystemTenant(new TenantRunAsWork<Void>()
|
||||
{
|
||||
public Object doWork()
|
||||
public Void doWork()
|
||||
{
|
||||
// invalidate - to force lazy re-init
|
||||
// note: since afterCommit - need to either clear shared cache or destroy in separate txn
|
||||
@@ -504,9 +504,7 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
|
||||
|
||||
return null;
|
||||
}
|
||||
}, tenantSystemUserName);
|
||||
|
||||
return null;
|
||||
}, tenantName);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -66,9 +66,6 @@ public class DynamicCreateRepositoryLocation extends RepositoryLocation
|
||||
|
||||
public void checkAndCreate(NodeRef rootNodeRef)
|
||||
{
|
||||
// try
|
||||
// {
|
||||
// String[] pathElements = getPathElements();
|
||||
List<NodeRef> nodes = searchService.selectNodes(rootNodeRef, getPath(), null, namespaceService, false);
|
||||
if(nodes.size() == 0)
|
||||
{
|
||||
@@ -76,15 +73,6 @@ public class DynamicCreateRepositoryLocation extends RepositoryLocation
|
||||
+ TenantUtil.getCurrentDomain() + ", creating");
|
||||
create();
|
||||
}
|
||||
|
||||
// fileFolderService.resolveNamePath(rootNodeRef, Arrays.asList(pathElements));
|
||||
// }
|
||||
// catch(FileNotFoundException e)
|
||||
// {
|
||||
// logger.info("Repository location " + getPath() + " does not exist for tenant "
|
||||
// + TenantUtil.getCurrentDomain() + ", creating");
|
||||
// create();
|
||||
// }
|
||||
}
|
||||
|
||||
protected String getParentPath()
|
||||
|
Reference in New Issue
Block a user