Skip to content

Commit

Permalink
feat: add dsfr query param for v3 visualize
Browse files Browse the repository at this point in the history
  • Loading branch information
nsenave committed Apr 25, 2024
1 parent b4b4bcd commit 736982f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<groupId>fr.insee</groupId>
<artifactId>Pogues-BO</artifactId>
<packaging>jar</packaging>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<name>Pogues-BO</name>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,18 @@ public String getDDITOLunaticXML(File fileInput) throws URISyntaxException, IOEx

@Override
public String getDDITOLunaticJSON(File fileInput, Map<String, Object> params) throws URISyntaxException, IOException, EnoException {
String WSPath;

if (params.get("mode") != null) {
WSPath = BASE_PATH+"/lunatic-json/"+params.get("mode").toString();
logger.info("Url for DDI to Lunatic transformation : "+WSPath);
} else {
WSPath = BASE_PATH+"/lunatic-json/"+MODE;
}
String modePathParam = params.get("mode") != null ? params.get("mode").toString() : MODE;
String WSPath = BASE_PATH + "/lunatic-json/" + modePathParam;
if (Boolean.TRUE.equals(params.get("dsfr")))
WSPath += "?dsfr=true";
logger.info("Url for DDI to Lunatic transformation: {}", WSPath);

URIBuilder uriBuilder = new URIBuilder();
uriBuilder.setScheme(enoScheme).setHost(enoHost).setPath(WSPath);
CloseableHttpClient httpclient = HttpClients.createDefault();
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost post = new HttpPost(uriBuilder.build());
logger.info("Calling Eno URL : "+uriBuilder.build().toString());
logger.info("Calling Eno URL: {}", uriBuilder.build());
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.addBinaryBody("in", fileInput, ContentType.DEFAULT_BINARY, fileInput.getName());
HttpEntity entity = builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public ResponseEntity<StreamingResponseBody> visualizeStromaeV3FromBody(@Request
params.put("needDeref", ref);
params.put("mode", "CAWI");
params.put("nomenclatureIds", SuggesterVisuTreatment.getNomenclatureIdsFromQuestionnaire(request));
params.put("dsfr", true);
try {
StreamingResponseBody stream = output -> {
try {
Expand Down

0 comments on commit 736982f

Please sign in to comment.