From e7a05a670e1d6859eec2ba0b87b02ea799c4cd3d Mon Sep 17 00:00:00 2001 From: Ali Oezyetimoglu Date: Mon, 5 Dec 2022 14:27:53 +0100 Subject: [PATCH] RED-5473: fixed output of value placeholder for empty values by adding type of entry --- .../service/ExcelReportGenerationService.java | 17 ----------------- .../server/service/IuclidFunctionService.java | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) 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 c6cf267..5aa1ae8 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 @@ -384,19 +384,8 @@ public class ExcelReportGenerationService { } if (placeholder.equals(REDACTION_VALUE_PLACEHOLDER)) { -// return input -> input.getEntry().getValue() != null ? input.getEntry().getValue().replaceAll("\n", " ").replaceAll(" ", " ") : ""; -// return input -> input.getEntry().getValue() != null ? input.getEntry().getValue().replaceAll("\n", " ").replaceAll(" ", " ") : computeValueForSignatureRedactions(input); return input -> input.getEntry().getValue() != null ? input.getEntry().getValue().replaceAll("\n", " ").replaceAll(" ", " ") : input.getEntry().getEntityDisplayName(); -// return input -> { -// String value = ""; -// if (input.getEntry().getValue() != null) { -// value = input.getEntry().getValue().replaceAll("\n", " ").replaceAll(" ", " "); -// } else { -// value = computeValueForSignatureRedactions(input); -// } -// return value; -// }; } if (placeholder.equals(REDACTION_ENTITY_DISPLAY_NAME_PLACEHOLDER)) { return input -> input.getEntry().getEntityDisplayName(); @@ -404,12 +393,6 @@ public class ExcelReportGenerationService { return input -> ""; } -// private String computeValueForSignatureRedactions(PlaceholderInput input) { -// -// System.out.println(input.getEntry().getEntityDisplayName()); -// return input.getEntry().getEntityDisplayName(); -// } - private void replacePlaceholdersForCell(Cell cell, String search, String replace) { diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/IuclidFunctionService.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/IuclidFunctionService.java index a9cbd64..952bb51 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/IuclidFunctionService.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/IuclidFunctionService.java @@ -36,7 +36,7 @@ public class IuclidFunctionService { ReportRedactionEntry entry = iterator.next(); s.append("P").append(entry.getPage()).append(" "); if (StringUtils.isBlank(entry.getValue()) || entry.getValue().equalsIgnoreCase("Rectangle")) { - s.append("non-readable content"); + s.append(entry.getEntityDisplayName()).append(" - non-readable content"); } else { s.append(entry.getValue().replaceAll("\n", " ").replaceAll(" ", " ")); }