use of gov.ca.cwds.cals.web.rest.parameter.RFA1aFormsParameterObject in project cals-api by ca-cwds.
the class RFA1aPDFGenerationService method generatePDF.
public String generatePDF(Long formId) {
String docId = null;
RFA1aFormDTO rfa1aFormDTO = rfa1aFormService.find(new RFA1aFormsParameterObject(formId, true));
if (rfa1aFormDTO != null) {
docId = generatePDF(rfa1aFormDTO);
}
return docId;
}
use of gov.ca.cwds.cals.web.rest.parameter.RFA1aFormsParameterObject in project cals-api by ca-cwds.
the class RFA1aFormsResource method getApplicationForm.
// @UnitOfWork(CALSNS)
@GET
@Path("/{" + RFA_1A_APPLICATION_ID + "}")
@Produces({ MediaType.APPLICATION_JSON, APPLICATION_PDF })
@Timed
@ApiResponses(value = { @ApiResponse(code = 401, message = "Not Authorized"), @ApiResponse(code = 404, message = "Not found"), @ApiResponse(code = 406, message = "Accept Header not supported") })
@ApiOperation(value = "Returns RFA 1A Form by Id", response = RFA1aFormDTO.class)
public Response getApplicationForm(@PathParam(RFA_1A_APPLICATION_ID) @ApiParam(required = true, name = RFA_1A_APPLICATION_ID, value = "The RFA-1A Form Id") Long formId, @QueryParam(EXPANDED) @ApiParam(name = EXPANDED, value = "Use 'true' to get form with all parts of form included") boolean expanded, @Context HttpHeaders headers) {
String accept = headers.getHeaderString(HttpHeaders.ACCEPT);
long startTime = System.currentTimeMillis();
Response response = null;
if (APPLICATION_PDF.equals(accept)) {
String documentId = pdfGenerationService.generatePDF(formId);
response = pdfGenerationService.getFormPdf(documentId);
} else {
RFA1aFormsParameterObject params = new RFA1aFormsParameterObject(formId, expanded);
response = resourceDelegate.get(params);
}
LOG.info("Get RFA1a form total time: {}", (System.currentTimeMillis() - startTime));
return response;
}
Aggregations