Skip to content

Commit 7f8df6b

Browse files
committed
[6574] Added support for biblatex-software
Added change to changelog md checkstyle fixed checkstyle fixed
1 parent 7d66c25 commit 7f8df6b

File tree

10 files changed

+232
-6
lines changed

10 files changed

+232
-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

3738
### Changed
3839

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

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

0 commit comments

Comments
 (0)