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

public Class MrDLibFetcher

extends Object
implements EntryBasedFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.EntryBasedFetcher, org.jabref.logic.importer.WebFetcher
Imports
java.io.IOException, java.net.URI, .URISyntaxException, java.util.ArrayList, .Calendar, .List, .Optional, org.jabref.logic.importer.EntryBasedFetcher, .FetcherException, .ParserResult, org.jabref.logic.importer.fileformat.MrDLibImporter, org.jabref.logic.l10n.Localization, org.jabref.logic.net.URLDownload, org.jabref.logic.util.Version, org.jabref.model.database.BibDatabase, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.StandardField, org.jabref.preferences.MrDlibPreferences, org.apache.hc.core5.net.URIBuilder, org.slf4j.Logger, .LoggerFactory

This class is responsible for getting the recommendations from Mr. DLib

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
MrDLibFetcher(String language, Version version, MrDlibPreferences preferences)

Method Summary

Modifier and TypeMethod and Description
private String

Returns:

the string used to make the query at mdl server
constructQuery
(String
the title of the bib entry.
queryWithTitle
)

Constructs the query based on title of the BibEntry.

public String
public String
public String
getName()

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

Returns the localized name of this fetcher.

private String

Returns:

Returns the server response. This is an XML document as a String.
makeServerRequest
(String
the query holds the title of the selected entry. Used to make a query to the MDL Server
queryByTitle
)

Contact the server with the title of the selected item

public List<BibEntry>
performSearch(BibEntry
entry to search bibliographic information for
entry
)

Implements org.jabref.logic.importer.EntryBasedFetcher.performSearch.

Looks for hits which are matched by the given BibEntry.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_MRDLIB_ERROR_MESSAGEback to summary
private static final String DEFAULT_MRDLIB_ERROR_MESSAGE
descriptionback to summary
private String description
headingback to summary
private String heading
LANGUAGEback to summary
private final String LANGUAGE
LOGGERback to summary
private static final Logger LOGGER
MDL_JABREF_PARTNER_IDback to summary
private static final String MDL_JABREF_PARTNER_ID
MDL_URLback to summary
private static final String MDL_URL
NAMEback to summary
private static final String NAME
preferencesback to summary
private final MrDlibPreferences preferences
recommendationSetIdback to summary
private String recommendationSetId
VERSIONback to summary
private final Version VERSION

Constructor Detail

MrDLibFetcherback to summary
public MrDLibFetcher(String language, Version version, MrDlibPreferences preferences)

Method Detail

constructQueryback to summary
private String constructQuery(String queryWithTitle)

Constructs the query based on title of the BibEntry. Adds statistical stuff to the url.

Parameters
queryWithTitle:String

the title of the bib entry.

Returns:String

the string used to make the query at mdl server

getDescriptionback to summary
public String getDescription()
getHeadingback to summary
public String getHeading()
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.

Returns:String

the localized name

Annotations
@Override
makeServerRequestback to summary
private String makeServerRequest(String queryByTitle) throws FetcherException

Contact the server with the title of the selected item

Parameters
queryByTitle:String

the query holds the title of the selected entry. Used to make a query to the MDL Server

Returns:String

Returns the server response. This is an XML document as a String.

performSearchback to summary
public List<BibEntry> performSearch(BibEntry entry) throws FetcherException

Implements org.jabref.logic.importer.EntryBasedFetcher.performSearch.

Doc from org.jabref.logic.importer.EntryBasedFetcher.performSearch.

Looks for hits which are matched by the given BibEntry.

Parameters
entry:BibEntry

entry to search bibliographic information for

Returns:List<BibEntry>

a list of BibEntry, which are matched by the query (may be empty)

Annotations
@Override