-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add 15 non-standard BibLaTeX entry types with .withType() method #14534
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
base: main
Are you sure you want to change the base?
Conversation
| // 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."); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
Siedlerchr
left a comment
There was a problem hiding this 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
* 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)
jabgui/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java
Outdated
Show resolved
Hide resolved
| 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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood . on it
…java Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
| Dataset("Dataset"); | ||
| Dataset("Dataset"), | ||
| // Non-standard Types (BibLaTeX only) | ||
| Artwork("Artwork"), |
There was a problem hiding this comment.
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
| 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"); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
* Junie try 1 * Refine test * Fix casing
…the connected files
| // 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()); | ||
| } | ||
|
|
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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 toBibEntryTypethat 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").
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.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.
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.
Persistence: Create entry with non-standard type → Add fields → Save library → Close and reopen → Verify entry type persists.
Screenshots
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)