Skip to content

Conversation

@lenhard
Copy link
Member

@lenhard lenhard commented Jan 17, 2018

Meeting time is programming time :)

This addresses the import related things described in #3634 #2607

I basically went through the lists linked by @dsifford in the first issue, tried to adapt our import if possible and added custom fields when not. Our importer tests are still running.


  • Change in CHANGELOG.md described
  • Tests created for changes
  • Screenshots added (for bigger UI changes)
  • Manually tested changed features in running JabRef
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)

@lenhard lenhard added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jan 17, 2018
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.

The changes look good. A few of the additional fields are actually standard biblatex fields (or have an equivalent one) and thus should be added to the FieldName enum. Apart from these minor points, this can be merged.

else if ("AV".equals(tag)) {
fields.put("archive_location", value);
} else if ("C3".equals(tag)) {
fields.put("event", value);
Copy link
Member

@tobiasdiez tobiasdiez Jan 17, 2018

Choose a reason for hiding this comment

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

Biblatex has eventtitle

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

} else if ("DB".equals(tag)) {
fields.put("archive", value);
} else if ("N1".equals(tag) || "RN".equals(tag)) {
fields.put("note", value);
Copy link
Member

Choose a reason for hiding this comment

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

Note is a standard biblatex field and thus should be added to FieldName

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

} else if ("SE".equals(tag)) {
fields.put("section", value);
} else if ("ST".equals(tag)) {
fields.put("shortTitle", value);
Copy link
Member

Choose a reason for hiding this comment

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

shorttitle is a standard biblatex field

Copy link
Member Author

Choose a reason for hiding this comment

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

shorttitle wasn't even part of FieldName so far. I have added it now.

} else if ("ST".equals(tag)) {
fields.put("shortTitle", value);
} else if ("C2".equals(tag)) {
fields.put("pubmed-identifier", value);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if we are already have a PMID field. If not, the (biblatex) standard is to specify it in the format

eprint = {<pmid>},
eprinttype = {pubmed},

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

} else if ("C2".equals(tag)) {
fields.put("pubmed-identifier", value);
} else if ("TA".equals(tag)) {
fields.put("translator", value);
Copy link
Member

Choose a reason for hiding this comment

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

translator is also a standard biblatex field

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@lenhard
Copy link
Member Author

lenhard commented Jan 17, 2018

@tobiasdiez Thanks a lot! I didn't have biblatex in mind when setting the fields. Your comments are all integrated.

Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

LGTM, but I would really prefer if you could add a simple test

} else if ("BT".equals(tag)) {
fields.put(FieldName.BOOKTITLE, value);
} else if ("T2".equals(tag) && (fields.get(FieldName.JOURNAL) == null || "".equals(fields.get(FieldName.JOURNAL)))) {
} else if (("T2".equals(tag) || "J2".equals(tag) || "JA".equals(tag)) && (fields.get(FieldName.JOURNAL) == null || "".equals(fields.get(FieldName.JOURNAL)))) {
Copy link
Member

Choose a reason for hiding this comment

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

This would have been optimal to use a switch case, which is very efficient for strings, but that's a bit of personal taste ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right in terms of efficiency, but I really don't like switches. It is just to easy to forget the break statement. That doesn't happen if you stick to if and always use braces.

@lenhard
Copy link
Member Author

lenhard commented Jan 18, 2018

Is the RISImporterTestFiles class not executed during the travis build? Because those tests were actually partly broken. Anyway, I adapted them to the new import structure (which changes a few fields) and I added the RIS code from #3634 as a new test case.

@Siedlerchr
Copy link
Member

Regarding the test, seems to be a general problem with the parameterized tests and the new junit ä.
I noticed the same with the office XML tests

@lenhard
Copy link
Member Author

lenhard commented Jan 18, 2018

Ok, then this is something that really needs fixing. I'll open an issue for it. Otherwise this PR is ready to merge from my point of view.

@lenhard
Copy link
Member Author

lenhard commented Jan 21, 2018

In the spirit of getting things done and because all reviewer comments have been addressed, I'll merge this now.

@lenhard lenhard merged commit 733da31 into master Jan 21, 2018
@lenhard lenhard deleted the fix-ris-import branch January 21, 2018 13:02
Siedlerchr added a commit that referenced this pull request Jan 21, 2018
* upstream/master:
  Extend RIS import with multiple fields (#3642)
  Fix ICAR fetcher test which resulted in build failure (#3654)
Siedlerchr added a commit that referenced this pull request Jan 24, 2018
* upstream/master: (46 commits)
  Replace openoffice jars with libreoffice  jars (#3662)
  Export no empty lines in RIS format (#3661)
  Remove apache commons logging in favor of slf4j + log4j for JAVA 9 (#3653)
  fix isbn fetcher test as Joshua Bloch has published a new revivsion of Effetive Java convert to junit5 jupiter
  Extend RIS import with multiple fields (#3642)
  Fix ICAR fetcher test which resulted in build failure (#3654)
  New translations JabRef_en.properties (French) (#3650)
  Add link to MADR and fix typo
  [WIP] Add "Convert to BibTeX format" cleanup (#3541)
  Fix typo
  Fix typo
  Quickfix to get build running on all platforms (#3638)
  New translations JabRef_en.properties (French)
  New translations JabRef_en.properties (Vietnamese)
  New translations JabRef_en.properties (Chinese Simplified)
  New translations JabRef_en.properties (Dutch)
  New translations JabRef_en.properties (French)
  New translations JabRef_en.properties (German)
  New translations JabRef_en.properties (Greek)
  New translations JabRef_en.properties (Indonesian)
  ...
@lenhard lenhard mentioned this pull request Jan 25, 2018
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants