Compare commits
99 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1452fe9374 | ||
|
|
8227e54033 | ||
|
|
b12e60b1ea | ||
|
|
c06f59bf7a | ||
|
|
0853a7eb95 | ||
|
|
9c8d79106a | ||
|
|
1a8d3d9e95 | ||
|
|
e890695a56 | ||
|
|
eb292d52d0 | ||
|
|
67622e82fc | ||
|
|
344283b0c3 | ||
|
|
3608274849 | ||
|
|
ca4a16f69d | ||
|
|
ddc1911a15 | ||
|
|
ff2449b395 | ||
|
|
af188cfc59 | ||
|
|
39de7fcfda | ||
|
|
b0d4523b17 | ||
|
|
14b16fd500 | ||
|
|
eefc7a7228 | ||
|
|
06eb5fa319 | ||
|
|
d2d66c4a44 | ||
|
|
7eb0120004 | ||
|
|
02baa451bd | ||
|
|
4a8dd656da | ||
|
|
de7263c6d7 | ||
|
|
2ff66b68f3 | ||
|
|
f6c7b734e4 | ||
|
|
54910f607b | ||
|
|
6e4ab255aa | ||
|
|
8e1db1a6cf | ||
|
|
3fecd164b0 | ||
|
|
560424ea3d | ||
|
|
084a7cd2e3 | ||
|
|
4006fbecfb | ||
|
|
0aaaaf4926 | ||
|
|
e21ce5cdc0 | ||
|
|
7c20cfd6bf | ||
|
|
8a146374d5 | ||
|
|
9f86e65738 | ||
|
|
509aa58aca | ||
|
|
5970f4bfd6 | ||
|
|
fb14f9cc1d | ||
|
|
99fe7c5ccb | ||
|
|
f99377240c | ||
|
|
ae183c250d | ||
|
|
d4a989ad50 | ||
|
|
921ef423a6 | ||
|
|
e1c195b343 | ||
|
|
173085bbfc | ||
|
|
959b7fa35c | ||
|
|
5b814428da | ||
|
|
2d2ad7cea0 | ||
|
|
b8ca879b6d | ||
|
|
0d3c7090dd | ||
|
|
42734a40f9 | ||
|
|
3c26a37bb9 | ||
|
|
717b0cd2fc | ||
|
|
c826f9f218 | ||
|
|
6e0f374d8c | ||
|
|
bf0f71394a | ||
|
|
bfd558be7c | ||
|
|
7d3df54d01 | ||
|
|
16c6191b20 | ||
|
|
50a26a27c2 | ||
|
|
10d52e12fd | ||
|
|
6b6b94cba1 | ||
|
|
69c8be6459 | ||
|
|
4547327477 | ||
|
|
56b86f58a5 | ||
|
|
f95b13f329 | ||
|
|
c63c41b055 | ||
|
|
df692a0703 | ||
|
|
72ce61445a | ||
|
|
64c0980585 | ||
|
|
c6077b9c03 | ||
|
|
871f518015 | ||
|
|
dca0b8c324 | ||
|
|
557069de1a | ||
|
|
9b3f2560f3 | ||
|
|
a4031b5569 | ||
|
|
ea43ce9303 | ||
|
|
064fe76f63 | ||
|
|
5718bb4654 | ||
|
|
8a6ccc9ebd | ||
|
|
aab02d507f | ||
|
|
8087a56b82 | ||
|
|
7ac90f2da3 | ||
|
|
ddbc2a8103 | ||
|
|
b6754ea939 | ||
|
|
080d4cff81 | ||
|
|
244932b00d | ||
|
|
8cbbcd3aab | ||
|
|
ebf096993b | ||
|
|
43fef76e2d | ||
|
|
723cb74c09 | ||
|
|
42bf87bfc2 | ||
|
|
b0ba274c15 | ||
|
|
e3375c1cc4 |
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@ -13,6 +13,8 @@ updates:
|
||||
ignore:
|
||||
- dependency-name: "net.bull.javamelody:javamelody-core"
|
||||
versions: ["2.x"]
|
||||
assignees:
|
||||
- omaster395464gh
|
||||
|
||||
- package-ecosystem: "maven" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
@ -21,3 +23,5 @@ updates:
|
||||
target-branch: "SERVLET60"
|
||||
labels:
|
||||
- "servlet60"
|
||||
assignees:
|
||||
- omaster395464gh
|
||||
15
README.md
15
README.md
@ -1,31 +1,36 @@
|
||||
# fop4apex [](https://sonarcloud.io/summary/new_code?id=omaster395464gh_fop4apex)[](https://sonarcloud.io/summary/new_code?id=omaster395464gh_fop4apex)
|
||||
# fop4apex [](https://sonarcloud.io/summary/new_code?id=omaster395464gh_fop4apex)[](https://sonarcloud.io/summary/new_code?id=omaster395464gh_fop4apex) [](https://app.codacy.com/gh/omaster395464gh/fop4apex/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
||||
|
||||
Servlet for Oracle APEX to run PDF Reports based on Apache FOP
|
||||
|
||||
Fahrdienst-Anwendung / Kostenblatt
|
||||
|
||||
* Uses Apache FOP for rendering
|
||||
https://xmlgraphics.apache.org/fop/
|
||||
<https://xmlgraphics.apache.org/fop/>
|
||||
* Uses JavaMelody for monitoring
|
||||
https://github.com/javamelody/javamelody/wiki
|
||||
<https://github.com/javamelody/javamelody/wiki>
|
||||
* Use Java 11 LTS (also tested with Java 17 LTS and Java 21 LTS)
|
||||
|
||||
## Run tests
|
||||
|
||||
`mvn test`
|
||||
|
||||
## Build
|
||||
|
||||
`mvn package verify`
|
||||
|
||||
## Upgrade
|
||||
|
||||
* set new version in pom.xml
|
||||
* check dependent libraries for updates
|
||||
* run tests and build
|
||||
|
||||
## Release
|
||||
|
||||
* create a tag with version number
|
||||
* create a github release
|
||||
|
||||
## Installation
|
||||
|
||||
* rename target/fop4apex*.war to fop4apex.war
|
||||
* copy fop4apex.war to tomcat webapps folder
|
||||
* Oracle APEX - Sample Settings
|
||||
@ -35,7 +40,9 @@ https://github.com/javamelody/javamelody/wiki
|
||||
* Port 8080
|
||||
* Script: /fop4apex/pdf
|
||||
* Timeout 300
|
||||
|
||||
### Debugging
|
||||
|
||||
Add to Tomcat logging.properties:
|
||||
```
|
||||
org.apache.tomcat.util.http.Parameters.level = ALL
|
||||
@ -43,6 +50,7 @@ de.pdv.apex.level = ALL
|
||||
```
|
||||
|
||||
### Deploy to tomcat 9.x (IntelliJ / Netbeans) / Jetty 10.x
|
||||
|
||||
Run http://localhost:port/
|
||||
|
||||
Example:
|
||||
@ -50,6 +58,7 @@ Example:
|
||||
* http://localhost:8080/fop4apex_war_exploded/monitoring
|
||||
|
||||
## Conversion using Apache fop (windows powershell)
|
||||
|
||||
```
|
||||
$env:PATH="c:\Users\oliver1\Downloads\_tools\fop-2.9\fop;$env:PATH"
|
||||
cd src\test\ressources\samples
|
||||
|
||||
42
pom.xml
42
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>de.pdv.apex</groupId>
|
||||
<artifactId>fop4apex</artifactId>
|
||||
<version>0.13.4-SNAPSHOT</version>
|
||||
<version>0.14.2-SNAPSHOT</version>
|
||||
<name>fop4apex</name>
|
||||
<packaging>war</packaging>
|
||||
<url>https://www.pdv.de</url>
|
||||
@ -15,9 +15,9 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<junit.version>5.10.3</junit.version>
|
||||
<junit.version>5.12.2</junit.version>
|
||||
<batik.version>1.16</batik.version>
|
||||
<pdfbox.version>3.0.2</pdfbox.version>
|
||||
<pdfbox.version>3.0.4</pdfbox.version>
|
||||
<sonar.organization>omaster395464gh</sonar.organization>
|
||||
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
|
||||
</properties>
|
||||
@ -29,6 +29,12 @@
|
||||
<version>4.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/javax.servlet/jstl -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
@ -52,7 +58,7 @@
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>5.12.0</version>
|
||||
<version>5.17.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@ -60,7 +66,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>fop-core</artifactId>
|
||||
<version>2.9</version>
|
||||
<version>2.10</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@ -83,7 +89,7 @@
|
||||
<dependency>
|
||||
<groupId>net.bull.javamelody</groupId>
|
||||
<artifactId>javamelody-core</artifactId>
|
||||
<version>1.99.0</version>
|
||||
<version>1.99.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
@ -95,6 +101,16 @@
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.github.librepdf/openpdf -->
|
||||
<!-- updates to 1.4 and 2.x currently not possible https://github.com/javamelody/javamelody/pull/1182 -->
|
||||
<!-- Optional: support pdf export for javamelody
|
||||
<dependency>
|
||||
<groupId>com.github.librepdf</groupId>
|
||||
<artifactId>openpdf</artifactId>
|
||||
<version>1.3.43</version>
|
||||
</dependency>
|
||||
-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@ -111,14 +127,14 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
<version>3.5.3</version>
|
||||
</plugin>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.cyclonedx/cyclonedx-maven-plugin -->
|
||||
<plugin>
|
||||
<groupId>org.cyclonedx</groupId>
|
||||
<artifactId>cyclonedx-maven-plugin</artifactId>
|
||||
<version>2.8.0</version>
|
||||
<version>2.9.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
@ -146,7 +162,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.13.0</version>
|
||||
<version>3.14.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@ -158,7 +174,7 @@
|
||||
<plugin>
|
||||
<groupId>com.google.cloud.tools</groupId>
|
||||
<artifactId>jib-maven-plugin</artifactId>
|
||||
<version>3.4.3</version>
|
||||
<version>3.4.5</version>
|
||||
<configuration>
|
||||
<from>
|
||||
<image>jetty:10-jre17-alpine</image>
|
||||
@ -175,7 +191,7 @@
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>11.0.22</version>
|
||||
<version>11.0.25</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
@ -187,7 +203,7 @@
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.12</version>
|
||||
<version>0.8.13</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>prepare-agent</id>
|
||||
@ -218,7 +234,7 @@
|
||||
<plugin>
|
||||
<groupId>org.owasp</groupId>
|
||||
<artifactId>dependency-check-maven</artifactId>
|
||||
<version>10.0.3</version>
|
||||
<version>12.1.1</version>
|
||||
<configuration>
|
||||
<nvdApiServerId>nvd</nvdApiServerId>
|
||||
<formats>
|
||||
|
||||
@ -1,10 +1,16 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
||||
<%@ page import="java.util.Map" %>
|
||||
<%@ page import="java.util.LinkedHashMap" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Apache Formatting Objects Processor integration for Oracle Application Express, converts xml and fop to pdf">
|
||||
<link rel="stylesheet" href="webjars/pico/css/pico.min.css">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description" content="Apache Formatting Objects Processor integration for Oracle Application Express, converts xml and fop to pdf" />
|
||||
<link rel="stylesheet" href="webjars/pico/css/pico.min.css" />
|
||||
<title>Apache FOP for Oracle APEX</title>
|
||||
</head>
|
||||
<body>
|
||||
@ -42,11 +48,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Port</th>
|
||||
<td>8080</td>
|
||||
<td><c:out value="${pageContext.request.serverPort}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Script</th>
|
||||
<td>${pageContext.request.contextPath}/pdf</td>
|
||||
<td><c:out value="${pageContext.request.contextPath}"/>/pdf</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Timeout</td>
|
||||
@ -61,24 +67,42 @@
|
||||
<pre>org.apache.tomcat.util.http.Parameters.level = ALL
|
||||
de.pdv.apex.level = ALL</pre>
|
||||
|
||||
<h2>Server Info / Environment</h2>
|
||||
<%--@elvariable id="System" type=""--%>
|
||||
<pre>
|
||||
Server Version: <%= application.getServerInfo() %>
|
||||
Servlet Version: <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %>
|
||||
JSP Version: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %>
|
||||
Context Path: ${pageContext.request.contextPath}
|
||||
<%
|
||||
Map<String,String> systemProperties = new LinkedHashMap<>();
|
||||
systemProperties.put("Server Version",application.getServerInfo());
|
||||
systemProperties.put("Servlet Version",String.format("%d.%d",application.getMajorVersion(),application.getMinorVersion()));
|
||||
systemProperties.put("JSP Version",JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion());
|
||||
systemProperties.put("Context Path", request.getContextPath() );
|
||||
systemProperties.put("","");
|
||||
systemProperties.put("java.version",System.getProperty("java.version"));
|
||||
systemProperties.put("java.vm.vendor",System.getProperty("java.vm.vendor"));
|
||||
systemProperties.put("user.country",System.getProperty("user.country"));
|
||||
systemProperties.put("user.language",System.getProperty("user.language"));
|
||||
systemProperties.put("user.name",System.getProperty("user.name"));
|
||||
systemProperties.put("user.timezone",System.getProperty("user.timezone"));
|
||||
systemProperties.put("os.name",System.getProperty("os.name"));
|
||||
systemProperties.put("os.version",System.getProperty("os.version"));
|
||||
systemProperties.put("file.encoding",System.getProperty("file.encoding"));
|
||||
systemProperties.put("sun.jnu.encoding",System.getProperty("sun.jnu.encoding"));
|
||||
request.setAttribute("systemProperties",systemProperties);
|
||||
%>
|
||||
|
||||
java.version: ${System.getProperty("java.version")}
|
||||
java.vm.vendor: ${System.getProperty("java.vm.vendor")}
|
||||
user.country: ${System.getProperty("user.country")}
|
||||
user.language: ${System.getProperty("user.language")}
|
||||
user.name: ${System.getProperty("user.name")}
|
||||
user.timezone: ${System.getProperty("user.timezone")}
|
||||
os.name: ${System.getProperty("os.name")}
|
||||
os.version: ${System.getProperty("os.version")}
|
||||
file.encoding: ${System.getProperty("file.encoding")}
|
||||
sun.jnu.encoding: ${System.getProperty("sun.jnu.encoding")}</pre>
|
||||
<h2>Server Info / Environment</h2>
|
||||
<table role="grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Parameter</th>
|
||||
<th scope="col">Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<c:forEach var="property" items="${systemProperties}">
|
||||
<tr>
|
||||
<th scope="row"><c:out value="${property.key}"/></th>
|
||||
<td><c:out value="${property.value}"/></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
<p>page built with <a href="https://picocss.com/">Pico.css</a>, fop conversion with <a href="https://xmlgraphics.apache.org/fop/">Apache FOP</a> </p>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
@ -109,8 +109,7 @@ class ExampleFO2PDFTest {
|
||||
|
||||
app.convertFO2PDFHelper(inputStream, pdfFile);
|
||||
|
||||
if (!pdfFile.exists())
|
||||
throw new Exception("result file missing");
|
||||
Assertions.assertTrue(pdfFile.exists(), "Error: result file missing");
|
||||
|
||||
try (PDDocument document = Loader.loadPDF(new RandomAccessReadBufferedFile(pdfFile)))
|
||||
{
|
||||
|
||||
@ -84,8 +84,7 @@ class ExampleXML2PDFTest {
|
||||
//close
|
||||
out.close();
|
||||
|
||||
if (!pdfFile.exists())
|
||||
throw new Exception("result file missing");
|
||||
Assertions.assertTrue(pdfFile.exists(), "Error: result file missing");
|
||||
try (PDDocument document = Loader.loadPDF(new RandomAccessReadBufferedFile(pdfFile))) {
|
||||
System.out.println("Pages: " + document.getNumberOfPages());
|
||||
System.out.println("Filesize (Bytes): " + Files.size(pdfFile.toPath()));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user