RED-7400: changed place of isLocalManualRedaction as it is not needed in RedactionLogEntry anymore #80
@ -78,11 +78,7 @@ public class RedactionLogMergeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private RedactionLog mergeRedactionLogData(RedactionLog redactionLog,
|
private RedactionLog mergeRedactionLogData(RedactionLog redactionLog, ManualRedactions manualRedactions, Set<Integer> excludedPages, List<Type> types, Colors colors) {
|
||||||
ManualRedactions manualRedactions,
|
|
||||||
Set<Integer> excludedPages,
|
|
||||||
List<Type> types,
|
|
||||||
Colors colors) {
|
|
||||||
|
|
||||||
var skippedImportedRedactions = new HashSet<>();
|
var skippedImportedRedactions = new HashSet<>();
|
||||||
log.info("Merging Redaction log with manual redactions");
|
log.info("Merging Redaction log with manual redactions");
|
||||||
@ -102,8 +98,7 @@ public class RedactionLogMergeService {
|
|||||||
|
|
||||||
if (excludedPages != null && !excludedPages.isEmpty()) {
|
if (excludedPages != null && !excludedPages.isEmpty()) {
|
||||||
entry.getPositions().forEach(pos -> {
|
entry.getPositions().forEach(pos -> {
|
||||||
if (!entry.isLocalManualRedaction() && excludedPages.contains(pos.getPage())) {
|
if (!isLocalManualRedaction(entry) && excludedPages.contains(pos.getPage())) {
|
||||||
// if (!isLocalManualRedaction(entry.getManualChanges()) && excludedPages.contains(pos.getPage())) {
|
|
||||||
entry.setExcluded(true);
|
entry.setExcluded(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -132,11 +127,15 @@ public class RedactionLogMergeService {
|
|||||||
return redactionLog;
|
return redactionLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private boolean isLocalManualRedaction(List<ManualChange> manualChanges) {
|
|
||||||
//
|
private boolean isLocalManualRedaction(RedactionLogEntry entry) {
|
||||||
// return manualChanges != null && manualChanges.stream()
|
|
||||||
// .anyMatch(mc -> (mc.getManualRedactionType() == ManualRedactionType.ADD_LOCALLY || mc.getManualRedactionType() == ManualRedactionType.RESIZE) && mc.getAnnotationStatus() == AnnotationStatus.APPROVED);
|
return entry.getManualChanges() != null && entry.getManualChanges()
|
||||||
// }
|
.stream()
|
||||||
|
.anyMatch(mc -> mc.getManualRedactionType() == ManualRedactionType.ADD_LOCALLY || mc.getManualRedactionType() == ManualRedactionType.RESIZE && mc.getAnnotationStatus() == AnnotationStatus.APPROVED && entry.getEngines()
|
||||||
|
.contains(Engine.RULE) && !entry.getEngines().contains(Engine.DICTIONARY));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<ManualRedactionWrapper> createManualRedactionWrappers(ManualRedactions manualRedactions) {
|
private List<ManualRedactionWrapper> createManualRedactionWrappers(ManualRedactions manualRedactions) {
|
||||||
|
|||||||
@ -70,8 +70,10 @@ public class RedactionLogEntry {
|
|||||||
@Builder.Default
|
@Builder.Default
|
||||||
private List<ManualChange> manualChanges = new ArrayList<>();
|
private List<ManualChange> manualChanges = new ArrayList<>();
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
private Set<Engine> engines = new HashSet<>();
|
private Set<Engine> engines = new HashSet<>();
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
private Set<String> reference = new HashSet<>();
|
private Set<String> reference = new HashSet<>();
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
@ -84,13 +86,6 @@ public class RedactionLogEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isLocalManualRedaction() {
|
|
||||||
|
|
||||||
return manualChanges != null && manualChanges.stream()
|
|
||||||
.anyMatch(mc -> (mc.getManualRedactionType() == ManualRedactionType.ADD_LOCALLY || mc.getManualRedactionType() == ManualRedactionType.RESIZE) && mc.getAnnotationStatus() == AnnotationStatus.APPROVED);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public boolean isManuallyRemoved() {
|
public boolean isManuallyRemoved() {
|
||||||
|
|
||||||
return manualChanges != null && manualChanges.stream()
|
return manualChanges != null && manualChanges.stream()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user