diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/model/ReportRedactionEntry.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/model/ReportRedactionEntry.java index 01a80b9..8754de6 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/model/ReportRedactionEntry.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/model/ReportRedactionEntry.java @@ -17,5 +17,6 @@ public class ReportRedactionEntry { private String excerpt; private String value; private String entityDisplayName; + private boolean isSkipped; } diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ExcelReportGenerationService.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ExcelReportGenerationService.java index d2f9793..14c8f9e 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ExcelReportGenerationService.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ExcelReportGenerationService.java @@ -26,6 +26,7 @@ import static com.iqser.red.service.redaction.report.v1.server.service.Placehold import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.SCM_FUNCTION_PLACEHOLDER; import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.SEEDS_FUNCTION_JUSTIFICATION_PLACEHOLDER; import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.SEEDS_FUNCTION_REDACTION_GROUPED_BY_JUSTIFICATION_PAGES_PLACEHOLDER; +import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.SKIPPED_PLACEHOLDER; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; @@ -338,7 +339,7 @@ public class ExcelReportGenerationService { JUSTIFICATION_PARAGRAPH_PLACEHOLDER) || text.contains(JUSTIFICATION_REASON_PLACEHOLDER) || text.contains(REDACTION_VALUE_PLACEHOLDER) || text.contains( JUSTIFICATION_LEGAL_BASIS_PLACEHOLDER) || text.contains(JUSTIFICATION_TEXT_PLACEHOLDER) || text.contains( SEEDS_FUNCTION_REDACTION_GROUPED_BY_JUSTIFICATION_PAGES_PLACEHOLDER) || text.contains(SEEDS_FUNCTION_JUSTIFICATION_PLACEHOLDER) || text.contains( - REDACTION_ENTITY_DISPLAY_NAME_PLACEHOLDER) || text.contains(SCM_FUNCTION_PLACEHOLDER); + REDACTION_ENTITY_DISPLAY_NAME_PLACEHOLDER) || text.contains(SCM_FUNCTION_PLACEHOLDER) || text.contains(SKIPPED_PLACEHOLDER); } @@ -385,6 +386,9 @@ public class ExcelReportGenerationService { if (placeholder.equals(REDACTION_ENTITY_DISPLAY_NAME_PLACEHOLDER)) { return input -> input.getEntry().getEntityDisplayName(); } + if (placeholder.equals(SKIPPED_PLACEHOLDER)) { + return input -> input.getEntry().isSkipped() ? "true" : ""; + } return input -> ""; } diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/PlaceholderService.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/PlaceholderService.java index 4b6c115..5f04b08 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/PlaceholderService.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/PlaceholderService.java @@ -48,6 +48,7 @@ public class PlaceholderService { public static final String EXCERPT_PLACEHOLDER = "{{redaction.excerpt}}"; public static final String REDACTION_VALUE_PLACEHOLDER = "{{redaction.value}}"; public static final String REDACTION_ENTITY_DISPLAY_NAME_PLACEHOLDER = "{{redaction.entity.displayName}}"; + public static final String SKIPPED_PLACEHOLDER = "{{redaction.skipped}}"; public static final String SCM_FUNCTION_PLACEHOLDER = "{{function.scm}}"; public static final String FILE_ATTRIBUTE_PLACEHOLDER_BASE = "{{file.attribute."; public static final String DOSSIER_ATTRIBUTE_PLACEHOLDER_BASE = "{{dossier.attribute."; @@ -94,7 +95,8 @@ public class PlaceholderService { JUSTIFICATION_TEXT_PLACEHOLDER, SEEDS_FUNCTION_REDACTION_GROUPED_BY_JUSTIFICATION_PAGES_PLACEHOLDER, SEEDS_FUNCTION_JUSTIFICATION_PLACEHOLDER, - REDACTION_ENTITY_DISPLAY_NAME_PLACEHOLDER); + REDACTION_ENTITY_DISPLAY_NAME_PLACEHOLDER, + SKIPPED_PLACEHOLDER); } diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/RedactionLogConverterService.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/RedactionLogConverterService.java index 95d95e0..f338cbb 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/RedactionLogConverterService.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/RedactionLogConverterService.java @@ -82,8 +82,8 @@ public class RedactionLogConverterService { List reportEntries = new ArrayList<>(); redactionLog.getRedactionLogEntry().forEach(entry -> { - - if (entry.isRedacted()) { + var isSkipped = !entry.isRedacted() && !entry.isHint(); + if (entry.isRedacted() || isSkipped) { if (entry.lastChangeIsRemoved()) { return; @@ -133,7 +133,8 @@ public class RedactionLogConverterService { .orElse(""), checkTextForNull(entry.getTextBefore()) + entry.getValue() + checkTextForNull(entry.getTextAfter()), entry.getValue(), - mapOfEntityDisplayName.get(entry.getType()))); + mapOfEntityDisplayName.get(entry.getType()), + isSkipped)); } } } diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportV2IntegrationTest.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportV2IntegrationTest.java index 6ff97b1..51ffc02 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportV2IntegrationTest.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportV2IntegrationTest.java @@ -256,21 +256,6 @@ public class RedactionReportV2IntegrationTest { } - @Configuration - @EnableAutoConfiguration(exclude = {StorageAutoConfiguration.class, RabbitAutoConfiguration.class}) - @ComponentScan("com.iqser.red.service.persistence") - public static class TestConfiguration { - - @Bean - @Primary - public StorageService inmemoryStorage() { - - return new FileSystemBackedStorageService(); - } - - } - - private List createFileModels(int numOfFileModelsToCreate) { if (numOfFileModelsToCreate <= 0) { @@ -284,4 +269,20 @@ public class RedactionReportV2IntegrationTest { return fileModels; } + + @Configuration + @EnableAutoConfiguration(exclude = {StorageAutoConfiguration.class, RabbitAutoConfiguration.class}) + @ComponentScan("com.iqser.red.service.persistence") + public static class TestConfiguration { + + @Bean + @Primary + public StorageService inmemoryStorage() { + + return new FileSystemBackedStorageService(); + } + + + } + } diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/templates/Excel Report.xlsx b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/templates/Excel Report.xlsx index db2fc88..3889cd9 100644 Binary files a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/templates/Excel Report.xlsx and b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/templates/Excel Report.xlsx differ