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

public Class IEEE

extends Object
implements FulltextFetcher, PagedSearchBasedParserFetcher, CustomizableKeyFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.fetcher.CustomizableKeyFetcher, org.jabref.logic.importer.WebFetcher, org.jabref.logic.importer.PagedSearchBasedParserFetcher, org.jabref.logic.importer.ParserFetcher, org.jabref.logic.importer.PagedSearchBasedFetcher, org.jabref.logic.importer.SearchBasedFetcher, org.jabref.logic.importer.SearchBasedParserFetcher, org.jabref.logic.importer.FulltextFetcher
Imports
java.io.BufferedReader, .IOException, .InputStreamReader, java.net.HttpURLConnection, .MalformedURLException, .URISyntaxException, .URL, java.util.ArrayList, .List, .Optional, java.util.regex.Matcher, .Pattern, java.util.stream.Collectors, org.jabref.logic.help.HelpFile, org.jabref.logic.importer.FetcherException, .FulltextFetcher, .ImportFormatPreferences, .ImporterPreferences, .PagedSearchBasedParserFetcher, .Parser, org.jabref.logic.importer.fetcher.transformers.IEEEQueryTransformer, org.jabref.logic.net.URLDownload, org.jabref.logic.os.OS, org.jabref.logic.util.URLUtil, org.jabref.logic.util.strings.StringUtil, org.jabref.model.entry.BibEntry, .LinkedFile, org.jabref.model.entry.field.StandardField, org.jabref.model.entry.identifier.DOI, org.jabref.model.entry.types.StandardEntryType, org.jabref.model.search.query.BaseQueryNode, kong.unirest.core.UnirestException, kong.unirest.core.json.JSONArray, kong.unirest.core.json.JSONObject, org.apache.hc.core5.net.URIBuilder, org.jspecify.annotations.NonNull, org.slf4j.Logger, .LoggerFactory

Class for finding PDF URLs for entries on IEEE. Will first look for URLs of the type https://ieeexplore.ieee.org/stamp/stamp.jsp?[tp=&]arnumber=.... If not found, will resolve the DOI, if it starts with 10.1109, and try to find a similar link on the HTML page.
See Also
API documentation

Field Summary

Modifier and TypeField and Description
private static final String
private static final Pattern
public static final String
private static final String
private final ImporterPreferences
private final ImportFormatPreferences
private static final Logger
private static final Pattern
private static final String
private static final Pattern
private static final String
private IEEEQueryTransformer

Constructor Summary

AccessConstructor and Description
public
IEEE(@NonNull ImportFormatPreferences importFormatPreferences, @NonNull ImporterPreferences importerPreferences)

Method Summary

Modifier and TypeMethod and Description
private URL
buildSearchURL(String
the query string to pass directly as the querytext parameter
rawQuery
,
int
zero based page number; converted to a one based start_record value.
pageNumber
)

Builds the IEEE search API URL for the given raw query string and page number.

public Optional<URL>
public Optional<HelpFile>
getHelpPage()

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

Returns the help page for this fetcher.

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.

public TrustLevel
getTrustLevel()

Implements org.jabref.logic.importer.FulltextFetcher.getTrustLevel.

Returns the level of trust for this fetcher.

private URL
getURLForQuery(String query, String apiKey)

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.

Builds the IEEE search URL for a raw, catalog-native query, sent verbatim as the querytext parameter.

public boolean
isValidKey(String apiKey)

Overrides default org.jabref.logic.importer.fetcher.CustomizableKeyFetcher.isValidKey.

Returns whether the API key is valid

private static BibEntry
parseJsonResponse(kong.unirest.core.json.JSONObject jsonEntry, Character keywordSeparator)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BASE_URLback to summary
private static final String BASE_URL
DOCUMENT_PATTERNback to summary
private static final Pattern DOCUMENT_PATTERN
FETCHER_NAMEback to summary
public static final String FETCHER_NAME
IEEE_DOIback to summary
private static final String IEEE_DOI
importerPreferencesback to summary
private final ImporterPreferences importerPreferences
importFormatPreferencesback to summary
private final ImportFormatPreferences importFormatPreferences
LOGGERback to summary
private static final Logger LOGGER
PDF_PATTERNback to summary
private static final Pattern PDF_PATTERN
STAMP_BASE_STRING_DOCUMENTback to summary
private static final String STAMP_BASE_STRING_DOCUMENT
STAMP_PATTERNback to summary
private static final Pattern STAMP_PATTERN
TEST_URL_WITHOUT_API_KEYback to summary
private static final String TEST_URL_WITHOUT_API_KEY
transformerback to summary
private IEEEQueryTransformer transformer

Constructor Detail

IEEEback to summary
public IEEE(@NonNull ImportFormatPreferences importFormatPreferences, @NonNull ImporterPreferences importerPreferences)

Method Detail

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

Builds the IEEE search API URL for the given raw query string and page number. The caller is responsible for setting transformer before invoking getParser().

Parameters
rawQuery:String

the query string to pass directly as the querytext parameter

pageNumber:int

zero based page number; converted to a one based start_record value.

findFullTextback to summary
public Optional<URL> findFullText(@NonNull BibEntry entry) throws FetcherException
Annotations
@Override
getHelpPageback to summary
public Optional<HelpFile> getHelpPage()

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

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

Returns the help page for this fetcher.

Annotations
@Override
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
getTrustLevelback to summary
public TrustLevel getTrustLevel()

Implements org.jabref.logic.importer.FulltextFetcher.getTrustLevel.

Doc from org.jabref.logic.importer.FulltextFetcher.getTrustLevel.

Returns the level of trust for this fetcher. We distinguish between publishers and meta search engines for example.

Annotations
@Override
getURLForQueryback to summary
private URL getURLForQuery(String query, String apiKey) throws URISyntaxException, MalformedURLException
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.

Builds the IEEE search URL for a raw, catalog-native query, sent verbatim as the querytext parameter. Resets transformer so getParser() applies no year filtering to raw results.

Annotations
@Override
isValidKeyback to summary
public boolean isValidKey(String apiKey)

Overrides default org.jabref.logic.importer.fetcher.CustomizableKeyFetcher.isValidKey.

Doc from org.jabref.logic.importer.fetcher.CustomizableKeyFetcher.isValidKey.

Returns whether the API key is valid

Annotations
@Override
parseJsonResponseback to summary
private static BibEntry parseJsonResponse(kong.unirest.core.json.JSONObject jsonEntry, Character keywordSeparator)

Implementation Note

documentation