-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
component: citation-relationsgood first issueAn issue intended for project-newcomers. Varies in difficulty.An issue intended for project-newcomers. Varies in difficulty.📍 AssignedAssigned by assign-issue-action (or manually assigned)Assigned by assign-issue-action (or manually assigned)🔔 reminder-sent
Description
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
| public interface CitationFetcher { |
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
| this.citationFetcher = new SemanticScholarCitationFetcher(importerPreferences); |
The CLI offers selecting one:
jabref/jabkit/src/main/java/org/jabref/toolkit/commands/GetCitedWorks.java
Lines 47 to 67 in 939b018
| 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
CitationFetcherFactoryin packageorg.jabref.logic.importer.fetcher.citation. UseenumandINSTANCE - Implement method
getCitationFetcheraccepting aStringas 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
CrossreftoCrossRefat org.jabref.logic.importer.fetcher.citation.crossref.CrossRefCitationFetcher#getName
Metadata
Metadata
Assignees
Labels
component: citation-relationsgood first issueAn issue intended for project-newcomers. Varies in difficulty.An issue intended for project-newcomers. Varies in difficulty.📍 AssignedAssigned by assign-issue-action (or manually assigned)Assigned by assign-issue-action (or manually assigned)🔔 reminder-sent
Type
Projects
Status
Assigned