Skip to content

Commit

Permalink
Merge pull request #108 from abes-esr/develop
Browse files Browse the repository at this point in the history
merge dev to test
  • Loading branch information
pierre-maraval authored Dec 9, 2024
2 parents acebfe4 + 20b7e97 commit 68a7096
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>fr.abes</groupId>
<artifactId>sudoc</artifactId>
<version>1.0.5</version>
<version>1.0.6-SNAPSHOT</version>
<packaging>jar</packaging>
<name>sudoc</name>
<description>webservices de récupération de ppns dans le sudoc</description>
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/fr/abes/sudoc/controller/SudocController.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ public ResultWsDto printIdentifier2Ppn(@PathVariable String type, @PathVariable
@GetMapping(value = {"/doi_identifier_2_ppn"}, produces = MediaType.APPLICATION_JSON_VALUE)
public ResultWsDto doiIdentifier2Ppn(@RequestParam(name = "doi") String doi_identifier, @RequestParam(name = "provider") Optional<String> provider) throws IOException {
log.debug("DOI IDENTIFIER 2 PPN");
log.debug("RequestParam doi : {}, provider : {}", doi_identifier, provider);
ResultWsDto resultat = new ResultWsDto();
Optional<ElementDto> providerDto = this.providerService.getProviderDisplayName(provider);
log.debug("providerDto : {}", providerDto);
try {
IIdentifiantService service = factory.getService(TYPE_ID.DOI);
if (service.checkFormat(doi_identifier)) {
Expand All @@ -141,12 +143,14 @@ public ResultWsDto doiIdentifier2Ppn(@RequestParam(name = "doi") String doi_iden
feedResultatWithNotice(resultat, providerDto, ppn);
}
} else {
log.debug("DOI mauvais format {}", doi_identifier);
throw new IllegalArgumentException("Le DOI n'est pas au bon format");
}
} catch (IOException ex) {
log.error("Erreur dans la récupération de la notice correspondant au doi {}", doi_identifier);
throw new IOException(ex);
} catch (ZoneNotFoundException e) {
log.debug("ZoneNotFoundException : {}", e.getMessage());
throw new IOException(e.getMessage());
} catch (IllegalPpnException e) {
log.info("Aucune notice ne correspond au doi {}", doi_identifier);
Expand All @@ -168,6 +172,8 @@ private void feedResultatWithNotice(ResultWsDto resultat, Optional<ElementDto> p
} else {
resultat.addErreur("Le PPN " + notice.getPpn() + " n'est pas une ressource électronique");
}
} else {
log.debug("La notice est supprimée : {}", notice);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/log4j2-all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!-- CONSOLE -->
<Console name="Console">
<PatternLayout
pattern="%style{%d{ISO8601}}{black} %highlight{%-5level }[%style{%t}{bright,blue}] %style{%C{1.}}{dark,yellow}: %msg%n%throwable" />
pattern="%style{%d{ISO8601}}{white} %highlight{%-5level }[%style{%t}{bright,blue}] %style{%C{1.}}{dark,yellow}: %msg%n%throwable" />
</Console>

<!-- LOG FILE -->
Expand Down

0 comments on commit 68a7096

Please sign in to comment.