Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Include https://bibtex.chimbori.com/ as fallback for the ebook.de fetcher #2374

Merged
merged 3 commits into from
Dec 16, 2016

Conversation

koppor
Copy link
Member

@koppor koppor commented Dec 13, 2016

The fetcher offered by ebook.de does not offer bibtex for all valid ISBNs. This PR adds https://bibtex.chimbori.com/ as fallback for the ebook.de fetcher

Long discussion at: #684 (comment)

I created a meta IsbnFetcher and two separate fetchers for ebook.de and chimbori. I readded the URL field as this is the deal with both ebook.de and chimbori.

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef
  • [n/a] Check documentation status (Issue created for outdated help page at help.jabref.org?)
  • [n/a] If you changed the localization: Did you run gradle localizationUpdate?

Fixes #684

@koppor koppor force-pushed the isbnfetcherupdate branch 3 times, most recently from 183c1c2 to 630e054 Compare December 13, 2016 00:25
@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 13, 2016
Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments as I have no time right now for a real review

@Override
public Parser getParser() {
return new BibtexParser(importFormatPreferences);
IsbnViaEbookDeFetcher isbnViaEbookDeFetcher = new IsbnViaEbookDeFetcher(importFormatPreferences);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the architecture that a fetcher controls other fetcher. All of them should be completely independent and their working-together should be controlled at a higher level. Moreover, I would allow the user to choose between "ISBN (ebook.de)" and "ISBN (Chimbori/Amazon)", or is the quality of ebook's metadata really superior?

Copy link
Member Author

@koppor koppor Dec 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, it should be transparent to the user, so that he does not need think, what fetcher he wants to use. We could also offer all three fetchers to the user so that if he really wants to choose.

It is the deal with Chimbori that we use ebook.de first to reduce load on his server. The deal was made in personal emails I exchanged with the author of Chimbori


HttpResponse<String> postResponse;
try {
postResponse = Unirest.post("https://bibtex.chimbori.com/isbn-bibtex")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rewrite IdBasedParserFetcher so that it also supports POST actions (and maybe uses Unirest for it).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether it is worth the effort - I think, we currently have only one exception for that.


@Override
public void doPostCleanup(BibEntry entry) {
// We MUST NOT clean the URL. this is the deal with ebook.de
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see that we have such an agreement with ebook.de

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can forward you the emails I exchanged with them.

@koppor koppor added this to the v3.8 milestone Dec 13, 2016
@koppor
Copy link
Member Author

koppor commented Dec 13, 2016

Update: Fixes #2343

@koppor koppor force-pushed the isbnfetcherupdate branch 2 times, most recently from 8f765b3 to 74b5527 Compare December 13, 2016 22:34
- Introduce AbstractIsbnFetcher
- Name the fetchers differently
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.logic.util.ISBN;

public abstract class AbstractIsbnFetcher implements IdBasedParserFetcher {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here IdBasedFetcher should be sufficient and then IsbnViaEbookDeFetcher implements IdBasedParserFetcher (in addition to AbstractIsbnFetcher)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In IsbnViaChimboriFetcher, I need both doPostCleanup() and getParser() which are not offered by IdBasedFetcher.

Don't want to introduce a new intermediate class...

@tobiasdiez tobiasdiez removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 16, 2016
@koppor koppor merged commit 566541d into master Dec 16, 2016
@koppor koppor deleted the isbnfetcherupdate branch December 16, 2016 16:40
@manastungare
Copy link

It is the deal with Chimbori that we use ebook.de first to reduce load on his server. The deal was made in personal emails I exchanged with the author of Chimbori

This was our conversation regarding the version that I had self-hosted, before I set up the dedicated service at bibtex.chimbori.com. Feel free to send all your traffic to this new endpoint!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants