Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where back navigation selected a deleted entry instead of skipping it. [#17353](https://github.com/JabRef/jabref/issues/17353)
- We fixed the linked file tooltip showing the old file name after renaming or moving the file. [#9277](https://github.com/JabRef/jabref/issues/9277)
- We fixed an issue where citationcount, day, and dayfiled columns were sorted alphabetically instead of numerically. [#17459](https://github.com/JabRef/jabref/issues/17459)
- We fixed an issue where the Hayagriva YAML export failed for libraries containing performance or custom entry types. [#17620](https://github.com/JabRef/jabref/issues/17620)

## [6.0-beta.1] - 2026-09-21

Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
package org.jabref.logic.layout.format;

import org.jabref.logic.layout.LayoutFormatter;
import org.jabref.model.entry.types.BiblatexNonStandardEntryType;
import org.jabref.model.entry.types.EntryTypeFactory;
import org.jabref.model.entry.types.StandardEntryType;

public class HayagrivaType implements LayoutFormatter {

@Override
public String format(String value) {
return switch (StandardEntryType.valueOf(value)) {
case Article,
Conference ->
return switch (EntryTypeFactory.parse(value)) {
case StandardEntryType.Article,
StandardEntryType.Conference ->
"article";
case Book ->
case StandardEntryType.Book ->
"book";
case InBook ->
case StandardEntryType.InBook ->
"chapter";
case Report,
TechReport ->
case StandardEntryType.Report,
StandardEntryType.TechReport ->
"report";
case Thesis,
MastersThesis,
PhdThesis ->
case StandardEntryType.Thesis,
StandardEntryType.MastersThesis,
StandardEntryType.PhdThesis ->
"thesis";
case WWW,
Online ->
case StandardEntryType.WWW,
StandardEntryType.Online ->
"web";
case Proceedings ->
case StandardEntryType.Proceedings ->
"proceedings";
case Reference ->
case StandardEntryType.Reference ->
"reference";
case BiblatexNonStandardEntryType.Performance ->
"performance";

default ->
"Misc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.entry.types.BiblatexNonStandardEntryType;
import org.jabref.model.entry.types.StandardEntryType;
import org.jabref.model.entry.types.UnknownEntryType;
import org.jabref.model.metadata.SaveOrder;

import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -353,5 +355,50 @@ final void exportsIssnNestedUnderSerialNumber(@TempDir Path tempFile) throws IOE

assertEquals(expected, Files.readAllLines(file));
}

@Test
final void exportsPerformanceEntryWithPerformanceType(@TempDir Path tempFile) throws IOException, SaveException, ParserConfigurationException, TransformerException {
BibEntry entry = new BibEntry(BiblatexNonStandardEntryType.Performance)
.withCitationKey("Example2024Performance")
.withField(StandardField.TITLE, "Example Performance Title")
.withField(StandardField.AUTHOR, "Example Author")
.withField(StandardField.DATE, "2024-09-12")
.withField(StandardField.LOCATION, "Example City")
.withField(StandardField.URL, "https://example.org/event");

Path file = tempFile.resolve("RandomFileName");
Files.createFile(file);
hayagrivaYamlExporter.export(databaseContext, file, List.of(entry));

List<String> expected = List.of(
"Example2024Performance:",
" type: performance",
" title: \"Example Performance Title\"",
" author:",
" - Author, Example",
" date: 2024-09-12",
" location: Example City",
" url: https://example.org/event");

assertEquals(expected, Files.readAllLines(file));
}

@Test
final void exportsUnknownEntryTypeAsMisc(@TempDir Path tempFile) throws IOException, SaveException, ParserConfigurationException, TransformerException {
BibEntry entry = new BibEntry(new UnknownEntryType("mycustomtype"))
.withCitationKey("test")
.withField(StandardField.TITLE, "Test Title");

Path file = tempFile.resolve("RandomFileName");
Files.createFile(file);
hayagrivaYamlExporter.export(databaseContext, file, List.of(entry));

List<String> expected = List.of(
"test:",
" type: Misc",
" title: \"Test Title\"");

assertEquals(expected, Files.readAllLines(file));
}
}

Loading