fixed GeoportalExporter stream

This commit is contained in:
Francesco Mangiacrapa 2024-04-19 12:28:56 +02:00
parent ffcc6a15e1
commit 1f33e820d5
2 changed files with 20 additions and 17 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -25,7 +26,8 @@
<wb-module deploy-name="uri-resolver-2.10.0-SNAPSHOT">
@ -51,7 +53,8 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -77,7 +80,8 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -103,7 +107,8 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -135,13 +140,8 @@
<dependent-module archiveName="geoportal-data-mapper-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-mapper/geoportal-data-mapper">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="geoportal-client-1.2.2-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-client/geoportal-client">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="geoportal-common-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-common/geoportal-common">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -167,7 +167,8 @@
<property name="context-root" value="uri-resolver"/>
@ -193,7 +194,8 @@
<property name="java-output-path" value="/uri-resolver/target/classes"/>
@ -219,7 +221,8 @@
</wb-module>

View File

@ -130,7 +130,7 @@ public class GeoportalExporter {
LOG.info("Serving request as client...");
FileReference pdfRef = exportAsPDF(req, ucdID, projectID, null, context, user);
InputStream input = new URL(pdfURL).openStream();
InputStream input = pdfRef.getStorageVolatileURL().openStream();
StreamingOutput so = new SingleFileStreamingOutput(input);
ResponseBuilder response = Response.ok(so)
@ -307,7 +307,7 @@ public class GeoportalExporter {
html += "<p style=\"font-size: 18px;\">" + action + "</p>";
if (waiting) {
html += "<img alt=\"D4Science Geoportal Loading...\" src=\"img/loading-gears.gif\"><br />";
html += "<img alt=\"D4Science Geoportal Loading...\" src=\"uri-resolver/img/loading-gears.gif\"><br />";
}
html += "<br/><p id=\"message\">" + message + "</p>";