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

public Class ScholarArchiveFetcher

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.net.MalformedURLException, .URISyntaxException, .URL, java.util.ArrayList, .List, .Optional, java.util.stream.IntStream, org.jabref.logic.importer.PagedSearchBasedParserFetcher, .ParseException, .Parser, org.jabref.logic.importer.fetcher.transformers.ScholarArchiveQueryTransformer, org.jabref.logic.importer.util.JsonReader, org.jabref.logic.net.URLDownload, org.jabref.model.entry.AuthorList, .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, kong.unirest.core.json.JSONArray, kong.unirest.core.json.JSONException, kong.unirest.core.json.JSONObject, org.apache.hc.core5.net.URIBuilder, org.slf4j.Logger, .LoggerFactory

Field Summary

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

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.

public String
getName()

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

Returns the localized name of this fetcher.

public Parser

Returns:

Parser, list of BibEntry
getParser
()

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

Gets the list of BibEntry by given Json response from scholar archive fetcher API

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

Returns:

URL
getURLForQuery
(BaseQueryNode
the first node from the parsed query
queryNode
,
int
the number of the page indexed from 0
pageNumber
)

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

Gets the query URL by luceneQuery and pageNumber.

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 BibEntry
parseJSONtoBibtex(kong.unirest.core.json.JSONObject jsonEntry)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

API_URLback to summary
private static final String API_URL
FETCHER_NAMEback to summary
public static final String FETCHER_NAME
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

ScholarArchiveFetcherback to summary
public ScholarArchiveFetcher()

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 ScholarArchiveQueryTransformer and are passed unchanged to the catalog.

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.

Gets the list of BibEntry by given Json response from scholar archive fetcher API

Returns:Parser

Parser, list of BibEntry

Annotations
@Override
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.

Gets the query URL by luceneQuery and pageNumber.

Parameters
queryNode:BaseQueryNode

the first node from the parsed query

pageNumber:int

the number of the page indexed from 0

Returns:URL

URL

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
parseJSONtoBibtexback to summary
private BibEntry parseJSONtoBibtex(kong.unirest.core.json.JSONObject jsonEntry) throws ParseException