Skip to content

Commit 9d17101

Browse files
hemantgsSiedlerchr
andauthored
[6574] Added support for biblatex-software (#6747)
* [6574] Added support for biblatex-software Added change to changelog md checkstyle fixed checkstyle fixed * Added changes to the ADR Co-authored-by: Christoph <siedlerkiller@gmail.com>
1 parent bee9651 commit 9d17101

File tree

10 files changed

+235
-6
lines changed

10 files changed

+235
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
3333
- We added a new fetcher to enable users to search all available E-Libraries simultaneously. [koppor#369](https://github.com/koppor/jabref/issues/369)
3434
- We added the field "entrytype" to the export sort criteria [#6531](https://github.com/JabRef/jabref/pull/6531)
3535
- We added the possibility to change the display order of the fields in the entry editor. The order can now be configured using drag and drop in the "Customize entry types" dialog [#6152](https://github.com/JabRef/jabref/pull/6152)
36+
- We added native support for biblatex-software [#6574](https://github.com/JabRef/jabref/issues/6574)
3637
- We added a missing restart warning for AutoComplete in the preferences dialog. [#6351](https://github.com/JabRef/jabref/issues/6351)
3738
- We added a note to the citation key pattern preferences dialog as a temporary workaround for a JavaFX bug, about committing changes in a table cell, if the focus is lost. [#5825](https://github.com/JabRef/jabref/issues/5825)
3839

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Add Native Support for BibLatex-Sotware
2+
* Deciders: Oliver Kopp
3+
4+
Technical Story: [6574-Adding support for biblatex-software](https://github.com/JabRef/jabref/issues/6574)
5+
6+
## Context and Problem Statement
7+
8+
JabRef does not right now have support for Biblatex-Software out of the box, users have to add custome entry type.
9+
With citing software becoming fairly common , native support is helpful.
10+
11+
12+
## Decision Drivers
13+
14+
* None of the existing flows should be impacted
15+
16+
## Considered Options
17+
18+
* Add the new entry types to the existing biblatex types
19+
* Add a divider with label Biblatex-Software under which the new entries are listed : Native support for Biblatex-Software
20+
* Support via customized entry types : A user can load a customized bib file
21+
22+
## Decision Outcome
23+
24+
Chosen option: Add a new divider, because comes out best (see below).
25+
26+
### Positive Consequences
27+
28+
* Inbuilt coverage for a entry type that is getting more and more importance
29+
30+
### Negative Consequences
31+
32+
* Adds a little bit more clutter to the Add Entry pane
33+
34+
## Pros and Cons of the Options
35+
36+
### Adding the new entry types to the existing biblatex types
37+
38+
* Good, because there is no need for a new category in the add entry pane
39+
40+
### Add a divider with label Biblatex-Software with relevant types
41+
42+
* Good, since this gives the user a bit more clarity
43+
44+
### Support via customized entry types
45+
46+
* Good, because no code needs to be changed
47+
* Bad, because documentation is needed
48+
* Bad, because the users are not guided through the UI, but have to do other steps.

src/main/java/org/jabref/gui/EntryType.fxml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
<FlowPane fx:id="biblatexPane" prefHeight="200.0" prefWidth="200.0"/>
2727
</content>
2828
</TitledPane>
29+
<TitledPane fx:id="biblatexSoftwareTitlePane" animated="false" collapsible="false" text="Biblatex-Software">
30+
<content>
31+
<FlowPane fx:id="biblatexSoftwarePane" prefHeight="200.0" prefWidth="200.0"/>
32+
</content>
33+
</TitledPane>
2934
<TitledPane fx:id="bibTexTitlePane" animated="false" collapsible="false" text="BibTeX">
3035
<content>
3136
<FlowPane fx:id="bibTexPane" prefHeight="200.0" prefWidth="200.0"/>

src/main/java/org/jabref/gui/EntryTypeView.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import javafx.application.Platform;
88
import javafx.event.Event;
99
import javafx.fxml.FXML;
10+
1011
import javax.inject.Inject;
12+
1113
import javafx.scene.control.Button;
1214
import javafx.scene.control.ButtonType;
1315
import javafx.scene.control.ComboBox;
@@ -27,6 +29,7 @@
2729
import org.jabref.model.database.BibDatabaseMode;
2830
import org.jabref.model.entry.BibEntryType;
2931
import org.jabref.model.entry.types.BiblatexEntryTypeDefinitions;
32+
import org.jabref.model.entry.types.BiblatexSoftwareEntryTypeDefinitions;
3033
import org.jabref.model.entry.types.BibtexEntryTypeDefinitions;
3134
import org.jabref.model.entry.types.EntryType;
3235
import org.jabref.model.entry.types.IEEETranEntryTypeDefinitions;
@@ -52,10 +55,12 @@ public class EntryTypeView extends BaseDialog<EntryType> {
5255
@FXML private FlowPane bibTexPane;
5356
@FXML private FlowPane ieeetranPane;
5457
@FXML private FlowPane customPane;
58+
@FXML private FlowPane biblatexSoftwarePane;
5559
@FXML private TitledPane biblatexTitlePane;
5660
@FXML private TitledPane bibTexTitlePane;
5761
@FXML private TitledPane ieeeTranTitlePane;
5862
@FXML private TitledPane customTitlePane;
63+
@FXML private TitledPane biblatexSoftwareTitlePane;
5964

6065
@Inject StateManager stateManager;
6166

@@ -140,9 +145,11 @@ public void initialize() {
140145
ieeeTranTitlePane.managedProperty().bind(ieeeTranTitlePane.visibleProperty());
141146
biblatexTitlePane.managedProperty().bind(biblatexTitlePane.visibleProperty());
142147
customTitlePane.managedProperty().bind(customTitlePane.visibleProperty());
148+
biblatexSoftwareTitlePane.managedProperty().bind(biblatexSoftwareTitlePane.visibleProperty());
143149

144150
if (basePanel.getBibDatabaseContext().isBiblatexMode()) {
145151
addEntriesToPane(biblatexPane, BiblatexEntryTypeDefinitions.ALL);
152+
addEntriesToPane(biblatexSoftwarePane, BiblatexSoftwareEntryTypeDefinitions.ALL);
146153

147154
bibTexTitlePane.setVisible(false);
148155
ieeeTranTitlePane.setVisible(false);
@@ -155,6 +162,7 @@ public void initialize() {
155162
}
156163
} else {
157164
biblatexTitlePane.setVisible(false);
165+
biblatexSoftwareTitlePane.setVisible(false);
158166
addEntriesToPane(bibTexPane, BibtexEntryTypeDefinitions.ALL);
159167
addEntriesToPane(ieeetranPane, IEEETranEntryTypeDefinitions.ALL);
160168

src/main/java/org/jabref/model/database/BibDatabase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ public class BibDatabase {
6161
private String epilog = "";
6262
private String sharedDatabaseID;
6363

64-
public BibDatabase() {
65-
this.registerListener(new KeyChangeListener(this));
66-
}
67-
6864
public BibDatabase(List<BibEntry> entries) {
6965
this();
7066
insertEntries(entries);
7167
}
7268

69+
public BibDatabase() {
70+
this.registerListener(new KeyChangeListener(this));
71+
}
72+
7373
/**
7474
* @param toResolve maybenull The text to resolve.
7575
* @param database maybenull The database to use for resolving the text.

src/main/java/org/jabref/model/entry/BibEntryTypesManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.jabref.model.entry.field.BibField;
1313
import org.jabref.model.entry.field.FieldFactory;
1414
import org.jabref.model.entry.types.BiblatexEntryTypeDefinitions;
15+
import org.jabref.model.entry.types.BiblatexSoftwareEntryTypeDefinitions;
1516
import org.jabref.model.entry.types.BibtexEntryTypeDefinitions;
1617
import org.jabref.model.entry.types.EntryType;
1718
import org.jabref.model.entry.types.EntryTypeFactory;
@@ -20,7 +21,7 @@
2021
public class BibEntryTypesManager {
2122
public static final String ENTRYTYPE_FLAG = "jabref-entrytype: ";
2223
private final InternalEntryTypes BIBTEX = new InternalEntryTypes(Stream.concat(BibtexEntryTypeDefinitions.ALL.stream(), IEEETranEntryTypeDefinitions.ALL.stream()).collect(Collectors.toList()));
23-
private final InternalEntryTypes BIBLATEX = new InternalEntryTypes(BiblatexEntryTypeDefinitions.ALL);
24+
private final InternalEntryTypes BIBLATEX = new InternalEntryTypes(Stream.concat(BiblatexEntryTypeDefinitions.ALL.stream(), BiblatexSoftwareEntryTypeDefinitions.ALL.stream()).collect(Collectors.toList()));
2425

2526
public BibEntryTypesManager() {
2627
}
@@ -97,6 +98,7 @@ public List<BibEntryType> getAllCustomTypes(BibDatabaseMode mode) {
9798
} else {
9899
return customizedTypes.stream()
99100
.filter(entryType -> BiblatexEntryTypeDefinitions.ALL.stream().noneMatch(biblatexType -> biblatexType.getType().equals(entryType.getType())))
101+
.filter(entryType -> BiblatexSoftwareEntryTypeDefinitions.ALL.stream().noneMatch(biblatexSoftware -> biblatexSoftware.getType().equals(entryType.getType())))
100102
.collect(Collectors.toList());
101103
}
102104
}

src/main/java/org/jabref/model/entry/field/StandardField.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@ public enum StandardField implements Field {
5555
FOREWORD("foreword", FieldProperty.PERSON_NAMES),
5656
FOLDER("folder"),
5757
GENDER("gender", FieldProperty.GENDER),
58+
HALID("hal_id"),
59+
HALVERSION("hal_version"),
5860
HOLDER("holder", FieldProperty.PERSON_NAMES),
5961
HOWPUBLISHED("howpublished"),
6062
IDS("ids", FieldProperty.MULTIPLE_ENTRY_LINK),
6163
INSTITUTION("institution"),
6264
INTRODUCTION("introduction", FieldProperty.PERSON_NAMES),
65+
INTRODUCEDIN("introducedin"),
6366
ISBN("isbn", "ISBN", FieldProperty.ISBN),
6467
ISRN("isrn", "ISRN"),
6568
ISSN("issn", "ISSN"),
@@ -74,6 +77,7 @@ public enum StandardField implements Field {
7477
LANGUAGE("language", FieldProperty.LANGUAGE),
7578
LABEL("label"),
7679
LIBRARY("library"),
80+
LICENSE("license"),
7781
LOCATION("location"),
7882
MAINSUBTITLE("mainsubtitle", FieldProperty.BOOK_NAME),
7983
MAINTITLE("maintitle", FieldProperty.BOOK_NAME),
@@ -98,7 +102,10 @@ public enum StandardField implements Field {
98102
PUBSTATE("pubstate", FieldProperty.PUBLICATION_STATE),
99103
PRIMARYCLASS("primaryclass"),
100104
RELATED("related", FieldProperty.MULTIPLE_ENTRY_LINK),
105+
RELATEDTYPE("relatedtype"),
106+
RELATEDSTRING("relatedstring"),
101107
REPORTNO("reportno"),
108+
REPOSITORY("repository"),
102109
REVIEW("review"),
103110
REVISION("revision"),
104111
SCHOOL("school"),
@@ -109,6 +116,7 @@ public enum StandardField implements Field {
109116
SORTKEY("sortkey"),
110117
SORTNAME("sortname", FieldProperty.PERSON_NAMES),
111118
SUBTITLE("subtitle"),
119+
SWHID("swhid"),
112120
TITLE("title"),
113121
TITLEADDON("titleaddon"),
114122
TRANSLATOR("translator", FieldProperty.PERSON_NAMES),
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package org.jabref.model.entry.types;
2+
3+
import java.util.Arrays;
4+
import java.util.List;
5+
6+
import org.jabref.model.entry.BibEntryType;
7+
import org.jabref.model.entry.BibEntryTypeBuilder;
8+
import org.jabref.model.entry.field.OrFields;
9+
import org.jabref.model.entry.field.StandardField;
10+
11+
public class BiblatexSoftwareEntryTypeDefinitions {
12+
private static final BibEntryType SOFTWARE = new BibEntryTypeBuilder()
13+
.withType(StandardEntryType.Software)
14+
.withImportantFields(StandardField.DATE, StandardField.DOI, StandardField.EPRINTTYPE, StandardField.EPRINTCLASS, StandardField.EPRINT,
15+
StandardField.EDITOR, StandardField.FILE, StandardField.HALID, StandardField.HALVERSION, StandardField.INSTITUTION, StandardField.INTRODUCEDIN,
16+
StandardField.LICENSE, StandardField.MONTH, StandardField.NOTE, StandardField.ORGANIZATION, StandardField.PUBLISHER, StandardField.RELATED,
17+
StandardField.RELATEDSTRING, StandardField.REPOSITORY, StandardField.SWHID, StandardField.URLDATE, StandardField.VERSION)
18+
.withRequiredFields(new OrFields(StandardField.AUTHOR, StandardField.EDITOR), StandardField.TITLE, StandardField.URL, StandardField.VERSION, StandardField.YEAR)
19+
.build();
20+
21+
private static final BibEntryType SOFTWAREVERSION = new BibEntryTypeBuilder()
22+
.withType(StandardEntryType.SoftwareVersion)
23+
.withImportantFields(StandardField.DATE, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.HALID, StandardField.HALVERSION,
24+
StandardField.INSTITUTION, StandardField.INTRODUCEDIN, StandardField.LICENSE, StandardField.MONTH, StandardField.NOTE, StandardField.ORGANIZATION,
25+
StandardField.PUBLISHER, StandardField.RELATED, StandardField.RELATEDTYPE, StandardField.RELATEDSTRING,
26+
StandardField.REPOSITORY, StandardField.SWHID, StandardField.SUBTITLE, StandardField.URLDATE)
27+
.withRequiredFields(new OrFields(StandardField.AUTHOR, StandardField.EDITOR), StandardField.TITLE, StandardField.URL, StandardField.YEAR, StandardField.VERSION)
28+
.withDetailFields(StandardField.DATE, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.HALID, StandardField.HALVERSION,
29+
StandardField.INSTITUTION, StandardField.INTRODUCEDIN, StandardField.LICENSE, StandardField.MONTH, StandardField.NOTE, StandardField.ORGANIZATION,
30+
StandardField.PUBLISHER, StandardField.RELATED, StandardField.RELATEDTYPE, StandardField.RELATEDSTRING,
31+
StandardField.REPOSITORY, StandardField.SWHID, StandardField.SUBTITLE, StandardField.URLDATE)
32+
.withRequiredFields(new OrFields(StandardField.AUTHOR, StandardField.EDITOR), StandardField.TITLE, StandardField.URL, StandardField.YEAR)
33+
.build();
34+
private static final BibEntryType SOFTWAREMODULE = new BibEntryTypeBuilder()
35+
.withType(StandardEntryType.SoftwareModule)
36+
.withImportantFields(StandardField.DATE, StandardField.DOI, StandardField.EPRINTTYPE, StandardField.EPRINTCLASS, StandardField.EPRINT,
37+
StandardField.EDITOR, StandardField.FILE, StandardField.HALID, StandardField.HALVERSION, StandardField.INSTITUTION, StandardField.INTRODUCEDIN,
38+
StandardField.LICENSE, StandardField.MONTH, StandardField.NOTE, StandardField.ORGANIZATION, StandardField.PUBLISHER, StandardField.RELATED,
39+
StandardField.RELATEDSTRING, StandardField.REPOSITORY, StandardField.SWHID, StandardField.URLDATE, StandardField.VERSION)
40+
.withRequiredFields(StandardField.AUTHOR, StandardField.SUBTITLE, StandardField.URL, StandardField.YEAR)
41+
.build();
42+
43+
private static final BibEntryType CODEFRAGMENT = new BibEntryTypeBuilder()
44+
.withType(StandardEntryType.CodeFragment)
45+
.withImportantFields(StandardField.DATE, StandardField.DOI, StandardField.EPRINTTYPE, StandardField.EPRINTCLASS, StandardField.EPRINT,
46+
StandardField.EDITOR, StandardField.FILE, StandardField.HALID, StandardField.HALVERSION, StandardField.INSTITUTION, StandardField.INTRODUCEDIN,
47+
StandardField.LICENSE, StandardField.MONTH, StandardField.NOTE, StandardField.ORGANIZATION, StandardField.PUBLISHER, StandardField.RELATED,
48+
StandardField.RELATEDSTRING, StandardField.REPOSITORY, StandardField.SWHID, StandardField.URLDATE, StandardField.VERSION)
49+
.withRequiredFields(StandardField.URL)
50+
.build();
51+
52+
public static final List<BibEntryType> ALL = Arrays.asList(SOFTWAREVERSION, SOFTWARE, SOFTWAREMODULE, CODEFRAGMENT);
53+
}

src/main/java/org/jabref/model/entry/types/StandardEntryType.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ public enum StandardEntryType implements EntryType {
3636
Thesis("Thesis"),
3737
WWW("WWW"),
3838
Software("Software"),
39-
Dataset("Dataset");
39+
Dataset("Dataset"),
40+
SoftwareVersion("SoftwareVersion"),
41+
SoftwareModule("SoftwareModule"),
42+
CodeFragment("CodeFragment");
4043

4144
private final String displayName;
4245

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
@softwareversion {delebecque:hal-02090402-condensed,
2+
title = {Scilab},
3+
author = {Delebecque, Fran{\c c}ois and Gomez, Claude and Goursat, Maurice
4+
and Nikoukhah, Ramine and Steer, Serge and Chancelier, Jean-Philippe},
5+
url = {https://www.scilab.org/},
6+
date = {1994-01},
7+
file = {https://hal.inria.fr/hal-02090402/file/scilab-1.1.tar.gz},
8+
institution = {Inria},
9+
license = {Scilab license},
10+
hal_id = {hal-02090402},
11+
hal_version = {v1},
12+
swhid = {swh:1:dir:1ba0b67b5d0c8f10961d878d91ae9d6e499d746a;
13+
origin=https://hal.archives-ouvertes.fr/hal-02090402},
14+
version = {1.1},
15+
note = {First Scilab version. It was distributed by anonymous ftp.},
16+
repository= {https://github.com/scilab/scilab},
17+
abstract = {Software for Numerical Computation freely distributed.}
18+
}
19+
20+
@software {delebecque:hal-02090402,
21+
title = {Scilab},
22+
author = {Delebecque, Fran{\c c}ois and Gomez, Claude and Goursat, Maurice
23+
and Nikoukhah, Ramine and Steer, Serge and Chancelier, Jean-Philippe},
24+
date = {1994},
25+
institution = {Inria},
26+
license = {Scilab license},
27+
hal_id = {hal-02090402},
28+
hal_version = {v1},
29+
url = {https://www.scilab.org/},
30+
abstract = {Software for Numerical Computation freely distributed.},
31+
repository= {https://github.com/scilab/scilab},
32+
}
33+
34+
@softwareversion {delebecque:hal-02090402v1,
35+
version = {1.1},
36+
date = {1994-01},
37+
file = {https://hal.inria.fr/hal-02090402/file/scilab-1.1.tar.gz},
38+
swhid = {swh:1:dir:1ba0b67b5d0c8f10961d878d91ae9d6e499d746a;
39+
origin=https://hal.archives-ouvertes.fr/hal-02090402},
40+
note = {First Scilab version. It was distributed by anonymous ftp.},
41+
crossref = {delebecque:hal-02090402}
42+
}
43+
44+
@software {cgal,
45+
title = {The Computational Geometry Algorithms Library},
46+
author = {{The CGAL Project}},
47+
editor = {{CGAL Editorial Board}},
48+
date = {1996},
49+
url = {https://cgal.org/}
50+
}
51+
52+
@softwareversion{cgal:5-0-2,
53+
crossref = {cgal},
54+
version = {{5.0.2}},
55+
url = {https://docs.cgal.org/5.02},
56+
date = {2020},
57+
swhid = {swh:1:rel:636541bbf6c77863908eae744610a3d91fa58855;
58+
origin=https://github.com/CGAL/cgal/}
59+
}
60+
61+
@softwaremodule{cgal:lp-gi-20a,
62+
crossref = {cgal:5-0-2},
63+
author = {Menelaos Karavelas},
64+
subtitle = {{2D} Voronoi Diagram Adaptor},
65+
license = {GPL},
66+
introducedin = {cgal:3-1},
67+
url = {https://doc.cgal.org/5.0.2/Manual/packages.html#PkgVoronoiDiagram2},
68+
}
69+
70+
@softwaremodule{cgal:lp-gi-20a-condensed,
71+
title = {The Computational Geometry Algorithms Library},
72+
subtitle = {{2D} Voronoi Diagram Adaptor},
73+
author = {Menelaos Karavelas},
74+
editor = {{CGAL Editorial Board}},
75+
license = {GPL},
76+
version = {{5.0.2}},
77+
introducedin = {cgal:3-1},
78+
date = {2020},
79+
swhid = {swh:1:rel:636541bbf6c77863908eae744610a3d91fa58855;
80+
origin=https://github.com/CGAL/cgal/},
81+
url = {https://doc.cgal.org/5.0.2/Manual/packages.html#PkgVoronoiDiagram2},
82+
}
83+
84+
@software {parmap,
85+
title = {The Parmap library},
86+
author = {Di Cosmo, Roberto and Marco Danelutto},
87+
date = {2020},
88+
version = {1.1.1},
89+
institution = {{Inria} and {University of Paris} and {University of Pisa}},
90+
license = {LGPL-2.0},
91+
url = {https://rdicosmo.github.io/parmap/},
92+
repository= {https://github.com/rdicosmo/parmap},
93+
}
94+
95+
@codefragment {simplemapper,
96+
subtitle = {Core mapping routine},
97+
swhid = {swh:1:cnt:43a6b232768017b03da934ba22d9cc3f2726a6c5;
98+
lines=192-228;
99+
origin=https://github.com/rdicosmo/parmap},
100+
crossref = {parmap}
101+
}

0 commit comments

Comments
 (0)