Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.importer.fetcher

public Class ISIDOREFetcher

extends Object
implements PagedSearchBasedParserFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.PagedSearchBasedParserFetcher, org.jabref.logic.importer.ParserFetcher, org.jabref.logic.importer.PagedSearchBasedFetcher, org.jabref.logic.importer.SearchBasedFetcher, org.jabref.logic.importer.WebFetcher, org.jabref.logic.importer.SearchBasedParserFetcher
Imports
java.io.IOException, .PushbackInputStream, java.net.MalformedURLException, .URISyntaxException, .URL, java.nio.charset.StandardCharsets, java.util.ArrayList, .List, .StringJoiner, javax.xml.parsers.DocumentBuilder, .DocumentBuilderFactory, .ParserConfigurationException, org.jabref.logic.importer.FetcherException, .PagedSearchBasedParserFetcher, .Parser, org.jabref.logic.importer.fetcher.transformers.ISIDOREQueryTransformer, org.jabref.logic.net.URLDownload, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.StandardField, org.jabref.model.entry.types.EntryType, .StandardEntryType, org.jabref.model.search.query.BaseQueryNode, jakarta.ws.rs.core.MediaType, org.apache.hc.core5.net.URIBuilder, org.jooq.lambda.Unchecked, org.slf4j.Logger, .LoggerFactory, org.w3c.dom.Document, .Element, .Node, .NodeList, org.xml.sax.SAXException

Fetcher for ISIDORE``` Will take in the link to the website or the last six digits that identify the reference Uses ISIDORE's API.

Field Summary

Modifier and TypeField and Description
private static final String
private static final Logger
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private URL
buildSearchURL(String query, int pageNumber)

Builds the search URL for the given query string

The query is sent as the q parameter, so raw queries bypass ISIDOREQueryTransformer and are passed unchanged to the catalog

private static DocumentBuilder
private String
getAuthor(Node itemElement)

private String
private String
public String
getName()

Implements org.jabref.logic.importer.WebFetcher.getName.

Returns the localized name of this fetcher.

public Parser
getParser()

Implements org.jabref.logic.importer.SearchBasedParserFetcher.getParser.

Returns the parser used to convert the response to a list of BibEntry.

private String
getPublishers(Node itemElement)

private EntryType
getType(NodeList list)

Get the type of the document, ISIDORE only seems to have select types, also their types are different to those used by JabRef.

public URLDownload
getUrlDownload(URL url)

Overrides default org.jabref.logic.importer.WebFetcher.getUrlDownload.

Constructs an URLDownload object for downloading content based on the given URL.

public URL
getURLForQuery(BaseQueryNode queryNode, int pageNumber)

Implements org.jabref.logic.importer.PagedSearchBasedParserFetcher.getURLForQuery.

Constructs a URL based on the query, size and page number.

public URL
getURLForRawQuery(String rawQuery, int pageNumber)

Overrides default org.jabref.logic.importer.PagedSearchBasedParserFetcher.getURLForRawQuery.

Constructs a URL that sends the raw, catalog-native query verbatim to the catalog (bypassing the query transformer).

private List<BibEntry>
parseXMl(Element element)

private String
removeNumbers(String string)

Remove numbers from a string and everything after the number, (helps with the author field).

private BibEntry
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DISALLOW_DOCTYPE_DECLARATIONback to summary
private static final String DISALLOW_DOCTYPE_DECLARATION
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

ISIDOREFetcherback to summary
public ISIDOREFetcher()

Method Detail

buildSearchURLback to summary
private URL buildSearchURL(String query, int pageNumber) throws URISyntaxException, MalformedURLException

Builds the search URL for the given query string

The query is sent as the q parameter, so raw queries bypass ISIDOREQueryTransformer and are passed unchanged to the catalog

createDocumentBuilderback to summary
private static DocumentBuilder createDocumentBuilder() throws ParserConfigurationException
getAuthorback to summary
private String getAuthor(Node itemElement)
getDOIback to summary
private String getDOI(NodeList list)
getJournalback to summary
private String getJournal(NodeList list)
getNameback to summary
public String getName()

Implements org.jabref.logic.importer.WebFetcher.getName.

Doc from org.jabref.logic.importer.WebFetcher.getName.

Returns the localized name of this fetcher. The title can be used to display the fetcher in the menu and in the side pane.

Todo

This name is also used for identifying the fetcher in preferences for API keys. Thus, any switch of the language will "remove" API keys.

Annotations
@Override
getParserback to summary
public Parser getParser()

Implements org.jabref.logic.importer.SearchBasedParserFetcher.getParser.

Doc from org.jabref.logic.importer.SearchBasedParserFetcher.getParser.

Returns the parser used to convert the response to a list of BibEntry.

Annotations
@Override
getPublishersback to summary
private String getPublishers(Node itemElement)
getTypeback to summary
private EntryType getType(NodeList list)

Get the type of the document, ISIDORE only seems to have select types, also their types are different to those used by JabRef.

getUrlDownloadback to summary
public URLDownload getUrlDownload(URL url)

Overrides default org.jabref.logic.importer.WebFetcher.getUrlDownload.

Doc from org.jabref.logic.importer.WebFetcher.getUrlDownload.

Constructs an URLDownload object for downloading content based on the given URL. Overwrite, if you need to send additional headers for the download.

Annotations
@Override
getURLForQueryback to summary
public URL getURLForQuery(BaseQueryNode queryNode, int pageNumber) throws URISyntaxException, MalformedURLException

Implements org.jabref.logic.importer.PagedSearchBasedParserFetcher.getURLForQuery.

Doc from org.jabref.logic.importer.PagedSearchBasedParserFetcher.getURLForQuery.

Constructs a URL based on the query, size and page number.

Annotations
@Override
getURLForRawQueryback to summary
public URL getURLForRawQuery(String rawQuery, int pageNumber) throws URISyntaxException, MalformedURLException

Overrides default org.jabref.logic.importer.PagedSearchBasedParserFetcher.getURLForRawQuery.

Doc from org.jabref.logic.importer.PagedSearchBasedParserFetcher.getURLForRawQuery.

Constructs a URL that sends the raw, catalog-native query verbatim to the catalog (bypassing the query transformer).

Annotations
@Override
parseXMlback to summary
private List<BibEntry> parseXMl(Element element)
removeNumbersback to summary
private String removeNumbers(String string)

Remove numbers from a string and everything after the number, (helps with the author field).

xmlItemToBibEntryback to summary
private BibEntry xmlItemToBibEntry(Element itemElement)