|
|
@@ -8,7 +8,6 @@ import java.nio.file.Path;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.core.io.FileSystemResource;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
@@ -23,7 +22,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import es.uv.saic.dto.PdfDTO;
|
|
|
import es.uv.saic.feign.DocumentClient;
|
|
|
import fr.opensagres.xdocreport.core.XDocReportException;
|
|
|
-import jakarta.servlet.http.HttpServletResponse;
|
|
|
|
|
|
@Controller
|
|
|
public class DownloadController {
|
|
|
@@ -66,21 +64,6 @@ public class DownloadController {
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * Download the latest report for a given process and degree
|
|
|
- * @param model
|
|
|
- * @param idTitulacio The ID of the degree
|
|
|
- * @param nomProces The name of the process
|
|
|
- * @param response HttpServletResponse
|
|
|
- * @return A FileSystemResource representing the report to download
|
|
|
- */
|
|
|
- @GetMapping(value="/download/report/{t}/{p}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
|
|
- @ResponseBody
|
|
|
- public FileSystemResource downloadReport(Model model, @PathVariable("t") Integer idTitulacio, @PathVariable("p") String nomProces) throws IOException, XDocReportException {
|
|
|
- return dc.downloadReport(idTitulacio, nomProces).getBody();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /*
|
|
|
* Download a populated template for a given task instance
|
|
|
* @param model
|
|
|
* @param idTascai The ID of the task instance
|
|
|
@@ -94,55 +77,6 @@ public class DownloadController {
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * Test endpoint to generate a populated template for a given task (id of task)
|
|
|
- * @param model
|
|
|
- * @param idTitulacio The ID of the degree
|
|
|
- * @param idCentre The ID of the center
|
|
|
- * @param idTascap The ID of the task
|
|
|
- * @param idProces The ID of the process
|
|
|
- * @param response HttpServletResponse
|
|
|
- * @return A byte array representing the populated template
|
|
|
- */
|
|
|
- @GetMapping(value="/test/template/{titulacio}/{centre}/{idProces}/{idTascap}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
|
|
- @ResponseBody
|
|
|
- public byte[] testTemplate(Model model, @PathVariable("titulacio") Integer idTitulacio, @PathVariable("centre") Integer idCentre,
|
|
|
- @PathVariable("idTascap") Integer idTascap, @PathVariable("idProces") Integer idProces)
|
|
|
- throws IOException, XDocReportException {
|
|
|
- return dc.testTemplate(idTitulacio, idCentre, idProces, idTascap);
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- * Test endpoint to generate a populated template for a given degree and evidence (Type of task)
|
|
|
- * @param model
|
|
|
- * @param idTitulacio The ID of the degree
|
|
|
- * @param idCentre The ID of the center
|
|
|
- * @param evidencia The name of the evidence
|
|
|
- * @param curs The academic year
|
|
|
- * @param tipusTasca The type of task
|
|
|
- * @param response HttpServletResponse
|
|
|
- * @return A byte array representing the populated template
|
|
|
- */
|
|
|
- @GetMapping(value="/test/template2/{titulacio}/{centre}/{evidencia}/{curs}/{tipusTasca}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
|
|
- @ResponseBody
|
|
|
- public byte[] testTemplate(Model model, @PathVariable("titulacio") Integer idTitulacio, @PathVariable("centre") Integer idCentre,
|
|
|
- @PathVariable("evidencia") String evidencia, @PathVariable("curs") Integer curs, @PathVariable("tipusTasca") Integer tipusTasca) throws IOException, XDocReportException {
|
|
|
- return dc.testTemplate(idTitulacio, idCentre, evidencia, curs, tipusTasca);
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- * Generate a PDF from the content of a task instance (unused)
|
|
|
- * @param model
|
|
|
- * @param idTascai The ID of the task instance
|
|
|
- * @param response HttpServletResponse
|
|
|
- * @return A byte array representing the generated PDF
|
|
|
- */
|
|
|
- @GetMapping(value="/pdf/download/{idTascai}")
|
|
|
- @ResponseBody
|
|
|
- public byte[] downloadTemplatePdf(Model model, @PathVariable("idTascai") BigInteger idTascai) throws IOException, InterruptedException {
|
|
|
- return dc.downloadTemplatePdf(idTascai);
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
* Generate a PDF preview from provided content
|
|
|
* @param model
|
|
|
* @param content The content to convert to PDF
|