renamed pdfCode to jobCode

This commit is contained in:
Francesco Mangiacrapa 2024-04-22 17:36:07 +02:00
parent 0263fd2235
commit 40f417c90b
1 changed files with 10 additions and 10 deletions

View File

@ -262,21 +262,21 @@ public class GeoportalExporter {
* View job.
*
* @param req the req
* @param pdfCode the pdf code
* @param jobCode the job code
* @return the response
* @throws WebApplicationException the web application exception
*/
@GET
@Path("/view/{jobCode}")
@Produces({ MediaType.TEXT_PLAIN, MediaType.TEXT_HTML })
public Response viewJob(@Context HttpServletRequest req, @PathParam(JOB_CODE) String pdfCode)
public Response viewJob(@Context HttpServletRequest req, @PathParam(JOB_CODE) String jobCode)
throws WebApplicationException {
LOG.info(this.getClass().getSimpleName() + " viewPDF - GET starts...");
LOG.info("viewJob param " + JOB_CODE + ": {}", pdfCode);
LOG.info("viewJob param " + JOB_CODE + ": {}", jobCode);
FetchPDF fetchedPDF = map.get(pdfCode);
LOG.info("viewJob FileReference at code {} is {}", pdfCode, fetchedPDF);
FetchPDF fetchedPDF = map.get(jobCode);
LOG.info("viewJob FileReference at code {} is {}", jobCode, fetchedPDF);
String theURL = null;
String messagge = null;
@ -300,7 +300,7 @@ public class GeoportalExporter {
return Response.status(Status.NOT_FOUND).entity(jsonReponse).build();
} catch (JsonProcessingException e) {
throw ExceptionManager.internalErrorException(req, "Error when returning "
+ GeoportalExporter.class.getSimpleName() + " not found job for " + pdfCode, this.getClass(),
+ GeoportalExporter.class.getSimpleName() + " not found job for " + jobCode, this.getClass(),
helpURI);
}
@ -319,14 +319,14 @@ public class GeoportalExporter {
theJson.setState(state);
}
// updating map status
map.put(pdfCode, fetchedPDF);
map.put(jobCode, fetchedPDF);
} else {
// File PDF is available
state = "OK";
theURL = fetchedPDF.getFileRef().getStorageVolatileURL().toString();
messagge = "PDF created correclty";
// removing from map
map.put(pdfCode, null);
map.put(jobCode, null);
}
theJson.setState(state);
@ -338,14 +338,14 @@ public class GeoportalExporter {
return Response.ok(jsonReponse).build();
} catch (JsonProcessingException e) {
throw ExceptionManager.internalErrorException(req,
"Error when returning " + GeoportalExporter.class.getSimpleName() + " response for " + pdfCode,
"Error when returning " + GeoportalExporter.class.getSimpleName() + " response for " + jobCode,
this.getClass(), helpURI);
}
} catch (Exception e) {
LOG.error("Error on checking job", e);
throw ExceptionManager.internalErrorException(req,
"Error when checking " + GeoportalExporter.class.getSimpleName() + " job view for " + pdfCode,
"Error when checking " + GeoportalExporter.class.getSimpleName() + " job view for " + jobCode,
this.getClass(), helpURI);
}