koppor / jabref

Collection of simple for JabRef issues. Please submit PRs to https://github.com/jabRef/jabref/.
https://github.com/jabRef/jabref/
MIT License
8 stars 13 forks source link

Entry import should generate citation key #553

Closed koppor closed 2 years ago

koppor commented 2 years ago

When importing https://dx.doi.org/10.18417/emisa.4.1.1, the citation key is not generated, but used. That should be changed

Note: A few years ago, there was a strong discussion on that. This discussion should be found.

grafik

k3KAW8Pnf7mkmdSMPHz27 commented 2 years ago

Similar to https://github.com/JabRef/jabref/issues/895 ? Also similar to https://github.com/JabRef/jabref/issues/8354#issuecomment-1000281869 if it comes to running clean-up ops.

Siedlerchr commented 2 years ago

@koppor Do you have the Option "Generate new key for imported entries" under preferences -> import and export activated?

k3KAW8Pnf7mkmdSMPHz27 commented 2 years ago

@Siedlerchr I think it has a different code path. Unless I screwed up, that preference did nothing when I tried this import option

Siedlerchr commented 2 years ago

@k3KAW8Pnf7mkmdSMPHz27 you are right. I dug a bit into the code.

The code from the NewEntryTypeViewModel should be copied/reused to make it consistent. I'm preparing a PR

https://github.com/JabRef/jabref/blob/f0f7aa49765fe68b521cb0eb4ef43cd3e1e763af/src/main/java/org/jabref/gui/EntryTypeViewModel.java#L149-L177

The code in GenerateEntryFromIdAction: https://github.com/JabRef/jabref/blob/f0f7aa49765fe68b521cb0eb4ef43cd3e1e763af/src/main/java/org/jabref/gui/importer/GenerateEntryFromIdAction.java#L80-L95