Skip to content

Commit

Permalink
Merge pull request #36 from abes-esr/CDE-228-maj-des-mappings-de-crea…
Browse files Browse the repository at this point in the history
…tion-de-notices

CDE-228 : fix : correction mapping sur zone 214 et zone 200
  • Loading branch information
jvk88511334 authored Feb 21, 2024
2 parents 0b3053f + cd8deb4 commit d84a2d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions src/main/java/fr/abes/kafkatosudoc/utils/NoticeMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,24 @@ public NoticeConcrete convert(MappingContext<LigneKbartConnect, NoticeConcrete>
noticeBiblio.addSousZone("183", "$a", "ceb");
//Titre

noticeBiblio.addZone("200", "$a", "@" + kbart.getPUBLICATIONTITLE(), new char[]{'1', '#'});
noticeBiblio.addZone("200", "$a", kbart.getPUBLICATIONTITLE().toString(), new char[]{'1', '#'});
if (!kbart.getFIRSTAUTHOR().isEmpty())
noticeBiblio.addSousZone("200", "$f", kbart.getFIRSTAUTHOR().toString());
//Mention de publication / diffusion
noticeBiblio.addZone("214", "$a", "[Lieu de publication inconnu]", new char[]{'#', '0'});
Zone zone214diese0 = new Zone("214", TYPE_NOTICE.BIBLIOGRAPHIQUE, new char[]{'#', '0'});
zone214diese0.addSubLabel("$a", "[Lieu de publication inconnu]");
if (kbart.getPUBLISHERNAME() != null)
noticeBiblio.addSousZone("214", "$c", kbart.getPUBLISHERNAME().toString());
zone214diese0.addSubLabel( "$c", kbart.getPUBLISHERNAME().toString());
noticeBiblio.addZone(zone214diese0);


noticeBiblio.addZone("214", "$a", "[Lieu de diffusion inconnu]", new char[]{'#', '2'});
Zone zone214diese2 = new Zone("214", TYPE_NOTICE.BIBLIOGRAPHIQUE, new char[]{'#', '2'});
zone214diese2.addSubLabel("$a", "[Lieu de diffusion inconnu]");
if (kbart.getDATEMONOGRAPHPUBLISHEDONLIN() != null && !kbart.getDATEMONOGRAPHPUBLISHEDONLIN().toString().isEmpty()) {
noticeBiblio.addSousZone("214", "$d", Utils.getYearFromDate(kbart.getDATEMONOGRAPHPUBLISHEDONLIN().toString()), 1);
zone214diese2.addSubLabel( "$d", Utils.getYearFromDate(kbart.getDATEMONOGRAPHPUBLISHEDONLIN().toString()));
} else {
noticeBiblio.addSousZone("214", "$d", "[20..]");
zone214diese2.addSubLabel( "$d", "[20..]");
}
noticeBiblio.addZone(zone214diese2);
noticeBiblio.addZone("309", "$a", "Notice générée automatiquement à partir des métadonnées de BACON. SUPPRIMER LA PRESENTE NOTE 309 APRES MISE A JOUR");

//Note sur les conditions d'accès
Expand Down Expand Up @@ -153,7 +156,7 @@ public NoticeConcrete convert(MappingContext<KbartAndImprimeDto, NoticeConcrete>

//DOI
String doi = Utils.extractDoiFromImprime(kbart);
if (!doi.equals("")) {
if (!doi.isEmpty()) {
noticeElec.addZone("017", "$a", doi, new char[]{'7', '0'});
noticeElec.addSousZone("017", "$2", "DOI");
}
Expand Down Expand Up @@ -234,7 +237,7 @@ public NoticeConcrete convert(MappingContext<KbartAndImprimeDto, NoticeConcrete>

Zone zone214 = new Zone("214", TYPE_NOTICE.BIBLIOGRAPHIQUE, new char[]{'#', '2'});
zone214.addSubLabel("$a", "[Lieu de diffusion inconnu]");
if (kbart.getDateMonographPublishedOnline() != null) {
if (kbart.getDateMonographPublishedOnline() != null && !kbart.getDateMonographPublishedOnline().isEmpty()) {
zone214.addSubLabel("$d", kbart.getDateMonographPublishedOnline().toString());
} else {
zone214.addSubLabel("$d", "[20..]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void testMapperNoticeFromKbartCas1() {
Assertions.assertEquals("ceb", biblio.findZones("183").get(0).findSubLabel("$a"));

//controle titre
Assertions.assertEquals("@Test title", biblio.findZones("200").get(0).findSubLabel("$a"));
Assertions.assertEquals("Test title", biblio.findZones("200").get(0).findSubLabel("$a"));
Assertions.assertEquals('1', biblio.findZones("200").get(0).getIndicateurs()[0]);
Assertions.assertEquals('#', biblio.findZones("200").get(0).getIndicateurs()[1]);

Expand Down

0 comments on commit d84a2d4

Please sign in to comment.