Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev to test #108

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading