From 5f5179b2b7206567dd02abc68dd9e399a8286d30 Mon Sep 17 00:00:00 2001 From: "bas.goorden" Date: Thu, 11 Apr 2024 12:00:16 +0200 Subject: [PATCH 1/7] Updated to openPDF 2.0.2 --- .../internal/stylable/StylableParagraph.java | 13 ++++----- .../pom.xml | 28 +------------------ .../openpdf/extension/ExtendedPdfPTable.java | 20 ++++++------- 3 files changed, 17 insertions(+), 44 deletions(-) diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf.openpdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf.openpdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java index 894c80af0..f9075d3d1 100644 --- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf.openpdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java +++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf.openpdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java @@ -24,16 +24,11 @@ */ package fr.opensagres.odfdom.converter.pdf.internal.stylable; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.Map; - import com.lowagie.text.Chunk; import com.lowagie.text.Element; import com.lowagie.text.Font; import com.lowagie.text.Paragraph; import com.lowagie.text.pdf.BaseFont; - import fr.opensagres.odfdom.converter.core.utils.ODFUtils; import fr.opensagres.odfdom.converter.pdf.internal.styles.Style; import fr.opensagres.odfdom.converter.pdf.internal.styles.StyleBreak; @@ -42,6 +37,10 @@ import fr.opensagres.odfdom.converter.pdf.internal.styles.StyleTextProperties; import fr.opensagres.xdocreport.openpdf.extension.ExtendedParagraph; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.Map; + /** * fixes for paragraph pdf conversion by Leszek Piotrowicz */ @@ -249,9 +248,9 @@ private void postProcessBookmarks() Chunk lastChunk = (Chunk) elements.get( elements.size() - 1 ); String localDestination = null; - if ( lastChunk.getAttributes() != null ) + if ( lastChunk.getChunkAttributes() != null ) { - localDestination = (String) lastChunk.getAttributes().get( Chunk.LOCALDESTINATION ); + localDestination = (String) lastChunk.getChunkAttributes().get( Chunk.LOCALDESTINATION ); } if ( localDestination != null ) { diff --git a/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/pom.xml b/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/pom.xml index 70fa88247..8142ec0f4 100644 --- a/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/pom.xml +++ b/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/pom.xml @@ -10,33 +10,7 @@ com.github.librepdf openpdf - 1.3.18 - - - bcmail-jdk14 - org.bouncycastle - - - bcprov-jdk14 - org.bouncycastle - - - bctsp-jdk14 - org.bouncycastle - - - bouncycastle - bcprov-jdk14 - - - bouncycastle - bctsp-jdk14 - - - bouncycastle - bcmail-jdk14 - - + 2.0.2 bcmail-jdk14 diff --git a/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/src/main/java/fr/opensagres/xdocreport/openpdf/extension/ExtendedPdfPTable.java b/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/src/main/java/fr/opensagres/xdocreport/openpdf/extension/ExtendedPdfPTable.java index 879d119c5..3ef3d4a8c 100644 --- a/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/src/main/java/fr/opensagres/xdocreport/openpdf/extension/ExtendedPdfPTable.java +++ b/thirdparties-extension/fr.opensagres.xdocreport.openpdf.extension/src/main/java/fr/opensagres/xdocreport/openpdf/extension/ExtendedPdfPTable.java @@ -184,38 +184,38 @@ boolean rowSpanAbove( int currRow, int currCol ) } @Override - public void addCell( Image image ) + public PdfPCell addCell( Image image ) { this.empty = false; - super.addCell( image ); + return super.addCell( image ); } @Override - public void addCell( PdfPCell cell ) + public PdfPCell addCell( PdfPCell cell ) { this.empty = false; - super.addCell( cell ); + return super.addCell( cell ); } @Override - public void addCell( PdfPTable table ) + public PdfPCell addCell( PdfPTable table ) { this.empty = false; - super.addCell( table ); + return super.addCell( table ); } @Override - public void addCell( Phrase phrase ) + public PdfPCell addCell( Phrase phrase ) { this.empty = false; - super.addCell( phrase ); + return super.addCell( phrase ); } @Override - public void addCell( String text ) + public PdfPCell addCell( String text ) { this.empty = false; - super.addCell( text ); + return super.addCell( text ); } public boolean isEmpty() From da6c573b2536f8b656c65b67bc71d2fb415be301 Mon Sep 17 00:00:00 2001 From: "bas.goorden" Date: Thu, 11 Apr 2024 14:14:36 +0200 Subject: [PATCH 2/7] Update maven workflow to use java 17 --- .github/workflows/maven.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d811018e3..583a1b281 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up JDK 8 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: - java-version: '8' + java-version: '17' distribution: 'temurin' cache: maven - name: Build with Maven From 45edec09d2246ae8e52ba23450881e998ff12105 Mon Sep 17 00:00:00 2001 From: "bas.goorden" Date: Thu, 11 Apr 2024 18:05:55 +0200 Subject: [PATCH 3/7] Updates to run build with jdk 17 --- .../document/odt/styling/TestODTStyling.java | 50 +++++++++---------- .../odt/textstyling/TestODTStyling.java | 46 ++++++++--------- .../pom.xml | 14 ++++++ pom.xml | 3 ++ .../pom.xml | 14 ++++++ 5 files changed, 75 insertions(+), 52 deletions(-) diff --git a/document/fr.opensagres.xdocreport.document.odt/src/test/java/fr/opensagres/xdocreport/document/odt/styling/TestODTStyling.java b/document/fr.opensagres.xdocreport.document.odt/src/test/java/fr/opensagres/xdocreport/document/odt/styling/TestODTStyling.java index 19a749e40..2209a3c76 100644 --- a/document/fr.opensagres.xdocreport.document.odt/src/test/java/fr/opensagres/xdocreport/document/odt/styling/TestODTStyling.java +++ b/document/fr.opensagres.xdocreport.document.odt/src/test/java/fr/opensagres/xdocreport/document/odt/styling/TestODTStyling.java @@ -24,32 +24,6 @@ */ package fr.opensagres.xdocreport.document.odt.styling; -import static org.junit.Assert.assertThat; - -import java.io.IOException; -import java.io.InputStream; -import java.io.StringReader; -import java.io.StringWriter; -import java.io.Writer; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.junit.Assert; -import org.junit.Test; -import org.w3c.dom.Document; -import org.xml.sax.InputSource; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; -import org.xmlunit.matchers.CompareMatcher; - -import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory; - import fr.opensagres.xdocreport.document.odt.preprocessor.ODTBufferedDocumentContentHandler; import fr.opensagres.xdocreport.document.odt.preprocessor.ODTStyleContentHandler; import fr.opensagres.xdocreport.document.odt.textstyling.MockContext; @@ -59,6 +33,28 @@ import fr.opensagres.xdocreport.document.textstyling.IDocumentHandler; import fr.opensagres.xdocreport.document.textstyling.ITextStylingTransformer; import fr.opensagres.xdocreport.document.textstyling.html.HTMLTextStylingTransformer; +import org.junit.Assert; +import org.junit.Test; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; +import org.xmlunit.matchers.CompareMatcher; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; + +import static org.junit.Assert.assertThat; /** * Check ODT Styling generation by comparing generated result against the expected XML @@ -106,7 +102,7 @@ public String formatXML( String unformattedXml ) Transformer serializer = tfactory.newTransformer(); serializer.setOutputProperty( OutputKeys.INDENT, "yes" ); - serializer.setOutputProperty( OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, "2" ); + serializer.setOutputProperty( "{http:// xml. apache. org/ xalan}indent-amount", "2" ); serializer.setOutputProperty( OutputKeys.STANDALONE, "no" ); Writer out = new StringWriter(); diff --git a/document/fr.opensagres.xdocreport.document.odt/src/test/java/fr/opensagres/xdocreport/document/odt/textstyling/TestODTStyling.java b/document/fr.opensagres.xdocreport.document.odt/src/test/java/fr/opensagres/xdocreport/document/odt/textstyling/TestODTStyling.java index 777bf7dc7..1275ba325 100644 --- a/document/fr.opensagres.xdocreport.document.odt/src/test/java/fr/opensagres/xdocreport/document/odt/textstyling/TestODTStyling.java +++ b/document/fr.opensagres.xdocreport.document.odt/src/test/java/fr/opensagres/xdocreport/document/odt/textstyling/TestODTStyling.java @@ -24,22 +24,13 @@ */ package fr.opensagres.xdocreport.document.odt.textstyling; -import static org.junit.Assert.assertThat; - -import java.io.IOException; -import java.io.InputStream; -import java.io.StringReader; -import java.io.StringWriter; -import java.io.Writer; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - +import fr.opensagres.xdocreport.document.odt.preprocessor.ODTBufferedDocumentContentHandler; +import fr.opensagres.xdocreport.document.odt.preprocessor.ODTStyleContentHandler; +import fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocument; +import fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocumentContentHandler; +import fr.opensagres.xdocreport.document.textstyling.IDocumentHandler; +import fr.opensagres.xdocreport.document.textstyling.ITextStylingTransformer; +import fr.opensagres.xdocreport.document.textstyling.html.HTMLTextStylingTransformer; import org.junit.Assert; import org.junit.Test; import org.w3c.dom.Document; @@ -48,15 +39,20 @@ import org.xml.sax.helpers.XMLReaderFactory; import org.xmlunit.matchers.CompareMatcher; -import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; -import fr.opensagres.xdocreport.document.odt.preprocessor.ODTBufferedDocumentContentHandler; -import fr.opensagres.xdocreport.document.odt.preprocessor.ODTStyleContentHandler; -import fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocument; -import fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocumentContentHandler; -import fr.opensagres.xdocreport.document.textstyling.IDocumentHandler; -import fr.opensagres.xdocreport.document.textstyling.ITextStylingTransformer; -import fr.opensagres.xdocreport.document.textstyling.html.HTMLTextStylingTransformer; +import static org.junit.Assert.assertThat; /** * Check ODT Styling generation by comparing generated result against the expected XML @@ -104,7 +100,7 @@ public String formatXML( String unformattedXml ) Transformer serializer = tfactory.newTransformer(); serializer.setOutputProperty( OutputKeys.INDENT, "yes" ); - serializer.setOutputProperty( OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, "2" ); + serializer.setOutputProperty( "{http:// xml. apache. org/ xalan}indent-amount", "2" ); serializer.setOutputProperty( OutputKeys.STANDALONE, "no" ); Writer out = new StringWriter(); diff --git a/document/fr.opensagres.xdocreport.document.tools/pom.xml b/document/fr.opensagres.xdocreport.document.tools/pom.xml index 70c4fc47f..d44928d73 100644 --- a/document/fr.opensagres.xdocreport.document.tools/pom.xml +++ b/document/fr.opensagres.xdocreport.document.tools/pom.xml @@ -145,5 +145,19 @@ logback-classic 1.2.13 + + + com.sun.xml.ws + jaxws-rt + 2.3.7 + pom + test + + + com.sun.xml.ws + rt + 2.3.7 + test + diff --git a/pom.xml b/pom.xml index 594dcccca..db438cf7e 100644 --- a/pom.xml +++ b/pom.xml @@ -177,6 +177,9 @@ maven-surefire-plugin 2.14 + + --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED + org.apache.felix diff --git a/remoting/fr.opensagres.xdocreport.remoting.resources.services.client/pom.xml b/remoting/fr.opensagres.xdocreport.remoting.resources.services.client/pom.xml index be52284f3..b822070ab 100644 --- a/remoting/fr.opensagres.xdocreport.remoting.resources.services.client/pom.xml +++ b/remoting/fr.opensagres.xdocreport.remoting.resources.services.client/pom.xml @@ -59,6 +59,20 @@ test + + com.sun.xml.ws + jaxws-rt + 2.3.7 + pom + test + + + com.sun.xml.ws + rt + 2.3.7 + test + + \ No newline at end of file From 858834e279d117b9c268e6cf9d19184cced2d8f9 Mon Sep 17 00:00:00 2001 From: "bas.goorden" Date: Sat, 18 May 2024 11:25:44 +0200 Subject: [PATCH 4/7] Using java 17 version for codeql analysis with update to openpdf 2.0 --- .github/workflows/codeql-analysis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ad9a27583..c8188dcd5 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -40,6 +40,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3 From 5d4247a2202b6c413ec17713791c75c3bb7659d5 Mon Sep 17 00:00:00 2001 From: "bas.goorden" Date: Sat, 18 May 2024 11:48:17 +0200 Subject: [PATCH 5/7] Set release version to compile to java 8 --- .../fr.opensagres.xdocreport.osgi.integrationtests/pom.xml | 6 +++--- pom.xml | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/integrationtests/fr.opensagres.xdocreport.osgi.integrationtests/pom.xml b/integrationtests/fr.opensagres.xdocreport.osgi.integrationtests/pom.xml index fcb60e797..a6097332c 100644 --- a/integrationtests/fr.opensagres.xdocreport.osgi.integrationtests/pom.xml +++ b/integrationtests/fr.opensagres.xdocreport.osgi.integrationtests/pom.xml @@ -12,10 +12,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.5.1 + 3.1 - 1.6 - 1.6 + 1.8 + 1.8 diff --git a/pom.xml b/pom.xml index db438cf7e..924c74e3e 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ ${maven.build.timestamp} UTF-8 yyyyMMddHHmm + 8 install @@ -28,8 +29,8 @@ maven-compiler-plugin - 1.7 - 1.7 + 1.8 + 1.8 From fee91c9d838112e51972b4480f4ac40c28df3a47 Mon Sep 17 00:00:00 2001 From: "bas.goorden" Date: Sat, 18 May 2024 12:02:25 +0200 Subject: [PATCH 6/7] Set compile target and source to java 17 --- .github/workflows/release-to-maven-central.yml | 2 +- .../fr.opensagres.xdocreport.osgi.integrationtests/pom.xml | 4 ++-- pom.xml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-to-maven-central.yml b/.github/workflows/release-to-maven-central.yml index f542eb3c7..faf6cc00d 100644 --- a/.github/workflows/release-to-maven-central.yml +++ b/.github/workflows/release-to-maven-central.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Maven Central Repository uses: actions/setup-java@v4 with: - java-version: 8 + java-version: '17' server-id: sonatype-nexus-staging server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD diff --git a/integrationtests/fr.opensagres.xdocreport.osgi.integrationtests/pom.xml b/integrationtests/fr.opensagres.xdocreport.osgi.integrationtests/pom.xml index a6097332c..892e081db 100644 --- a/integrationtests/fr.opensagres.xdocreport.osgi.integrationtests/pom.xml +++ b/integrationtests/fr.opensagres.xdocreport.osgi.integrationtests/pom.xml @@ -14,8 +14,8 @@ maven-compiler-plugin 3.1 - 1.8 - 1.8 + 17 + 17 diff --git a/pom.xml b/pom.xml index 924c74e3e..8607d7e08 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ ${maven.build.timestamp} UTF-8 yyyyMMddHHmm - 8 + 17 install @@ -29,8 +29,8 @@ maven-compiler-plugin - 1.8 - 1.8 + 17 + 17 From 29be2fb0fdb575e6b9f31b64bc8493f7de7b87a1 Mon Sep 17 00:00:00 2001 From: "bas.goorden" Date: Mon, 27 May 2024 16:23:01 +0200 Subject: [PATCH 7/7] Updated maven bundle plugin --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8607d7e08..80b283f6d 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ <_snapshot>${osgi-version-qualifier} <_nouses>true ${project.artifactId} - JavaSE-1.6 + JavaSE-17 @@ -185,7 +185,7 @@ org.apache.felix maven-bundle-plugin - 2.3.7 + 5.1.9 maven-compiler-plugin