|
|
@@ -1,31 +1,18 @@
|
|
|
package es.uv.saic.web;
|
|
|
|
|
|
-import java.io.File;
|
|
|
-import java.io.FileInputStream;
|
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.IOException;
|
|
|
-import java.io.InputStream;
|
|
|
import java.math.BigInteger;
|
|
|
import java.net.HttpURLConnection;
|
|
|
import java.net.URI;
|
|
|
import java.net.http.HttpClient;
|
|
|
import java.net.http.HttpRequest;
|
|
|
import java.net.http.HttpResponse;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
-import jakarta.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
-import org.apache.commons.io.FilenameUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.boot.actuate.autoconfigure.observation.ObservationProperties.Http;
|
|
|
import org.springframework.core.io.FileSystemResource;
|
|
|
-import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.MediaType;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
@@ -35,53 +22,16 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
-import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
|
-import es.uv.saic.domain.Document;
|
|
|
-import es.uv.saic.domain.Indicador;
|
|
|
-import es.uv.saic.domain.InstanciaTasca;
|
|
|
-import es.uv.saic.domain.Organ;
|
|
|
-import es.uv.saic.domain.Proces;
|
|
|
-import es.uv.saic.domain.Tasca;
|
|
|
-import es.uv.saic.dto.CategoriaDTO;
|
|
|
-import es.uv.saic.dto.IndicadorEnquestaDTO;
|
|
|
-import es.uv.saic.dto.IndicadorEnquestaValorDTO;
|
|
|
import es.uv.saic.dto.PdfDTO;
|
|
|
-import es.uv.saic.dto.ProcesDTO;
|
|
|
-import es.uv.saic.dto.TascaInformeTransferDTO;
|
|
|
-import es.uv.saic.service.PlantillaService;
|
|
|
import fr.opensagres.xdocreport.core.XDocReportException;
|
|
|
-import fr.opensagres.xdocreport.core.io.internal.ByteArrayOutputStream;
|
|
|
-import fr.opensagres.xdocreport.document.IXDocReport;
|
|
|
-import fr.opensagres.xdocreport.document.images.FileImageProvider;
|
|
|
-import fr.opensagres.xdocreport.document.images.IImageProvider;
|
|
|
-import fr.opensagres.xdocreport.document.registry.XDocReportRegistry;
|
|
|
-import fr.opensagres.xdocreport.template.IContext;
|
|
|
-import fr.opensagres.xdocreport.template.TemplateEngineKind;
|
|
|
-import fr.opensagres.xdocreport.template.formatter.FieldsMetadata;
|
|
|
+
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
public class DownloadController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private PlantillaService pls;
|
|
|
-
|
|
|
- @Value("${saic.data.filePath}")
|
|
|
- private String filePath;
|
|
|
-
|
|
|
- @Value("${saic.data.docsPath}")
|
|
|
- private String docsPath;
|
|
|
-
|
|
|
- @Value("${saic.data.templates.fileNotFound}")
|
|
|
- private String fileNotFound;
|
|
|
-
|
|
|
- @Value("${saic.data.templates.filePath}")
|
|
|
- private String templatePath;
|
|
|
-
|
|
|
- @Value("${saic.data.templates.logoPath}")
|
|
|
- private String logoPath;
|
|
|
|
|
|
@Value("${saic.url.domain}")
|
|
|
private String uri;
|