Add 'RFC' entry generator ID-type option#3988
Conversation
Added RFC to BibTeX option to the drop-down menu of the id-based entry generator section of the new entry dialog. The RFC fetcher accepts entrys that include or exclude the rfc prefix. BibTex data is retreived from 'https://datatracker.ietf.org' (e.g. https://datatracker.ietf.org/doc/rfc1945/bibtex/'). A test for the fetcher is included; .
Siedlerchr
left a comment
There was a problem hiding this comment.
Overall looks good!
Please have a look at the Travis output which seems to fail
| @Override | ||
| public URL getURLForID(String identifier) throws URISyntaxException, MalformedURLException, FetcherException { | ||
| // Add "rfc" prefix if user's search entry was only digits | ||
| identifier = (!identifier.startsWith("rfc")) ? "rfc" + identifier : identifier; |
There was a problem hiding this comment.
Even better if you check for case insensitive with equals ignore case
stefan-kolb
left a comment
There was a problem hiding this comment.
I added a few comments, other than that the code looks fine 😄 👍
| entry.setField("number", "1945"); | ||
| entry.setField("howpublished", "{RfcFetcher 1945}"); | ||
| entry.setField("publisher", "{RfcFetcher Editor}"); | ||
| entry.setField("doi", "{10.17487/RFC1945}"); |
There was a problem hiding this comment.
Can you extract that BibEntry in the @beforeeach block and add a few more tests, e.g.:
- no id
- invalid
- id not found but valid
- id with rfc
- id without rfc
- ...
| Test for when 'RfcFetcher to Bibtex' help page is added | ||
|
|
||
| @Test | ||
| public void testGetHelpPage() { |
There was a problem hiding this comment.
If possible, we should add this help file now.
There was a problem hiding this comment.
This is also the problem that the tests/compiling fails:
/home/travis/build/JabRef/jabref/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java:36: error: cannot find symbol
return HelpFile.FETCHER_RFC;
^
symbol: variable FETCHER_RFC
location: class HelpFile
There was a problem hiding this comment.
Just submitted pull request for updated help files. I'll include change to the HelpFile enum and add helppage test after successful merge into the Help Repo. Thanks! :)
|
I've merged your help file change and restarted the travis build. so the help pages related error should be gone now! |
Add RFC fetcher that obtains more accurate BibTeX data than the DOI fetcher, includes test cases.
Add RFC fetcher that obtains more accurate BibTeX data than the DOI fetcher, includes test cases.
|
All set, thanks for all of your help! I've learned a lot about the process, and hopefully won't be as needy next time :) |
|
Thank you for your contribution 😄 ! Hope to see more from you in the future! |
| } | ||
|
|
||
| @Test | ||
| public void performSearchByIdThrowsExceptionWithInvalidIdentifier() throws Exception { |
There was a problem hiding this comment.
If this throws an Exception we should asert for the Exception!
There was a problem hiding this comment.
You cann use assertThrows() for this
fixes #3971
UI Image of entry type in dropdown
RFC, an additional ID-based entry generator ID type, has been added in order to fetch more complete BibTeX data compared to DOI fetches of RFC type.
Following the DiVA ID type classes as template, an RFC fetcher class and fetcher test has been added.
I added RFC to the ID-based entry generator list within WebFetchers so it is an option in the dialog's dropdown.
Currently, the RFC fetcher class accepts search requests with or without the "rfc" prefix--is this an okay feature?
Additionally, help in finding the best RFC BibTeX API. I am using the API referenced in #3971.
P.S. This is my first ever contribution to open source, so thanks for your patience... 😄