diff --git a/CHANGELOG.md b/CHANGELOG.md index 700744d9516..3cae132a85f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We now encrypt and store the custom API keys in the OS native credential store. [#10044](https://github.com/JabRef/jabref/issues/10044) - We changed the behavior of group addition/edit, so that sorting by alphabetical order is not performed by default after the modification [#10017](https://github.com/JabRef/jabref/issues/10017) - We fixed an issue with spacing in the cleanup dialogue. [#10081](https://github.com/JabRef/jabref/issues/10081) +- The GVK fetcher now uses the new [K10plus](https://www.bszgbv.de/services/k10plus/) database [#10189](https://github.com/JabRef/jabref/pull/10189) ### Fixed diff --git a/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java index ad3982d5dfe..81e011ccde0 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java @@ -19,7 +19,7 @@ public class GvkFetcher implements SearchBasedParserFetcher { - private static final String URL_PATTERN = "http://sru.gbv.de/gvk?"; + private static final String URL_PATTERN = "https://sru.k10plus.de/gvk?"; /** * Searchkeys are used to specify a search request. For example "tit" stands for "title". diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PicaXmlParser.java b/src/main/java/org/jabref/logic/importer/fileformat/PicaXmlParser.java index ba488552613..9b0fd526a3d 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PicaXmlParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PicaXmlParser.java @@ -445,7 +445,7 @@ private String getSubfield(String a, Element datafield) { List liste = getChildren("subfield", datafield); for (Element subfield : liste) { - if (subfield.getAttribute("code").equals(a)) { + if (subfield.getAttribute("code").equalsIgnoreCase(a)) { return subfield.getTextContent(); } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java index 0bc03b1ce9b..402350e179e 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java @@ -52,7 +52,8 @@ public void setUp() { .withField(StandardField.FILE, "ParsedFileField{description='', link='http://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=1906353', fileType='PDF'}") .withField(StandardField.ISBN, "9783960886402") .withField(StandardField.KEYWORDS, "Klassen, Interfaces, Generics, Enums, Annotationen, Lambdas, Streams, Module, parallel, Parallele Programmierung, Serialisierung, funktional, funktionale Programmierung, Java EE, Jakarta EE") - .withField(StandardField.LOCATION, "Heidelberg") + .withField(StandardField.ADDRESS, "Heidelberg") + .withField(StandardField.PAGETOTAL, "396") .withField(StandardField.PUBLISHER, "{dpunkt.verlag} and {Dpunkt. Verlag (Heidelberg)}"); bibEntryISBN0134685997 = new BibEntry(StandardEntryType.Misc) @@ -62,7 +63,8 @@ public void setUp() { .withField(StandardField.TITLEADDON, "Joshua Bloch") .withField(StandardField.EDITION, "Third edition") .withField(StandardField.ISBN, "0134685997") - .withField(StandardField.LOCATION, "Boston") + .withField(StandardField.PAGETOTAL, "392") + .withField(StandardField.ADDRESS, "Boston") .withField(StandardField.PUBLISHER, "{Addison-Wesley}"); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java index 17e8b2ded4e..f47e4ad9180 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java @@ -36,10 +36,10 @@ public void setUp() { .withField(StandardField.PUBLISHER, "Addison-Wesley") .withField(StandardField.YEAR, "2008") .withField(StandardField.AUTHOR, "Joshua Bloch") - .withField(StandardField.SERIES, "The @Java series") - .withField(StandardField.ADDRESS, "Upper Saddle River, NJ [u.a.]") + .withField(StandardField.SERIES, "The Java series ... from the source") + .withField(StandardField.ADDRESS, "Upper Saddle River, NJ") .withField(StandardField.EDITION, "2. ed., 5. print.") - .withField(StandardField.NOTE, "Literaturverz. S. 321 - 325") + .withField(StandardField.NOTE, "Includes bibliographical references and index. - Previous ed.: 2001. - Hier auch später erschienene, unveränderte Nachdrucke") .withField(StandardField.ISBN, "9780321356680") .withField(StandardField.PAGETOTAL, "XXI, 346") .withField(new UnknownField("ppn_gvk"), "591166003") @@ -67,7 +67,7 @@ public void simpleSearchQueryURLCorrect() throws Exception { String query = "java jdk"; QueryNode luceneQuery = new StandardSyntaxParser().parse(query, AbstractQueryTransformer.NO_EXPLICIT_FIELD); URL url = fetcher.getURLForQuery(luceneQuery); - assertEquals("http://sru.gbv.de/gvk?version=1.1&operation=searchRetrieve&query=pica.all%3Djava+and+pica.all%3Djdk&maximumRecords=50&recordSchema=picaxml&sortKeys=Year%2C%2C1", url.toString()); + assertEquals("https://sru.k10plus.de/gvk?version=1.1&operation=searchRetrieve&query=pica.all%3Djava+and+pica.all%3Djdk&maximumRecords=50&recordSchema=picaxml&sortKeys=Year%2C%2C1", url.toString()); } @Test @@ -75,7 +75,7 @@ public void complexSearchQueryURLCorrect() throws Exception { String query = "kon:java tit:jdk"; QueryNode luceneQuery = new StandardSyntaxParser().parse(query, AbstractQueryTransformer.NO_EXPLICIT_FIELD); URL url = fetcher.getURLForQuery(luceneQuery); - assertEquals("http://sru.gbv.de/gvk?version=1.1&operation=searchRetrieve&query=pica.kon%3Djava+and+pica.tit%3Djdk&maximumRecords=50&recordSchema=picaxml&sortKeys=Year%2C%2C1", url.toString()); + assertEquals("https://sru.k10plus.de/gvk?version=1.1&operation=searchRetrieve&query=pica.kon%3Djava+and+pica.tit%3Djdk&maximumRecords=50&recordSchema=picaxml&sortKeys=Year%2C%2C1", url.toString()); } @Test