RED-10196: Backend adaptions for RM/DM unification

This commit is contained in:
maverickstuder 2024-10-18 14:07:21 +02:00
parent 2219519a2b
commit a76c718be9
3 changed files with 5 additions and 6 deletions

View File

@ -1,7 +1,9 @@
package com.knecon.fforesight.service.layoutparser.internal.api.queue; package com.knecon.fforesight.service.layoutparser.internal.api.queue;
import java.util.Arrays;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
@ -10,7 +12,7 @@ import lombok.NonNull;
@Builder @Builder
@Schema(description = "Object containing all storage paths the service needs to know.") @Schema(description = "Object containing all storage paths the service needs to know.")
public record LayoutParsingRequest( public record LayoutParsingRequest(
@Schema(description = "Enum specifying the type of layout parsing to be performed.", allowableValues = "{RedactManager, DocuMine, TAAS}")// @Schema(description = "Enum specifying the type of layout parsing to be performed.") //
@NonNull LayoutParsingType layoutParsingType, @NonNull LayoutParsingType layoutParsingType,
@Schema(description = "General purpose identifiers. They are not changed by the service at all and are returned as is in the response queue.")// @Schema(description = "General purpose identifiers. They are not changed by the service at all and are returned as is in the response queue.")//

View File

@ -125,8 +125,7 @@ public class LayoutParsingPipeline {
TableServiceResponse tableServiceResponse = layoutParsingRequest.tablesFileStorageId() TableServiceResponse tableServiceResponse = layoutParsingRequest.tablesFileStorageId()
.map(layoutParsingStorageService::getTablesFile).orElse(new TableServiceResponse()); .map(layoutParsingStorageService::getTablesFile).orElse(new TableServiceResponse());
ClassificationDocument classificationDocument = parseLayout(settings.getLayoutParsingTypeOverride() == null // ClassificationDocument classificationDocument = parseLayout(layoutParsingRequest.layoutParsingType(),
? layoutParsingRequest.layoutParsingType() : settings.getLayoutParsingTypeOverride(),
originFile, originFile,
imageServiceResponse, imageServiceResponse,
tableServiceResponse, tableServiceResponse,
@ -135,8 +134,7 @@ public class LayoutParsingPipeline {
log.info("Building document graph for {}", layoutParsingRequest.identifier()); log.info("Building document graph for {}", layoutParsingRequest.identifier());
Document documentGraph = observeBuildDocumentGraph(settings.getLayoutParsingTypeOverride() == null // Document documentGraph = observeBuildDocumentGraph(layoutParsingRequest.layoutParsingType(), classificationDocument);
? layoutParsingRequest.layoutParsingType() : settings.getLayoutParsingTypeOverride(), classificationDocument);
log.info("Creating viewer document for {}", layoutParsingRequest.identifier()); log.info("Creating viewer document for {}", layoutParsingRequest.identifier());

View File

@ -16,6 +16,5 @@ import lombok.experimental.FieldDefaults;
public class LayoutparserSettings { public class LayoutparserSettings {
boolean debug; boolean debug;
LayoutParsingType layoutParsingTypeOverride;
String pdftronLicense; String pdftronLicense;
} }