export_to_pdf #8
|
@ -69,7 +69,8 @@ public class HTML_Page {
|
||||||
newHTML += "<p style=\"font-size: 18px;\">" + action + "</p>";
|
newHTML += "<p style=\"font-size: 18px;\">" + action + "</p>";
|
||||||
|
|
||||||
if (waiting) {
|
if (waiting) {
|
||||||
newHTML += "<img alt=\"D4Science Geoportal Loading...\" src=\"uri-resolver/img/loading-gears.gif\"><br />";
|
newHTML += "<img alt=\"D4GNA Logo\" src=\"https://data.d4science.org/shub/E_dmhxT0ZReFpXQ1ZXZUp0M2pXUGhtTEZicHNyMGZUVTB4cTkyc2xqMXFSWmo2Q3o4dWl0dTBmY1p1VTdPN29KMQ==\"><br /><br />";
|
||||||
|
newHTML += "<img alt=\"D4Science Geoportal Loading...\" src=\"https://data.d4science.org/shub/E_a2Y1N2ZIaUhCVlE5R0JXNjJhVXVsTlNyNVJta2ZKZVFMaG52N2gxZm05VWJOb2RFTVBpa0pyV1hsUlg2WXJSTw==\"><br />";
|
||||||
}
|
}
|
||||||
|
|
||||||
newHTML += "<br/><p id=\"message\">" + message + "</p>";
|
newHTML += "<br/><p id=\"message\">" + message + "</p>";
|
||||||
|
@ -124,7 +125,7 @@ public class HTML_Page {
|
||||||
newHTML += "<div id=\"content\">";
|
newHTML += "<div id=\"content\">";
|
||||||
newHTML += "<p style=\"font-size: 18px;\">" + action + "</p>";
|
newHTML += "<p style=\"font-size: 18px;\">" + action + "</p>";
|
||||||
newHTML += "<br/><p id=\"message\">" + message + "</p>";
|
newHTML += "<br/><p id=\"message\">" + message + "</p>";
|
||||||
newHTML += "</div>/body></html>";
|
newHTML += "</div></body></html>";
|
||||||
|
|
||||||
return newHTML;
|
return newHTML;
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,9 +190,6 @@ public class GeoportalExporter {
|
||||||
org.gcube.common.authorization.utils.user.User user = cm.getUser();
|
org.gcube.common.authorization.utils.user.User user = cm.getUser();
|
||||||
LOG.info("Identified caller {} in context {}", user.getUsername(), context);
|
LOG.info("Identified caller {} in context {}", user.getUsername(), context);
|
||||||
|
|
||||||
// Set<String> roles = new HashSet<>();
|
|
||||||
// roles.addAll(user.getRoles());
|
|
||||||
|
|
||||||
Geoportal_PDF_Exporter pdfExporter = new Geoportal_PDF_Exporter();
|
Geoportal_PDF_Exporter pdfExporter = new Geoportal_PDF_Exporter();
|
||||||
boolean checked = pdfExporter.checkConfig();
|
boolean checked = pdfExporter.checkConfig();
|
||||||
|
|
||||||
|
@ -220,17 +217,16 @@ public class GeoportalExporter {
|
||||||
LOG.info(this.getClass().getSimpleName() + " viewPDF - GET starts...");
|
LOG.info(this.getClass().getSimpleName() + " viewPDF - GET starts...");
|
||||||
LOG.info("param is: pdfCode: {}", pdfCode);
|
LOG.info("param is: pdfCode: {}", pdfCode);
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
FetchPDF fetchedPDF = map.get(pdfCode);
|
FetchPDF fetchedPDF = map.get(pdfCode);
|
||||||
LOG.info("FileReference at code {} is {}", pdfCode, fetchedPDF);
|
LOG.info("FileReference at code {} is {}", pdfCode, fetchedPDF);
|
||||||
|
|
||||||
if (fetchedPDF == null) {
|
if (fetchedPDF == null) {
|
||||||
throw ExceptionManager.notFoundException(req,
|
throw ExceptionManager.notFoundException(req,
|
||||||
GeoportalExporter.class.getSimpleName() + " view with task code " + pdfCode + "not found",
|
GeoportalExporter.class.getSimpleName() + " view with job code " + pdfCode + " not found",
|
||||||
this.getClass(), helpURI);
|
this.getClass(), helpURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
String theURL = null;
|
String theURL = null;
|
||||||
|
|
||||||
// File PDF is not available
|
// File PDF is not available
|
||||||
|
@ -257,9 +253,9 @@ public class GeoportalExporter {
|
||||||
return Response.ok(json).build();
|
return Response.ok(json).build();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Error on performing healthcheck", e);
|
LOG.error("Error on checking job", e);
|
||||||
throw ExceptionManager.internalErrorException(req,
|
throw ExceptionManager.internalErrorException(req,
|
||||||
"Error when performing " + GeoportalExporter.class.getSimpleName() + " healthcheck",
|
"Error when checking " + GeoportalExporter.class.getSimpleName() + " job view for " + pdfCode,
|
||||||
this.getClass(), helpURI);
|
this.getClass(), helpURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue