From fd3a304224cef1ee5b179bd5464968b2c4925b33 Mon Sep 17 00:00:00 2001 From: Sergey Grigoriev Date: Tue, 10 Sep 2024 15:09:27 +0200 Subject: [PATCH] chore: refactoring LiveDocHelper renamed to DocumentDataHelper DocumentData moved to external class --- .../pdf/exporter/converter/CoverPageProcessor.java | 2 +- .../extension/pdf/exporter/converter/PdfConverter.java | 2 +- .../pdf/exporter/{util => rest/model}/DocumentData.java | 2 +- .../extension/pdf/exporter/util/DocumentDataHelper.java | 7 +------ .../pdf/exporter/util/DocumentFileNameHelper.java | 1 + .../exporter/util/placeholder/PlaceholderProcessor.java | 2 +- .../pdf/exporter/util/velocity/VelocityEvaluator.java | 2 +- .../pdf/exporter/converter/CoverPageProcessorTest.java | 2 +- .../extension/pdf/exporter/converter/PdfConverterTest.java | 2 +- .../pdf/exporter/util/DocumentDataHelperTest.java | 1 + .../pdf/exporter/util/DocumentFileNameHelperTest.java | 1 + .../exporter/weasyprint/PdfConverterWeasyPrintTest.java | 2 +- 12 files changed, 12 insertions(+), 14 deletions(-) rename src/main/java/ch/sbb/polarion/extension/pdf/exporter/{util => rest/model}/DocumentData.java (91%) diff --git a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/converter/CoverPageProcessor.java b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/converter/CoverPageProcessor.java index a0cb7b0..d34f74d 100644 --- a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/converter/CoverPageProcessor.java +++ b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/converter/CoverPageProcessor.java @@ -4,7 +4,7 @@ import ch.sbb.polarion.extension.pdf.exporter.rest.model.conversion.ExportParams; import ch.sbb.polarion.extension.pdf.exporter.rest.model.settings.coverpage.CoverPageModel; import ch.sbb.polarion.extension.pdf.exporter.settings.CoverPageSettings; -import ch.sbb.polarion.extension.pdf.exporter.util.DocumentData; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import ch.sbb.polarion.extension.pdf.exporter.util.MediaUtils; import ch.sbb.polarion.extension.pdf.exporter.util.PdfGenerationLog; import ch.sbb.polarion.extension.pdf.exporter.util.PdfTemplateProcessor; diff --git a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/converter/PdfConverter.java b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/converter/PdfConverter.java index 7ea5b05..84cbc06 100644 --- a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/converter/PdfConverter.java +++ b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/converter/PdfConverter.java @@ -17,7 +17,7 @@ import ch.sbb.polarion.extension.pdf.exporter.settings.HeaderFooterSettings; import ch.sbb.polarion.extension.pdf.exporter.settings.LocalizationSettings; import ch.sbb.polarion.extension.pdf.exporter.settings.WebhooksSettings; -import ch.sbb.polarion.extension.pdf.exporter.util.DocumentData; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import ch.sbb.polarion.extension.pdf.exporter.util.EnumValuesProvider; import ch.sbb.polarion.extension.pdf.exporter.util.HtmlLogger; import ch.sbb.polarion.extension.pdf.exporter.util.HtmlProcessor; diff --git a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentData.java b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/rest/model/DocumentData.java similarity index 91% rename from src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentData.java rename to src/main/java/ch/sbb/polarion/extension/pdf/exporter/rest/model/DocumentData.java index 3777d40..66bbba3 100644 --- a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentData.java +++ b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/rest/model/DocumentData.java @@ -1,4 +1,4 @@ -package ch.sbb.polarion.extension.pdf.exporter.util; +package ch.sbb.polarion.extension.pdf.exporter.rest.model; import com.polarion.alm.tracker.model.IModule; import com.polarion.alm.tracker.model.IRichPage; diff --git a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentDataHelper.java b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentDataHelper.java index bdb9d71..e9c4dab 100644 --- a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentDataHelper.java +++ b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentDataHelper.java @@ -1,5 +1,6 @@ package ch.sbb.polarion.extension.pdf.exporter.util; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import ch.sbb.polarion.extension.pdf.exporter.rest.model.conversion.ExportParams; import ch.sbb.polarion.extension.pdf.exporter.service.PdfExporterPolarionService; import ch.sbb.polarion.extension.pdf.exporter.util.exporter.ModifiedDocumentRenderer; @@ -23,17 +24,11 @@ import com.polarion.alm.shared.rpe.RpeModelAspect; import com.polarion.alm.shared.rpe.RpeRenderer; import com.polarion.alm.tracker.model.IBaseline; -import com.polarion.alm.tracker.model.IModule; -import com.polarion.alm.tracker.model.IRichPage; -import com.polarion.alm.tracker.model.ITestRun; import com.polarion.alm.tracker.model.ITrackerProject; -import com.polarion.alm.tracker.model.IWikiPage; import com.polarion.alm.tracker.model.ipi.IInternalBaselinesManager; import com.polarion.platform.persistence.model.IPObject; import com.polarion.subterra.base.location.ILocation; import com.polarion.subterra.base.location.Location; -import lombok.Builder; -import lombok.Getter; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.VisibleForTesting; diff --git a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentFileNameHelper.java b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentFileNameHelper.java index cd9ef19..0c0edc7 100644 --- a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentFileNameHelper.java +++ b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentFileNameHelper.java @@ -4,6 +4,7 @@ import ch.sbb.polarion.extension.generic.settings.NamedSettingsRegistry; import ch.sbb.polarion.extension.generic.settings.SettingId; import ch.sbb.polarion.extension.generic.util.ScopeUtils; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import ch.sbb.polarion.extension.pdf.exporter.rest.model.conversion.DocumentType; import ch.sbb.polarion.extension.pdf.exporter.rest.model.conversion.ExportParams; import ch.sbb.polarion.extension.pdf.exporter.rest.model.settings.filename.FileNameTemplateModel; diff --git a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/placeholder/PlaceholderProcessor.java b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/placeholder/PlaceholderProcessor.java index f9243ce..5ec35d1 100644 --- a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/placeholder/PlaceholderProcessor.java +++ b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/placeholder/PlaceholderProcessor.java @@ -3,7 +3,7 @@ import ch.sbb.polarion.extension.pdf.exporter.rest.model.conversion.ExportParams; import ch.sbb.polarion.extension.pdf.exporter.rest.model.settings.headerfooter.Placeholder; import ch.sbb.polarion.extension.pdf.exporter.service.PdfExporterPolarionService; -import ch.sbb.polarion.extension.pdf.exporter.util.DocumentData; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import ch.sbb.polarion.extension.pdf.exporter.util.DocumentDataHelper; import ch.sbb.polarion.extension.generic.regex.RegexMatcher; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/velocity/VelocityEvaluator.java b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/velocity/VelocityEvaluator.java index 1381fc7..94ea3c8 100644 --- a/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/velocity/VelocityEvaluator.java +++ b/src/main/java/ch/sbb/polarion/extension/pdf/exporter/util/velocity/VelocityEvaluator.java @@ -1,7 +1,7 @@ package ch.sbb.polarion.extension.pdf.exporter.util.velocity; import ch.sbb.polarion.extension.generic.util.ObjectUtils; -import ch.sbb.polarion.extension.pdf.exporter.util.DocumentData; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import com.polarion.alm.shared.api.transaction.ReadOnlyTransaction; import com.polarion.alm.shared.api.transaction.TransactionalExecutor; import com.polarion.alm.shared.util.VelocityContextInitializer; diff --git a/src/test/java/ch/sbb/polarion/extension/pdf/exporter/converter/CoverPageProcessorTest.java b/src/test/java/ch/sbb/polarion/extension/pdf/exporter/converter/CoverPageProcessorTest.java index dd00916..02e62fc 100644 --- a/src/test/java/ch/sbb/polarion/extension/pdf/exporter/converter/CoverPageProcessorTest.java +++ b/src/test/java/ch/sbb/polarion/extension/pdf/exporter/converter/CoverPageProcessorTest.java @@ -4,7 +4,7 @@ import ch.sbb.polarion.extension.pdf.exporter.rest.model.conversion.ExportParams; import ch.sbb.polarion.extension.pdf.exporter.rest.model.settings.coverpage.CoverPageModel; import ch.sbb.polarion.extension.pdf.exporter.settings.CoverPageSettings; -import ch.sbb.polarion.extension.pdf.exporter.util.DocumentData; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import ch.sbb.polarion.extension.pdf.exporter.util.PdfGenerationLog; import ch.sbb.polarion.extension.pdf.exporter.util.PdfTemplateProcessor; import ch.sbb.polarion.extension.pdf.exporter.util.placeholder.PlaceholderProcessor; diff --git a/src/test/java/ch/sbb/polarion/extension/pdf/exporter/converter/PdfConverterTest.java b/src/test/java/ch/sbb/polarion/extension/pdf/exporter/converter/PdfConverterTest.java index 6475798..cfb3490 100644 --- a/src/test/java/ch/sbb/polarion/extension/pdf/exporter/converter/PdfConverterTest.java +++ b/src/test/java/ch/sbb/polarion/extension/pdf/exporter/converter/PdfConverterTest.java @@ -10,7 +10,7 @@ import ch.sbb.polarion.extension.pdf.exporter.service.PdfExporterPolarionService; import ch.sbb.polarion.extension.pdf.exporter.settings.CssSettings; import ch.sbb.polarion.extension.pdf.exporter.settings.HeaderFooterSettings; -import ch.sbb.polarion.extension.pdf.exporter.util.DocumentData; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import ch.sbb.polarion.extension.pdf.exporter.util.HtmlProcessor; import ch.sbb.polarion.extension.pdf.exporter.util.DocumentDataHelper; import ch.sbb.polarion.extension.pdf.exporter.util.PdfGenerationLog; diff --git a/src/test/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentDataHelperTest.java b/src/test/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentDataHelperTest.java index 26de703..eab6308 100644 --- a/src/test/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentDataHelperTest.java +++ b/src/test/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentDataHelperTest.java @@ -1,5 +1,6 @@ package ch.sbb.polarion.extension.pdf.exporter.util; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import com.polarion.alm.tracker.model.IModule; import com.polarion.subterra.base.location.ILocation; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentFileNameHelperTest.java b/src/test/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentFileNameHelperTest.java index 33ca1a9..1e712ec 100644 --- a/src/test/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentFileNameHelperTest.java +++ b/src/test/java/ch/sbb/polarion/extension/pdf/exporter/util/DocumentFileNameHelperTest.java @@ -1,5 +1,6 @@ package ch.sbb.polarion.extension.pdf.exporter.util; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import ch.sbb.polarion.extension.pdf.exporter.rest.model.settings.filename.FileNameTemplateModel; import ch.sbb.polarion.extension.pdf.exporter.util.velocity.VelocityEvaluator; import org.junit.jupiter.api.Test; diff --git a/src/test/java/ch/sbb/polarion/extension/pdf/exporter/weasyprint/PdfConverterWeasyPrintTest.java b/src/test/java/ch/sbb/polarion/extension/pdf/exporter/weasyprint/PdfConverterWeasyPrintTest.java index df31735..d89547a 100644 --- a/src/test/java/ch/sbb/polarion/extension/pdf/exporter/weasyprint/PdfConverterWeasyPrintTest.java +++ b/src/test/java/ch/sbb/polarion/extension/pdf/exporter/weasyprint/PdfConverterWeasyPrintTest.java @@ -15,7 +15,7 @@ import ch.sbb.polarion.extension.pdf.exporter.settings.CssSettings; import ch.sbb.polarion.extension.pdf.exporter.settings.HeaderFooterSettings; import ch.sbb.polarion.extension.pdf.exporter.settings.LocalizationSettings; -import ch.sbb.polarion.extension.pdf.exporter.util.DocumentData; +import ch.sbb.polarion.extension.pdf.exporter.rest.model.DocumentData; import ch.sbb.polarion.extension.pdf.exporter.util.HtmlProcessor; import ch.sbb.polarion.extension.pdf.exporter.util.DocumentDataHelper; import ch.sbb.polarion.extension.pdf.exporter.util.MediaUtils;