Commit 75ac30d5 authored by oussamasic's avatar oussamasic Committed by vitam-prg
Browse files

delete illegal characters from manifest document

parent f0bab8ae
......@@ -528,13 +528,12 @@ public class IngestGeneratorODTFile {
}
private String getStartedDate(List<String> listOfDate) {
if(listOfDate.size() > 0) {
if(listOfDate != null && listOfDate.size() > 0) {
String firstStartDate = listOfDate.stream().map(
startDate ->
startDate.substring(0, startDate.indexOf("T")))
.sorted().findFirst().get();
return transformDate(firstStartDate);
}
return "_ _ _ _";
......
......@@ -78,6 +78,8 @@ import java.util.*;
public class IngestInternalService {
private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(IngestInternalController.class);
private final String ILLEGAL_CHARACTERS = "[\uFEFF-\uFFFF]";
private final InternalSecurityService internalSecurityService;
private final IngestExternalClient ingestExternalClient;
......@@ -211,7 +213,9 @@ public class IngestInternalService {
Object entity = response.getEntity();
if (entity instanceof InputStream) {
Resource resource = new InputStreamResource((InputStream) entity);
manifest = ingestGeneratorODTFile.resourceAsString(resource);
manifest = ingestGeneratorODTFile.resourceAsString(resource)
.replaceAll(ILLEGAL_CHARACTERS, "");
}
LOGGER.info("Manifest EvIdAppSession : {} ", vitamContext.getApplicationSessionId());
return manifest;
......@@ -230,7 +234,8 @@ public class IngestInternalService {
Object entity = response.getEntity();
if (entity instanceof InputStream) {
Resource resource = new InputStreamResource((InputStream) entity);
atr = ingestGeneratorODTFile.resourceAsString(resource);
atr = ingestGeneratorODTFile.resourceAsString(resource)
.replaceAll(ILLEGAL_CHARACTERS, "");
}
LOGGER.info("ATR EvIdAppSession : {} ", vitamContext.getApplicationSessionId());
return atr;
......@@ -248,8 +253,9 @@ public class IngestInternalService {
Resource customerLogo = null;
try {
Document atr = ingestGeneratorODTFile.convertStringToXMLDocument(getAtrAsString(vitamContext, id));
LOGGER.info("Generate ODT Report : get Manifest and ATR of the operation ID : {} ", id);
Document atr =
ingestGeneratorODTFile.convertStringToXMLDocument(getAtrAsString(vitamContext, id));
Document manifest =
ingestGeneratorODTFile.convertStringToXMLDocument(getManifestAsString(vitamContext, id));
TextDocument document;
......@@ -267,8 +273,10 @@ public class IngestInternalService {
}
List<ArchiveUnitDto> archiveUnitDtoList = ingestGeneratorODTFile.getValuesForDynamicTable(atr, manifest);
LOGGER.info("Generate ODT Report : get customer : {} logo ", myCustomer.getId());
ingestGeneratorODTFile.generateDocumentHeader(document, myCustomer, customerLogo);
LOGGER.info("Generate ODT Report : generate the first page content ");
ingestGeneratorODTFile.generateFirstTitle(document);
ingestGeneratorODTFile.generateServicesTable(document, manifest);
......@@ -281,12 +289,14 @@ public class IngestInternalService {
document.addPageBreak();
LOGGER.info("Generate ODT Report : generate the second page content");
ingestGeneratorODTFile.generateSecondtTitle(document);
ingestGeneratorODTFile.generateArchiveUnitDetailsTable(document, archiveUnitDtoList);
LOGGER.info("Generate ODT Report EvIdAppSession : {} ", vitamContext.getApplicationSessionId());
ByteArrayOutputStream result = new ByteArrayOutputStream();
try {
document.save(result);
} catch (Exception e) {
......
......@@ -697,4 +697,4 @@ button, textarea, input {
height: 28px;
object-fit: contain; }
/*# sourceMappingURL=../../../../../target/cas.css.map */
/*# sourceMappingURL=../../../../../target/cas.css.map */
\ No newline at end of file
......@@ -4,7 +4,7 @@ spring:
config:
use-legacy-processing: true
profiles:
active: dev, swagger
active: dev,swagger
cloud:
consul: #disable for dev
......@@ -72,10 +72,28 @@ ui-ingest:
key-path: src/main/resources/dev/truststore_server.jks
key-password: changeme
hostname-verification: false
referential-external-client:
server-host: localhost
server-port: 8087
connect-time-out: 30
read-time-out: 30
write-time-out: 30
secure: true
ssl-configuration:
keystore:
key-path: src/main/resources/dev/keystore_ui-referential.jks
key-password: changeme
type: JKS
truststore:
key-path: src/main/resources/dev/truststore_server.jks
key-password: changeme
hostname-verification: false
base-url:
portal: "https://dev.vitamui.com:4200"
archives-search: "https://dev.vitamui.com:4209/archive-search"
ingest: "https://dev.vitamui.com:4208/ingest"
referential: "https://dev.vitamui.com:4202"
portal-categories:
ingest_and_consultation:
title: "Versement & consultation"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment