Skip to content

Commit

Permalink
Merge pull request #294 from olofsvensson/issue_293
Browse files Browse the repository at this point in the history
Issue #293 : New web services getAutoProcAttachmentPdf and getAutoProcAttachmentHtml
  • Loading branch information
antolinos authored May 18, 2018
2 parents 59c91b1 + 050de4a commit f2b05d8
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,29 @@ public Response downloadAutoProcAttachment(@PathParam("token") String token, @Pa
@Produces("text/plain")
public Response getAutoProcAttachment(@PathParam("token") String token, @PathParam("proposal") String proposal,
@PathParam("autoProcAttachmentId") int autoProcAttachmentId) {
return this.getFile(token, proposal, autoProcAttachmentId);
}

@RolesAllowed({ "User", "Manager", "Industrial", "Localcontact" })
@GET
@Path("{token}/proposal/{proposal}/mx/autoprocintegration/autoprocattachmentid/{autoProcAttachmentId}/getPdf")
@Produces("application/pdf")
public Response getAutoProcAttachmentPdf(@PathParam("token") String token, @PathParam("proposal") String proposal,
@PathParam("autoProcAttachmentId") int autoProcAttachmentId) {
return this.getFile(token, proposal, autoProcAttachmentId);
}

String methodName = "getAutoProcAttachment";
@RolesAllowed({ "User", "Manager", "Industrial", "Localcontact" })
@GET
@Path("{token}/proposal/{proposal}/mx/autoprocintegration/autoprocattachmentid/{autoProcAttachmentId}/getHtml")
@Produces("text/html")
public Response getAutoProcAttachmentHtml(@PathParam("token") String token, @PathParam("proposal") String proposal,
@PathParam("autoProcAttachmentId") int autoProcAttachmentId) {
return this.getFile(token, proposal, autoProcAttachmentId);
}

private Response getFile(String token, String proposal, int autoProcAttachmentId) {
String methodName = "getFile";
long start = this.logInit(methodName, logger, token, proposal);
try {
/** Checking that attachment is linked to the proposal **/
Expand All @@ -404,5 +425,4 @@ public Response getAutoProcAttachment(@PathParam("token") String token, @PathPar
}
}


}

0 comments on commit f2b05d8

Please sign in to comment.