From 233781b463cc5786eba367906553d18be596ef6f Mon Sep 17 00:00:00 2001 From: Sergey Grigoriev Date: Mon, 9 Dec 2024 16:48:30 +0100 Subject: [PATCH] feat: Support Baseline view Refs: #305 --- .../service/PdfExporterPolarionService.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/sbb/polarion/extension/pdf_exporter/service/PdfExporterPolarionService.java b/src/main/java/ch/sbb/polarion/extension/pdf_exporter/service/PdfExporterPolarionService.java index 31a7a4e..49eab1d 100644 --- a/src/main/java/ch/sbb/polarion/extension/pdf_exporter/service/PdfExporterPolarionService.java +++ b/src/main/java/ch/sbb/polarion/extension/pdf_exporter/service/PdfExporterPolarionService.java @@ -207,7 +207,7 @@ private boolean sameDocument(@Nullable String projectId, @NotNull String spaceId } @SneakyThrows - public T executeInBaseline(@Nullable String baselineRevision, @NotNull ReadOnlyTransaction transaction, Callable callable) { + public T executeInBaseline(@Nullable String baselineRevision, @NotNull ReadOnlyTransaction transaction, @NotNull Callable callable) { if (baselineRevision == null) { return callable.call(); } else { @@ -221,4 +221,12 @@ public T executeInBaseline(@Nullable String baselineRevision, @NotNull ReadO } } + @SneakyThrows + public T executeInBaseline(@Nullable String baselineRevision, @NotNull ReadOnlyTransaction transaction, @NotNull Runnable runnable) { + return executeInBaseline(baselineRevision, transaction, () -> { + runnable.run(); + return null; + }); + } + }