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

public Class Medra

extends Object
implements IdBasedParserFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.IdBasedParserFetcher, org.jabref.logic.importer.ParserFetcher, org.jabref.logic.importer.IdBasedFetcher, org.jabref.logic.importer.WebFetcher
Imports
java.net.MalformedURLException, .URISyntaxException, .URL, java.util.Collections, .Optional, java.util.stream.IntStream, org.jabref.logic.cleanup.DoiCleanup, org.jabref.logic.importer.FetcherException, .IdBasedParserFetcher, .ParseException, .Parser, org.jabref.logic.importer.util.JsonReader, .MediaTypes, org.jabref.logic.net.URLDownload, org.jabref.model.entry.Author, .AuthorList, .BibEntry, org.jabref.model.entry.field.StandardField, org.jabref.model.entry.types.EntryType, .StandardEntryType, kong.unirest.core.json.JSONArray, kong.unirest.core.json.JSONException, kong.unirest.core.json.JSONObject

A class for fetching DOIs from Medra
See Also
mEDRA Content Negotiation API for an overview of the API

It requires "Accept" request Header attribute to be set to desired content-type.

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private EntryType
public void
doPostCleanup(BibEntry
the entry to be cleaned-up
entry
)

Overrides default org.jabref.logic.importer.ParserFetcher.doPostCleanup.

Performs a cleanup of the fetched entry.

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.IdBasedParserFetcher.getParser.

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

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
getUrlForIdentifier(String
the ID
identifier
)

Implements org.jabref.logic.importer.IdBasedParserFetcher.getUrlForIdentifier.

Constructs a URL based on the query.

private BibEntry
jsonItemToBibEntry(kong.unirest.core.json.JSONObject item)

private String
toAuthors(kong.unirest.core.json.JSONArray authors)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

API_URLback to summary
public static final String API_URL

Constructor Detail

Medraback to summary
public Medra()

Method Detail

convertTypeback to summary
private EntryType convertType(String type)
doPostCleanupback to summary
public void doPostCleanup(BibEntry entry)

Overrides default org.jabref.logic.importer.ParserFetcher.doPostCleanup.

Doc from org.jabref.logic.importer.ParserFetcher.doPostCleanup.

Performs a cleanup of the fetched entry.

Only systematic errors of the fetcher should be corrected here (i.e. if information is consistently contained in the wrong field or the wrong format) but not cosmetic issues which may depend on the user's taste (for example, LateX code vs HTML in the abstract).

Try to reuse existing Formatter for the cleanup. For example, new FieldFormatterCleanup(StandardField.TITLE, new RemoveBracesFormatter()).cleanup(entry);

By default, no cleanup is done.

Parameters
entry:BibEntry

the entry to be cleaned-up

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.

Returns:String

the localized name

Annotations
@Override
getParserback to summary
public Parser getParser()

Implements org.jabref.logic.importer.IdBasedParserFetcher.getParser.

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

Returns the parser used to convert the response to a 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
getUrlForIdentifierback to summary
public URL getUrlForIdentifier(String identifier) throws URISyntaxException, MalformedURLException, FetcherException

Implements org.jabref.logic.importer.IdBasedParserFetcher.getUrlForIdentifier.

Doc from org.jabref.logic.importer.IdBasedParserFetcher.getUrlForIdentifier.

Constructs a URL based on the query.

Parameters
identifier:String

the ID

Annotations
@Override
jsonItemToBibEntryback to summary
private BibEntry jsonItemToBibEntry(kong.unirest.core.json.JSONObject item) throws ParseException
toAuthorsback to summary
private String toAuthors(kong.unirest.core.json.JSONArray authors)