Skip to content

Conversation

@shubhamk0205
Copy link
Contributor

@shubhamk0205 shubhamk0205 commented Dec 6, 2025

Closes #12963

Adds 15 non-standard BibLaTeX entry types (Artwork, Audio, Bibnote, Commentary, Image, Jurisdiction, Legislation, Legal, Letter, Movie, Music, Performance, Review, Standard, Video) that are hard-coded and only available in BibLaTeX mode. These types are displayed in a dedicated "Non-standard Types" group in the New Entry dialog and in the context menu. The implementation introduces a .withType() method to BibEntryType that allows creating type variants with the same field definitions, enabling all 15 types to be implemented as one-liners based on the MISC entry type.

Steps to test

Prerequisites: Ensure the library is in BibLaTeX mode (Library → Library Properties → General → Library mode = "biblatex").

  1. New Entry dialog: Press Ctrl+N → Scroll to "Non-standard types" section → Verify all 15 types are visible with tooltips → Click any type to create an entry → Verify correct type is set.

  2. Context menu: Right-click an entry → "Change entry type" → "Non-standard Types" → Verify all 15 types listed → Select a type → Verify entry type changes → Confirm no duplicates in main menu.

  3. BibTeX mode: Switch to BibTeX mode → Open New Entry dialog → Verify "Non-standard types" section is hidden → Right-click entry → Verify "Non-standard Types" submenu is not present.

  4. Persistence: Create entry with non-standard type → Add fields → Save library → Close and reopen → Verify entry type persists.

Screenshots

image image

Mandatory checks

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Dec 6, 2025
// Non-standard Types (BibLaTeX only) - these use the @misc driver in standard bibliography styles
// Descriptions are taken from subsection 2.1.3 of the biblatex package documentation.
case Artwork ->
Localization.lang("Works of the visual arts such as paintings, sculpture, and installations.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these need do be added to en.properties

Plain\ citation\ parsing\ may\ generate\ inappropriate\ results.=Plain citation parsing may generate inappropriate results.
Recommended\ types=Recommended types
Non-standard\ types=Non-standard types
Non-standard\ Types=Non-standard Types
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate here and add all the other new descriptions

public class KeyCollisionException extends RuntimeException {

private String id;
private @Nullable String id;
Copy link
Member

@Siedlerchr Siedlerchr Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not modify this class

*/
public class BiblatexEntryTypeDefinitions {

static final BibEntryType MISC = new BibEntryTypeBuilder()
Copy link
Member

@Siedlerchr Siedlerchr Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move to the old position after article, makes it easer to review the changes and I don't think there are some

* @param newType The new EntryType to use
* @return A new BibEntryType instance with the new type but same field definitions
*/
public BibEntryType withType(@NonNull EntryType newType) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecesary, we already hava. constructor

Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments
Also you are missing tests

Siedlerchr and others added 5 commits December 7, 2025 03:54
* New translations jabref_en.properties (French)

* New translations jabref_en.properties (Spanish)

* New translations jabref_en.properties (Danish)

* New translations jabref_en.properties (German)

* New translations jabref_en.properties (Greek)

* New translations jabref_en.properties (Italian)

* New translations jabref_en.properties (Japanese)

* New translations jabref_en.properties (Korean)

* New translations jabref_en.properties (Dutch)

* New translations jabref_en.properties (Norwegian)

* New translations jabref_en.properties (Polish)

* New translations jabref_en.properties (Portuguese)

* New translations jabref_en.properties (Russian)

* New translations jabref_en.properties (Swedish)

* New translations jabref_en.properties (Turkish)

* New translations jabref_en.properties (Chinese Simplified)

* New translations jabref_en.properties (Vietnamese)

* New translations jabref_en.properties (Portuguese, Brazilian)

* New translations jabref_en.properties (Indonesian)

* New translations jabref_en.properties (Tagalog)
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Dec 7, 2025
Comment on lines 35 to 46
private static final BibEntryType MISC = new BibEntryTypeBuilder()
.withType(StandardEntryType.Misc)
.withRequiredFields(new OrFields(StandardField.AUTHOR, StandardField.EDITOR), StandardField.TITLE, StandardField.DATE)
.withImportantFields(
StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.HOWPUBLISHED, StandardField.LOCATION, StandardField.DOI,
StandardField.EPRINT, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE)
.withDetailFields(StandardField.LANGUAGE,
StandardField.TYPE, StandardField.VERSION, StandardField.NOTE, StandardField.ORGANIZATION,
StandardField.PAGETOTAL, StandardField.ADDENDUM, StandardField.PUBSTATE)
.build();

private static final BibEntryType BOOK = new BibEntryTypeBuilder()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We like alphabetical ordering - please keep the position

Copy link
Contributor Author

@shubhamk0205 shubhamk0205 Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

understood . on it

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Dec 7, 2025
…java

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Dec 7, 2025
@shubhamk0205 shubhamk0205 requested a review from koppor December 7, 2025 23:26
Dataset("Dataset");
Dataset("Dataset"),
// Non-standard Types (BibLaTeX only)
Artwork("Artwork"),
Copy link
Member

@Siedlerchr Siedlerchr Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These non standard types must be moved to it's own class, e.g. see BiblatexSoftwareEntryType or BiblatexApaEntryType

Comment on lines 45 to 61
Dataset("Dataset"),
// Non-standard Types (BibLaTeX only)
Artwork("Artwork"),
Audio("Audio"),
Bibnote("Bibnote"),
Commentary("Commentary"),
Image("Image"),
Jurisdiction("Jurisdiction"),
Legislation("Legislation"),
Legal("Legal"),
Letter("Letter"),
Movie("Movie"),
Music("Music"),
Performance("Performance"),
Review("Review"),
Standard("Standard"),
Video("Video");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is contradictory. Add non-standard entry types to Enum StandardEntryTypes.
I will not agree to this.

If it is absolutely necessary, then it must be a separate types class such as ieeeEntryTypes, if at all.
@JabRef/developers

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DevCall decision: We move forward with supporting these types hardcoded - in a separate class. As outlined by SiedlerChr.

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Dec 8, 2025
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Dec 8, 2025
Comment on lines +36 to +62
// Creates object with default preference values
private ProxyPreferences() {
this(
false, // useProxy: Whether to enable proxy usage
"", // proxyHostname: The hostname of proxy
"80", // proxyPort: Port number on which the proxy is listening
false, // useAuthentication: Whether proxy authentication should be enabled
"", // proxyUsername: Username for proxy authentication (if enabled)
"", // proxyPassword: Password for proxy authentication (if enabled)
false // persistPassword: Whether the proxy password should be saved/persisted
);
}

public static ProxyPreferences getDefault() {
return new ProxyPreferences();
}

public void setAll(ProxyPreferences preferences) {
this.useProxy.set(preferences.shouldUseProxy());
this.hostname.set(preferences.getHostname());
this.port.set(preferences.getPort());
this.useAuthentication.set(preferences.shouldUseAuthentication());
this.username.set(preferences.getUsername());
this.password.set(preferences.getPassword());
this.persistPassword.set(preferences.shouldPersistPassword());
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an artifact from another PR...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is not actually modified in this PR , it is identical to main , the commit appears in the history because i think it was merged from the main , but there are no actual changes to that file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@calixtus if u still want this to be removed from the history i will make a new clean pr with the same changes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, do not create another PR. Just fix / cleanup your branch and push it. the GitHub PR will be updated automatically.

@koppor koppor added the status: changes-required Pull requests that are not yet complete label Dec 8, 2025
@shubhamk0205 shubhamk0205 requested a review from calixtus December 9, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: changes-required Pull requests that are not yet complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Non-standard Types" of biblatex entry types

6 participants