Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ADS Fetcher using the new fetcher infrastructure #1923

Merged
merged 13 commits into from
Sep 21, 2016

Conversation

zesaro
Copy link
Contributor

@zesaro zesaro commented Sep 5, 2016

Recreate the ADS Fetcher from ADS using the new fetcher infrastructure #1594

  • Tests created for changes
  • Manually tested changed features in running JabRef

@zesaro zesaro force-pushed the adsfetcher branch 2 times, most recently from 6089cb7 to eff8deb Compare September 5, 2016 17:12

try {
URIBuilder uriBuilder = new URIBuilder(URL_PATTERN + key);
uriBuilder.addParameter("data_type", "BIBTEX");
Copy link
Member

Choose a reason for hiding this comment

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

If you pass "BIBTEXPLUS" as the data_type, then the abstract is also included and the second request below is unnecessary.

@tobiasdiez
Copy link
Member

Good timing! In #1929, I introduce the search-query-based ADS fetcher. Since some of the (apparently) open problems are already solved in #1929 (like the post-processing), I think it is best to wait with this PR until #1929 is merged. Or you create a PR onto tobiasdiez:newFetcher, whatever you like the best.

@tobiasdiez
Copy link
Member

Could you please integrate your AdsFetcher class with the new AstrophysicsDataSystem and use the new IdBasedParserFetcher (see #1998). Thanks.

# Conflicts:
#	src/main/java/net/sf/jabref/gui/importer/fetcher/EntryFetchers.java
#	src/test/java/net/sf/jabref/logic/importer/fetcher/IsbnFetcherTest.java
@zesaro
Copy link
Contributor Author

zesaro commented Sep 19, 2016

Travis fails the searchByQueryFindsEntry Test due to an IOException. When I run the tests locally I have no problems.
I also found another bug in the EntryTypeDialog. Because of the long name of the ADS Fetcher the JComboBox is larger and the Generate Buttons moves to the left on my Ubuntu system. I will investigate that.

@tobiasdiez tobiasdiez closed this Sep 19, 2016
@tobiasdiez tobiasdiez reopened this Sep 19, 2016
Copy link
Contributor

@tschechlovdev tschechlovdev left a comment

Choose a reason for hiding this comment

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

Beside some minor comments, LGTM.

@@ -90,6 +93,19 @@ public URL getURLForEntry(BibEntry entry) throws URISyntaxException, MalformedUR
}

@Override
public URL getURLForID(String identifier) throws URISyntaxException, MalformedURLException, FetcherException {
String key = identifier.replaceAll("^(doi:|DOI:)", "");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please extract pattern

+ "problems of this alternative paradigm at all astrophysical scales, and" + NEWLINE
+ "summarize the various theoretical attempts (TeVeS, GEA, BIMOND, and" + NEWLINE
+ "others) made to effectively embed this modification of Newtonian" + NEWLINE
+ "dynamics within a relativistic theory of gravity."+ NEWLINE);
Copy link
Contributor

Choose a reason for hiding this comment

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

Abstracts are copyright protected... Whether you can remove it or you have to take an other entry.

@Test(expected = FetcherException.class)
public void testPerformSearchByIdInvalidDoi() throws Exception {
Optional<BibEntry> fetchedEntry = fetcher.performSearchById("this.doi.will.fail");
assertEquals(Optional.empty(), fetchedEntry);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the assertEquals. You expect a exception and not an empty optional right?

Copy link
Member

Choose a reason for hiding this comment

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

I think you then have to use the fail(), otherwise it will produce a codecov or warning in Eclipse for about the test

Copy link
Contributor Author

@zesaro zesaro Sep 21, 2016

Choose a reason for hiding this comment

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

I replaced the assertEquals() with fail() and removed fetchedEntry. so just performSearch() is called :)

@zesaro zesaro changed the title [WIP] ADS Fetcher using the new fetcher infrastructure ADS Fetcher using the new fetcher infrastructure Sep 21, 2016
@tobiasdiez tobiasdiez merged commit 6fe9196 into JabRef:master Sep 21, 2016
@zesaro zesaro deleted the adsfetcher branch September 21, 2016 17:20
zesaro added a commit to zesaro/jabref that referenced this pull request Nov 22, 2016
* create new fetcher and test

* remove old fetcher

* remove obsolete keys

* add new fetcher in EntryFetchers

* include feedback use BIBTEXPLUS as type

* remove useless curly brackets

* rename test cases

* use IdBasedParserFetcher, update adsfetcher and test, add to entryfetchers

* integrate AdsFetcher into AstrophysicsDataSystem

* fix localization

* modify remove doi pattern and testPerformSearchByIdEmptyDOI

* remove abstract in existing entries and add new without any abstract by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants