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
44359: Fix for ALF-15236 - JSF - Edit online of html files does not keep the formatting 44365: Fix for ALF-14653 - Share - Page link created wrongly in wiki 44366: Fix for ALF-15435 - Incorrect behavior while managing groups via Explorer 44370: Completion of existing fix for ALF-14568. Also a build fix. 44372: Fix for ALF-13192 Rules from first folder move to second when delete first folder. This bug was caused because up to now, all rules have been firing for system folders, which they shouldn't have been. 44381: ALF-17094: Merged V4.1.1 (4.1.1.14) to V4.1-BUG-FIX (4.1.3) << Code is actually as suggested by Derek rather than code on V4.1.1 >> 44291: MNT-222 InvalidNodeRefException on user deletion in Share UI 44385: Fix for ALF-16006 - MT: Document Library is absent after upgrade from 3.4.x to 4.1.x (eg. 3.4.10 -> 4.1.1) Offshore team identified that patches running outside of a TXN were returning an empty list of tenants for MT upgrades - fixed after chat to Derek – added a new "big" TenantAdminService with a TXN wrapper interceptor so the AbstractPatch method that generates the list of tenants will also have a txn support regardless of the config set for a particularly patch - merged in fix to AVMToADM store patch to respect tenant named objects in paths 44395: Fix for ALF-17061 Search is failing with Node does not exist: missing://missing/missing(null) 44402: Merged DEV to V4.1-BUG-FIX 44347: ALF-16866 : Failure when trying to login as tenant created on 3.4.0 after the upgrade from 3.4.0 to 4.1.2 The immutableEntityTransactionalCache was made not tenant aware, and fixUserQNames patch now runs after migrateTenantsFromAttrsToTable to fix tenant users, too. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@44521 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -96,6 +96,8 @@ public class AVMToADMRemoteStorePatch extends AbstractPatch
|
||||
private static final int MIGRATE_BATCH_THREADS = 4;
|
||||
private static final int MIGRATE_BATCH_SIZE = 250;
|
||||
|
||||
private static final String SEPARATOR = "@";
|
||||
|
||||
private Map<String, NodeRef> siteReferenceCache = null;
|
||||
private SortedMap<String, AVMNodeDescriptor> paths;
|
||||
private SortedMap<String, AVMNodeDescriptor> retryPaths;
|
||||
@@ -198,11 +200,14 @@ public class AVMToADMRemoteStorePatch extends AbstractPatch
|
||||
{
|
||||
this.retryPaths = new TreeMap<String, AVMNodeDescriptor>();
|
||||
|
||||
// get user names that will be used to RunAs and set permissions later
|
||||
final String systemUser = AuthenticationUtil.getSystemUserName();
|
||||
|
||||
// firstly retrieve all AVM paths and descriptors that we need to process
|
||||
// execute in a single transaction to retrieve the stateless object list
|
||||
RetryingTransactionCallback<Void> work = new RetryingTransactionCallback<Void>()
|
||||
RetryingTransactionCallback<String> work = new RetryingTransactionCallback<String>()
|
||||
{
|
||||
public Void execute() throws Exception
|
||||
public String execute() throws Exception
|
||||
{
|
||||
long start = System.currentTimeMillis();
|
||||
paths = retrieveAVMPaths();
|
||||
@@ -220,21 +225,17 @@ public class AVMToADMRemoteStorePatch extends AbstractPatch
|
||||
folderPath.add("user");
|
||||
FileFolderUtil.makeFolders(fileFolderService, surfConfigRef, folderPath, ContentModel.TYPE_FOLDER);
|
||||
|
||||
return null;
|
||||
// return the tenant system user name while in the txn
|
||||
return tenantAdminService.getDomainUser(systemUser, tenantAdminService.getCurrentUserDomain());
|
||||
}
|
||||
};
|
||||
this.transactionHelper.doInTransaction(work, false, true);
|
||||
final String tenantSystemUser = this.transactionHelper.doInTransaction(work, false, true);
|
||||
|
||||
try
|
||||
{
|
||||
// init the siteid to surf-config noderef cache
|
||||
this.siteReferenceCache = new ConcurrentHashMap<String, NodeRef>(16384);
|
||||
|
||||
// get user names that will be used to RunAs and set permissions later
|
||||
String systemUser = AuthenticationUtil.getSystemUserName();
|
||||
final String tenantSystemUser = this.tenantAdminService.getDomainUser(
|
||||
systemUser, this.tenantAdminService.getCurrentUserDomain());
|
||||
|
||||
// build a set of unique site names
|
||||
final Set<String> sites = new HashSet<String>(paths.size());
|
||||
Matcher matcher;
|
||||
@@ -421,7 +422,7 @@ public class AVMToADMRemoteStorePatch extends AbstractPatch
|
||||
if (this.retryPaths.size() != 0)
|
||||
{
|
||||
logger.info("Retrying " + this.retryPaths.size() + " paths...");
|
||||
work = new RetryingTransactionCallback<Void>()
|
||||
RetryingTransactionCallback<Void> retrywork = new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
public Void execute() throws Exception
|
||||
{
|
||||
@@ -432,7 +433,7 @@ public class AVMToADMRemoteStorePatch extends AbstractPatch
|
||||
return null;
|
||||
}
|
||||
};
|
||||
this.transactionHelper.doInTransaction(work, false, true);
|
||||
this.transactionHelper.doInTransaction(retrywork, false, true);
|
||||
}
|
||||
|
||||
logger.info("Migrated: " + this.paths.size() + " AVM nodes to DM in " + (System.currentTimeMillis()-start) + "ms");
|
||||
@@ -650,7 +651,16 @@ public class AVMToADMRemoteStorePatch extends AbstractPatch
|
||||
|
||||
SortedMap<String, AVMNodeDescriptor> paths = new TreeMap<String, AVMNodeDescriptor>();
|
||||
|
||||
String avmPath = this.avmStore + ":" + this.avmRootPath;
|
||||
String avmPath;
|
||||
if (this.tenantAdminService.getCurrentUserDomain().isEmpty())
|
||||
{
|
||||
avmPath = this.avmStore + ":" + this.avmRootPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
avmPath = SEPARATOR + this.tenantAdminService.getCurrentUserDomain() + SEPARATOR + this.avmStore + ":" + this.avmRootPath;
|
||||
}
|
||||
|
||||
AVMNodeDescriptor node = this.avmService.lookup(-1, avmPath);
|
||||
if (node != null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user