Merge branch 'RED-9796' into 'master'

RED-9796: Links should not be removed on upload

Closes RED-9796

See merge request redactmanager/persistence-service!723
This commit is contained in:
Maverick Studer 2024-09-05 16:29:49 +02:00
commit d7694b37a2
2 changed files with 12 additions and 1 deletions

View File

@ -7,7 +7,7 @@ plugins {
}
val redactionServiceVersion by rootProject.extra { "4.290.0" }
val pdftronRedactionServiceVersion by rootProject.extra { "4.81.0" }
val pdftronRedactionServiceVersion by rootProject.extra { "4.87.0" }
val redactionReportServiceVersion by rootProject.extra { "4.81.0" }
val searchServiceVersion by rootProject.extra { "2.90.0" }

View File

@ -135,6 +135,7 @@ public class DownloadPreparationService {
switch (downloadFileType) {
case REDACTED -> result.add(RedactionType.REDACTED);
case PREVIEW -> result.add(RedactionType.PREVIEW);
case OPTIMIZED_PREVIEW -> result.add(RedactionType.OPTIMIZED_PREVIEW);
case DELTA_PREVIEW -> result.add(RedactionType.DELTA);
default -> {
}
@ -263,6 +264,10 @@ public class DownloadPreparationService {
fileSystemBackedArchiver.addEntry(new FileSystemBackedArchiver.ArchiveModel("Preview", addSuffix(filename, "highlighted"), //
getPreview(file.getId(), redactionFileResult.get().getDetails())));
}
if (downloadFileType.name().equals(DownloadFileType.OPTIMIZED_PREVIEW.name())) {
fileSystemBackedArchiver.addEntry(new FileSystemBackedArchiver.ArchiveModel("Optimized Preview", addSuffix(filename, "optimized_highlighted"), //
getOptimizedPreview(file.getId(), redactionFileResult.get().getDetails())));
}
if (downloadFileType.name().equals(DownloadFileType.DELTA_PREVIEW.name())) {
fileSystemBackedArchiver.addEntry(new FileSystemBackedArchiver.ArchiveModel("Delta Preview", addSuffix(filename, "delta_highlighted"), //
getDeltaPreview(file.getId(), redactionFileResult.get().getDetails())));
@ -327,6 +332,12 @@ public class DownloadPreparationService {
}
private byte[] getOptimizedPreview(String fileId, List<RedactionResultDetail> redactionResultDetails) {
return getStoredFileBytes(fileId, redactionResultDetails, RedactionType.OPTIMIZED_PREVIEW);
}
private void addReports(String downloadId,
DownloadStatusEntity downloadStatus,
List<StoredFileInformation> storedFileInformations,