RED-3243: Added new delta preview download file type
This commit is contained in:
parent
dd2c5453aa
commit
3a22964b8d
@ -1,5 +1,5 @@
|
||||
package com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate;
|
||||
|
||||
public enum DownloadFileType {
|
||||
ORIGINAL, PREVIEW, REDACTED, ANNOTATED, FLATTEN
|
||||
ORIGINAL, PREVIEW, REDACTED, ANNOTATED, FLATTEN, DELTA_PREVIEW
|
||||
}
|
||||
|
||||
@ -95,6 +95,10 @@ public class DownloadPreparationService {
|
||||
fileSystemBackedArchiver.addEntry(new FileSystemBackedArchiver.ArchiveModel("Preview", addSuffix(fileStatus.getFilename(), "highlighted"),
|
||||
getPreview(original, redactionLog, dossier.getDossierTemplateId(), dossier.isWatermarkPreviewEnabled())));
|
||||
}
|
||||
if (downloadFileType.name().equals(DownloadFileType.DELTA_PREVIEW.name())) {
|
||||
fileSystemBackedArchiver.addEntry(new FileSystemBackedArchiver.ArchiveModel("Delta Preview", addSuffix(fileStatus.getFilename(), "delta_highlighted"),
|
||||
getDeltaPreview(original, redactionLog, dossier.getDossierTemplateId(), dossier.isWatermarkPreviewEnabled())));
|
||||
}
|
||||
if (downloadFileType.name().equals(DownloadFileType.REDACTED.name())) {
|
||||
fileSystemBackedArchiver.addEntry(new FileSystemBackedArchiver.ArchiveModel("Redacted", addSuffix(fileStatus.getFilename(), "redacted"),
|
||||
getRedacted(original, redactionLog, dossier.getDossierTemplateId(), dossier.isWatermarkEnabled())));
|
||||
@ -207,6 +211,17 @@ public class DownloadPreparationService {
|
||||
}
|
||||
|
||||
|
||||
private byte[] getDeltaPreview(byte[] original, RedactionLog redactionLog, String dossierTemplateId, boolean watermarkEnabled) {
|
||||
|
||||
return pdfTronRedactionClient.redactionPreviewDiff(PdfTronRedactionRequest.builder()
|
||||
.document(original)
|
||||
.dossierTemplateId(dossierTemplateId)
|
||||
.redactionLog(redactionLog)
|
||||
.applyWatermark(watermarkEnabled)
|
||||
.build()).getDocument();
|
||||
}
|
||||
|
||||
|
||||
private RedactionLog getRedactionLog(String dossierId, String fileId, boolean isExcluded) {
|
||||
|
||||
if (isExcluded) {
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<properties>
|
||||
<redaction-service.version>3.68.0</redaction-service.version>
|
||||
<search-service.version>2.18.0</search-service.version>
|
||||
<pdftron-redaction-service.version>3.28.0</pdftron-redaction-service.version>
|
||||
<pdftron-redaction-service.version>3.30.0</pdftron-redaction-service.version>
|
||||
<redaction-report-service.version>3.19.0</redaction-report-service.version>
|
||||
</properties>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user