JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.53k stars 2.47k forks source link

RIS export empty #4494

Closed vanukalla closed 4 years ago

vanukalla commented 5 years ago

Would it be possible to add key bindings for export (ctrl+E) and export selected entries (ctrl+shift+E)?

ishaan007 commented 5 years ago

@Siedlerchr I would like to get started on this, could you help out with steps to build the code and which java files to look into for this particular fix.

Thanks

Siedlerchr commented 5 years ago

@ishaan007 Thanks for your interest! Check out the Contributing.md https://github.com/JabRef/jabref/blob/master/CONTRIBUTING.md and the how to setup a local workspace https://github.com/JabRef/jabref/wiki/Guidelines-for-setting-up-a-local-workspace

Siedlerchr commented 5 years ago

The relevant java files are probably in the basePanel where the exportAction is called

ishaan007 commented 5 years ago

Thanks for this information @Siedlerchr. I have built the code. How do I run the app locally now? image

Siedlerchr commented 5 years ago

Either you setup Eclipse using ./gradlew eclipse or you import it into Intellij. To run you can use ./gradlew run

aman-coolinc1 commented 5 years ago

Hello,

ctrl+e is not available for Export ctrl+alt+e can be used and for export selected entries (ctrl+shift+E) can be used, is it fine, i have done changes and tested

RonakLakhotia commented 5 years ago

@Siedlerchr I would like to work on this issue. However, I am not sure if I understand how to go about this

Siedlerchr commented 5 years ago

We have an Enum for all actions which are listed there with their keybinding. https://github.com/JabRef/jabref/blob/master/src/main/java/org/jabref/gui/actions/StandardActions.java

You could look at the import database action to see how it's done and then apply it to the export action The action/menu item needs to be modified as well to support the keybinding

Siedlerchr commented 5 years ago

This should be fixed now, thanks to @RonakLakhotia

We would like to ask you to use a development build from https://builds.jabref.org/master and report back if it works for you. Please remember to make a backup of your library before trying-out this version.

vanukalla commented 5 years ago

Thanks for adding the functionality! I tested the key binding on the development build 5.0. It works fine when I select BibTex.xml as export format, importing the selected references into another file goes smoothly. However, when exporting references into ris format, which I usually use, the export file is empty and import - accordingly - gives an error:

org.jabref.logic.importer.ImportException: Could not find a suitable import format. at org.jabref.logic.importer.ImportFormatReader.importUnknownFormat(ImportFormatReader.java:233) at org.jabref.logic.importer.ImportFormatReader.importUnknownFormat(ImportFormatReader.java:184) at org.jabref.gui.importer.ImportAction.doImport(ImportAction.java:116) at org.jabref.gui.importer.ImportAction.lambda$automatedImport$1181(ImportAction.java:57) at org.jabref.gui.util.BackgroundTask$1.call(BackgroundTask.java:46) at org.jabref.gui.util.DefaultTaskExecutor$1.call(DefaultTaskExecutor.java:122) at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

This does not happen when using one of my "old" ris-export files created with Jabref-4.3.1. If you need any further informtaion, please tell me!

Siedlerchr commented 5 years ago

@vanukkalla I tried it and it works fine. Both export to RIS format and import of the file again. This is the sample bibtex entry I used:

@Article{Stigler,
  author    = {George J. Stigler},
  title     = {A Theory of Oligopoly},
  journal   = {Journal of Political Economy},
  year      = {1964},
  volume    = {72},
  number    = {1},
  issn      = {00223808, 1537534X},
  publisher = {University of Chicago Press},
  url       = {http://www.jstor.org/stable/1828791},
}

RIS file from epxort:

TY  - JOUR
AU  - Stigler, George J.
T1  - A Theory of Oligopoly
JO  - Journal of Political Economy
Y1  - 1964
VL  - 72
IS  - 1

UR  - http://www.jstor.org/stable/1828791

U1  - 00223808, 1537534X

ER  -

Import window: grafik

vanukalla commented 5 years ago

This is really weird! If I select entries in one library to export into RIS, Jabref5 says "RIS successfully exported", however, the file itself is empty. And when trying to import into another library, import fails (in Versions 4 and 5).

If I export into RIS in Jabref4, the entries are exported, the resulting file looks fine:

TY - JOUR AU - Ohe, Rintaro AU - Meng, Hong-Xue AU - Ye Aung, Naing AU - Yamada, Akane AU - Kabasawa, Takanobu AU - Utsunomiya, Aya AU - Tamazawa, Nobuyuki AU - Tamura, Yuka AU - Kitaoka, Takumi AU - Hashimoto, Toshio AU - Shibata, Kenichi AU - Toubai, Tomomi AU - Kimura, Wataru AU - Ishizawa, Kenichi AU - Yamakawa, Mitsunori T1 - Differential expression of estrogen receptor-α on follicular dendritic cells from patients with grade 1-2 and grade 3 follicular lymphoma. JO - Hematological oncology Y1 - 2019/february M3 - https://doi.org/10.1002/hon.2577 KW - CD23; estrogen receptor alpha; follicular dendritic cell; follicular lymphoma U1 - 1099-1069

and I am able to import into a library using Jabref 4 or Jabref5 as expected, everything works well.

If I export the selected entries in Jabref5 as plain bibtex library, I can append them to another library without problems. So while Jabref5 tells me that the export was successful, something is not working. And I just noticed in Thunar that the working ris files are labeled as "simple text document" while the ris files not working are labeled "SDL 3D-model (binary)".

The terminal does not give any information on what is going on.

Siedlerchr commented 5 years ago

So you are on linux? Could you please try the latest version from today ( 11-03) https://builds.jabref.org/master/ Could you please post the bibtex entry? Maybe it's something about this entry which fails.

vanukalla commented 5 years ago

Xubuntu 18.04 LTS and openjdk which works smoothly for JabRef4.3.1.

The entry is:

@Article{Welzel2001,
 author    = {Welzel, N. and Le, T. and Marculescu, R. and Mitterbauer, G. and Chott, A. and Pott, C. and Kneba, M. and Du, M. and Kusec, R. and Drach, J. and Raderer, M. and Mannhalter, C. and Lechner, K. and Nadel, B. and Jaeger, U.},
  title     = {Templated nucleotide addition and immunoglobulin JIvHIv-gene utilization in t(11;14) junctions: implications for the mechanism of translocation and the origin of mantle cell lymphoma},
  journal   = {Cancer Res},
  year      = {2001},
  volume    = {61},
  pages     = {1629--1636},
  abstract  = {LL Genetics  pdfs1  electronic only},
  comment   = {00001},
  timestamp = {2016.10.03},
}

which is just one of over 20 I tried in different combinations and with different export settings.

Using today's snapshot does not change anything on what I observe, although, it is the first time that I actually see the import window opening in JabRef5. But, as before, while V5.0 tells me export was successful, the file is empty and nothing can be marked for import, V4.3.1 exports everything as intended and import works for both versions. As I noted before, those ris-files that actually contain an entry are defined as text documents, those that are empty are unknown filetypes.

Siedlerchr commented 5 years ago

@vanukkalla Okay, this is odd. @CaptainDaVinci did not have any problems with Arch Linux. So I suggest it might be something with the Preferences. Try to reset your preferences and report back if it works again

vanukalla commented 5 years ago

Its getting weirder. I tried Version5 also on Debian Stretch and Win7. It all results in the same. Jabref reports successful export of selected entries. The files are of unknown filetype. When importing, the import window opens but no entry is visible, therefore no import into library. These ris files look empty when I open them on linux using the texteditor or leafpad. When opening them with the Editor on Win7 or with Atom on linux the entry actually is visible. Resetting the preferences did not change anything. I get the impression that the export process does something to the file so that it is not marked as text file but rather some sort of programming/executable file.

tobiasdiez commented 5 years ago

What exactly are the steps you use to export the entries?

vanukalla commented 5 years ago

I select the entry / entries. Ctrl+Shift+E or export selected entries, select RIS format, type filename.ris, Save.

Siedlerchr commented 4 years ago

Closing this issue due to inactivity :zzz: Please reopen the issue with additional information if the problem persists.