Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fixCopyPasteCodeArea
Browse files Browse the repository at this point in the history
* upstream/master:
  Fix sort order in main table not stored (#6898)
  Window "Manage field names & content": make title consistent with menu (+ localization) (#6895)
  Complete rebranding of `bibtexkey` as `citationkey` (#6875)
  Dev-doc: ADR list (#6887)
  Bump lucene-queryparser from 8.6.1 to 8.6.2 (#6881)
  Bump fontbox from 2.0.20 to 2.0.21 (#6883)
  Bump org.beryx.jlink from 2.21.3 to 2.21.4 (#6882)
  Bump com.github.ben-manes.versions from 0.29.0 to 0.30.0 (#6884)
  Bump pdfbox from 2.0.20 to 2.0.21 (#6885)
  Bump mockito-core from 3.5.7 to 3.5.10 (#6886)
  lint changelog
  Dev Doc: Moving around ADR (end?) (#6873)
  Add MD031 to lint ignore list
  Add mlep's other email adress
  Fetch by ID: SAO/NASA Astrophysics Data System -> SAO/NASA ADS (#6876)
  • Loading branch information
Siedlerchr committed Sep 12, 2020
2 parents b671459 + 1d2ecff commit 897f5e0
Show file tree
Hide file tree
Showing 182 changed files with 871 additions and 824 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Frédéric Darboux <Frederic.Darboux@orleans.inra.fr>
Frédéric Darboux <Frederic.Darboux@orleans.inra.fr> <fdar@users.sourceforge.net>
Frédéric Darboux <Frederic.Darboux@orleans.inra.fr> <mlep@users.noreply.github.com>
Frédéric Darboux <Frederic.Darboux@orleans.inra.fr> <mlep@github.com>
Frédéric Darboux <frederic.darboux@inrae.fr>
Florian Straßer <strassfn@studi.informatik.uni-stuttgart.de>
Gregor Herrmann <gregoa@debian.org>
Hakan Duran <ehakanduran@gmail.com> hakova <ehakanduran@gmail.com>
Expand Down
3 changes: 3 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ MD013: false
MD026:
punctuation: ".,;:!"

# not supported by gitbook
MD031: false

MD033:
# we have <a> tags with ids and superscript
allowed_elements: ['a', 'sup']
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- JabRef now offers journal lists from <https://abbrv.jabref.org>. JabRef the lists which use a dot inside the abbreviations. [#5749](https://github.com/JabRef/jabref/pull/5749)
- We removed two useless preferences in the groups preferences dialog. [#6836](https://github.com/JabRef/jabref/pull/6836)
- Synchronization of SpecialFields to keywords is now disabled by default. [#6621](https://github.com/JabRef/jabref/issues/6621)
- JabRef no longer opens the entry editor with the first entry on startup [6855](https://github.com/JabRef/jabref/issues/6855)
- JabRef no longer opens the entry editor with the first entry on startup [#6855](https://github.com/JabRef/jabref/issues/6855)
- We completed the rebranding of `bibtexkey` as `citationkey` which was started in JabRef 5.1.
- JabRef no longer opens the entry editor with the first entry on startup [#6855](https://github.com/JabRef/jabref/issues/6855)
- Fetch by ID: (long) "SAO/NASA Astrophysics Data System" replaced by (short) "SAO/NASA ADS" [#6876](https://github.com/JabRef/jabref/pull/6876)
- We changed the title of the window "Manage field names and content": to have the same title as the corresponding menu item [#6895](https://github.com/JabRef/jabref/pull/6895)

### Fixed

- We fixed an issue changing the icon link_variation_off that is not meaningful. [#6834][https://github.com/JabRef/jabref/issues/6834]
- We fixed an issue where the `.sav` file was not deleted upon exiting JabRef. [#6109](https://github.com/JabRef/jabref/issues/6109)
- We fixed a linked identifier icon inconsistency. [#6705](https://github.com/JabRef/jabref/issues/6705)
- We fixed the wrong behavior that font size changes are not reflected in dialogs. [#6039](https://github.com/JabRef/jabref/issues/6039)
- We fixed an issue where the sort order of the entry table was reset after a restart of JabRef [#6898](https://github.com/JabRef/jabref/pull/6898)

### Removed


## [5.1] – 2020-08-30

### Added
Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ plugins {
id 'application'
id "com.simonharrer.modernizer" version '2.1.0-1'
id 'me.champeau.gradle.jmh' version '0.5.1'
id 'com.github.ben-manes.versions' version '0.29.0'
id 'com.github.ben-manes.versions' version '0.30.0'
id 'org.javamodularity.moduleplugin' version '1.7.0'
id 'org.openjfx.javafxplugin' version '0.0.9'
id 'org.beryx.jlink' version '2.21.3'
id 'org.beryx.jlink' version '2.21.4'

// nicer test outputs during running and completion
// Homepage: https://github.com/radarsh/gradle-test-logger-plugin
Expand Down Expand Up @@ -105,8 +105,8 @@ dependencies {
// Include all jar-files in the 'lib' folder as dependencies
implementation fileTree(dir: 'lib', includes: ['*.jar'])

implementation 'org.apache.pdfbox:pdfbox:2.0.20'
implementation 'org.apache.pdfbox:fontbox:2.0.20'
implementation 'org.apache.pdfbox:pdfbox:2.0.21'
implementation 'org.apache.pdfbox:fontbox:2.0.21'
implementation 'org.apache.pdfbox:xmpbox:2.0.20'

implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.8'
Expand Down Expand Up @@ -137,7 +137,7 @@ dependencies {
antlr4 'org.antlr:antlr4:4.8-1'
implementation 'org.antlr:antlr4-runtime:4.8-1'

implementation (group: 'org.apache.lucene', name: 'lucene-queryparser', version: '8.6.1') {
implementation (group: 'org.apache.lucene', name: 'lucene-queryparser', version: '8.6.2') {
exclude group: 'org.apache.lucene', module: 'lucene-sandbox'
}

Expand Down Expand Up @@ -207,7 +207,7 @@ dependencies {
testImplementation 'net.bytebuddy:byte-buddy-parent:1.10.14'
testRuntime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT'
testRuntime group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '3.0.0-SNAPSHOT'
testImplementation 'org.mockito:mockito-core:3.5.7'
testImplementation 'org.mockito:mockito-core:3.5.10'
testImplementation 'org.xmlunit:xmlunit-core:2.7.0'
testImplementation 'org.xmlunit:xmlunit-matchers:2.7.0'
testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.14.1'
Expand Down
23 changes: 21 additions & 2 deletions docs/adr.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
# Architectural Decisions

This directory contains the architectural decisions for JabRef.
Architectural decisions for JabRef:

* [ADR-0000](https://github.com/JabRef/jabref/tree/docs/adr/0000-use-markdown-architectural-decision-records.md) - Use Markdown Architectural Decision Records
* [ADR-0001](https://github.com/JabRef/jabref/tree/docs/adr/0001-use-crowdin-for-translations.md) - Use Crowdin for translations
* [ADR-0002](https://github.com/JabRef/jabref/tree/docs/adr/0002-use-slf4j-for-logging.md) - Use slf4j together with log4j2 for logging
* [ADR-0003](https://github.com/JabRef/jabref/tree/docs/adr/0003-use-gradle-as-build-tool.md) - Use Gradle as build tool
* [ADR-0004](https://github.com/JabRef/jabref/tree/docs/adr/0004-use-mariadb-connector.md) - Use MariaDB Connector
* [ADR-0005](https://github.com/JabRef/jabref/tree/docs/adr/0005-fully-support-utf8-only-for-latex-files.md) - Fully Support UTF-8 Only For LaTeX Files
* [ADR-0006](https://github.com/JabRef/jabref/tree/docs/adr/0006-only-translated-strings-in-language-file.md) - Only translated strings in language file
* [ADR-0007](https://github.com/JabRef/jabref/tree/docs/adr/0007-human-readable-changelog.md) - Provide a human-readable changelog
* [ADR-0008](https://github.com/JabRef/jabref/tree/docs/adr/0008-use-public-final-instead-of-getters.md) - Use public final instead of getters to offer access to immutable variables
* [ADR-0009](https://github.com/JabRef/jabref/tree/docs/adr/0009-use-plain-junit5-for-testing.md) - Use Plain JUnit5 for advanced test assertions
* [ADR-0010](https://github.com/JabRef/jabref/tree/docs/adr/0010-use-h2-as-internal-database.md) - Use H2 as Internal SQL Database
* [ADR-0011](https://github.com/JabRef/jabref/tree/docs/adr/0011-test-external-links-in-documentation.md) - Test external links in documentation
* [ADR-0012](https://github.com/JabRef/jabref/tree/docs/adr/0012-handle-different-bibEntry-formats-of-fetchers.md) - Handle different bibentry formats of fetchers by adding a layer
* [ADR-0013](https://github.com/JabRef/jabref/tree/docs/adr/0013-add-native-support-biblatex-software.md) - Add Native Support for BibLatex-Sotware
fix checkstyle in adr
* [ADR-0014](https://github.com/JabRef/jabref/tree/docs/adr/0014-separate-URL-creation-to-enable-proper-logging.md) - Separate URL creation to enable proper logging
* [ADR-0015](https://github.com/JabRef/jabref/tree/docs/adr/0015-support-an-abstract-query-syntax-for-query-conversion.md) - Query syntax design
* [ADR-0016](https://github.com/JabRef/jabref/tree/docs/adr/0016-mutable-preferences-objects.md) - Mutable preferences objects
* [ADR-0017](https://github.com/JabRef/jabref/tree/docs/adr/0017-allow-model-access-logic.md) - Allow org.jabref.model to access org.jabref.logic


For new ADRs, please use [template.md](https://github.com/JabRef/jabref/tree/98e9fc3ddc7b59ca35101c7f37b183ca2e69d8a0/docs/adr/template.md) as basis. More information on the used format is available at [https://adr.github.io/madr/](https://adr.github.io/madr/). General information about architectural decision records is available at [https://adr.github.io/](https://adr.github.io/).
For new ADRs, please use [template.md](https://github.com/JabRef/jabref/tree/98e9fc3ddc7b59ca35101c7f37b183ca2e69d8a0/docs/adr/template.md) as basis. More information on the used format is available at [https://adr.github.io/madr/](https://adr.github.io/madr/). General information about architectural decision records is available at [https://adr.github.io/](https://adr.github.io/). Then add them to the above list.

File renamed without changes.
2 changes: 1 addition & 1 deletion docs/getting-into-the-code/high-level-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ All packages and classes which are currently not part of these packages \(we are

## Most Important Classes and their Relation

Both GUI and CLI are started via the `JabRefMain` which will in turn call `JabRef` which then decides whether the GUI \(`JabRefFrame`\) or the CLI \(`JabRefCLI` and a lot of code in `JabRef`\) will be started. The `JabRefFrame` represents the Window which contains a `SidePane` on the left used for the fetchers/groups Each tab is a `BasePanel` which has a `SearchBar` at the top, a `MainTable` at the center and a `PreviewPanel` or an `EntryEditor` at the bottom. Any right click on the `MainTable` is handled by the `RightClickMenu`. Each `BasePanel` holds a `BibDatabaseContext` consisting of a `BibDatabase` and the `MetaData`, which are the only relevant data of the currently shown database. A `BibDatabase` has a list of `BibEntries`. Each `BibEntry` has a key, a bibtex key and a key/value store for the fields with their values. Interpreted data \(such as the type or the file field\) is stored in the `TypedBibentry` type. The user can change the `JabRefPreferences` through the `PreferencesDialog`.
Both GUI and CLI are started via the `JabRefMain` which will in turn call `JabRef` which then decides whether the GUI \(`JabRefFrame`\) or the CLI \(`JabRefCLI` and a lot of code in `JabRef`\) will be started. The `JabRefFrame` represents the Window which contains a `SidePane` on the left used for the fetchers/groups Each tab is a `BasePanel` which has a `SearchBar` at the top, a `MainTable` at the center and a `PreviewPanel` or an `EntryEditor` at the bottom. Any right click on the `MainTable` is handled by the `RightClickMenu`. Each `BasePanel` holds a `BibDatabaseContext` consisting of a `BibDatabase` and the `MetaData`, which are the only relevant data of the currently shown database. A `BibDatabase` has a list of `BibEntries`. Each `BibEntry` has an ID, a citation key and a key/value store for the fields with their values. Interpreted data \(such as the type or the file field\) is stored in the `TypedBibentry` type. The user can change the `JabRefPreferences` through the `PreferencesDialog`.

2 changes: 1 addition & 1 deletion src/jmh/java/org/jabref/benchmarks/Benchmarks.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void init() throws Exception {
Random randomizer = new Random();
for (int i = 0; i < 1000; i++) {
BibEntry entry = new BibEntry();
entry.setCiteKey("id" + i);
entry.setCitationKey("id" + i);
entry.setField(StandardField.TITLE, "This is my title " + i);
entry.setField(StandardField.AUTHOR, "Firstname Lastname and FirstnameA LastnameA and FirstnameB LastnameB" + i);
entry.setField(StandardField.JOURNAL, "Journal Title " + i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.controlsfx.control.textfield.AutoCompletionBinding;

/**
* Delivers possible completions as a list of {@link BibEntry} based on their cite key.
* Delivers possible completions as a list of {@link BibEntry} based on their citation key.
*/
public class BibEntrySuggestionProvider extends SuggestionProvider<BibEntry> {

Expand All @@ -25,7 +25,7 @@ public BibEntrySuggestionProvider(BibDatabase database) {

@Override
protected Equivalence<BibEntry> getEquivalence() {
return Equivalence.equals().onResultOf(BibEntry::getCiteKeyOptional);
return Equivalence.equals().onResultOf(BibEntry::getCitationKey);
}

@Override
Expand All @@ -36,7 +36,7 @@ protected Comparator<BibEntry> getComparator() {
@Override
protected boolean isMatch(BibEntry entry, AutoCompletionBinding.ISuggestionRequest request) {
String userText = request.getUserText();
return entry.getCiteKeyOptional()
return entry.getCitationKey()
.map(key -> StringUtil.containsIgnoreCase(key, userText))
.orElse(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,14 @@ public static boolean confirmOverwriteKeys(DialogService dialogService) {
private void checkOverwriteKeysChosen() {
// We don't want to generate keys for entries which already have one thus remove the entries
if (Globals.prefs.getBoolean(JabRefPreferences.AVOID_OVERWRITING_KEY)) {
entries.removeIf(BibEntry::hasCiteKey);
// if we're going to override some cite keys warn the user about it
} else if (entries.parallelStream().anyMatch(BibEntry::hasCiteKey)) {
entries.removeIf(BibEntry::hasCitationKey);
// if we're going to override some citation keys warn the user about it
} else if (entries.parallelStream().anyMatch(BibEntry::hasCitationKey)) {
boolean overwriteKeys = confirmOverwriteKeys(dialogService);

// The user doesn't want to override cite keys
// The user doesn't want to override citation keys
if (!overwriteKeys) {
isCanceled = true;
return;
}
}
}
Expand All @@ -87,7 +86,7 @@ private void generateKeys() {
}

stateManager.getActiveDatabase().ifPresent(databaseContext -> {
// generate the new cite keys for each entry
// generate the new citation keys for each entry
final NamedCompound compound = new NamedCompound(Localization.lang("Autogenerate citation keys"));
CitationKeyGenerator keyGenerator =
new CitationKeyGenerator(databaseContext, Globals.prefs.getCitationKeyPatternPreferences());
Expand All @@ -97,7 +96,7 @@ private void generateKeys() {
}
compound.end();

// register the undo event only if new cite keys were generated
// register the undo event only if new citation keys were generated
if (compound.hasEdits()) {
frame.getUndoManager().addEdit(compound);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public GenerateCitationKeySingleAction(BibEntry entry, BibDatabaseContext databa

@Override
public void execute() {
if (!entry.hasCiteKey() || GenerateCitationKeyAction.confirmOverwriteKeys(dialogService)) {
if (!entry.hasCitationKey() || GenerateCitationKeyAction.confirmOverwriteKeys(dialogService)) {
new CitationKeyGenerator(databaseContext, preferencesService.getCitationKeyPatternPreferences())
.generateAndSetKey(entry)
.ifPresent(change -> undoManager.addEdit(new UndoableKeyChange(change)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EntryAddChangeViewModel extends DatabaseChangeViewModel {

public EntryAddChangeViewModel(BibEntry entry) {
super();
this.name = entry.getCiteKeyOptional()
this.name = entry.getCitationKey()
.map(key -> Localization.lang("Added entry") + ": '" + key + '\'')
.orElse(Localization.lang("Added entry"));
this.entry = entry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public EntryChangeViewModel(BibEntry entry, BibEntry newEntry) {
this.oldEntry = entry;
this.newEntry = newEntry;

name = entry.getCiteKeyOptional()
name = entry.getCitationKey()
.map(key -> Localization.lang("Modified entry") + ": '" + key + '\'')
.orElse(Localization.lang("Modified entry"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class EntryDeleteChangeViewModel extends DatabaseChangeViewModel {
public EntryDeleteChangeViewModel(BibEntry entry) {
super(Localization.lang("Deleted entry"));

this.name = entry.getCiteKeyOptional()
this.name = entry.getCitationKey()
.map(key -> Localization.lang("Deleted entry") + ": '" + key + '\'')
.orElse(Localization.lang("Deleted entry"));
this.entry = entry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Field fromString(String string) {
}
};

private final ObservableList<Field> fieldsForAdding = FXCollections.observableArrayList(FieldFactory.getStandardFielsdsWithBibTexKey());
private final ObservableList<Field> fieldsForAdding = FXCollections.observableArrayList(FieldFactory.getStandardFieldsWithCitationKey());
private final ObjectProperty<CustomEntryTypeViewModel> selectedEntryType = new SimpleObjectProperty<>();
private final ObjectProperty<Field> selectedFieldToAdd = new SimpleObjectProperty<>();
private final StringProperty entryTypeToAdd = new SimpleStringProperty("");
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/org/jabref/gui/edit/CopyMoreAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ private void copyKey() {

// Collect all non-null keys.
List<String> keys = entries.stream()
.filter(entry -> entry.getCiteKeyOptional().isPresent())
.map(entry -> entry.getCiteKeyOptional().get())
.filter(entry -> entry.getCitationKey().isPresent())
.map(entry -> entry.getCitationKey().get())
.collect(Collectors.toList());

if (keys.isEmpty()) {
Expand All @@ -131,8 +131,8 @@ private void copyCiteKey() {

// Collect all non-null keys.
List<String> keys = entries.stream()
.filter(entry -> entry.getCiteKeyOptional().isPresent())
.map(entry -> entry.getCiteKeyOptional().get())
.filter(entry -> entry.getCitationKey().isPresent())
.map(entry -> entry.getCitationKey().get())
.collect(Collectors.toList());

if (keys.isEmpty()) {
Expand Down Expand Up @@ -161,7 +161,7 @@ private void copyKeyAndTitle() {
List<BibEntry> entries = stateManager.getSelectedEntries();

// ToDo: this string should be configurable to allow arbitrary exports
StringReader layoutString = new StringReader("\\bibtexkey - \\begin{title}\\format[RemoveBrackets]{\\title}\\end{title}\n");
StringReader layoutString = new StringReader("\\citationkey - \\begin{title}\\format[RemoveBrackets]{\\title}\\end{title}\n");
Layout layout;
try {
layout = new LayoutHelper(layoutString, preferencesService.getLayoutFormatterPreferences(Globals.journalAbbreviationRepository)).getLayoutFromText();
Expand All @@ -175,7 +175,7 @@ private void copyKeyAndTitle() {
int entriesWithKeys = 0;
// Collect all non-null keys.
for (BibEntry entry : entries) {
if (entry.hasCiteKey()) {
if (entry.hasCitationKey()) {
entriesWithKeys++;
keyAndTitle.append(layout.doLayout(entry, stateManager.getActiveDatabase().get().getDatabase()));
}
Expand Down Expand Up @@ -209,7 +209,7 @@ private void copyKeyAndLink() {
StringBuilder keyAndLink = new StringBuilder();

List<BibEntry> entriesWithKey = entries.stream()
.filter(BibEntry::hasCiteKey)
.filter(BibEntry::hasCitationKey)
.collect(Collectors.toList());

if (entriesWithKey.isEmpty()) {
Expand All @@ -218,7 +218,7 @@ private void copyKeyAndLink() {
}

for (BibEntry entry : entriesWithKey) {
String key = entry.getCiteKeyOptional().get();
String key = entry.getCitationKey().get();
String url = entry.getField(StandardField.URL).orElse("");
keyAndLink.append(url.isEmpty() ? key : String.format("<a href=\"%s\">%s</a>", url, key));
keyAndLink.append(OS.NEWLINE);
Expand Down
Loading

0 comments on commit 897f5e0

Please sign in to comment.