Skip to content

Rewrite org.jabref.logic.importer.fetcher.CustomizableKeyFetcher#getTestUrl to be a pattern #14016

@koppor

Description

@koppor

Currently, the assumption of org.jabref.logic.importer.fetcher.CustomizableKeyFetcher#getTestUrl is that the API key is appended.

It is appended at org.jabref.gui.preferences.websearch.WebSearchTabViewModel#checkCustomApiKey and then some fetch is done.

This does not work if the API key is used otherwise.

Task

  1. Replace default String getTestUrl() by boolean isValidKey(String apiKey.
    • Instead of checkCustomApiKey testing for the key, the fetcher itself does the test
    • No default implementaiton - all fetchers need to implement - stub: return true with a TODO that it needs to be implemented
  2. Remove the tests baseURLConstruction etc from org.jabref.logic.importer.fetcher.BiodiversityLibraryTest
  3. Implement checkCustomApiKey for org.jabref.logic.importer.fetcher.BiodiversityLibrary based on the existing idea. -- You can move code from WebSearchTabViewModel#checkCustomApiKey to here
  4. Adapt WebSearchTabViewModel#checkCustomApiKey to use the new interface
  5. Adapt org.jabref.logic.importer.fetcher.IEEE to test for api key - add new private getURLForQuery accepting an API key - and have the existing getURLForQuery make use of it - Use "JabRef API key test" as search (look at the code on how to construct a lucene query)

Metadata

Metadata

Assignees

Labels

good first issueAn issue intended for project-newcomers. Varies in difficulty.size: medium📌 Pinned📍 AssignedAssigned by assign-issue-action (or manually assigned)

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions