RED-7382: Delete section grid for migrated files
This commit is contained in:
parent
f2a6a90529
commit
36e8a2bfdb
@ -196,7 +196,7 @@ public class SaasMigrationService implements TenantSyncService {
|
|||||||
saasMigrationStatusPersistenceService.updateStatus(fileId, SaasMigrationStatus.REDACTION_LOGS_MIGRATED);
|
saasMigrationStatusPersistenceService.updateStatus(fileId, SaasMigrationStatus.REDACTION_LOGS_MIGRATED);
|
||||||
|
|
||||||
log.info("EntityLog migration finished for saas migration for tenant {} dossier {} and file {}", TenantContext.getTenantId(), dossierId, fileId);
|
log.info("EntityLog migration finished for saas migration for tenant {} dossier {} and file {}", TenantContext.getTenantId(), dossierId, fileId);
|
||||||
migrateAnnotationIdsAndAddManualAddRedactions(dossierId, fileId);
|
migrateAnnotationIdsAndAddManualAddRedactionsAndDeleteSectionGrid(dossierId, fileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ public class SaasMigrationService implements TenantSyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void migrateAnnotationIdsAndAddManualAddRedactions(String dossierId, String fileId) {
|
private void migrateAnnotationIdsAndAddManualAddRedactionsAndDeleteSectionGrid(String dossierId, String fileId) {
|
||||||
|
|
||||||
MigratedIds migratedIds = getMigratedIds(dossierId, fileId);
|
MigratedIds migratedIds = getMigratedIds(dossierId, fileId);
|
||||||
Map<String, String> oldToNewMapping = migratedIds.buildOldToNewMapping();
|
Map<String, String> oldToNewMapping = migratedIds.buildOldToNewMapping();
|
||||||
@ -231,6 +231,7 @@ public class SaasMigrationService implements TenantSyncService {
|
|||||||
List<ManualRedactionEntry> manualRedactionEntriesToAdd = migratedIds.getManualRedactionEntriesToAdd();
|
List<ManualRedactionEntry> manualRedactionEntriesToAdd = migratedIds.getManualRedactionEntriesToAdd();
|
||||||
int count = addManualRedactionEntries(manualRedactionEntriesToAdd);
|
int count = addManualRedactionEntries(manualRedactionEntriesToAdd);
|
||||||
log.info("Added {} additional manual entries.", count);
|
log.info("Added {} additional manual entries.", count);
|
||||||
|
deleteSectionGrid(dossierId, fileId);
|
||||||
saasMigrationStatusPersistenceService.updateStatus(fileId, SaasMigrationStatus.FINISHED);
|
saasMigrationStatusPersistenceService.updateStatus(fileId, SaasMigrationStatus.FINISHED);
|
||||||
|
|
||||||
log.info("AnnotationIds migration finished for saas migration for tenant {} dossier {} and file {}", TenantContext.getTenantId(), dossierId, fileId);
|
log.info("AnnotationIds migration finished for saas migration for tenant {} dossier {} and file {}", TenantContext.getTenantId(), dossierId, fileId);
|
||||||
@ -238,6 +239,18 @@ public class SaasMigrationService implements TenantSyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void deleteSectionGrid(String dossierId, String fileId) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
storageService.deleteObject(TenantContext.getTenantId(), StorageIdUtils.getStorageId(dossierId, fileId, FileType.SECTION_GRID));
|
||||||
|
} catch (StorageObjectDoesNotExist e) {
|
||||||
|
log.info("No sectiongrid found for {}, {}, ignoring....", dossierId, fileId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private int addManualRedactionEntries(List<ManualRedactionEntry> manualRedactionEntriesToAdd) {
|
private int addManualRedactionEntries(List<ManualRedactionEntry> manualRedactionEntriesToAdd) {
|
||||||
|
|
||||||
return manualRedactionService.addManualRedactionEntries(manualRedactionEntriesToAdd, true);
|
return manualRedactionService.addManualRedactionEntries(manualRedactionEntriesToAdd, true);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user