RED-2836: Upgraded to redaction-service api
This commit is contained in:
parent
fb623bd0d2
commit
4d63908c8a
@ -26,7 +26,8 @@ public interface RedactionLogResource {
|
||||
@GetMapping(value = REDACTION_LOG_PATH + DOSSIER_ID_PATH_PARAM + FILE_ID_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
RedactionLog getRedactionLog(@PathVariable(DOSSIER_ID_PARAM) String dossierId, @PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = "excludedType", required = false) List<String> excludedTypes,
|
||||
@RequestParam(value = "withManualRedactions", required = false, defaultValue = "true") boolean withManualRedactions);
|
||||
@RequestParam(value = "withManualRedactions", required = false, defaultValue = "true") boolean withManualRedactions,
|
||||
@RequestParam(value = "includeFalsePositives", required = false, defaultValue = "false") boolean includeFalsePositives);
|
||||
|
||||
@GetMapping(value = SECTION_GRID_PATH + DOSSIER_ID_PATH_PARAM + FILE_ID_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
SectionGrid getSectionGrid(@PathVariable(DOSSIER_ID_PARAM) String dossierId, @PathVariable(FILE_ID) String fileId);
|
||||
|
||||
@ -21,9 +21,10 @@ public class RedactionLogController implements RedactionLogResource {
|
||||
public RedactionLog getRedactionLog(@PathVariable(DOSSIER_ID_PARAM) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = "excludedType", required = false) List<String> excludedTypes,
|
||||
@RequestParam(value = "withManualRedactions", required = false, defaultValue = "true") boolean withManualRedactions) {
|
||||
@RequestParam(value = "withManualRedactions", required = false, defaultValue = "true") boolean withManualRedactions,
|
||||
@RequestParam(value = "includeFalsePositives", required = false, defaultValue = "false") boolean includeFalsePositives) {
|
||||
|
||||
return redactionLogService.getRedactionLog(dossierId, fileId, excludedTypes, withManualRedactions);
|
||||
return redactionLogService.getRedactionLog(dossierId, fileId, excludedTypes, withManualRedactions, includeFalsePositives);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ public class AnalysisFlagsCalculationService {
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
var file = fileStatusPersistenceService.getStatus(fileId);
|
||||
var redactionLog = redactionLogService.getRedactionLog(dossierId, fileId, true);
|
||||
var redactionLog = redactionLogService.getRedactionLog(dossierId, fileId, true, false);
|
||||
|
||||
var viewedPagesForCurrentAssignee = viewedPagesPersistenceService.findViewedPages(fileId, file.getAssignee());
|
||||
|
||||
@ -76,11 +76,11 @@ public class AnalysisFlagsCalculationService {
|
||||
lastModification = lastChange.getDateTime();
|
||||
}
|
||||
|
||||
if (!hasRedactions && entry.isRedacted()) {
|
||||
if (!hasRedactions && entry.isRedacted() && !entry.isRecommendation()) {
|
||||
hasRedactions = true;
|
||||
}
|
||||
|
||||
if (!hasHints && entry.isHint() && !type.equals("false_positive")) {
|
||||
if (!hasHints && entry.isHint()) {
|
||||
hasHints = true;
|
||||
}
|
||||
|
||||
|
||||
@ -26,13 +26,13 @@ public class RedactionLogService {
|
||||
private final FileStatusService fileStatusService;
|
||||
|
||||
|
||||
public RedactionLog getRedactionLog(String dossierId, String fileId, boolean withManualRedactions) {
|
||||
public RedactionLog getRedactionLog(String dossierId, String fileId, boolean withManualRedactions, boolean includeFalsePositives) {
|
||||
|
||||
return getRedactionLog(dossierId, fileId, null, withManualRedactions);
|
||||
return getRedactionLog(dossierId, fileId, null, withManualRedactions, includeFalsePositives);
|
||||
}
|
||||
|
||||
|
||||
public RedactionLog getRedactionLog(String dossierId, String fileId, List<String> excludedTypes, boolean withManualRedactions) {
|
||||
public RedactionLog getRedactionLog(String dossierId, String fileId, List<String> excludedTypes, boolean withManualRedactions, boolean includeFalsePositives) {
|
||||
|
||||
var fileStatus = fileStatusService.getStatus(fileId);
|
||||
|
||||
@ -52,6 +52,7 @@ public class RedactionLogService {
|
||||
.manualRedactions(manualRedactions)
|
||||
.dossierTemplateId(dossier.getDossierTemplateId())
|
||||
.excludedPages(fileStatus.getExcludedPages())
|
||||
.includeFalsePositives(includeFalsePositives)
|
||||
.build());
|
||||
} catch (FeignException e) {
|
||||
if (e.status() == HttpStatus.NOT_FOUND.value()) {
|
||||
|
||||
@ -228,7 +228,7 @@ public class DownloadPreparationService {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return redactionLogService.getRedactionLog(dossierId, fileId, true);
|
||||
return redactionLogService.getRedactionLog(dossierId, fileId, true, false);
|
||||
} catch (NotFoundException e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -27,8 +27,8 @@ public class RedactionLogTest extends AbstractPersistenceServerServiceTest {
|
||||
var file = fileTesterAndProvider.testAndProvideFile(dossier);
|
||||
|
||||
assertThat(redactionLogClient.getSectionGrid(dossier.getId(), file.getId())).isNotNull();
|
||||
assertThat(redactionLogClient.getRedactionLog(dossier.getId(), file.getId(), null,true)).isNotNull();
|
||||
assertThat(redactionLogClient.getRedactionLog(dossier.getId(), file.getId(), null,false)).isNotNull();
|
||||
assertThat(redactionLogClient.getRedactionLog(dossier.getId(), file.getId(), null,true, false)).isNotNull();
|
||||
assertThat(redactionLogClient.getRedactionLog(dossier.getId(), file.getId(), null,false, false)).isNotNull();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<redaction-service.version>3.76.0</redaction-service.version>
|
||||
<redaction-service.version>3.86.0</redaction-service.version>
|
||||
<search-service.version>2.26.0</search-service.version>
|
||||
<pdftron-redaction-service.version>3.44.0</pdftron-redaction-service.version>
|
||||
<redaction-report-service.version>3.19.0</redaction-report-service.version>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user