Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance customization of entry types #9840

Open
2 of 3 tasks
koppor opened this issue May 4, 2023 · 47 comments · May be fixed by #11230
Open
2 of 3 tasks

Enhance customization of entry types #9840

koppor opened this issue May 4, 2023 · 47 comments · May be fixed by #11230
Assignees
Labels
bib(la)tex good first issue An issue intended for project-newcomers. Varies in difficulty. ui

Comments

@koppor
Copy link
Member

koppor commented May 4, 2023

As user, I want to create a new entry type. For example, a new entry type "Person" with "name" and "googlescholar" as fields. JabRef offers advanced field handling for names, URLs, and more. This is implemented using org.jabref.model.entry.field.FieldProperty. The current dialog enables only the addition and deletion of fields. Not assigning field properties or changing the name.

Thus, TODOs:

  • Enable setting zero ore more org.jabref.model.entry.field.FieldPropertys. Should be done in a combo-box allowing multiple selections.
  • Enable update of name: I cannot fix typos in the name -- it should be possible to double click the name and then change the value:
  • Optional: Enable casing: I tried to add "GoogleScholar", but I could not type the capital "s". I think, users should be allowed to use arbitrary casing?

image

More information

@koppor koppor added the good first issue An issue intended for project-newcomers. Varies in difficulty. label May 4, 2023
@github-project-automation github-project-automation bot moved this to Free to take in Good First Issues May 4, 2023
@eric052199
Copy link

Hey team, can i work on this issue?

@ThiloteE ThiloteE added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label May 11, 2023
@ThiloteE ThiloteE moved this from Free to take to Reserved in Candidates for University Projects May 11, 2023
@ThiloteE ThiloteE moved this from Free to take to Reserved in Good First Issues May 11, 2023
@github-actions
Copy link
Contributor

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

@eric052199
Copy link

Hi, can you please explain more about the first todo? Not sure about what setting zero or more FieldProperty means.

@koppor
Copy link
Member Author

koppor commented May 12, 2023

@eric052199 For me, it is not clear, what is unclear to you ^^.

I try to write a few text on "Enable setting zero ore more org.jabref.model.entry.field.FieldPropertys." Please ask which item should I refine or if you need additional information.

  1. The class /src/main/java/org/jabref/model/entry/field/FieldProperty.java#L3 models properties of a field
  2. An EntryType specifies which fields are contained
  3. Custom Entry types are stored in /src/main/java/org/jabref/model/entry/types/UnknownEntryType.java#L8
  4. Custom Fields are stored in org.jabref.model.entry.field.UnknownField
  5. From the UI, a new Custom Entry Type is generated at org.jabref.gui.preferences.customentrytypes.CustomEntryTypesTabViewModel#addNewCustomEntryType
  6. org.jabref.gui.preferences.customentrytypes.CustomEntryTypesTabViewModel#addNewField is used to add a new field to the customized entry type
  7. There, org.jabref.gui.preferences.customentrytypes.FieldViewModel class is used to put a single FieldProperty. The issue is to be able to add more than one property
  8. JabRef saves the customized entry types into the .bib file:\
    @Comment{jabref-entrytype: person: req[Name] opt[Googlescholar;Orcid]}
  9. an example person looks as follows:\
    @Person{demo,
      name          = {Oliver Kopp},
      googlescholar = {https://scholar.google.de/citations?user=nB2GungAAAAJ&hl=de&oi=ao},
      orcid         = {https://orcid.org/0000-0001-6962-4290},
    }
  10. Proposal for the new format: Use | to separate field names with the list field properties:
   .orElse(new UnknownField(fieldName));
  • Note that I added -v2, because the new format is NOT backwards-compatible with the old one and thus JabRef users might loose data if they switch versions back and forth.
  • Note that there might be no field properties given. See discussion at No user info about changing bib-format in 4.0 #3251.
  • The proposal is NOT backwards-compatible. We can also come up with a completely new format. Nested JSON. Then, the string after jabref-entrytype-v2: needs to be forwarded to a JSON parser.

Hints:

  1. IDE hint: By holding Ctrl and then click with the mouse on an identifier, you can navigate to the usage of a class, method, etc.
  2. IDE hint: By holdingCtrl+Shift+F, you can search all text occurrences. Helpful to find some code.
  3. Please try to understand the current UI
  4. Add a sketch of the new UI - maybe this helps to understand the issue more
  5. Define the new data format for writing jabref-entrytype
  6. Add test cases for the new data format. The tests should go into org.jabref.logic.exporter.MetaDataSerializerTest.
  7. A new test class for org.jabref.logic.importer.util.MetaDataParser. Needs to be created. This can be done with Ctrl+Shift+T and then Enter. parseCustomEntryType should be tested.
  8. You can also work on org.jabref.model.entry.field.FieldFactoryTest, because org.jabref.model.entry.field.FieldFactory is called in MetaDataParser.
  9. Other tests are in org.jabref.model.entry.BibEntryTypesManagerTest
  10. More tests should go into org.jabref.logic.exporter.BibtexDatabaseWriterTest
  11. Please do test-driven development. Thus, please add test cases and then use the debugger to step into the methods. Then change the methods. With that, you save development time. If you use the GUI to test your implementation, you will be slow in developing.

@ThiloteE
Copy link
Member

"BibTEX does not distinguish between normal and capital letters in entry and field names"

- tamethebeast p. 20

@koppor
Copy link
Member Author

koppor commented May 16, 2023

The entry field casing is the least important wish of the issue. I have removed the requirement to put the focus on the important code changes.

Background information: The field capitalization refs JabRef/blog.jabref.org#47 and #8676

@koppor
Copy link
Member Author

koppor commented May 21, 2023

After this is fixed, please check if #5857 is also fixed.

@koppor
Copy link
Member Author

koppor commented Jun 8, 2023

@eric052199 I saw activity on the minor TODOs of this PR. May I ask if you work on the big TODO, too?

@koppor koppor removed the good first issue An issue intended for project-newcomers. Varies in difficulty. label Jun 8, 2023
@ThiloteE ThiloteE moved this from Reserved to In Progress in Candidates for University Projects Jun 8, 2023
@koppor koppor added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Jun 8, 2023
@koppor
Copy link
Member Author

koppor commented Jun 12, 2023

@DinjerChang @eric052199 #9993 is now merged.

Now, it should be even more easy to work to fix this issue. Please remind my hints at #9840 (comment). Please reach out if something is unclear.

@ThiloteE ThiloteE moved this from In Progress to Free to take in Good First Issues Jun 12, 2023
@ThiloteE ThiloteE moved this from Free to take to In Progress in Good First Issues Jun 12, 2023
@DinjerChang
Copy link
Contributor

DinjerChang commented Jun 12, 2023

@koppor Thank you very much! I'll hop on to it after finals.

@Xavieryyu
Copy link

Hi. Can I continue working on this issue?

@ThiloteE
Copy link
Member

Apparently, yes. Nice catch for noticing nobody was assigned ;-)

@Xavieryyu Xavieryyu removed their assignment Dec 5, 2023
@Siedlerchr Siedlerchr moved this from Reserved to Free to take in Good First Issues Jan 9, 2024
@Siedlerchr Siedlerchr moved this from Reserved to Free to take in Candidates for University Projects Jan 9, 2024
@Siedlerchr
Copy link
Member

This issue is free to take again! There is still only one thing missing

@enesbkoca
Copy link

Hey. I'd like to work on this issue, can you assign me to it? Thanks :)

@ThiloteE ThiloteE moved this from Free to take to Reserved in Good First Issues Feb 24, 2024
@ThiloteE ThiloteE moved this from Free to take to Reserved in Candidates for University Projects Feb 24, 2024
@koppor
Copy link
Member Author

koppor commented Feb 29, 2024

@enesbkoca Nice! Looking forward!

@enesbkoca
Copy link

Hi, I've looked into this issue, and it seems to be more complicated than I initially thought and due to time constraints I'm afraid I will not be able to implement this issue. For this reason I'd like to be unassigned, my apologies.

@enesbkoca enesbkoca removed their assignment Mar 27, 2024
@koppor koppor moved this from Reserved to Free to take in Good First Issues Mar 27, 2024
@koppor koppor moved this from Reserved to Free to take in Candidates for University Projects Mar 27, 2024
@koppor koppor removed the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Mar 27, 2024
@aqurilla
Copy link
Contributor

aqurilla commented Apr 7, 2024

Hi! I’d like to take up this issue

@ThiloteE ThiloteE moved this from Free to take to Reserved in Candidates for University Projects Apr 7, 2024
@ThiloteE ThiloteE moved this from Free to take to Reserved in Good First Issues Apr 7, 2024
@ThiloteE
Copy link
Member

ThiloteE commented Apr 7, 2024

Hi @aqurilla, nice to see you again :-)

@aqurilla
Copy link
Contributor

aqurilla commented Apr 7, 2024

@ThiloteE thankyou, happy to be back! :D

@aqurilla aqurilla linked a pull request Apr 21, 2024 that will close this issue
6 tasks
@ThiloteE
Copy link
Member

This change will add to the proliferation of undocumented entry types that will probably be shared with colleagues and in the wild. Maybe there should be some kind of documentation or "info" that points to the biblatex issue tracker for people that want to make their entry type "official".

@koppor
Copy link
Member Author

koppor commented Oct 19, 2024

Note that "nonWrappable" fields is the current configuration for multiline fields. With "wrappable" we meant that JabRef can automatically introduce linebreaks whenever it thinks, it is good.

@Siedlerchr
Copy link
Member

Originally there existed only the "wrappable fields" options, meant for saving the fields with linebreaks in between or not. This is important as otherwise, for example, a line break inside the content of the URL or DOI field would break the link in LaTeX documents when rendering.
Then it was misused as an easy way for users to be able to also configure it in the UI (entry editor).

However, these two features should be decoupled now!

@koppor
Copy link
Member Author

koppor commented Oct 19, 2024

Originally there existed only the "wrappable fields" options, meant for saving the fields with linebreaks in between or not. This is important as otherwise, for example, a line break inside the content of the URL or DOI field would break the link in LaTeX documents when rendering. Then it was misused as an easy way for users to be able to also configure it in the UI (entry editor).

However, these two features should be decoupled now!

No - see #12032.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bib(la)tex good first issue An issue intended for project-newcomers. Varies in difficulty. ui
Projects
Status: In Progress
Status: In Progress