Merged BRANCHES/V3.2 to HEAD:

18104: Merged in DEV/BELARUS/V3.2-2009_12_15 rev 17847: ETHREEOH-3746 DB2 upgrade issue
   18476: Fixed ETHREEOH-3983: NodeLockedException:  IncompleteNodeTagger fails for locked nodes
   18761: Merged V3.1 to V3.2
        18760 (RECORD-ONLY): Merged V2.2 to V3.1 
           18759: Merged DEV/BELARUS/V2.2-2010_02_03 to V2.2 
              18553: ResultSet closing was added to methods. This was fixed separately in V3.2.
   18787: MT: fix ETHREEOH-4125 - authority migration / batch processor (when upgrading groups from 3.1 to 3.2)
   19059: Fix read-only marker in test
   19061: Handle missing alf_content_data ID for node cleaning


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19226 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-03-11 15:08:37 +00:00
parent 0c5d02d543
commit c36fe6b6c0
6 changed files with 200 additions and 24 deletions

View File

@@ -36,7 +36,9 @@ import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.admin.patch.PatchExecuter;
import org.alfresco.repo.batch.BatchProcessor;
import org.alfresco.repo.importer.ImporterBootstrap;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authority.UnknownAuthorityException;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
@@ -180,17 +182,35 @@ public class AuthorityMigrationPatch extends AbstractPatch implements Applicatio
parents.add(parentAuthority);
assocCount++;
}
// loop over properties
Collection<String> members = DefaultTypeConverter.INSTANCE.getCollection(String.class, this.nodeService
.getProperty(current, AuthorityMigrationPatch.PROP_MEMBERS));
if (members != null)
{
String tenantDomain = null;
if (tenantAdminService.isEnabled())
{
tenantDomain = tenantAdminService.getCurrentUserDomain();
}
for (String user : members)
{
// Believe it or not, some old authorities have null members in them!
if (user != null)
{
if ((tenantDomain != null) && (! (tenantDomain.equals(TenantService.DEFAULT_DOMAIN))))
{
if (tenantAdminService.getUserDomain(user).equals(TenantService.DEFAULT_DOMAIN))
{
if (user.equals(tenantAdminService.getBaseNameUser(AuthenticationUtil.getAdminUserName())))
{
// MT: workaround for CHK-11393 (eg. EMAIL_CONTRIBUTORS with member "admin" instead of "admin@tenant")
user = tenantAdminService.getDomainUser(user, tenantDomain);
}
}
}
Set<String> propParents = parentAssocs.get(user);
if (propParents == null)
{
@@ -271,7 +291,7 @@ public class AuthorityMigrationPatch extends AbstractPatch implements Applicatio
};
// Migrate using 2 threads, 20 authorities per transaction. Log every 100 entries.
new BatchProcessor<Map.Entry<String, Set<String>>>(AuthorityMigrationPatch.progress_logger,
this.transactionService.getRetryingTransactionHelper(), this.ruleService,
this.transactionService.getRetryingTransactionHelper(), this.ruleService, this.tenantAdminService,
this.applicationEventPublisher, parentAssocs.entrySet(), I18NUtil
.getMessage(AuthorityMigrationPatch.MSG_PROCESS_NAME), 100, 2, 20).process(worker, true);
}

View File

@@ -181,7 +181,7 @@ public class FixNameCrcValuesPatch extends AbstractPatch implements ApplicationE
{
// get the association types to check
BatchProcessor<Long> batchProcessor = new BatchProcessor<Long>(logger, transactionService
.getRetryingTransactionHelper(), ruleService, applicationEventPublisher, findMismatchedCrcs(),
.getRetryingTransactionHelper(), ruleService, tenantAdminService, applicationEventPublisher, findMismatchedCrcs(),
"FixNameCrcValuesPatch", 1000, 2, 20);
// Precautionary flush and clear so that we have an empty session