diff --git a/CHANGELOG.md b/CHANGELOG.md index 1477782a160..24af6f3b56c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,10 +46,12 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where changing entry type doesn't always work when biblatex source is shown. [#5905](https://github.com/JabRef/jabref/issues/5905) - We fixed an issue where the group and the link column were not updated after changing the entry in the main table. [#5985](https://github.com/JabRef/jabref/issues/5985) - We fixed an issue where reordering the groups was not possible after inserting an article. [#6008](https://github.com/JabRef/jabref/issues/6008) +- We fixed an issue where citation styles except the default "Preview" could not be used. [#56220](https://github.com/JabRef/jabref/issues/5622) ### Removed - Ampersands are no longer escaped by default in the `bib` file. If you want to keep the current behaviour, you can use the new "Escape Ampersands" formatter as a save action. [#5869](https://github.com/JabRef/jabref/issues/5869) +- The "Merge Entries" entry was removed from the Quality Menu. Users should use the right-click menu instead. [#6021](https://github.com/JabRef/jabref/pull/6021) ## [5.0-beta] – 2019-12-15 diff --git a/build.gradle b/build.gradle index 3daa53628ce..72d2f156e01 100644 --- a/build.gradle +++ b/build.gradle @@ -181,7 +181,7 @@ dependencies { implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' - implementation 'de.undercouch:citeproc-java:2.0.0' + implementation 'de.undercouch:citeproc-java:2.1.0-SNAPSHOT' implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.1' implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.2' @@ -205,7 +205,7 @@ dependencies { testImplementation 'net.bytebuddy:byte-buddy-parent:1.10.8' 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.3.0' + testImplementation 'org.mockito:mockito-core:3.3.1' testImplementation 'org.xmlunit:xmlunit-core:2.6.3' testImplementation 'org.xmlunit:xmlunit-matchers:2.6.3' testImplementation 'com.tngtech.archunit:archunit-junit5-api:0.13.1' @@ -238,14 +238,12 @@ dependencyUpdates.resolutionStrategy = { } } rules.withModule("org.python:jython-standalone") { ComponentSelection selection -> - if (selection.candidate.version ==~ /2.7.2b2/) { + if (selection.candidate.version ==~ /2.7.2b\d/) { selection.reject('Release candidate') } } rules.withModule("de.jensd:fontawesomefx-materialdesignfont") { ComponentSelection selection -> - if (selection.candidate.version ==~ /2.0.26-9.1.2/ - || selection.candidate.version ==~ /2.0.26-9.1.1/ - || selection.candidate.version ==~ /2.0.26-9.1.0/) { + if (selection.candidate.version ==~ /2.0.26.*/) { selection.reject('1.7.22-11 is actually newer (strange version system)') } } @@ -546,7 +544,7 @@ task deleteInstallerTemp(type: Delete) { jpackage.dependsOn deleteInstallerTemp jlink { - options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] + options = ['--strip-debug','--compress', '2', '--no-header-files', '--no-man-pages'] launcher { name = 'JabRef' } diff --git a/codecov.yml b/codecov.yml index 29aaa66eedc..78fd542fe8a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -3,4 +3,7 @@ coverage: - src/gen/.* status: patch: false + project: + default: + threshold: 0.005 comment: off diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index a90f0226983..6ef392d0005 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -61,7 +61,11 @@ requires jbibtex; requires citeproc.java; requires antlr.runtime; - requires org.graalvm.js; + requires org.graalvm.truffle; + requires org.graalvm.sdk; + requires transitive org.graalvm.js; + requires java.scripting; + requires jdk.internal.vm.compiler; requires org.apache.xmpbox; requires de.saxsys.mvvmfx.validation; requires com.google.gson; diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 3ac91212dbf..c7bc0a63088 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -89,7 +89,6 @@ import org.jabref.gui.keyboard.KeyBinding; import org.jabref.gui.libraryproperties.LibraryPropertiesAction; import org.jabref.gui.menus.FileHistoryMenu; -import org.jabref.gui.mergeentries.MergeEntriesAction; import org.jabref.gui.metadata.BibtexStringEditorAction; import org.jabref.gui.metadata.PreambleEditor; import org.jabref.gui.preferences.ShowPreferencesAction; @@ -409,7 +408,7 @@ private void initLayout() { setId("frame"); - VBox head = new VBox(createMenu(),createToolbar()); + VBox head = new VBox(createMenu(), createToolbar()); head.setSpacing(0d); setTop(head); @@ -682,8 +681,12 @@ private MenuBar createMenu() { factory.createMenuItem(StandardActions.EXPORT_SELECTED, new ExportCommand(this, true, Globals.prefs)), factory.createMenuItem(StandardActions.SAVE_SELECTED_AS_PLAIN_BIBTEX, new OldDatabaseCommandWrapper(Actions.SAVE_SELECTED_AS_PLAIN, this, stateManager))), - factory.createMenuItem(StandardActions.CONNECT_TO_SHARED_DB, new ConnectToSharedDatabaseCommand(this)), - factory.createMenuItem(StandardActions.PULL_CHANGES_FROM_SHARED_DB, new OldDatabaseCommandWrapper(Actions.PULL_CHANGES_FROM_SHARED_DATABASE, this, stateManager)), + new SeparatorMenuItem(), + + factory.createSubMenu(StandardActions.REMOTE_DB, + factory.createMenuItem(StandardActions.CONNECT_TO_SHARED_DB, new ConnectToSharedDatabaseCommand(this)), + factory.createMenuItem(StandardActions.PULL_CHANGES_FROM_SHARED_DB, new OldDatabaseCommandWrapper(Actions.PULL_CHANGES_FROM_SHARED_DATABASE, this, stateManager)) + ), new SeparatorMenuItem(), @@ -756,19 +759,27 @@ private MenuBar createMenu() { quality.getItems().addAll( factory.createMenuItem(StandardActions.FIND_DUPLICATES, new DuplicateSearch(this, dialogService, stateManager)), - factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(this, stateManager)), factory.createMenuItem(StandardActions.CHECK_INTEGRITY, new IntegrityCheckAction(this, stateManager, Globals.TASK_EXECUTOR)), factory.createMenuItem(StandardActions.CLEANUP_ENTRIES, new OldDatabaseCommandWrapper(Actions.CLEANUP, this, stateManager)), new SeparatorMenuItem(), - factory.createMenuItem(StandardActions.SET_FILE_LINKS, new AutoLinkFilesAction(this, prefs, stateManager, undoManager, Globals.TASK_EXECUTOR)) + factory.createMenuItem(StandardActions.SET_FILE_LINKS, new AutoLinkFilesAction(this, prefs, stateManager, undoManager, Globals.TASK_EXECUTOR)), + + new SeparatorMenuItem(), + + factory.createSubMenu(StandardActions.ABBREVIATE, + factory.createMenuItem(StandardActions.ABBREVIATE_DEFAULT, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_DEFAULT, this, stateManager)), + factory.createMenuItem(StandardActions.ABBREVIATE_MEDLINE, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_MEDLINE, this, stateManager)), + factory.createMenuItem(StandardActions.ABBREVIATE_SHORTEST_UNIQUE, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_SHORTEST_UNIQUE, this, stateManager))), + + factory.createMenuItem(StandardActions.UNABBREVIATE, new OldDatabaseCommandWrapper(Actions.UNABBREVIATE, this, stateManager)) ); lookup.getItems().addAll( factory.createMenuItem(StandardActions.FIND_DUPLICATES, new DuplicateSearch(this, dialogService, stateManager)) ); - + // PushToApplication final PushToApplicationAction pushToApplicationAction = pushToApplicationsManager.getPushToApplicationAction(); final MenuItem pushToApplicationMenuItem = factory.createMenuItem(pushToApplicationAction.getActionInformation(), pushToApplicationAction); @@ -792,14 +803,7 @@ private MenuBar createMenu() { new SeparatorMenuItem(), factory.createMenuItem(StandardActions.SEND_AS_EMAIL, new OldDatabaseCommandWrapper(Actions.SEND_AS_EMAIL, this, stateManager)), - pushToApplicationMenuItem, - - factory.createSubMenu(StandardActions.ABBREVIATE, - factory.createMenuItem(StandardActions.ABBREVIATE_DEFAULT, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_DEFAULT, this, stateManager)), - factory.createMenuItem(StandardActions.ABBREVIATE_MEDLINE, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_MEDLINE, this, stateManager)), - factory.createMenuItem(StandardActions.ABBREVIATE_SHORTEST_UNIQUE, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_SHORTEST_UNIQUE, this, stateManager))), - - factory.createMenuItem(StandardActions.UNABBREVIATE, new OldDatabaseCommandWrapper(Actions.UNABBREVIATE, this, stateManager)) + pushToApplicationMenuItem ); SidePaneComponent webSearch = sidePaneManager.getComponent(SidePaneType.WEB_SEARCH); diff --git a/src/main/java/org/jabref/gui/actions/StandardActions.java b/src/main/java/org/jabref/gui/actions/StandardActions.java index c1b7a2dfa7c..930d710a495 100644 --- a/src/main/java/org/jabref/gui/actions/StandardActions.java +++ b/src/main/java/org/jabref/gui/actions/StandardActions.java @@ -71,6 +71,7 @@ public enum StandardActions implements Action { IMPORT_INTO_NEW_LIBRARY(Localization.lang("Import into new library"), KeyBinding.IMPORT_INTO_NEW_DATABASE), IMPORT_INTO_CURRENT_LIBRARY(Localization.lang("Import into current library"), KeyBinding.IMPORT_INTO_CURRENT_DATABASE), EXPORT_ALL(Localization.lang("Export all entries")), + REMOTE_DB(Localization.lang("Shared database"), IconTheme.JabRefIcons.REMOTE_DATABASE), EXPORT_SELECTED(Localization.lang("Export selected entries"), KeyBinding.EXPORT_SELECTED), CONNECT_TO_SHARED_DB(Localization.lang("Connect to shared database"), IconTheme.JabRefIcons.CONNECT_DB), PULL_CHANGES_FROM_SHARED_DB(Localization.lang("Pull changes from shared database"), KeyBinding.PULL_CHANGES_FROM_SHARED_DATABASE), diff --git a/src/main/java/org/jabref/gui/icon/IconTheme.java b/src/main/java/org/jabref/gui/icon/IconTheme.java index 112df9d206e..0faa4d0eb7a 100644 --- a/src/main/java/org/jabref/gui/icon/IconTheme.java +++ b/src/main/java/org/jabref/gui/icon/IconTheme.java @@ -300,6 +300,7 @@ public enum JabRefIcons implements JabRefIcon { ADD_ABBREVIATION(MaterialDesignIcon.PLAYLIST_PLUS), REMOVE_ABBREVIATION(MaterialDesignIcon.PLAYLIST_MINUS), NEW_ENTRY_FROM_PLAIN_TEXT(MaterialDesignIcon.PLUS_BOX), + REMOTE_DATABASE(MaterialDesignIcon.DATABASE), HOME(MaterialDesignIcon.HOME); private final JabRefIcon icon; diff --git a/src/main/java/org/jabref/gui/util/FieldsUtil.java b/src/main/java/org/jabref/gui/util/FieldsUtil.java index 7a72b944c91..f461a5123d4 100644 --- a/src/main/java/org/jabref/gui/util/FieldsUtil.java +++ b/src/main/java/org/jabref/gui/util/FieldsUtil.java @@ -2,6 +2,8 @@ import javafx.util.StringConverter; +import org.jabref.Globals; +import org.jabref.gui.specialfields.SpecialFieldViewModel; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; @@ -30,7 +32,8 @@ public Field fromString(String string) { public static String getNameWithType(Field field) { if (field instanceof SpecialField) { - return field.getDisplayName() + " (" + Localization.lang("Special") + ")"; + return new SpecialFieldViewModel((SpecialField) field, Globals.undoManager).getLocalization() + + " (" + Localization.lang("Special") + ")"; } else if (field instanceof IEEEField) { return field.getDisplayName() + " (" + Localization.lang("IEEE") + ")"; } else if (field instanceof InternalField) { diff --git a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java b/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java index 5728839efe9..6d34c21c514 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java +++ b/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java @@ -14,6 +14,7 @@ import org.jabref.model.strings.LatexToUnicodeAdapter; import de.undercouch.citeproc.CSL; +import de.undercouch.citeproc.DefaultAbbreviationProvider; import de.undercouch.citeproc.ItemDataProvider; import de.undercouch.citeproc.bibtex.BibTeXConverter; import de.undercouch.citeproc.csl.CSLItemData; @@ -66,7 +67,8 @@ public synchronized List makeBibliography(List bibEntries, Str private void initialize(String newStyle, CitationStyleOutputFormat newFormat) throws IOException { if ((cslInstance == null) || !Objects.equals(newStyle, style)) { // lang and forceLang are set to the default values of other CSL constructors - cslInstance = new CSL(dataProvider, new JabRefLocaleProvider(), newStyle, "en-US", false); + cslInstance = new CSL(dataProvider, new JabRefLocaleProvider(), + new DefaultAbbreviationProvider(), null, newStyle, "en-US", false, true); style = newStyle; } diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java b/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java index 05285948ccd..99ddd023239 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java +++ b/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java @@ -6,9 +6,6 @@ import java.net.URISyntaxException; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.nio.file.FileSystem; -import java.nio.file.FileSystemAlreadyExistsException; -import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.NoSuchFileException; import java.nio.file.Path; @@ -25,6 +22,7 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; +import org.jabref.JabRefMain; import org.jabref.logic.util.StandardFileType; import de.undercouch.citeproc.helper.CSLUtils; @@ -138,28 +136,18 @@ public static List discoverCitationStyles() { return STYLES; } - URL url = CitationStyle.class.getResource(STYLES_ROOT); - if (url == null) { - return Collections.emptyList(); - } + URL url = JabRefMain.class.getResource(STYLES_ROOT + "/acm-siggraph.csl"); + Objects.requireNonNull(url); + try { URI uri = url.toURI(); - if ("jar".equals(uri.getScheme())) { - try (FileSystem fs = FileSystems.newFileSystem(uri, Collections.emptyMap())) { - Path path = fs.getPath(STYLES_ROOT); - STYLES.addAll(discoverCitationStylesInPath(path)); - } catch (FileSystemAlreadyExistsException e) { - try (FileSystem fs = FileSystems.getFileSystem(uri)) { - Path path = fs.getPath(STYLES_ROOT); - STYLES.addAll(discoverCitationStylesInPath(path)); - } - } - } else { - STYLES.addAll(discoverCitationStylesInPath(Paths.get(uri))); - } + Path path = Path.of(uri).getParent(); + + STYLES.addAll(discoverCitationStylesInPath(path)); + return STYLES; } catch (URISyntaxException | IOException e) { - LOGGER.error("something went wrong while searching available CitationStyles. Are you running directly from source code?", e); + LOGGER.error("something went wrong while searching available CitationStyles", e); return Collections.emptyList(); } } diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index e8c18de9a7d..576ec67ee0d 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2115,4 +2115,5 @@ Optional=Optional Required=Required Entry\ type\ cannot\ be\ empty.\ Please\ enter\ a\ name.=Entry type cannot be empty. Please enter a name. Field\ cannot\ be\ empty.\ Please\ enter\ a\ name.=Field cannot be empty. Please enter a name. +Shared\ database=Shared database Lookup=Lookup