JabRef offers to display cited and citing papers.
Thereby, it used the interface CitationFetcher:
|
public interface CitationFetcher { |
There are currently two implementations.
Only one is used in the GUI:
|
this.citationFetcher = new SemanticScholarCitationFetcher(importerPreferences); |
The CLI offers selecting one:
|
CitationFetcher citationFetcher = switch (provider) { |
|
case CROSSREF -> { |
|
CliPreferences preferences = argumentProcessor.cliPreferences; |
|
AiService aiService = new AiService( |
|
preferences.getAiPreferences(), |
|
preferences.getFilePreferences(), |
|
preferences.getCitationKeyPatternPreferences(), |
|
LOGGER::info, |
|
new CurrentThreadTaskExecutor()); |
|
yield new CrossRefCitationFetcher( |
|
preferences.getImporterPreferences(), |
|
preferences.getImportFormatPreferences(), |
|
preferences.getCitationKeyPatternPreferences(), |
|
preferences.getGrobidPreferences(), |
|
aiService); |
|
} |
|
case SEMANTICSCHOLAR -> |
|
new SemanticScholarCitationFetcher( |
|
argumentProcessor.cliPreferences.getImporterPreferences() |
|
); |
|
}; |
Task
- Create
CitationFetcherFactory in package org.jabref.logic.importer.fetcher.citation. Use enum and INSTANCE
- Implement method
getCitationFetcher accepting a String as first paramter
- The method checks org.jabref.logic.importer.fetcher.citation.crossref.CrossRefCitationFetcher#getName / org.jabref.logic.importer.fetcher.citation.semanticscholar.SemanticScholarCitationFetcher#getName and returns a new instance of the fetcher. The parameters are a union of the parameters of the respective constructors
- Add a dropdown to the citation panel (the left panel)
- Dropdown has "CrossRef" and "SemanticScholar" as values
- DropDown state is stored in
org.jabref.gui.entryeditor.EntryEditorPreferences (see how other classes to that; also handle the default ("SemanticScholar")
- Location is somewhere at org.jabref.gui.entryeditor.citationrelationtab.CitationRelationsTab#getPaneAndStartSearch.
- Have org.jabref.toolkit.commands.GetCitedWorks#call using this factory.
- Minor: Change
Crossref to CrossRef at org.jabref.logic.importer.fetcher.citation.crossref.CrossRefCitationFetcher#getName
JabRef offers to display cited and citing papers.
Thereby, it used the interface
CitationFetcher:jabref/jablib/src/main/java/org/jabref/logic/importer/fetcher/citation/CitationFetcher.java
Line 15 in 939b018
There are currently two implementations.
Only one is used in the GUI:
jabref/jablib/src/main/java/org/jabref/logic/citation/SearchCitationsRelationsService.java
Line 33 in 939b018
The CLI offers selecting one:
jabref/jabkit/src/main/java/org/jabref/toolkit/commands/GetCitedWorks.java
Lines 47 to 67 in 939b018
Task
CitationFetcherFactoryin packageorg.jabref.logic.importer.fetcher.citation. UseenumandINSTANCEgetCitationFetcheraccepting aStringas first paramterorg.jabref.gui.entryeditor.EntryEditorPreferences(see how other classes to that; also handle the default ("SemanticScholar")CrossreftoCrossRefat org.jabref.logic.importer.fetcher.citation.crossref.CrossRefCitationFetcher#getName