Pull request #3: Only add redacted entries to redaction report

Merge in RED/redaction-report-service from Fix1 to master

* commit '65c283e5eb872667a45fae1464dc71a66420b6fb':
  Only add redacted entries to redaction report
This commit is contained in:
Dominique Eiflaender 2020-09-03 12:25:42 +02:00
commit bcad8333f5

View File

@ -48,18 +48,19 @@ public class ReportGenerationService {
multiFileRedactionLog.getRedactionLogs().forEach(fileRedactionLog -> {
fileRedactionLog.getRedactionLogEntry().forEach(redactionLogEntry -> {
Set<Integer> pages = new HashSet<>();
redactionLogEntry.getPositions().forEach(position -> {
pages.add(position.getPage());
});
pages.forEach(page -> {
XWPFTableRow row = table.createRow();
row.getCell(0).setText(fileRedactionLog.getFilename());
row.getCell(1).setText(String.valueOf(page));
row.getCell(2).setText(String.valueOf(redactionLogEntry.getSectionNumber()));
row.getCell(3).setText(redactionLogEntry.getReason());
});
if(redactionLogEntry.isRedacted()) {
Set<Integer> pages = new HashSet<>();
redactionLogEntry.getPositions().forEach(position -> {
pages.add(position.getPage());
});
pages.forEach(page -> {
XWPFTableRow row = table.createRow();
row.getCell(0).setText(fileRedactionLog.getFilename());
row.getCell(1).setText(String.valueOf(page));
row.getCell(2).setText(String.valueOf(redactionLogEntry.getSectionNumber()));
row.getCell(3).setText(redactionLogEntry.getReason());
});
}
});
});