Merge branch 'hotfix' into 'main'
hotfix: double viewerdoc writes in rare cases lead to some contentstreams not being written See merge request fforesight/layout-parser!104
This commit is contained in:
commit
e7bf607663
@ -136,8 +136,6 @@ public class LayoutParsingPipeline {
|
|||||||
|
|
||||||
layoutGridService.addLayoutGrid(viewerDocumentFile, documentGraph, viewerDocumentFile, false);
|
layoutGridService.addLayoutGrid(viewerDocumentFile, documentGraph, viewerDocumentFile, false);
|
||||||
|
|
||||||
layoutGridService.addLayoutGrid(viewerDocumentFile, documentGraph, viewerDocumentFile, false, true);
|
|
||||||
|
|
||||||
log.info("Storing resulting files for {}", layoutParsingRequest.identifier());
|
log.info("Storing resulting files for {}", layoutParsingRequest.identifier());
|
||||||
|
|
||||||
layoutParsingStorageService.storeDocumentData(layoutParsingRequest, DocumentDataMapper.toDocumentData(documentGraph));
|
layoutParsingStorageService.storeDocumentData(layoutParsingRequest, DocumentDataMapper.toDocumentData(documentGraph));
|
||||||
|
|||||||
@ -59,30 +59,29 @@ public class LayoutGridService {
|
|||||||
static Color HEADER_COLOR = new Color(171, 131, 6);
|
static Color HEADER_COLOR = new Color(171, 131, 6);
|
||||||
static Color IMAGE_COLOR = new Color(253, 63, 146);
|
static Color IMAGE_COLOR = new Color(253, 63, 146);
|
||||||
|
|
||||||
static Color IMAGE_VISUAL_COLOR = new Color(122, 0, 255);
|
|
||||||
|
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Observed(name = "ViewerDocumentService", contextualName = "create-viewer-document")
|
@Observed(name = "ViewerDocumentService", contextualName = "create-viewer-document")
|
||||||
public void addLayoutGrid(File originFile, Document document, File destinationFile, boolean layerVisibilityDefaultValue) {
|
public void addLayoutGrid(File originFile, Document document, File destinationFile, boolean layerVisibilityDefaultValue) {
|
||||||
|
|
||||||
this.addLayoutGrid(originFile, document, destinationFile, layerVisibilityDefaultValue, false);
|
Visualizations layoutGrid = this.addLayoutGrid(document, layerVisibilityDefaultValue, false);
|
||||||
|
Visualizations visualLayoutGrid = this.addLayoutGrid(document, layerVisibilityDefaultValue, true);
|
||||||
|
|
||||||
|
viewerDocumentService.addVisualizationsOnPage(originFile, destinationFile, List.of(layoutGrid, visualLayoutGrid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Observed(name = "ViewerDocumentService", contextualName = "create-viewer-document")
|
@Observed(name = "ViewerDocumentService", contextualName = "create-viewer-document")
|
||||||
public void addLayoutGrid(File originFile, Document document, File destinationFile, boolean layerVisibilityDefaultValue, boolean visualParsingGrid) {
|
public Visualizations addLayoutGrid(Document document, boolean layerVisibilityDefaultValue, boolean visualParsingGrid) {
|
||||||
|
|
||||||
LayoutGrid layoutGrid = createLayoutGrid(document, visualParsingGrid);
|
LayoutGrid layoutGrid = createLayoutGrid(document, visualParsingGrid);
|
||||||
|
|
||||||
viewerDocumentService.addVisualizationsOnPage(originFile,
|
return Visualizations.builder()
|
||||||
destinationFile,
|
.layer(visualParsingGrid ? ContentStreams.KNECON_VISUAL_PARSING : ContentStreams.KNECON_LAYOUT)
|
||||||
Visualizations.builder()
|
.visualizationsOnPages(layoutGrid.getVisualizationsPerPages())
|
||||||
.layer(visualParsingGrid ? ContentStreams.KNECON_VISUAL_PARSING : ContentStreams.KNECON_LAYOUT)
|
.layerVisibilityDefaultValue(layerVisibilityDefaultValue)
|
||||||
.visualizationsOnPages(layoutGrid.getVisualizationsPerPages())
|
.build();
|
||||||
.layerVisibilityDefaultValue(layerVisibilityDefaultValue)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user