Question about developing JabRef - location of new entry || location of new authorlist

I’ve been tasked to add a new feature to JabRef but I’m having problems identifying where (or when) a new object entry is created. I needed to identify that since I need to also check where an AuthorList is created with the given info after adding the new entry. Does anyone know?

Hello and welcome!

  1. I’d suggest starting at the AuthorList creation in AuthorList.parse(…). Most IDE’s have a function “find usages” or similar that will tell you where it is being used.
  2. The string parsing code is a bit of a mess, and unless you really need to, I’d not recommend spending too much time on it.
  3. What do you mean with “new object entry”? An entry/row in the main table of JabRef?

@Siedlerchr thank you for linking me, I hadn’t seen this one!

Hey there! To clarify, by entry I meant a BibEntry. Would it be possible for us to get in contact? I’m having trouble doing what I wanted.

I think I might be hard to get hold of during the holidays :confused:
Generally speaking, using our Gitter, these forums, or submitting an issue/PR and using the @mentions should all work.

Regarding where/when an entry is created depends on how it is created and what it is created for. Can you tell me a bit more about what you wanted and I might be able to help you better? Is there an issue on GitHub for it?

In a nutshell, a BibEntry consists of “fields” that are just text strings. E.g., it could contain a StandardField.AUTHOR Kob the-Kob. Those strings are usually created by BibEntry.setField.
The AuthorListParser takes one of those string and tries to make it into an AuthorList
AuthorLists are mostly used to make it easier to display/export list of Authors (since they are easier to manage if you can literally think of them as lists of Authors)

I am trying to make a simple addition: display a CoAuthorList in a New tab of an entry for each author it has. A co author should be any author besides oneself a main author has worked with, or, in other words, all the authors that main author is with in every entry. I tried to create a CoAuthorList and making it a singleton of each Author, but I’m having trouble figuring out how to go through every single entry in JabRef and extracts their authors to add them to each authors’ CoAuthorList. This should also work when adding or removing an entry, adding and removing the correct authors from that CoAuthorList, situations that I can’t identify where they happen and how they store the authors of an entry. Also, I tried to focus this problem to just BibEntries, but if it is possible to do it for all types of entries that would be cool. Thanks again for your time!

I don’t know about the functionality itself, perhaps someone else can comment on that. Perhaps using the fetchers would be an alternative approach for finding co-authors? (although I don’t think that the Google Scholar fetcher works right now).

Also, I am not 100% sure that this is a simple addition.

From a technical point of view,
Not sure, but I’d guess StateManager.getOpenDatabases() → BibDatabase.getEntries() → BibEntry.getFieldsObservable() is a good starting point.

  • All entries should be BibEntries, I don’t believe you’ll have to worry about that.
  • I am not too familiar with these parts of the code, but for fetching BibEntries I’d start with
    • BibDatabaseContext.getEntries() or BibDatabase.getEntries(), and to listen for changes you can either try
      • BibDatabase.getEntries() (observable list, JavaFX)
      • BibEntry.getFieldsObservable() (observable, JavaFX, you are probably only interested in the StandardField.AUTHOR)
      • BibEntry.registerListener() (EventBus, perhaps with the FieldChangedEvent)
  • I am not sure how to access all open databases, I’d start looking at the StateManager.getOpenDatabases, and see how other parts of JabRef use it.

This strongly relates to discussions on a rewrite of the entry editor - Entry editor: move from textfields to more intelligent controls · Issue #6191 · JabRef/jabref · GitHub and New concept for the entry editor · Issue #6856 · JabRef/jabref · GitHub

Issues discussing the entry editor can be found at Issues · JabRef/jabref · GitHub

This also relates to Add support for ORCID · Issue #122 · koppor/jabref · GitHub.

We have ParsedBibEntry somewhere. This should be handed over to the EntryEditor? Making AuthorList more close to a first class citizen when editing an entry.