Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into writebackupToTemp
Browse files Browse the repository at this point in the history
* upstream/main:
  Main instead of master
  Custom DOI base address fix (#7569)
  Change export to save (#7518)
  Bump unoloader from 7.1.1 to 7.1.2 (#7609)
  Bump org.beryx.jlink from 2.23.5 to 2.23.6 (#7610)
  Bump com.adarshr.test-logger from 2.1.1 to 3.0.0 (#7611)
  Bump libreoffice from 7.1.1 to 7.1.2 (#7612)
  Squashed 'buildres/csl/csl-styles/' changes from e1acabe..bfa3b6d (#7603)
  Rename master to main
  • Loading branch information
Siedlerchr committed Apr 11, 2021
2 parents 80b4f98 + 132f232 commit 5b2b64c
Show file tree
Hide file tree
Showing 18 changed files with 234 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ JabRef version <!-- version as shown in the about box --> on <!-- Windows 10|Ubu
<!--
Please always test if the bug is still reproducible in the latest development version.
We are constantly improving JabRef and some bugs may already be fixed.
You can download the development version at: http://builds.jabref.org/master/
You can download the development version at: http://builds.jabref.org/main
Please make a backup of your library before you try out this version.
If you already use a development version, ensure that you use the latest one.
-->
- [ ] **Mandatory**: I have tested the latest development version from http://builds.jabref.org/master/ and the problem persists
- [ ] **Mandatory**: I have tested the latest development version from http://builds.jabref.org/main and the problem persists

<!-- Add a clear and concise description of what the bug is. -->

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ plugins {
id 'com.github.ben-manes.versions' version '0.38.0'
id 'org.javamodularity.moduleplugin' version '1.7.0'
id 'org.openjfx.javafxplugin' version '0.0.9'
id 'org.beryx.jlink' version '2.23.5'
id 'org.beryx.jlink' version '2.23.6'
// nicer test outputs during running and completion
// Homepage: https://github.com/radarsh/gradle-test-logger-plugin
id 'com.adarshr.test-logger' version '2.1.1'
id 'com.adarshr.test-logger' version '3.0.0'
}

gradle.startParameter.showStacktrace = org.gradle.api.logging.configuration.ShowStacktrace.ALWAYS
Expand Down Expand Up @@ -115,8 +115,8 @@ dependencies {

implementation 'commons-cli:commons-cli:1.4'

implementation 'org.libreoffice:libreoffice:7.1.1'
implementation 'org.libreoffice:unoloader:7.1.1'
implementation 'org.libreoffice:libreoffice:7.1.2'
implementation 'org.libreoffice:unoloader:7.1.2'

implementation 'io.github.java-diff-utils:java-diff-utils:4.9'
implementation 'info.debatty:java-string-similarity:2.0.0'
Expand Down
158 changes: 158 additions & 0 deletions buildres/csl/csl-styles/archives-of-hand-and-microsurgery.csl
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
<info>
<title>Archives of Hand and Microsurgery</title>
<title-short>AHM</title-short>
<id>http://www.zotero.org/styles/archives-of-hand-and-microsurgery</id>
<link href="http://www.zotero.org/styles/archives-of-hand-and-microsurgery" rel="self"/>
<link href="http://www.zotero.org/styles/the-pan-african-medical-journal" rel="template"/>
<link href="https://submit.handmicro.org/about/Author.php" rel="documentation"/>
<author>
<name>Patrick O'Brien</name>
</author>
<category citation-format="numeric"/>
<category field="medicine"/>
<issn>2586-3290</issn>
<eissn>2586-3533</eissn>
<updated>2021-03-30T14:44:29+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<macro name="author">
<names variable="author" suffix=". ">
<name delimiter-precedes-et-al="always" delimiter-precedes-last="always" initialize-with="" name-as-sort-order="all" sort-separator=" "/>
<label form="short" prefix=" (" suffix=")"/>
<substitute>
<names variable="editor"/>
</substitute>
</names>
</macro>
<macro name="editor">
<names variable="editor">
<name sort-separator=" " initialize-with="" name-as-sort-order="all" delimiter=", " delimiter-precedes-last="always" delimiter-precedes-et-al="never"/>
<label prefix=", "/>
</names>
</macro>
<macro name="publisher">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
</macro>
<macro name="access">
<choose>
<if variable="page" match="none">
<choose>
<if type="article-journal">
<choose>
<if match="none" variable="page volume">
<text variable="DOI" prefix="https://doi.org/"/>
</if>
</choose>
</if>
<else-if type="webpage post post-weblog">
<group delimiter=". ">
<text variable="URL"/>
<group delimiter=" ">
<text term="accessed" text-case="capitalize-first"/>
<date variable="accessed">
<date-part name="day" prefix=" "/>
<date-part name="month" strip-periods="true" prefix=" "/>
<date-part name="year" prefix=" "/>
</date>
</group>
</group>
</else-if>
</choose>
</if>
</choose>
</macro>
<macro name="journal-title">
<choose>
<if type="article-journal article-magazine" match="any">
<text variable="container-title" form="short" strip-periods="true" suffix="."/>
</if>
<else>
<text variable="container-title" suffix=". "/>
</else>
</choose>
</macro>
<macro name="title">
<choose>
<if type="book thesis" match="any">
<text variable="title" font-style="italic"/>
</if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short"/>
</group>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
</macro>
<citation collapse="citation-number">
<sort>
<key variable="citation-number"/>
</sort>
<layout vertical-align="baseline" delimiter="," prefix="[" suffix="]">
<text variable="citation-number"/>
</layout>
</citation>
<bibliography et-al-min="7" et-al-use-first="6" second-field-align="flush">
<layout suffix=".">
<text variable="citation-number" suffix="."/>
<text macro="author"/>
<text macro="title" suffix=". "/>
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<group delimiter=" " prefix=" ">
<text macro="edition"/>
<text macro="publisher"/>
</group>
</if>
<else-if type="chapter paper-conference" match="any">
<group delimiter=". " prefix=" ">
<group>
<text term="in" suffix=": " text-case="capitalize-first"/>
<text macro="editor"/>
</group>
<text variable="container-title" font-style="italic"/>
<date variable="issued">
<date-part name="year"/>
</date>
<text macro="publisher"/>
<group delimiter=" ">
<label plural="never" variable="page" form="short"/>
<text variable="page"/>
</group>
</group>
</else-if>
<else>
<text macro="journal-title"/>
<group delimiter=";" suffix=".">
<date variable="issued" prefix=" ">
<date-part name="year"/>
</date>
<group delimiter=":">
<group>
<text variable="volume"/>
<text variable="issue" prefix="(" suffix=")"/>
</group>
<text variable="page"/>
</group>
</group>
</else>
</choose>
<text macro="access" prefix=" "/>
</layout>
</bibliography>
</style>
11 changes: 10 additions & 1 deletion buildres/csl/csl-styles/canadian-biosystems-engineering.csl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<issn>1492-9058</issn>
<eissn>1492-9066</eissn>
<summary>Style for online journal Canadian Biosystems Engineering</summary>
<updated>2020-09-26T15:27:23+00:00</updated>
<updated>2020-12-05T19:18:31+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<locale xml:lang="en-US">
Expand Down Expand Up @@ -275,6 +275,15 @@
<else-if type="webpage chapter paper-conference article-journal article-magazine article-newspaper" match="any">
<text variable="title"/>
</else-if>
<else-if type="patent">
<group delimiter=". ">
<text variable="title"/>
<group delimiter=", ">
<text variable="authority"/>
<text variable="number"/>
</group>
</group>
</else-if>
<else-if type="motion_picture broadcast" match="any"/>
<else>
<choose>
Expand Down
6 changes: 1 addition & 5 deletions buildres/csl/csl-styles/journal-of-accounting-research.csl
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
<name>Xuanheng Huang</name>
<email>huangxuanheng@gmail.com</email>
</contributor>
<contributor>
<name>Vito Ferrulli</name>
<email>vitof970@gmail.com</email>
</contributor>
<category citation-format="author-date"/>
<category field="generic-base"/>
<issn>0021-8456</issn>
Expand Down Expand Up @@ -161,7 +157,7 @@
<if type="legal_case" match="none">
<choose>
<if variable="DOI">
<text variable="DOI" prefix="Available at https://doi.org/"/>
<text variable="DOI" prefix="https://doi.org/"/>
</if>
<else>
<text variable="URL" prefix="Available at "/>
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ environment:
parts:
jabref:
plugin: dump
source: https://builds.jabref.org/master/JabRef-5.3-portable_linux.tar.gz
source: https://builds.jabref.org/main/JabRef-5.3-portable_linux.tar.gz
stage-packages:
- x11-utils
override-build: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<ToggleGroup fx:id="saveOrderToggleGroup"/>
</fx:define>

<RadioButton fx:id="exportInOriginalOrder" text="%Export entries in their original order"
<RadioButton fx:id="exportInOriginalOrder" text="%Keep original order"
toggleGroup="$saveOrderToggleGroup"/>
<RadioButton fx:id="exportInTableOrder" text="%Export in current table sort order"
<RadioButton fx:id="exportInTableOrder" text="%Use current table sort order"
toggleGroup="$saveOrderToggleGroup"/>
<RadioButton fx:id="exportInSpecifiedOrder"
text="%Export entries ordered as specified" toggleGroup="$saveOrderToggleGroup"/>
text="%Use specified order" toggleGroup="$saveOrderToggleGroup"/>

<GridPane hgap="10.0" vgap="4.0">
<columnConstraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.jabref.gui.util.FieldsUtil;
import org.jabref.gui.util.ViewModelListCellFactory;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.entry.field.Field;

import com.airhacks.afterburner.views.ViewLoader;
Expand Down Expand Up @@ -70,12 +69,6 @@ private void initialize() {
saveTerDesc.selectedProperty().bindBidirectional(viewModel.saveTertiaryDescPropertySelected());
}

public void changeExportDescriptionToSave() {
exportInOriginalOrder.setText(Localization.lang("Save entries in their original order"));
exportInSpecifiedOrder.setText(Localization.lang("Save entries ordered as specified"));
exportInTableOrder.setText(Localization.lang("Save in current table sort order"));
}

public BooleanProperty saveInOriginalProperty() {
return viewModel.saveInOriginalProperty();
}
Expand Down
21 changes: 18 additions & 3 deletions src/main/java/org/jabref/gui/desktop/JabRefDesktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.Optional;
import java.util.regex.Pattern;

import org.jabref.gui.DialogService;
import org.jabref.gui.Globals;
import org.jabref.gui.JabRefGUI;
import org.jabref.gui.desktop.os.DefaultDesktop;
Expand All @@ -19,6 +20,7 @@
import org.jabref.gui.desktop.os.Windows;
import org.jabref.gui.externalfiletype.ExternalFileType;
import org.jabref.gui.externalfiletype.ExternalFileTypes;
import org.jabref.logic.importer.util.IdentifierParser;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.util.OS;
import org.jabref.model.database.BibDatabaseContext;
Expand All @@ -27,6 +29,7 @@
import org.jabref.model.entry.identifier.DOI;
import org.jabref.model.entry.identifier.Eprint;
import org.jabref.model.util.FileHelper;
import org.jabref.preferences.PreferencesService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -107,6 +110,19 @@ private static void openDoi(String doi) throws IOException {
openBrowser(link);
}

public static void openCustomDoi(String link, PreferencesService preferences, DialogService dialogService) {
IdentifierParser.parse(StandardField.DOI, link)
.map(identifier -> (DOI) identifier)
.flatMap(doi -> doi.getExternalURIWithCustomBase(preferences.getDOIPreferences().getDefaultBaseURI()))
.ifPresent(uri -> {
try {
JabRefDesktop.openBrowser(uri);
} catch (IOException e) {
dialogService.showErrorDialogAndWait(Localization.lang("Unable to open link."), e);
}
});
}

/**
* Open an external file, attempting to use the correct viewer for it.
*
Expand Down Expand Up @@ -203,9 +219,8 @@ public static void openBrowser(URI url) throws IOException {
}

/**
* Opens the url with the users standard Browser.
* If that fails a popup will be shown to instruct the user to open the link manually
* and the link gets copied to the clipboard
* Opens the url with the users standard Browser. If that fails a popup will be shown to instruct the user to open the link manually and the link gets copied to the clipboard
*
* @param url the URL to open
*/
public static void openBrowserShowPopup(String url) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class IdentifierEditorViewModel extends AbstractEditorViewModel {
private final TaskExecutor taskExecutor;
private final DialogService dialogService;
private final Field field;
private PreferencesService preferences;
private final PreferencesService preferences;

public IdentifierEditorViewModel(Field field, SuggestionProvider<?> suggestionProvider, TaskExecutor taskExecutor, DialogService dialogService, FieldCheckers fieldCheckers, PreferencesService preferences) {
super(field, suggestionProvider, fieldCheckers);
Expand Down Expand Up @@ -75,8 +75,8 @@ public BooleanProperty validIdentifierIsNotPresentProperty() {

public void openExternalLink() {
if (field.equals(StandardField.DOI) && preferences.getDOIPreferences().isUseCustom()) {
String baseURI = preferences.getDOIPreferences().getDefaultBaseURI();
openDOIWithCustomBase(baseURI);
identifier.get().map(identifier -> (DOI) identifier).map(DOI::getDOI)
.ifPresent(s -> JabRefDesktop.openCustomDoi(s, preferences, dialogService));
} else {
openExternalLinkDefault();
}
Expand All @@ -94,18 +94,6 @@ public void openExternalLinkDefault() {
);
}

public void openDOIWithCustomBase(String baseURI) {
identifier.get().map(identifier -> (DOI) identifier).flatMap(doi -> doi.getExternalURIWithCustomBase(baseURI)).ifPresent(
uri -> {
try {
JabRefDesktop.openBrowser(uri);
} catch (IOException ex) {
dialogService.showErrorDialogAndWait(Localization.lang("Unable to open link."), ex);
}
}
);
}

public boolean getIdentifierLookupInProgress() {
return identifierLookupInProgress.get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<CheckBox fx:id="protect"
text="%Refuse to save the library before external changes have been reviewed."/>

<Label styleClass="sectionHeader" text="%Export sort order"/>
<Label styleClass="sectionHeader" text="%Save sort order"/>
<SaveOrderConfigPanel fx:id="saveOrderConfigPanel"/>

<Label styleClass="sectionHeader" text="%Save actions"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ private void initialize() {
protect.disableProperty().bind(viewModel.protectDisableProperty());
protect.selectedProperty().bindBidirectional(viewModel.libraryProtectedProperty());

saveOrderConfigPanel.changeExportDescriptionToSave();
saveOrderConfigPanel.saveInOriginalProperty().bindBidirectional(viewModel.saveInOriginalProperty());
saveOrderConfigPanel.saveInTableOrderProperty().bindBidirectional(viewModel.saveInTableOrderProperty());
saveOrderConfigPanel.saveInSpecifiedOrderProperty().bindBidirectional(viewModel.saveInSpecifiedOrderProperty());
Expand Down
Loading

0 comments on commit 5b2b64c

Please sign in to comment.