Skip to content

Commit

Permalink
Fix URL for "Volltext"
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Sep 29, 2024
1 parent 759b1d7 commit 654616c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where search result highlighting was incorrectly highlighting the boolean operators. [#11595](https://github.com/JabRef/jabref/issues/11595)
- We fixed an issue where search result highlighting was broken at complex searches. [#8067](https://github.com/JabRef/jabref/issues/8067)
- We fixed an exception when searching for unlinked files. [#11731](https://github.com/JabRef/jabref/issues/11731)
- We fixed an issue with the link to the full text at the BVB fetcher. [#11852](https://github.com/JabRef/jabref/pull/11852)
- We fixed an issue where two contradicting notifications were shown when cutting an entry in the main table. [#11724](https://github.com/JabRef/jabref/pull/11724)
- We fixed an issue where unescaped braces in the arXiv fetcher were not treated. [#11704](https://github.com/JabRef/jabref/issues/11704)
- We fixed an issue where HTML instead of the fulltext pdf was downloaded when importing arXiv entries. [#4913](https://github.com/JabRef/jabref/issues/4913)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import org.apache.hc.core5.net.URIBuilder;
import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode;

/**
* Fetcher for <a href="Bibliotheksverbund Bayern (BVB)">https://www.bib-bvb.de/</a>.
*/
public class BvbFetcher implements SearchBasedParserFetcher {

private static final String URL_PATTERN = "http://bvbr.bib-bvb.de:5661/bvb01sru?";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.jabref.logic.importer.AuthorListParser;
import org.jabref.logic.importer.ParseException;
import org.jabref.logic.importer.Parser;
import org.jabref.logic.util.StandardFileType;
import org.jabref.model.entry.AuthorList;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.Date;
Expand Down Expand Up @@ -405,8 +406,8 @@ private void putElectronicLocation(BibEntry bibEntry, Element datafield) {

if ("Volltext".equals(fulltext) && StringUtil.isNotBlank(resource)) {
try {
LinkedFile linkedFile = new LinkedFile(URI.create(resource).toURL(), "PDF");
bibEntry.setField(StandardField.FILE, linkedFile.toString());
LinkedFile linkedFile = new LinkedFile("", URI.create(resource).toURL(), StandardFileType.PDF.getName());
bibEntry.setFiles(List.of(linkedFile));
} catch (MalformedURLException | IllegalArgumentException e) {
LOGGER.info("Malformed URL: {}", resource);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import java.util.List;

import org.jabref.logic.importer.FetcherException;
import org.jabref.logic.util.StandardFileType;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.LinkedFile;
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.entry.types.StandardEntryType;
import org.jabref.testutils.category.FetcherTest;
Expand All @@ -29,7 +31,7 @@ class BvbFetcherTest {
.withField(StandardField.AUTHOR, "Bloch, Joshua")
.withField(StandardField.TITLEADDON, "Joshua Bloch")
.withField(StandardField.EDITION, "3. Auflage, Übersetzung der englischsprachigen 3. Originalausgabe 2018")
.withField(StandardField.FILE, "ParsedFileField{description='', link='http://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=1906353', fileType='PDF'}")
.withFiles(List.of(new LinkedFile("", "http://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=1906353", StandardFileType.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.ADDRESS, "Heidelberg")
Expand Down Expand Up @@ -78,8 +80,7 @@ void complexSearchQueryURLCorrect() throws Exception {
@Test
void performSearchMatchingMultipleEntries() throws FetcherException {
List<BibEntry> searchResult = fetcher.performSearch("effective java bloch");
assertEquals(bibEntryISBN9783960886402, searchResult.getFirst());
assertEquals(bibEntryISBN0134685997, searchResult.get(1));
assertEquals(List.of(bibEntryISBN9783960886402, bibEntryISBN0134685997), searchResult.subList(0, 1));
}

@Test
Expand Down

0 comments on commit 654616c

Please sign in to comment.