jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Add button to shorten the DOI

Open koppor opened this issue 1 year ago • 4 comments

JabRef renders the DOI in General -> DOI - Example DOI: 10.1038/ejcn.2011.64

Image

(See this: Open JabRef -> "New example library" -> "Tokede_2011")

JabRef allows to shorten the doi using the cleanup dialog: (Quality -> cleanup entries)

Image

Result:

10/bt29n7

Although this is technically OK, there should be a better way: A button "shorten" at the DOI editor

Image

Task:

  1. Copy IdentifierEditor.fxml to DoiIdentifierEditor.fxml
  2. Add button "shortenDoi" (you need to find a nice glyph)
  3. Copy IdentifierEditor.java to new package org.jabref.gui.fieldeditors.identifier.doi to DoiEditor
  4. Move DoiIdentifierEditorViewModel to the new package
  5. Remove doi logic from org.jabref.gui.fieldeditors.identifier.IdentifierEditor
  6. Adapt DoiEditor to contain the new button w/ the shortDoi functionality7. Add an if at org.jabref.gui.fieldeditors.FieldEditors#getForField before fieldProperties.contains(FieldProperty.IDENTIFIER to return the DoiEditor

koppor avatar Aug 03 '25 11:08 koppor

/assign-me

turhantolgaunal avatar Aug 03 '25 19:08 turhantolgaunal

👋 Hey @turhantolgaunal, thank you for your interest in this issue! 🎉

We're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.

For questions on JabRef functionality and the code base, you can consult the JabRef Guru or ask on our Gitter chat.

In case you encounter failing tests during development, please check our developer FAQs!

Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.

Happy coding! 🚀

github-actions[bot] avatar Aug 03 '25 19:08 github-actions[bot]

Copy IdentifierEditor.fxml to DoiIdentifierEditor.fxml

We have a mechnism in BaseIdentifierEditorViewModel to enable/disable actions based on type of identifier, so creating a new ID editor specifically for DOI is not necessary.

See BaseIdentifierEditorViewModel#configure.

HoussemNasri avatar Aug 06 '25 15:08 HoussemNasri

We think that this issue was fixed. Please head to https://builds.jabref.org/main to download a development build and try it out.

For any feedback, add a comment to the pull request at https://github.com/JabRef/jabref/pull/13657.

github-actions[bot] avatar Aug 08 '25 21:08 github-actions[bot]