Add 15 non-standard BibLaTeX entry types with .withType() method#14534
Conversation
| 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.
Duplicate here and add all the other new descriptions
| public class KeyCollisionException extends RuntimeException { | ||
|
|
||
| private String id; | ||
| private @Nullable String id; |
| */ | ||
| public class BiblatexEntryTypeDefinitions { | ||
|
|
||
| static final BibEntryType MISC = new BibEntryTypeBuilder() |
There was a problem hiding this comment.
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.
This is unnecesary, we already hava. constructor
Siedlerchr
left a comment
There was a problem hiding this comment.
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)
| 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.
We like alphabetical ordering - please keep the position
There was a problem hiding this comment.
understood . on it
…java Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
…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.
This looks like an artifact from another PR...
There was a problem hiding this comment.
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.
@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.
No, do not create another PR. Just fix / cleanup your branch and push it. the GitHub PR will be updated automatically.
This reverts commit 430b6b9. Clean PR
| - We added 15 non-standard BibLaTeX entry types (Artwork, Audio, Bibnote, Commentary, Image, Jurisdiction, Legislation, Legal, Letter, Movie, Music, Performance, Review, Standard, Video) available in BibLaTeX mode only. These types are displayed in a dedicated "Non-standard types" group in the New Entry dialog and in the context menu. [#12963](https://github.com/JabRef/jabref/issues/12963) | ||
| - Improved merge dialog decisions for fields containing person names (e.g., `author`, `editor`) by using a new plausibility comparator. JabRef now prefers the side with more detailed/complete author information. [#14454](https://github.com/JabRef/jabref/issues/14454) | ||
| - We added 15 non-standard BibLaTeX entry types (Artwork, Audio, Bibnote, Commentary, Image, Jurisdiction, Legislation, Legal, Letter, Movie, Music, Performance, Review, Standard, Video) available in BibLaTeX mode only. These types are displayed in a dedicated "Non-standard types" group in the New Entry dialog and in the context menu. [#12963](https://github.com/JabRef/jabref/issues/12963) |
| | [ScienceDirect](https://www.sciencedirect.com) | [Elsevier Dev Portal](https://dev.elsevier.com/) | `ScienceDirectApiKey` | | | ||
| | [SemanticScholar](https://www.semanticscholar.org/) | <https://www.semanticscholar.org/product/api#api-key-form> | `SemanticScholarApiKey` | [20.000 calls/week](https://dev.elsevier.com/api_key_settings.html) | | ||
| | [ScienceDirect](https://www.sciencedirect.com) | [Elsevier Dev Portal](https://dev.elsevier.com/) | `ScienceDirectApiKey` | [20.000 calls/week](https://dev.elsevier.com/api_key_settings.html) | | ||
| | [SemanticScholar](https://www.semanticscholar.org/) | <https://www.semanticscholar.org/product/api#api-key-form> | `SemanticScholarApiKey` | | |
There was a problem hiding this comment.
I am not sure about this change - Do we have an issue with GitHub?
main shows at https://github.com/JabRef/jabref/blob/main/docs/code-howtos/fetchers.md
There was a problem hiding this comment.
I think some merge went wrong
There was a problem hiding this comment.
I merged main and I think it disappeared
There was a problem hiding this comment.
I merged main and I think it disappeared
There was a problem hiding this comment.
I merged main and I think it disappeared
koppor
left a comment
There was a problem hiding this comment.
I fixed the CHANGELOG.md for myself.
…Ref#14534) * Add 15 non-standard BibLaTeX entry types with .withType() method * updated ChangeLog.md * fixed formatting issue * fixed Formatting * fixed Checkstyle's DeclarationOrder * fix checkstyle errors * fixed Key Collision error * New Crowdin updates (JabRef#14535) * 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) * Revise JavaDoc links in README.md (JabRef#14533) * applied given changes * fixed formatting * fixed formatting * Update jabgui/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java Co-authored-by: Oliver Kopp <kopp.dev@gmail.com> * fixed alphabatical ordering * Fix link * Proxy Preference reset (JabRef#14554) * Fix typos (JabRef#14552) * Add LlmPlainCitationParserTest (JabRef#14553) * Junie try 1 * Refine test * Fix casing * updated ChangeLog.md * moved the non-standard types to their own own enum class and updated the connected files * eevert "Proxy Preference reset (JabRef#14554)" This reverts commit 430b6b9. Clean PR * Fix CHANGELOG.md --------- Co-authored-by: Christoph <siedlerkiller@gmail.com> Co-authored-by: Oliver Kopp <kopp.dev@gmail.com> Co-authored-by: Lalit Kumar Verma <lalit2506verma@gmail.com>
* upstream/main: (23 commits) Chore(deps): Bump org.mockito:mockito-core in /jablib (#14611) Chore(deps): Bump actions/download-artifact from 6 to 7 (#14605) Chore(deps): Bump com.squareup.okio:okio-jvm in /versions (#14613) Chore(deps): Bump DavidAnson/markdownlint-cli2-action from 21 to 22 (#14607) Chore(deps): Bump org.mockito:mockito-core in /versions (#14615) New translations jabref_en.properties (Italian) (#14596) Reset and Import for GroupsPreferences (#14572) Enable parallel tests (#14571) Copy over label in all cases Also allow adding label Fix workflow (#14586) Unassign issues on stale (#14585) Increase max assignments from 1 to 2 Reduce time for initial PR to 14 days (#14580) New Crowdin updates (#14579) chore(deps): update dependency org.eclipse.jgit:org.eclipse.jgit.pgm to v7.5.0.202512021534-r (#14577) Fix stale closing Try to fix commenting on closed PRs Add 15 non-standard BibLaTeX entry types with .withType() method (#14534) New Crowdin updates (#14570) ...
…Ref#14534) * Add 15 non-standard BibLaTeX entry types with .withType() method * updated ChangeLog.md * fixed formatting issue * fixed Formatting * fixed Checkstyle's DeclarationOrder * fix checkstyle errors * fixed Key Collision error * New Crowdin updates (JabRef#14535) * 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) * Revise JavaDoc links in README.md (JabRef#14533) * applied given changes * fixed formatting * fixed formatting * Update jabgui/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java Co-authored-by: Oliver Kopp <kopp.dev@gmail.com> * fixed alphabatical ordering * Fix link * Proxy Preference reset (JabRef#14554) * Fix typos (JabRef#14552) * Add LlmPlainCitationParserTest (JabRef#14553) * Junie try 1 * Refine test * Fix casing * updated ChangeLog.md * moved the non-standard types to their own own enum class and updated the connected files * eevert "Proxy Preference reset (JabRef#14554)" This reverts commit 430b6b9. Clean PR * Fix CHANGELOG.md --------- Co-authored-by: Christoph <siedlerkiller@gmail.com> Co-authored-by: Oliver Kopp <kopp.dev@gmail.com> Co-authored-by: Lalit Kumar Verma <lalit2506verma@gmail.com>
|
@shubhamk0205 This PR caused some issues (see #14985 and #14984). Either we fix it with a follow up PR or we have to revert this one before the JabRef 6.0 release. What's your opinion? Do you have time and willingness for a follow up? |
sure i will start working on the fix |
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)