From c48986c7837a1b8ea771e091c6d82c0f1501699d Mon Sep 17 00:00:00 2001 From: Github Action Date: Thu, 9 Jan 2025 14:21:54 +0000 Subject: [PATCH 1/2] Version 1.1.3-SNAPSHOT [skip ci] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2a41c02..4ea2a30 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ fr.abes sudoc - 1.1.2 + 1.1.3-SNAPSHOT jar sudoc webservices de récupération de ppns dans le sudoc From 0cd849d56bbf9b1b123b4ed3c3b6334defeabc40 Mon Sep 17 00:00:00 2001 From: pierre-maraval Date: Wed, 15 Jan 2025 10:59:16 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Fix=20:=20Remplacement=20caract=C3=A8res=20?= =?UTF-8?q?sp=C3=A9ciaux=20dans=20requ=C3=AAte=20DAT=20par=20espace=20au?= =?UTF-8?q?=20lieu=20de=20rien,=20suppression=20biblevel=20quand=20pas=20d?= =?UTF-8?q?e=20date,=20optimisation=20sur=20typerecord?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/abes/sudoc/component/BaseXmlFunctionsCaller.java | 8 ++++---- src/main/java/fr/abes/sudoc/utils/Utilitaire.java | 2 +- src/test/java/fr/abes/sudoc/utils/UtilitaireTest.java | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/fr/abes/sudoc/component/BaseXmlFunctionsCaller.java b/src/main/java/fr/abes/sudoc/component/BaseXmlFunctionsCaller.java index d5bae4c..30d25b8 100644 --- a/src/main/java/fr/abes/sudoc/component/BaseXmlFunctionsCaller.java +++ b/src/main/java/fr/abes/sudoc/component/BaseXmlFunctionsCaller.java @@ -51,16 +51,16 @@ public List datToPpn(Integer date, String auteur, String titre) throws U request.append(" JOIN AUTORITES.bib_100$a b"); request.append(" ON a.ppn=b.ppn"); if (auteur != null) { - request.append(" WHERE a.typerecord != 'd' and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(") AND (").append(auteur).append(")')>0 and (substr(b.datas,10,4) = '").append(date).append("' or substr(b.datas,14,4)='").append(date).append("')"); + request.append(" WHERE a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(") AND (").append(auteur).append(")')>0 and (substr(b.datas,10,4) = '").append(date).append("' or substr(b.datas,14,4)='").append(date).append("')"); } else { - request.append(" WHERE a.typerecord != 'd' and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(")')>0 and (substr(b.datas,10,4) = '").append(date).append("' or substr(b.datas,14,4)='").append(date).append("')"); + request.append(" WHERE a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(")')>0 and (substr(b.datas,10,4) = '").append(date).append("' or substr(b.datas,14,4)='").append(date).append("')"); } } else { request.append(" FROM biblio_table_generale a"); if (auteur != null) { - request.append(" WHERE a.typerecord != 'd' and a.biblevel='l' and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(") AND (").append(auteur).append(")')>0"); + request.append(" WHERE a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(") AND (").append(auteur).append(")')>0"); } else { - request.append(" WHERE a.typerecord != 'd' and a.biblevel='l' and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(")')>0"); + request.append(" WHERE a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(")')>0"); } } return baseXmlJdbcTemplate.queryForList(request.toString(), String.class); diff --git a/src/main/java/fr/abes/sudoc/utils/Utilitaire.java b/src/main/java/fr/abes/sudoc/utils/Utilitaire.java index 8a6e781..ab445f3 100644 --- a/src/main/java/fr/abes/sudoc/utils/Utilitaire.java +++ b/src/main/java/fr/abes/sudoc/utils/Utilitaire.java @@ -109,7 +109,7 @@ private static String suppCaracters(String chaine) { String regex = "[" + charsToRemove.stream() .map(c -> "\\" + c) // Échapper les caractères spéciaux si nécessaire .reduce("", (acc, c) -> acc + c) + "]"; - return chaine.replaceAll(regex, ""); + return chaine.replaceAll(regex, " "); } private static String banalisationReservedWords(String chaine) { diff --git a/src/test/java/fr/abes/sudoc/utils/UtilitaireTest.java b/src/test/java/fr/abes/sudoc/utils/UtilitaireTest.java index cb036e9..2fe95b2 100644 --- a/src/test/java/fr/abes/sudoc/utils/UtilitaireTest.java +++ b/src/test/java/fr/abes/sudoc/utils/UtilitaireTest.java @@ -113,5 +113,6 @@ void testReformatageChaineDat() { Assertions.assertEquals("Assez NEAR de NEAR ces NEAR fichus NEAR TU".toUpperCase(), Utilitaire.formatString("Assez ! de _ ces ~fichus *TU")); Assertions.assertEquals("Je NEAR {AND} NEAR suis NEAR {WITHIN} NEAR content".toUpperCase(), Utilitaire.formatString("Je AND suis! within content")); Assertions.assertEquals("Je NEAR {AND} NEAR suis NEAR {WITHIN} NEAR content".toUpperCase(), Utilitaire.formatString("Je AND suis! 'WITHIN' content")); + Assertions.assertEquals("J NEAR y NEAR {AND} NEAR suis NEAR {WITHIN} NEAR content".toUpperCase(), Utilitaire.formatString("J'y AND suis! 'WITHIN' content")); } }