diff --git a/.github/workflows/cleanup_pr.yml b/.github/workflows/cleanup_pr.yml index 863a7a57bb3..fc83191f00d 100644 --- a/.github/workflows/cleanup_pr.yml +++ b/.github/workflows/cleanup_pr.yml @@ -5,15 +5,14 @@ on: types: [closed] jobs: - build: - + cleanup: runs-on: ubuntu-latest steps: - name: Extract branch name id: extract_branch run: | - echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + echo "##[set-output name=branch;]$(echo ${{ github.event.pull_request.head.ref }})" - name: Delete folder on builds.jabref.org uses: appleboy/ssh-action@v0.0.6 with: diff --git a/.github/workflows/refresh-csl-subtrees.yml b/.github/workflows/refresh-csl-subtrees.yml index b6f6a59e98e..b6bcffbf6e9 100644 --- a/.github/workflows/refresh-csl-subtrees.yml +++ b/.github/workflows/refresh-csl-subtrees.yml @@ -1,6 +1,10 @@ name: Refresh Citation Style Language Files on: + push: + paths: + - '.github/workflows/refresh-csl-subtrees.yml' + - 'src/main/resources/csl-locales/**' schedule: # run on 1st and 15th of each month - cron: '1 2 1,15 * *' @@ -11,28 +15,32 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout source - uses: actions/checkout@v2-beta + uses: actions/checkout@v2 with: ref: master + fetch-depth: 0 - name: Add csl-styles remote run: git remote add -f csl-styles https://github.com/citation-style-language/styles.git - name: Update csl-styles - run: | + run: | git checkout master + git config --local core.editor /usr/bin/cat + git config user.name "github actions" + git config user.email "jabrefmail+webfeedback@gmail.com" git subtree pull --prefix src/main/resources/csl-styles csl-styles master --squash - name: Add csl-locales remote run: git remote add -f csl-locales https://github.com/citation-style-language/locales.git - name: Update csl-locales run: | - git checkout master git subtree pull --prefix src/main/resources/csl-locales csl-locales master --squash - uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} + branch: master - name: Report issues if: failure() uses: JasonEtco/create-an-issue@master - env: + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: filename: .github/failure-csl-update.md diff --git a/.github/workflows/tests-oracle.yml b/.github/workflows/tests-oracle.yml index 850a561cc9c..b86806667bd 100644 --- a/.github/workflows/tests-oracle.yml +++ b/.github/workflows/tests-oracle.yml @@ -2,6 +2,8 @@ name: Oracle Tests on: push: + branches: + - master paths: - 'src/test/java/org/jabref/model/database/**' - 'src/test/java/org/jabref/logic/shared/**' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d408315577d..4786f358e28 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,11 @@ name: Tests -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + # always run on pull requests jobs: checkstyle: diff --git a/AUTHORS b/AUTHORS index e8ff220b00e..3b4f540c584 100644 --- a/AUTHORS +++ b/AUTHORS @@ -151,6 +151,7 @@ Jong-Ho Shinn Jorge Tornero josephshin93 Joshua Ramon Enslin +José Jesús Sinohui Fernández Julian Pfeifer Jure Slak József Pallagi @@ -182,6 +183,7 @@ Ling Wang Linus Dietz Lorenzo Genta Luciana de Melo e Abud +Luis Romero Mairieli Wessel Malik Atalla Malte Deiseroth @@ -196,6 +198,7 @@ Martin Stolle Martina Catizone Mathias Walter Matthias Geiger +Matthias Mueller Mattia Bunel Mattias Ulbrich mcmoody diff --git a/CHANGELOG.md b/CHANGELOG.md index c68c9635ce7..8489723adc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where the Medline fetcher was only working when JabRef was running from source [#5645](https://github.com/JabRef/jabref/issues/5645) - We fixed some visual issues in the dark theme [#5764](https://github.com/JabRef/jabref/pull/5764) [#5753](https://github.com/JabRef/jabref/issues/5753) - We fixed an issue where non-default previews didn't handle unicode characters. [#5779](https://github.com/JabRef/jabref/issues/5779) +- We fixed an issue where the ampersand character wasn't rendering correctly on previews.[#3840](https://github.com/JabRef/jabref/issues/3840) ### Removed diff --git a/build.gradle b/build.gradle index 389cd30fd49..d1dcd020cb3 100644 --- a/build.gradle +++ b/build.gradle @@ -255,7 +255,9 @@ dependencyUpdates.resolutionStrategy = { } } rules.withModule("de.jensd:fontawesomefx-materialdesignfont") { ComponentSelection selection -> - if (selection.candidate.version ==~ /2.0.26-9.1.1/ || selection.candidate.version ==~ /2.0.26-9.1.2/) { + 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/) { selection.reject('1.7.22-11 is actually newer (strange version system)') } } diff --git a/src/main/java/org/jabref/gui/BasePanel.java b/src/main/java/org/jabref/gui/BasePanel.java index ff63746c6cc..efec6542ab0 100644 --- a/src/main/java/org/jabref/gui/BasePanel.java +++ b/src/main/java/org/jabref/gui/BasePanel.java @@ -59,7 +59,7 @@ import org.jabref.gui.undo.CountingUndoManager; import org.jabref.gui.undo.NamedCompound; import org.jabref.gui.undo.UndoableFieldChange; -import org.jabref.gui.undo.UndoableInsertEntry; +import org.jabref.gui.undo.UndoableInsertEntries; import org.jabref.gui.undo.UndoableRemoveEntries; import org.jabref.gui.util.DefaultTaskExecutor; import org.jabref.gui.worker.SendAsEMailAction; @@ -80,8 +80,8 @@ import org.jabref.model.database.KeyCollisionException; import org.jabref.model.database.event.BibDatabaseContextChangedEvent; import org.jabref.model.database.event.CoarseChangeFilter; +import org.jabref.model.database.event.EntriesAddedEvent; import org.jabref.model.database.event.EntriesRemovedEvent; -import org.jabref.model.database.event.EntryAddedEvent; import org.jabref.model.database.shared.DatabaseLocation; import org.jabref.model.database.shared.DatabaseSynchronizer; import org.jabref.model.entry.BibEntry; @@ -168,7 +168,7 @@ public BasePanel(JabRefFrame frame, BasePanelPreferences preferences, BibDatabas setupActions(); this.getDatabase().registerListener(new SearchListener()); - this.getDatabase().registerListener(new EntryRemovedListener()); + this.getDatabase().registerListener(new EntriesRemovedListener()); // ensure that at each addition of a new entry, the entry is added to the groups interface this.bibDatabaseContext.getDatabase().registerListener(new GroupTreeListener()); @@ -605,29 +605,39 @@ public void registerUndoableChanges(List changes) { } } + public void insertEntry(final BibEntry bibEntry) { + if (bibEntry != null) { + insertEntries(Collections.singletonList(bibEntry)); + } + } + /** - * This method is called from JabRefFrame when the user wants to create a new entry. + * This method is called from JabRefFrame when the user wants to create a new entry or entries. + * It is necessary when the user would expect the added entry or one of the added entries + * to be selected in the entry editor * - * @param bibEntry The new entry. + * @param entries The new entries. */ - public void insertEntry(final BibEntry bibEntry) { - if (bibEntry != null) { + + public void insertEntries(final List entries) { + if (!entries.isEmpty()) { try { - bibDatabaseContext.getDatabase().insertEntry(bibEntry); + bibDatabaseContext.getDatabase().insertEntries(entries); // Set owner and timestamp - UpdateField.setAutomaticFields(bibEntry, true, true, Globals.prefs.getUpdateFieldPreferences()); - - // Create an UndoableInsertEntry object. - getUndoManager().addEdit(new UndoableInsertEntry(bibDatabaseContext.getDatabase(), bibEntry)); + for (BibEntry entry : entries) { + UpdateField.setAutomaticFields(entry, true, true, Globals.prefs.getUpdateFieldPreferences()); + } + // Create an UndoableInsertEntries object. + getUndoManager().addEdit(new UndoableInsertEntries(bibDatabaseContext.getDatabase(), entries)); markBaseChanged(); // The database just changed. if (Globals.prefs.getBoolean(JabRefPreferences.AUTO_OPEN_FORM)) { - showAndEdit(bibEntry); + showAndEdit(entries.get(0)); } - clearAndSelect(bibEntry); + clearAndSelect(entries.get(0)); } catch (KeyCollisionException ex) { - LOGGER.info("Collision for bibtex key" + bibEntry.getId(), ex); + LOGGER.info("Collision for bibtex key" + ex.getId(), ex); } } } @@ -1111,22 +1121,21 @@ public void searchAndOpen() { private class GroupTreeListener { @Subscribe - public void listen(EntryAddedEvent addedEntryEvent) { - // if the added entry is an undo don't add it to the current group - if (addedEntryEvent.getEntriesEventSource() == EntriesEventSource.UNDO) { + public void listen(EntriesAddedEvent addedEntriesEvent) { + // if the event is an undo, don't add it to the current group + if (addedEntriesEvent.getEntriesEventSource() == EntriesEventSource.UNDO) { return; } - // Automatically add new entry to the selected group (or set of groups) + // Automatically add new entries to the selected group (or set of groups) if (Globals.prefs.getBoolean(JabRefPreferences.AUTO_ASSIGN_GROUP)) { - final List entries = Collections.singletonList(addedEntryEvent.getBibEntry()); Globals.stateManager.getSelectedGroup(bibDatabaseContext).forEach( - selectedGroup -> selectedGroup.addEntriesToGroup(entries)); + selectedGroup -> selectedGroup.addEntriesToGroup(addedEntriesEvent.getBibEntries())); } } } - private class EntryRemovedListener { + private class EntriesRemovedListener { @Subscribe public void listen(EntriesRemovedEvent entriesRemovedEvent) { @@ -1141,8 +1150,8 @@ public void listen(EntriesRemovedEvent entriesRemovedEvent) { private class SearchAutoCompleteListener { @Subscribe - public void listen(EntryAddedEvent addedEntryEvent) { - DefaultTaskExecutor.runInJavaFXThread(() -> searchAutoCompleter.indexEntry(addedEntryEvent.getBibEntry())); + public void listen(EntriesAddedEvent addedEntriesEvent) { + DefaultTaskExecutor.runInJavaFXThread(() -> addedEntriesEvent.getBibEntries().forEach(entry -> searchAutoCompleter.indexEntry(entry))); } @Subscribe @@ -1158,7 +1167,7 @@ public void listen(EntryChangedEvent entryChangedEvent) { private class SearchListener { @Subscribe - public void listen(EntryAddedEvent addedEntryEvent) { + public void listen(EntriesAddedEvent addedEntryEvent) { DefaultTaskExecutor.runInJavaFXThread(() -> frame.getGlobalSearchBar().performSearch()); } diff --git a/src/main/java/org/jabref/gui/autocompleter/AutoCompleteUpdater.java b/src/main/java/org/jabref/gui/autocompleter/AutoCompleteUpdater.java index 7fe7fec4aba..7ace3ef5bba 100644 --- a/src/main/java/org/jabref/gui/autocompleter/AutoCompleteUpdater.java +++ b/src/main/java/org/jabref/gui/autocompleter/AutoCompleteUpdater.java @@ -1,6 +1,9 @@ package org.jabref.gui.autocompleter; -import org.jabref.model.database.event.EntryAddedEvent; +import java.util.List; + +import org.jabref.model.database.event.EntriesAddedEvent; +import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.event.EntryChangedEvent; import com.google.common.eventbus.Subscribe; @@ -17,8 +20,11 @@ public AutoCompleteUpdater(SuggestionProviders suggestionProviders) { } @Subscribe - public void listen(EntryAddedEvent addedEntryEvent) { - suggestionProviders.indexEntry(addedEntryEvent.getBibEntry()); + public void listen(EntriesAddedEvent entryAddedEvent) { + List entries = entryAddedEvent.getBibEntries(); + for (BibEntry entry : entries) { + suggestionProviders.indexEntry(entry); + } } @Subscribe diff --git a/src/main/java/org/jabref/gui/collab/ChangeDisplayDialog.java b/src/main/java/org/jabref/gui/collab/ChangeDisplayDialog.java index a1124f837ee..47d2de3d873 100644 --- a/src/main/java/org/jabref/gui/collab/ChangeDisplayDialog.java +++ b/src/main/java/org/jabref/gui/collab/ChangeDisplayDialog.java @@ -3,7 +3,9 @@ import java.util.List; import javafx.collections.FXCollections; +import javafx.scene.control.Button; import javafx.scene.control.ButtonBar; +import javafx.scene.control.ButtonBar.ButtonData; import javafx.scene.control.ButtonType; import javafx.scene.control.CheckBox; import javafx.scene.control.Label; @@ -11,6 +13,8 @@ import javafx.scene.control.ScrollPane; import javafx.scene.control.SplitPane; import javafx.scene.layout.BorderPane; +import javafx.scene.layout.Region; +import javafx.scene.layout.VBox; import org.jabref.gui.undo.NamedCompound; import org.jabref.gui.util.BaseDialog; @@ -21,7 +25,7 @@ class ChangeDisplayDialog extends BaseDialog { - private final ListView tree; + private final ListView changesList; private final BorderPane infoPanel = new BorderPane(); private final CheckBox cb = new CheckBox(Localization.lang("Accept change")); @@ -29,39 +33,60 @@ public ChangeDisplayDialog(BibDatabaseContext database, List(FXCollections.observableArrayList(changes)); - tree.setPrefWidth(160); - EasyBind.subscribe(tree.getSelectionModel().selectedItemProperty(), this::selectedChangeChanged); + changesList = new ListView<>(FXCollections.observableArrayList(changes)); + changesList.setPrefWidth(200); + EasyBind.subscribe(changesList.getSelectionModel().selectedItemProperty(), this::selectedChangeChanged); SplitPane pane = new SplitPane(); pane.setDividerPositions(0.2); - ScrollPane scroll = new ScrollPane(tree); - scroll.setFitToHeight(true); - scroll.setFitToWidth(true); - pane.getItems().addAll(scroll, infoPanel); - pane.setResizableWithParent(scroll, false); - getDialogPane().setContent(pane); + Button selectAllChangesFromDisk = new Button(Localization.lang("Mark all changes as accepted")); + selectAllChangesFromDisk.setMinWidth(Region.USE_PREF_SIZE); + selectAllChangesFromDisk.setOnAction(evt -> { + for (DatabaseChangeViewModel change : changes) { + change.setAccepted(true); + } + }); + Button unselectAllAcceptChanges = new Button(Localization.lang("Unmark all changes")); + unselectAllAcceptChanges.setOnAction(evt -> { + for (DatabaseChangeViewModel change : changes) { + change.setAccepted(false); + } + }); + VBox leftContent = new VBox(changesList, + selectAllChangesFromDisk, + unselectAllAcceptChanges); + + ScrollPane leftScroll = new ScrollPane(leftContent); + leftScroll.setFitToHeight(true); + leftScroll.setFitToWidth(true); + + pane.getItems().addAll(leftScroll, infoPanel); + pane.setResizableWithParent(leftScroll, false); + + getDialogPane().setContent(pane); Label rootInfo = new Label(Localization.lang("Select the tree nodes to view and accept or reject changes") + '.'); infoPanel.setCenter(rootInfo); - tree.getSelectionModel().select(0); + changesList.getSelectionModel().selectFirst(); - ButtonType dismissChanges = new ButtonType(Localization.lang("Dismiss changes"), ButtonBar.ButtonData.CANCEL_CLOSE); - getDialogPane().getButtonTypes().setAll( - new ButtonType(Localization.lang("Accept changes"), ButtonBar.ButtonData.APPLY), - dismissChanges - ); + ButtonType dismissChanges = new ButtonType(Localization.lang("Dismiss"), ButtonData.CANCEL_CLOSE); + + getDialogPane().getButtonTypes().setAll(new ButtonType(Localization.lang("Accept changes"), ButtonBar.ButtonData.APPLY), + dismissChanges); setResultConverter(button -> { if (button == dismissChanges) { return false; + } else { // Perform all accepted changes NamedCompound ce = new NamedCompound(Localization.lang("Merged external changes")); for (DatabaseChangeViewModel change : changes) { - if (change.isAccepted()) { + if (change instanceof EntryChangeViewModel) { + change.makeChange(database, ce); //We don't have a checkbox for accept and always get the correct merged entry, the accept property in this special case only controls the radio buttons selection + } else if (change.isAccepted()) { change.makeChange(database, ce); } } @@ -72,20 +97,21 @@ public ChangeDisplayDialog(BibDatabaseContext database, List { - if ((selected != null) && (tree.getSelectionModel().getSelectedItem() != null)) { - tree.getSelectionModel().getSelectedItem().setAccepted(selected); - } - }); } private void selectedChangeChanged(DatabaseChangeViewModel currentChange) { if (currentChange != null) { infoPanel.setCenter(currentChange.description()); + if (!(currentChange instanceof EntryChangeViewModel)) { + cb.setManaged(true); infoPanel.setBottom(cb); - cb.setSelected(currentChange.isAccepted()); + cb.selectedProperty().bindBidirectional(currentChange.acceptedProperty()); + + } else { + cb.setManaged(false); } + } } } diff --git a/src/main/java/org/jabref/gui/collab/DatabaseChangeViewModel.java b/src/main/java/org/jabref/gui/collab/DatabaseChangeViewModel.java index 1d3cecd3a8d..5665c47caf3 100644 --- a/src/main/java/org/jabref/gui/collab/DatabaseChangeViewModel.java +++ b/src/main/java/org/jabref/gui/collab/DatabaseChangeViewModel.java @@ -1,5 +1,7 @@ package org.jabref.gui.collab; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.SimpleBooleanProperty; import javafx.scene.Node; import org.jabref.gui.undo.NamedCompound; @@ -8,7 +10,7 @@ abstract class DatabaseChangeViewModel { protected String name; - private boolean accepted = true; + private BooleanProperty acceptedProperty = new SimpleBooleanProperty(true); DatabaseChangeViewModel() { name = ""; @@ -24,11 +26,15 @@ public String toString() { } public boolean isAccepted() { - return accepted; + return acceptedProperty.getValue(); } - public void setAccepted(boolean a) { - accepted = a; + public BooleanProperty acceptedProperty() { + return this.acceptedProperty; + } + + public void setAccepted(boolean accepted) { + this.acceptedProperty.setValue(accepted); } /** diff --git a/src/main/java/org/jabref/gui/collab/EntryAddChangeViewModel.java b/src/main/java/org/jabref/gui/collab/EntryAddChangeViewModel.java index cb41f3d4d0a..ea28f4e9d1d 100644 --- a/src/main/java/org/jabref/gui/collab/EntryAddChangeViewModel.java +++ b/src/main/java/org/jabref/gui/collab/EntryAddChangeViewModel.java @@ -6,7 +6,7 @@ import org.jabref.JabRefGUI; import org.jabref.gui.preview.PreviewViewer; import org.jabref.gui.undo.NamedCompound; -import org.jabref.gui.undo.UndoableInsertEntry; +import org.jabref.gui.undo.UndoableInsertEntries; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; @@ -26,7 +26,7 @@ public EntryAddChangeViewModel(BibEntry entry) { @Override public void makeChange(BibDatabaseContext database, NamedCompound undoEdit) { database.getDatabase().insertEntry(entry); - undoEdit.addEdit(new UndoableInsertEntry(database.getDatabase(), entry)); + undoEdit.addEdit(new UndoableInsertEntries(database.getDatabase(), entry)); } @Override diff --git a/src/main/java/org/jabref/gui/collab/EntryChangeViewModel.java b/src/main/java/org/jabref/gui/collab/EntryChangeViewModel.java index 0fa2b5de139..adc8de730d7 100644 --- a/src/main/java/org/jabref/gui/collab/EntryChangeViewModel.java +++ b/src/main/java/org/jabref/gui/collab/EntryChangeViewModel.java @@ -8,7 +8,7 @@ import org.jabref.gui.mergeentries.MergeEntries; import org.jabref.gui.mergeentries.MergeEntries.DefaultRadioButtonSelectionMode; import org.jabref.gui.undo.NamedCompound; -import org.jabref.gui.undo.UndoableInsertEntry; +import org.jabref.gui.undo.UndoableInsertEntries; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; @@ -39,19 +39,30 @@ public EntryChangeViewModel(BibEntry entry, BibEntry newEntry, BibDatabaseContex } + /** + * We override this here to select the radio buttons accordingly + */ + @Override + public void setAccepted(boolean accepted) { + super.setAccepted(accepted); + if (accepted) { + mergePanel.selectAllRightRadioButtons(); + } else { + mergePanel.selectAllLeftRadioButtons(); + } + } + @Override public void makeChange(BibDatabaseContext database, NamedCompound undoEdit) { database.getDatabase().removeEntry(oldEntry); database.getDatabase().insertEntry(mergePanel.getMergeEntry()); - undoEdit.addEdit(new UndoableInsertEntry(database.getDatabase(), oldEntry)); - undoEdit.addEdit(new UndoableInsertEntry(database.getDatabase(), mergePanel.getMergeEntry())); + undoEdit.addEdit(new UndoableInsertEntries(database.getDatabase(), oldEntry)); + undoEdit.addEdit(new UndoableInsertEntries(database.getDatabase(), mergePanel.getMergeEntry())); } @Override public Node description() { - mergePanel = new MergeEntries(oldEntry, newEntry, Localization.lang("In JabRef"), Localization.lang("On disk"), DefaultRadioButtonSelectionMode.LEFT); - VBox container = new VBox(10); Label header = new Label(name); header.getStyleClass().add("sectionHeader"); diff --git a/src/main/java/org/jabref/gui/duplicationFinder/DuplicateSearch.java b/src/main/java/org/jabref/gui/duplicationFinder/DuplicateSearch.java index 113fe4f1d2e..2c7dc4db6ab 100644 --- a/src/main/java/org/jabref/gui/duplicationFinder/DuplicateSearch.java +++ b/src/main/java/org/jabref/gui/duplicationFinder/DuplicateSearch.java @@ -21,7 +21,7 @@ import org.jabref.gui.duplicationFinder.DuplicateResolverDialog.DuplicateResolverResult; import org.jabref.gui.duplicationFinder.DuplicateResolverDialog.DuplicateResolverType; import org.jabref.gui.undo.NamedCompound; -import org.jabref.gui.undo.UndoableInsertEntry; +import org.jabref.gui.undo.UndoableInsertEntries; import org.jabref.gui.undo.UndoableRemoveEntries; import org.jabref.gui.util.BackgroundTask; import org.jabref.gui.util.DefaultTaskExecutor; @@ -167,10 +167,8 @@ private void handleDuplicates(DuplicateSearchResult result) { } // and adding merged entries: if (!result.getToAdd().isEmpty()) { - for (BibEntry entry : result.getToAdd()) { - panel.getDatabase().insertEntry(entry); - compoundEdit.addEdit(new UndoableInsertEntry(panel.getDatabase(), entry)); - } + compoundEdit.addEdit(new UndoableInsertEntries(panel.getDatabase(), result.getToAdd())); + panel.getDatabase().insertEntries(result.getToAdd()); panel.markBaseChanged(); } diff --git a/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java b/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java index 365ce487941..6e155fee70e 100644 --- a/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java +++ b/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java @@ -12,7 +12,7 @@ import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.externalfiletype.ExternalFileTypes; -import org.jabref.gui.undo.UndoableInsertEntry; +import org.jabref.gui.undo.UndoableInsertEntries; import org.jabref.logic.bibtexkeypattern.BibtexKeyGenerator; import org.jabref.logic.externalfiles.ExternalFilesContentImporter; import org.jabref.logic.importer.ImportFormatPreferences; @@ -94,7 +94,7 @@ public void importAsNewEntries(List files) { } importEntries(entriesToAdd); - entriesToAdd.forEach(entry -> ce.addEdit(new UndoableInsertEntry(database.getDatabase(), entry))); + ce.addEdit(new UndoableInsertEntries(database.getDatabase(), entriesToAdd)); } ce.end(); undoManager.addEdit(ce); @@ -109,7 +109,7 @@ private BibEntry createEmptyEntryWithLink(Path file) { public void importEntries(List entries) { //TODO: Add undo/redo - //ce.addEdit(new UndoableInsertEntry(panel.getDatabase(), entry)); + //undoManager.addEdit(new UndoableInsertEntries(panel.getDatabase(), entries)); database.getDatabase().insertEntries(entries); diff --git a/src/main/java/org/jabref/gui/importer/ImportAction.java b/src/main/java/org/jabref/gui/importer/ImportAction.java index 7a945fef1f8..2221c2e439c 100644 --- a/src/main/java/org/jabref/gui/importer/ImportAction.java +++ b/src/main/java/org/jabref/gui/importer/ImportAction.java @@ -4,7 +4,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @@ -135,9 +134,7 @@ private ParserResult mergeImportResults(List entries = pr.getDatabase().getEntries(); + List entries = pr.getDatabase().getEntries(); anythingUseful = anythingUseful | !entries.isEmpty(); // set timestamp and owner UpdateField.setAutomaticFields(entries, Globals.prefs.getUpdateFieldPreferences()); // set timestamp and owner - for (BibEntry entry : entries) { - database.insertEntry(entry); - } + database.insertEntries(entries); } } diff --git a/src/main/java/org/jabref/gui/importer/actions/AppendDatabaseAction.java b/src/main/java/org/jabref/gui/importer/actions/AppendDatabaseAction.java index 3e066cdece8..e2f60a56aa5 100644 --- a/src/main/java/org/jabref/gui/importer/actions/AppendDatabaseAction.java +++ b/src/main/java/org/jabref/gui/importer/actions/AppendDatabaseAction.java @@ -15,7 +15,7 @@ import org.jabref.gui.actions.BaseAction; import org.jabref.gui.importer.AppendDatabaseDialog; import org.jabref.gui.undo.NamedCompound; -import org.jabref.gui.undo.UndoableInsertEntry; +import org.jabref.gui.undo.UndoableInsertEntries; import org.jabref.gui.undo.UndoableInsertString; import org.jabref.gui.util.BackgroundTask; import org.jabref.gui.util.FileDialogConfiguration; @@ -59,8 +59,7 @@ private static void mergeFromBibtex(BasePanel panel, ParserResult parserResult, boolean importStrings, boolean importGroups, boolean importSelectorWords) throws KeyCollisionException { BibDatabase fromDatabase = parserResult.getDatabase(); - List appendedEntries = new ArrayList<>(); - List originalEntries = new ArrayList<>(); + List entriesToAppend = new ArrayList<>(); BibDatabase database = panel.getDatabase(); NamedCompound ce = new NamedCompound(Localization.lang("Append library")); @@ -74,11 +73,10 @@ private static void mergeFromBibtex(BasePanel panel, ParserResult parserResult, BibEntry entry = (BibEntry) originalEntry.clone(); UpdateField.setAutomaticFields(entry, overwriteOwner, overwriteTimeStamp, Globals.prefs.getUpdateFieldPreferences()); - database.insertEntry(entry); - appendedEntries.add(entry); - originalEntries.add(originalEntry); - ce.addEdit(new UndoableInsertEntry(database, entry)); + entriesToAppend.add(entry); } + database.insertEntries(entriesToAppend); + ce.addEdit(new UndoableInsertEntries(database, entriesToAppend)); } if (importStrings) { @@ -99,7 +97,7 @@ private static void mergeFromBibtex(BasePanel panel, ParserResult parserResult, ExplicitGroup group = new ExplicitGroup("Imported", GroupHierarchyType.INDEPENDENT, Globals.prefs.getKeywordDelimiter()); newGroups.setGroup(group); - group.add(appendedEntries); + group.add(entriesToAppend); } catch (IllegalArgumentException e) { LOGGER.error("Problem appending entries to group", e); } diff --git a/src/main/java/org/jabref/gui/maintable/MainTable.java b/src/main/java/org/jabref/gui/maintable/MainTable.java index 5eb3b3704fa..935470b1599 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTable.java +++ b/src/main/java/org/jabref/gui/maintable/MainTable.java @@ -32,18 +32,14 @@ import org.jabref.gui.externalfiletype.ExternalFileTypes; import org.jabref.gui.keyboard.KeyBinding; import org.jabref.gui.keyboard.KeyBindingRepository; -import org.jabref.gui.undo.NamedCompound; -import org.jabref.gui.undo.UndoableInsertEntry; import org.jabref.gui.util.ControlHelper; import org.jabref.gui.util.CustomLocalDragboard; import org.jabref.gui.util.DefaultTaskExecutor; import org.jabref.gui.util.ViewModelTableRowFactory; import org.jabref.logic.l10n.Localization; -import org.jabref.logic.util.UpdateField; import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.database.event.AllInsertsFinishedEvent; +import org.jabref.model.database.event.EntriesAddedEvent; import org.jabref.model.entry.BibEntry; -import org.jabref.preferences.JabRefPreferences; import com.google.common.eventbus.Subscribe; import org.slf4j.Logger; @@ -130,8 +126,8 @@ public MainTable(MainTableDataModel model, JabRefFrame frame, } @Subscribe - public void listen(AllInsertsFinishedEvent event) { - DefaultTaskExecutor.runInJavaFXThread(() -> clearAndSelect(event.getBibEntry())); + public void listen(EntriesAddedEvent event) { + DefaultTaskExecutor.runInJavaFXThread(() -> clearAndSelect(event.getFirstEntry())); } public void clearAndSelect(BibEntry bibEntry) { @@ -215,28 +211,8 @@ private void clearAndSelectLast() { public void paste() { // Find entries in clipboard List entriesToAdd = Globals.clipboardManager.extractData(); - + panel.insertEntries(entriesToAdd); if (!entriesToAdd.isEmpty()) { - // Add new entries - NamedCompound ce = new NamedCompound((entriesToAdd.size() > 1 ? Localization.lang("paste entries") : Localization.lang("paste entry"))); - for (BibEntry entryToAdd : entriesToAdd) { - UpdateField.setAutomaticFields(entryToAdd, Globals.prefs.getUpdateFieldPreferences()); - - database.getDatabase().insertEntry(entryToAdd); - - ce.addEdit(new UndoableInsertEntry(database.getDatabase(), entryToAdd)); - } - ce.end(); - undoManager.addEdit(ce); - - // Show editor if user want us to do this - BibEntry firstNewEntry = entriesToAdd.get(0); - if (Globals.prefs.getBoolean(JabRefPreferences.AUTO_OPEN_FORM)) { - panel.showAndEdit(firstNewEntry); - } - - // Select and focus first new entry - clearAndSelect(firstNewEntry); this.requestFocus(); } } diff --git a/src/main/java/org/jabref/gui/mergeentries/MergeEntries.java b/src/main/java/org/jabref/gui/mergeentries/MergeEntries.java index 39ea82bf64d..4494773b151 100644 --- a/src/main/java/org/jabref/gui/mergeentries/MergeEntries.java +++ b/src/main/java/org/jabref/gui/mergeentries/MergeEntries.java @@ -17,11 +17,13 @@ import javafx.collections.FXCollections; import javafx.geometry.HPos; import javafx.geometry.Insets; +import javafx.scene.control.Button; import javafx.scene.control.ComboBox; import javafx.scene.control.Label; import javafx.scene.control.RadioButton; import javafx.scene.control.ScrollPane; import javafx.scene.control.ToggleGroup; +import javafx.scene.control.Tooltip; import javafx.scene.layout.BorderPane; import javafx.scene.layout.ColumnConstraints; import javafx.scene.layout.GridPane; @@ -68,6 +70,8 @@ public class MergeEntries extends BorderPane { private Boolean identicalTypes; private List typeRadioButtons; private final DefaultRadioButtonSelectionMode defaultRadioButtonSelectionMode; + private final List leftRadioButtons = new ArrayList<>(); + private final List rightRadioButtons = new ArrayList<>(); /** * Constructor with optional column captions for the two entries @@ -218,15 +222,20 @@ private void setupFieldRows(GridPane mergePanel) { } radioButtons.put(field, list); if (leftString.isPresent()) { + leftRadioButtons.add(list.get(LEFT_RADIOBUTTON_INDEX)); list.get(LEFT_RADIOBUTTON_INDEX).setSelected(true); if (!rightString.isPresent()) { list.get(RIGHT_RADIOBUTTON_INDEX).setDisable(true); } else if (this.defaultRadioButtonSelectionMode == DefaultRadioButtonSelectionMode.RIGHT) { list.get(RIGHT_RADIOBUTTON_INDEX).setSelected(true); + rightRadioButtons.add(list.get(RIGHT_RADIOBUTTON_INDEX)); + } else { + rightRadioButtons.add(list.get(RIGHT_RADIOBUTTON_INDEX)); } } else { list.get(LEFT_RADIOBUTTON_INDEX).setDisable(true); list.get(RIGHT_RADIOBUTTON_INDEX).setSelected(true); + rightRadioButtons.add(list.get(RIGHT_RADIOBUTTON_INDEX)); } } @@ -242,29 +251,32 @@ private void setupFieldRows(GridPane mergePanel) { private void setupEntryTypeRow(GridPane mergePanel) { // Start with entry type - mergePanel.add(new Label(Localization.lang("Entry type")), 0, 1); - + int rowIndex = 1; + mergePanel.add(new Label(Localization.lang("Entry type")), 0, rowIndex); if (leftEntry.getType().equals(rightEntry.getType())) { - mergePanel.add(DiffHighlighting.forUnchanged(leftEntry.getType().getDisplayName()), 1, 1); - mergePanel.add(DiffHighlighting.forUnchanged(rightEntry.getType().getDisplayName()), 5, 1); + mergePanel.add(DiffHighlighting.forUnchanged(leftEntry.getType().getDisplayName()), 1, rowIndex); + mergePanel.add(DiffHighlighting.forUnchanged(rightEntry.getType().getDisplayName()), 5, rowIndex); identicalTypes = true; } else { - mergePanel.add(DiffHighlighting.forChanged(leftEntry.getType().getDisplayName()), 1, 1); - mergePanel.add(DiffHighlighting.forChanged(rightEntry.getType().getDisplayName()), 5, 1); + mergePanel.add(DiffHighlighting.forChanged(leftEntry.getType().getDisplayName()), 1, rowIndex); + mergePanel.add(DiffHighlighting.forChanged(rightEntry.getType().getDisplayName()), 5, rowIndex); identicalTypes = false; ToggleGroup group = new ToggleGroup(); typeRadioButtons = new ArrayList<>(2); + for (int k = 0; k < 3; k += 2) { RadioButton button = new RadioButton(); EasyBind.subscribe(button.selectedProperty(), selected -> updateMergedEntry()); typeRadioButtons.add(button); group.getToggles().add(button); - mergePanel.add(button, 2 + k, 1); + mergePanel.add(button, 2 + k, rowIndex); } if (defaultRadioButtonSelectionMode == DefaultRadioButtonSelectionMode.RIGHT) { typeRadioButtons.get(1).setSelected(true); //This Radio Button list does not have a third option as compared to the fields, so do not use the constants here + rightRadioButtons.add(typeRadioButtons.get(1)); } else { typeRadioButtons.get(0).setSelected(true); + leftRadioButtons.add(typeRadioButtons.get(0)); } } } @@ -272,16 +284,24 @@ private void setupEntryTypeRow(GridPane mergePanel) { private void setupHeadingRows(GridPane mergePanel) { // Set headings for (int i = 0; i < NUMBER_OF_COLUMNS; i++) { - Label colHeading = new Label(); if (i == 2) { - colHeading.setGraphic(JabRefIcons.LEFT.getGraphicNode()); + Button selectAllLeft = new Button(); + selectAllLeft.setGraphic(JabRefIcons.LEFT.getGraphicNode()); + selectAllLeft.setOnAction(evt -> this.selectAllLeftRadioButtons()); + selectAllLeft.setTooltip(new Tooltip(Localization.lang("Select all changes on the left"))); + mergePanel.add(selectAllLeft, i, 0); } else if (i == 4) { - colHeading.setGraphic(JabRefIcons.RIGHT.getGraphicNode()); + Button selectAllRight = new Button(); + selectAllRight.setOnAction(evt -> this.selectAllRightRadioButtons()); + selectAllRight.setGraphic(JabRefIcons.RIGHT.getGraphicNode()); + selectAllRight.setTooltip(new Tooltip(Localization.lang("Select all changes on the right"))); + mergePanel.add(selectAllRight, i, 0); } else { - colHeading.setText(columnHeadings.get(i)); + Label colHeading = new Label(columnHeadings.get(i)); + colHeading.setMinWidth(USE_PREF_SIZE); + mergePanel.add(colHeading, i, 0); } - colHeading.setMinWidth(USE_PREF_SIZE); - mergePanel.add(colHeading, i, 0); + } } @@ -349,6 +369,18 @@ private void updateFieldValues(Collection fields) { } } + public void selectAllRightRadioButtons() { + for (RadioButton radioButton : rightRadioButtons) { + radioButton.setSelected(true); + } + } + + public void selectAllLeftRadioButtons() { + for (RadioButton radioButton : leftRadioButtons) { + radioButton.setSelected(true); + } + } + /** * @return Merged BibEntry */ diff --git a/src/main/java/org/jabref/gui/mergeentries/MergeEntriesAction.java b/src/main/java/org/jabref/gui/mergeentries/MergeEntriesAction.java index 701e8e49599..baca427159e 100644 --- a/src/main/java/org/jabref/gui/mergeentries/MergeEntriesAction.java +++ b/src/main/java/org/jabref/gui/mergeentries/MergeEntriesAction.java @@ -10,7 +10,7 @@ import org.jabref.gui.StateManager; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.undo.NamedCompound; -import org.jabref.gui.undo.UndoableInsertEntry; +import org.jabref.gui.undo.UndoableInsertEntries; import org.jabref.gui.undo.UndoableRemoveEntries; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; @@ -57,7 +57,7 @@ public void execute() { // Create a new entry and add it to the undo stack // Remove the other two entries and add them to the undo stack (which is not working...) NamedCompound ce = new NamedCompound(Localization.lang("Merge entries")); - ce.addEdit(new UndoableInsertEntry(basePanel.getDatabase(), mergedEntry.get())); + ce.addEdit(new UndoableInsertEntries(basePanel.getDatabase(), mergedEntry.get())); List entriesToRemove = Arrays.asList(one, two); ce.addEdit(new UndoableRemoveEntries(basePanel.getDatabase(), entriesToRemove)); basePanel.getDatabase().removeEntries(entriesToRemove); diff --git a/src/main/java/org/jabref/gui/openoffice/OOBibBase.java b/src/main/java/org/jabref/gui/openoffice/OOBibBase.java index 1700f07f722..d22362b7973 100644 --- a/src/main/java/org/jabref/gui/openoffice/OOBibBase.java +++ b/src/main/java/org/jabref/gui/openoffice/OOBibBase.java @@ -227,7 +227,7 @@ private List getTextDocuments() throws NoSuchElementException, Wr if (document != null) { result.add(document); } - } + } return result; } @@ -1273,6 +1273,7 @@ public BibDatabase generateDatabase(List databases) throws NoSuchElementException, WrappedTargetException { BibDatabase resultDatabase = new BibDatabase(); List cited = findCitedKeys(); + List entriesToInsert = new ArrayList(); // For each cited key for (String key : cited) { @@ -1283,13 +1284,13 @@ public BibDatabase generateDatabase(List databases) if (entry.isPresent()) { BibEntry clonedEntry = (BibEntry) entry.get().clone(); // Insert a copy of the entry - resultDatabase.insertEntry(clonedEntry); + entriesToInsert.add(clonedEntry); // Check if the cloned entry has a crossref field clonedEntry.getField(StandardField.CROSSREF).ifPresent(crossref -> { // If the crossref entry is not already in the database if (!resultDatabase.getEntryByKey(crossref).isPresent()) { // Add it if it is in the current library - loopDatabase.getEntryByKey(crossref).ifPresent(resultDatabase::insertEntry); + loopDatabase.getEntryByKey(crossref).ifPresent(entriesToInsert::add); } }); @@ -1298,7 +1299,7 @@ public BibDatabase generateDatabase(List databases) } } } - + resultDatabase.insertEntries(entriesToInsert); return resultDatabase; } diff --git a/src/main/java/org/jabref/gui/specialfields/SpecialFieldDatabaseChangeListener.java b/src/main/java/org/jabref/gui/specialfields/SpecialFieldDatabaseChangeListener.java index ad315c82d9e..f895a2e29e6 100644 --- a/src/main/java/org/jabref/gui/specialfields/SpecialFieldDatabaseChangeListener.java +++ b/src/main/java/org/jabref/gui/specialfields/SpecialFieldDatabaseChangeListener.java @@ -1,6 +1,6 @@ package org.jabref.gui.specialfields; -import org.jabref.model.database.event.EntryAddedEvent; +import org.jabref.model.database.event.EntriesAddedEvent; import com.google.common.eventbus.Subscribe; @@ -9,23 +9,27 @@ public enum SpecialFieldDatabaseChangeListener { INSTANCE; @Subscribe - public void listen(EntryAddedEvent event) { + public void listen(EntriesAddedEvent event) { // TODO - } - /* - if (!Globals.prefs.isKeywordSyncEnabled()) { - return; - } + /* + if (!Globals.prefs.isKeywordSyncEnabled()) { + return; + } + + final List entries = event.getBibEntries(); + // NamedCompound code similar to SpecialFieldUpdateListener + NamedCompound nc = new NamedCompound(Localization.lang("Synchronized special fields based on keywords")); + for (BibEntry entry : entries) { + List changes = SpecialFieldsUtils.syncSpecialFieldsFromKeywords(entry, Globals.prefs.getKeywordDelimiter()); + for (FieldChange change : changes) { + nc.addEdit(new UndoableFieldChange(change)); + } + } + // Don't insert the compound into the undoManager, + // it would be added before the component which undoes the insertion of the entry and creates heavy problems + // (which prohibits the undo the deleting multiple entries) - final BibEntry entry = event.getBibEntry(); - // NamedCompount code similar to SpecialFieldUpdateListener - NamedCompound nc = new NamedCompound(Localization.lang("Synchronized special fields based on keywords")); - List changes = SpecialFieldsUtils.syncSpecialFieldsFromKeywords(entry, Globals.prefs.getKeywordDelimiter()); - for (FieldChange change: changes) { - nc.addEdit(new UndoableFieldChange(change)); + // See if the above is still true after EntryAddedEvent changed to EntriesAddedEvent + */ } - // Don't insert the compound into the undoManager, - // it would be added before the component which undoes the insertion of the entry and creates heavy problems - // (which prohibits the undo the deleting multiple entries) - */ } diff --git a/src/main/java/org/jabref/gui/undo/UndoableInsertEntries.java b/src/main/java/org/jabref/gui/undo/UndoableInsertEntries.java new file mode 100644 index 00000000000..120b9eb26ed --- /dev/null +++ b/src/main/java/org/jabref/gui/undo/UndoableInsertEntries.java @@ -0,0 +1,80 @@ +package org.jabref.gui.undo; + +import java.util.Collections; +import java.util.List; + +import org.jabref.logic.l10n.Localization; +import org.jabref.model.database.BibDatabase; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.strings.StringUtil; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This class represents the removal of entries. The constructor needs + * references to the database, entries, and a boolean marked true if the undo + * is from a call to paste(). + */ +public class UndoableInsertEntries extends AbstractUndoableJabRefEdit { + + private static final Logger LOGGER = LoggerFactory.getLogger(UndoableInsertEntries.class); + private final BibDatabase database; + private final List entries; + private final boolean paste; + + public UndoableInsertEntries(BibDatabase database, BibEntry entry) { + this(database, Collections.singletonList(entry)); + } + + public UndoableInsertEntries(BibDatabase database, List entries) { + this(database, entries, false); + } + + public UndoableInsertEntries(BibDatabase database, List entries, boolean paste) { + this.database = database; + this.entries = entries; + this.paste = paste; + } + + @Override + public String getPresentationName() { + if (paste) { + if (entries.size() > 1) { + return Localization.lang("paste entries"); + } else if (entries.size() == 1) { + return Localization.lang("paste entry %0", + StringUtil.boldHTML(entries.get(0).getCiteKeyOptional().orElse(Localization.lang("undefined")))); + } else { + return null; + } + } else { + if (entries.size() > 1) { + return Localization.lang("insert entries"); + } else if (entries.size() == 1) { + return Localization.lang("insert entry %0", + StringUtil.boldHTML(entries.get(0).getCiteKeyOptional().orElse(Localization.lang("undefined")))); + } else { + return null; + } + } + } + + @Override + public void undo() { + super.undo(); + + try { + database.removeEntries(entries); + } catch (Throwable ex) { + LOGGER.warn("Problem undoing `insert entries`", ex); + } + } + + @Override + public void redo() { + super.redo(); + database.insertEntries(entries); + } + +} diff --git a/src/main/java/org/jabref/gui/undo/UndoableInsertEntry.java b/src/main/java/org/jabref/gui/undo/UndoableInsertEntry.java deleted file mode 100644 index 8bb0249f798..00000000000 --- a/src/main/java/org/jabref/gui/undo/UndoableInsertEntry.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.jabref.gui.undo; - -import org.jabref.logic.l10n.Localization; -import org.jabref.model.database.BibDatabase; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.strings.StringUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class represents the removal of an entry. The constructor needs - * references to the database, the entry, and the map of open entry editors. - * The latter to be able to close the entry's editor if it is opened before - * the insert is undone. - */ -public class UndoableInsertEntry extends AbstractUndoableJabRefEdit { - - private static final Logger LOGGER = LoggerFactory.getLogger(UndoableInsertEntry.class); - private final BibDatabase base; - private final BibEntry entry; - - public UndoableInsertEntry(BibDatabase base, BibEntry entry) { - this.base = base; - this.entry = entry; - } - - @Override - public String getPresentationName() { - return Localization.lang("insert entry %0", - StringUtil.boldHTML(entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); - } - - @Override - public void undo() { - super.undo(); - - // Revert the change. - try { - base.removeEntry(entry); - } catch (Throwable ex) { - LOGGER.warn("Problem to undo `insert entry`", ex); - } - } - - @Override - public void redo() { - super.redo(); - base.insertEntry(entry); - } - -} diff --git a/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java b/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java index 90f1c4112f6..60de2a294f7 100644 --- a/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java +++ b/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java @@ -120,21 +120,26 @@ private void matchCitation(AuxParserResult result, String line) { } } - /* + /** * Try to find an equivalent BibTeX entry inside the reference database for all keys inside the AUX file. + * + * @param result AUX file */ private void resolveTags(AuxParserResult result) { + List entriesToInsert = new ArrayList<>(); + for (String key : result.getUniqueKeys()) { if (!result.getGeneratedBibDatabase().getEntryByKey(key).isPresent()) { Optional entry = masterDatabase.getEntryByKey(key); if (entry.isPresent()) { - insertEntry(entry.get(), result); - resolveCrossReferences(entry.get(), result); + entriesToInsert.add(entry.get()); } else { result.getUnresolvedKeys().add(key); } } } + insertEntries(entriesToInsert, result); + resolveCrossReferences(entriesToInsert, result); // Copy database definitions if (result.getGeneratedBibDatabase().hasEntries()) { @@ -143,29 +148,44 @@ private void resolveTags(AuxParserResult result) { } } - /* - * Resolves and adds CrossRef entries + /** + * Resolves and adds CrossRef entries to insert them in addition to the original entries + * + * @param entries Entries to check for CrossRefs + * @param result AUX file */ - private void resolveCrossReferences(BibEntry entry, AuxParserResult result) { - entry.getField(StandardField.CROSSREF).ifPresent(crossref -> { - if (!result.getGeneratedBibDatabase().getEntryByKey(crossref).isPresent()) { - Optional refEntry = masterDatabase.getEntryByKey(crossref); - - if (refEntry.isPresent()) { - insertEntry(refEntry.get(), result); - result.increaseCrossRefEntriesCounter(); - } else { - result.getUnresolvedKeys().add(crossref); + private void resolveCrossReferences(List entries, AuxParserResult result) { + List entriesToInsert = new ArrayList<>(); + for (BibEntry entry : entries) { + entry.getField(StandardField.CROSSREF).ifPresent(crossref -> { + if (!result.getGeneratedBibDatabase().getEntryByKey(crossref).isPresent()) { + Optional refEntry = masterDatabase.getEntryByKey(crossref); + + if (refEntry.isPresent()) { + if (!entriesToInsert.contains(refEntry.get())) { + entriesToInsert.add(refEntry.get()); + result.increaseCrossRefEntriesCounter(); + } + } else { + result.getUnresolvedKeys().add(crossref); + } } - } - }); + }); + } + insertEntries(entriesToInsert, result); } - /* - * Insert a clone of the given entry. The clone is given a new unique ID. + /** + * Insert a clone of each given entry. The clones are each given a new unique ID. + * + * @param entries Entries to be cloned + * @param result AUX file */ - private void insertEntry(BibEntry entry, AuxParserResult result) { - BibEntry clonedEntry = (BibEntry) entry.clone(); - result.getGeneratedBibDatabase().insertEntry(clonedEntry); + private void insertEntries(List entries, AuxParserResult result) { + List clonedEntries = new ArrayList<>(); + for (BibEntry entry : entries) { + clonedEntries.add((BibEntry) entry.clone()); + } + result.getGeneratedBibDatabase().insertEntries(clonedEntries); } } diff --git a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java b/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java index a30ca70845e..5728839efe9 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java +++ b/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java @@ -7,7 +7,6 @@ import java.util.Objects; import org.jabref.logic.formatter.bibtexfields.RemoveNewlinesFormatter; -import org.jabref.logic.layout.format.HTMLChars; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Month; import org.jabref.model.entry.field.Field; @@ -93,13 +92,11 @@ private static CSLItemData bibEntryToCSLItemData(BibEntry bibEntry) { BibTeXEntry bibTeXEntry = new BibTeXEntry(new Key(bibEntry.getType().getName()), new Key(citeKey)); // Not every field is already generated into latex free fields - HTMLChars latexToHtmlConverter = new HTMLChars(); RemoveNewlinesFormatter removeNewlinesFormatter = new RemoveNewlinesFormatter(); for (Field key : bibEntry.getFieldMap().keySet()) { bibEntry.getField(key) .map(removeNewlinesFormatter::format) .map(LatexToUnicodeAdapter::format) - .map(latexToHtmlConverter::format) .ifPresent(value -> { if (StandardField.MONTH.equals(key)) { // Change month from #mon# to mon because CSL does not support the former format diff --git a/src/main/java/org/jabref/logic/importer/WebFetchers.java b/src/main/java/org/jabref/logic/importer/WebFetchers.java index 66319f5e6b4..45f035914ca 100644 --- a/src/main/java/org/jabref/logic/importer/WebFetchers.java +++ b/src/main/java/org/jabref/logic/importer/WebFetchers.java @@ -7,7 +7,6 @@ import java.util.SortedSet; import java.util.TreeSet; -import org.jabref.logic.importer.fetcher.ACMPortalFetcher; import org.jabref.logic.importer.fetcher.ACS; import org.jabref.logic.importer.fetcher.ArXiv; import org.jabref.logic.importer.fetcher.AstrophysicsDataSystem; @@ -90,7 +89,8 @@ public static SortedSet getSearchBasedFetchers(ImportFormatP set.add(new AstrophysicsDataSystem(importFormatPreferences)); set.add(new MathSciNet(importFormatPreferences)); set.add(new ZbMATH(importFormatPreferences)); - set.add(new ACMPortalFetcher(importFormatPreferences)); + // see https://github.com/JabRef/jabref/issues/5804 + // set.add(new ACMPortalFetcher(importFormatPreferences)); set.add(new GoogleScholar(importFormatPreferences)); set.add(new DBLPFetcher(importFormatPreferences)); set.add(new SpringerFetcher()); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java index 37c7676307b..fcc72396631 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java @@ -130,9 +130,7 @@ private void parse(BufferedReader input) throws IOException { RankedBibEntry rankedBibEntry2) -> rankedBibEntry1.rank.compareTo(rankedBibEntry2.rank)); List bibEntries = rankedBibEntries.stream().map(e -> e.entry).collect(Collectors.toList()); - for (BibEntry bibentry : bibEntries) { - bibDatabase.insertEntry(bibentry); - } + bibDatabase.insertEntries(bibEntries); parserResult = new ParserResult(bibDatabase); JSONObject label = recommendationSetJson.getJSONObject("label"); diff --git a/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java b/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java index 8e253219eb3..ed535797f62 100644 --- a/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java +++ b/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java @@ -21,8 +21,8 @@ import org.jabref.model.bibtexkeypattern.GlobalBibtexKeyPattern; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.database.event.EntriesAddedEvent; import org.jabref.model.database.event.EntriesRemovedEvent; -import org.jabref.model.database.event.EntryAddedEvent; import org.jabref.model.database.shared.DatabaseConnection; import org.jabref.model.database.shared.DatabaseConnectionProperties; import org.jabref.model.database.shared.DatabaseNotSupportedException; @@ -76,13 +76,16 @@ public DBMSSynchronizer(BibDatabaseContext bibDatabaseContext, Character keyword * @param event {@link EntryAddedEvent} object */ @Subscribe - public void listen(EntryAddedEvent event) { + public void listen(EntriesAddedEvent event) { // While synchronizing the local database (see synchronizeLocalDatabase() below), some EntriesEvents may be posted. // In this case DBSynchronizer should not try to insert the bibEntry entry again (but it would not harm). if (isEventSourceAccepted(event) && checkCurrentConnection()) { synchronizeLocalMetaData(); synchronizeLocalDatabase(); // Pull changes for the case that there were some - dbmsProcessor.insertEntry(event.getBibEntry()); + List entries = event.getBibEntries(); + for (BibEntry entry : entries) { + dbmsProcessor.insertEntry(entry); + } } } @@ -106,10 +109,9 @@ public void listen(FieldChangedEvent event) { /** * Listening method. Deletes the given list of {@link BibEntry} from shared database. * - * @param event {@link EntryRemovedEvent} object + * @param event {@link EntriesRemovedEvent} object */ - // This has not been made parallel yet - hence the for loop - that will take more effort @Subscribe public void listen(EntriesRemovedEvent event) { // While synchronizing the local database (see synchronizeLocalDatabase() below), some EntriesEvents may be posted. diff --git a/src/main/java/org/jabref/model/database/BibDatabase.java b/src/main/java/org/jabref/model/database/BibDatabase.java index 8559561a31f..814925ee55f 100644 --- a/src/main/java/org/jabref/model/database/BibDatabase.java +++ b/src/main/java/org/jabref/model/database/BibDatabase.java @@ -21,9 +21,8 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; -import org.jabref.model.database.event.AllInsertsFinishedEvent; +import org.jabref.model.database.event.EntriesAddedEvent; import org.jabref.model.database.event.EntriesRemovedEvent; -import org.jabref.model.database.event.EntryAddedEvent; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibtexString; import org.jabref.model.entry.Month; @@ -225,27 +224,21 @@ public synchronized void insertEntries(List entries) throws KeyCollisi public synchronized void insertEntries(List newEntries, EntriesEventSource eventSource) throws KeyCollisionException { Objects.requireNonNull(newEntries); - - BibEntry firstEntry = null; for (BibEntry entry : newEntries) { String id = entry.getId(); if (containsEntryWithId(id)) { - throw new KeyCollisionException("ID is already in use, please choose another"); + throw new KeyCollisionException("ID is already in use, please choose another", id); } internalIDs.add(id); entry.registerListener(this); - - eventBus.post(new EntryAddedEvent(entry, eventSource)); - - if (firstEntry == null) { - firstEntry = entry; - } } - entries.addAll(newEntries); - if (firstEntry != null) { - eventBus.post(new AllInsertsFinishedEvent(firstEntry, eventSource)); + if (newEntries.isEmpty()) { + eventBus.post(new EntriesAddedEvent(newEntries, eventSource)); + } else { + eventBus.post(new EntriesAddedEvent(newEntries, newEntries.get(0), eventSource)); } + entries.addAll(newEntries); } public synchronized void removeEntry(BibEntry bibEntry) { @@ -309,15 +302,17 @@ public synchronized void setPreamble(String preamble) { * Inserts a Bibtex String. */ public synchronized void addString(BibtexString string) throws KeyCollisionException { + String id = string.getId(); + if (hasStringByName(string.getName())) { - throw new KeyCollisionException("A string with that label already exists"); + throw new KeyCollisionException("A string with that label already exists", id); } - if (bibtexStrings.containsKey(string.getId())) { - throw new KeyCollisionException("Duplicate BibTeX string id."); + if (bibtexStrings.containsKey(id)) { + throw new KeyCollisionException("Duplicate BibTeX string id.", id); } - bibtexStrings.put(string.getId(), string); + bibtexStrings.put(id, string); } /** @@ -589,8 +584,7 @@ public void setEpilog(String epilog) { * * - {@link EntryAddedEvent} * - {@link EntryChangedEvent} - * - {@link EntryRemovedEvent} - * - {@link AllInsertsFinishedEvent} + * - {@link EntriesRemovedEvent} * * @param listener listener (subscriber) to add */ diff --git a/src/main/java/org/jabref/model/database/BibDatabases.java b/src/main/java/org/jabref/model/database/BibDatabases.java index 7850f868787..3d85e693d79 100644 --- a/src/main/java/org/jabref/model/database/BibDatabases.java +++ b/src/main/java/org/jabref/model/database/BibDatabases.java @@ -1,5 +1,6 @@ package org.jabref.model.database; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; @@ -13,19 +14,19 @@ private BibDatabases() { } /** - * Gets a collection of bibentries and sets an ID for every entry. After that - * all entries will be inserted into a new BibDatabase. + * Gets a collection of entries and sets an ID for every entry. After that + * all entries are inserted into a new BibDatabase. * - * @param bibentries a collection that contains {@link BibEntry} + * @param entries a collection that contains {@link BibEntry} * @return BibDatabase that contains the entries */ - public static BibDatabase createDatabase(Collection bibentries) { + public static BibDatabase createDatabase(Collection entries) { BibDatabase database = new BibDatabase(); - for (BibEntry entry : bibentries) { + for (BibEntry entry : entries) { entry.setId(IdGenerator.next()); - database.insertEntry(entry); } + database.insertEntries(new ArrayList<>(entries)); return database; } diff --git a/src/main/java/org/jabref/model/database/DuplicationChecker.java b/src/main/java/org/jabref/model/database/DuplicationChecker.java index 732338e5cbf..4667cdbc1da 100644 --- a/src/main/java/org/jabref/model/database/DuplicationChecker.java +++ b/src/main/java/org/jabref/model/database/DuplicationChecker.java @@ -5,8 +5,8 @@ import java.util.Map; import java.util.Optional; +import org.jabref.model.database.event.EntriesAddedEvent; import org.jabref.model.database.event.EntriesRemovedEvent; -import org.jabref.model.database.event.EntryAddedEvent; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.event.FieldChangedEvent; import org.jabref.model.entry.field.InternalField; @@ -95,20 +95,13 @@ public void listen(FieldChangedEvent fieldChangedEvent) { @Subscribe public void listen(EntriesRemovedEvent entriesRemovedEvent) { List entries = entriesRemovedEvent.getBibEntries(); - for (BibEntry entry : entries) { - Optional citeKey = entry.getCiteKeyOptional(); - if (citeKey.isPresent()) { - removeKeyFromSet(citeKey.get()); - } - } + entries.stream().map(BibEntry::getCiteKeyOptional).flatMap(Optional::stream).forEach(citeKey -> removeKeyFromSet(citeKey)); } @Subscribe - public void listen(EntryAddedEvent entryAddedEvent) { - Optional citekey = entryAddedEvent.getBibEntry().getCiteKeyOptional(); - if (citekey.isPresent()) { - addKeyToSet(citekey.get()); - } + public void listen(EntriesAddedEvent entriesAddedEvent) { + List entries = entriesAddedEvent.getBibEntries(); + entries.stream().map(BibEntry::getCiteKeyOptional).flatMap(Optional::stream).forEach(citeKey -> addKeyToSet(citeKey)); } } diff --git a/src/main/java/org/jabref/model/database/KeyCollisionException.java b/src/main/java/org/jabref/model/database/KeyCollisionException.java index 21d1bcfd77a..05bb346599c 100644 --- a/src/main/java/org/jabref/model/database/KeyCollisionException.java +++ b/src/main/java/org/jabref/model/database/KeyCollisionException.java @@ -2,12 +2,15 @@ public class KeyCollisionException extends RuntimeException { + private String id; + public KeyCollisionException() { super(); } - public KeyCollisionException(String msg) { + public KeyCollisionException(String msg, String id) { super(msg); + this.id = id; } public KeyCollisionException(String msg, Throwable exception) { @@ -17,4 +20,8 @@ public KeyCollisionException(String msg, Throwable exception) { public KeyCollisionException(Throwable exception) { super(exception); } + + public String getId() { + return id; + } } diff --git a/src/main/java/org/jabref/model/database/event/AllInsertsFinishedEvent.java b/src/main/java/org/jabref/model/database/event/AllInsertsFinishedEvent.java deleted file mode 100644 index eb9bc84df00..00000000000 --- a/src/main/java/org/jabref/model/database/event/AllInsertsFinishedEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.jabref.model.database.event; - -import java.util.Collections; - -import org.jabref.model.database.BibDatabase; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.event.EntriesEvent; -import org.jabref.model.entry.event.EntriesEventSource; - -/** - * {@link AllInsertsFinishedEvent} is fired when insertion of {@link BibEntry} to the {@link BibDatabase} was finished. - */ -public class AllInsertsFinishedEvent extends EntriesEvent { - - /** - * @param bibEntry the entry which has been added - */ - public AllInsertsFinishedEvent(BibEntry bibEntry) { - super(Collections.singletonList(bibEntry)); - } - - /** - * @param bibEntry BibEntry object which has been added. - * @param location Location affected by this event - */ - public AllInsertsFinishedEvent(BibEntry bibEntry, EntriesEventSource location) { - super(Collections.singletonList(bibEntry), location); - } -} diff --git a/src/main/java/org/jabref/model/database/event/EntriesAddedEvent.java b/src/main/java/org/jabref/model/database/event/EntriesAddedEvent.java new file mode 100644 index 00000000000..3229664ab16 --- /dev/null +++ b/src/main/java/org/jabref/model/database/event/EntriesAddedEvent.java @@ -0,0 +1,41 @@ +package org.jabref.model.database.event; + +import java.util.List; + +import org.jabref.model.database.BibDatabase; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.event.EntriesEvent; +import org.jabref.model.entry.event.EntriesEventSource; + +/** + * {@link EntriesAddedEvent} is fired when at least {@link BibEntry} is being added to the {@link BibDatabase}. + */ +public class EntriesAddedEvent extends EntriesEvent { + + // firstEntry used by listeners that used to listen to AllInsertsFinishedEvent + // final? + private final BibEntry firstEntry; + + /** + * @param bibEntries the entries which are being added + * @param firstEntry the first entry being added + */ + + public EntriesAddedEvent(List bibEntries, BibEntry firstEntry, EntriesEventSource location) { + super(bibEntries, location); + this.firstEntry = firstEntry; + } + + /** + * @param bibEntries List of BibEntry objects which are being added. + * @param location Location affected by this event + */ + public EntriesAddedEvent(List bibEntries, EntriesEventSource location) { + super(bibEntries, location); + this.firstEntry = null; + } + + public BibEntry getFirstEntry() { + return this.firstEntry; + } +} diff --git a/src/main/java/org/jabref/model/database/event/EntriesRemovedEvent.java b/src/main/java/org/jabref/model/database/event/EntriesRemovedEvent.java index aa10fe2fe8a..666ca89aca0 100644 --- a/src/main/java/org/jabref/model/database/event/EntriesRemovedEvent.java +++ b/src/main/java/org/jabref/model/database/event/EntriesRemovedEvent.java @@ -7,21 +7,21 @@ import org.jabref.model.entry.event.EntriesEventSource; /** - * EntriesRemovedEvent is fired when at least one BibEntry is removed + * EntriesRemovedEvent is fired when at least one BibEntry is being removed * from the database. */ public class EntriesRemovedEvent extends EntriesEvent { /** - * @param bibEntries List of BibEntry object which have been removed. + * @param bibEntries List of BibEntry objects which are being removed. */ public EntriesRemovedEvent(List bibEntries) { super(bibEntries); } /** - * @param bibEntries List of BibEntry object which have been removed. + * @param bibEntries List of BibEntry objects which are being removed. * @param location Location affected by this event */ public EntriesRemovedEvent(List bibEntries, EntriesEventSource location) { diff --git a/src/main/java/org/jabref/model/database/event/EntryAddedEvent.java b/src/main/java/org/jabref/model/database/event/EntryAddedEvent.java deleted file mode 100644 index fbd6655e88e..00000000000 --- a/src/main/java/org/jabref/model/database/event/EntryAddedEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.jabref.model.database.event; - -import java.util.Collections; - -import org.jabref.model.database.BibDatabase; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.event.EntriesEvent; -import org.jabref.model.entry.event.EntriesEventSource; - -/** - * {@link EntryAddedEvent} is fired when a new {@link BibEntry} was added to the {@link BibDatabase}. - */ -public class EntryAddedEvent extends EntriesEvent { - - /** - * @param bibEntry the entry which has been added - */ - public EntryAddedEvent(BibEntry bibEntry) { - super(Collections.singletonList(bibEntry)); - } - - /** - * @param bibEntry BibEntry object which has been added. - * @param location Location affected by this event - */ - public EntryAddedEvent(BibEntry bibEntry, EntriesEventSource location) { - super(Collections.singletonList(bibEntry), location); - } -} diff --git a/src/main/java/org/jabref/model/entry/InternalBibtexFields.java b/src/main/java/org/jabref/model/entry/InternalBibtexFields.java deleted file mode 100644 index 124b7b5e220..00000000000 --- a/src/main/java/org/jabref/model/entry/InternalBibtexFields.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.jabref.model.entry; - -/** - * Handling of bibtex fields. - * All bibtex-field related stuff should be placed here! - * Because we can export this information into additional - * config files -> simple extension and definition of new fields - * - * TODO: - * - handling of identically fields with different names (https://github.com/JabRef/jabref/issues/521) - * e.g. LCCN = lib-congress, journaltitle = journal - * - group id for each fields, e.g. standard, jurabib, bio, ... - * - add a additional properties functionality into the BibField class - */ -public class InternalBibtexFields { - - private InternalBibtexFields() { - // Singleton - } -} diff --git a/src/main/java/org/jabref/model/entry/event/EntriesEvent.java b/src/main/java/org/jabref/model/entry/event/EntriesEvent.java index b8a2c10e6f2..a0f5345ccfa 100644 --- a/src/main/java/org/jabref/model/entry/event/EntriesEvent.java +++ b/src/main/java/org/jabref/model/entry/event/EntriesEvent.java @@ -15,7 +15,6 @@ public abstract class EntriesEvent extends BibDatabaseContextChangedEvent { private final List bibEntries; private final EntriesEventSource location; - /** * @param bibEntries List of BibEntry objects which are involved in this event */ @@ -32,9 +31,6 @@ public EntriesEvent(List bibEntries, EntriesEventSource location) { this.location = Objects.requireNonNull(location); } - //Temporary fix, while we change to plural entries - public BibEntry getBibEntry() { return this.bibEntries.get(0); } - public List getBibEntries() { return this.bibEntries; } diff --git a/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java b/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java index cf83402d498..d10928a16c9 100644 --- a/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java +++ b/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java @@ -25,4 +25,8 @@ public EntryChangedEvent(BibEntry bibEntry, EntriesEventSource location) { super(Collections.singletonList(bibEntry), location); } + public BibEntry getBibEntry() { + // An entryChangedEvent should only have one BibEntry, but its parent class stores a List + return getBibEntries().get(0); + } } diff --git a/src/main/resources/csl-locales/Gemfile.lock b/src/main/resources/csl-locales/Gemfile.lock index 5aab010f588..88cb51dd2e0 100644 --- a/src/main/resources/csl-locales/Gemfile.lock +++ b/src/main/resources/csl-locales/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/citation-style-language/Sheldon.git - revision: 09d0daebe0b6c76ccf9963f86e2e966b28a3ef46 + revision: c2cc508c57157ee7d00948e24c46e10e3f319d57 specs: sheldon (1.0.2) citeproc-ruby @@ -26,30 +26,30 @@ GEM diff-lcs (1.3) diffy (3.3.0) dotenv (2.7.5) - fuubar (2.4.1) + fuubar (2.5.0) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) mini_portile2 (2.4.0) namae (1.0.1) - nokogiri (1.10.4) + nokogiri (1.10.7) mini_portile2 (~> 2.4.0) ostruct (0.1.0) - rake (13.0.0) + rake (13.0.1) reverse_markdown (1.3.0) nokogiri - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.2) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.4) + rspec (3.9.0) + rspec-core (~> 3.9.0) + rspec-expectations (~> 3.9.0) + rspec-mocks (~> 3.9.0) + rspec-core (3.9.0) + rspec-support (~> 3.9.0) + rspec-expectations (3.9.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.1) + rspec-support (~> 3.9.0) + rspec-mocks (3.9.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.2) + rspec-support (~> 3.9.0) + rspec-support (3.9.0) ruby-progressbar (1.10.1) PLATFORMS diff --git a/src/main/resources/csl-styles/.github/FUNDING.yml b/src/main/resources/csl-styles/.github/FUNDING.yml new file mode 100644 index 00000000000..85be4bb9662 --- /dev/null +++ b/src/main/resources/csl-styles/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: rmzelle diff --git a/src/main/resources/csl-styles/.github/stale.yml b/src/main/resources/csl-styles/.github/stale.yml index 64d14f64815..c226400853f 100644 --- a/src/main/resources/csl-styles/.github/stale.yml +++ b/src/main/resources/csl-styles/.github/stale.yml @@ -1,7 +1,7 @@ # Number of days of inactivity before an issue becomes stale daysUntilStale: 30 # Number of days of inactivity before a stale issue is closed -daysUntilClose: 14 +daysUntilClose: false # Issues with these labels will never be considered stale exemptLabels: - pinned @@ -13,6 +13,8 @@ staleLabel: waiting # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue hasn't seen any activity in the past 30 days. It will be automatically closed if no further activity occurs in the next two weeks. +# Limit to only `issues` or `pulls` +only: pulls # Comment to post when closing a stale issue. Set to `false` to disable closeComment: false # Limit the number of actions per hour, from 1-30. Default is 30 diff --git a/src/main/resources/csl-styles/.travis.yml b/src/main/resources/csl-styles/.travis.yml index b7faafd2f12..9ca1f2550dc 100644 --- a/src/main/resources/csl-styles/.travis.yml +++ b/src/main/resources/csl-styles/.travis.yml @@ -1,8 +1,8 @@ -dist: xenial +dist: bionic language: ruby cache: bundler rvm: - - 2.5.3 + - 2.6.5 install: - bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle} - bundle update sheldon diff --git a/src/main/resources/csl-styles/Gemfile b/src/main/resources/csl-styles/Gemfile index fe9fc8e61c8..65bb4267142 100644 --- a/src/main/resources/csl-styles/Gemfile +++ b/src/main/resources/csl-styles/Gemfile @@ -1,4 +1,4 @@ -ruby '2.5.3' +ruby '2.6.5' source 'https://rubygems.org' gem 'rake' diff --git a/src/main/resources/csl-styles/Gemfile.lock b/src/main/resources/csl-styles/Gemfile.lock index 0d689349329..c3cc47dff24 100644 --- a/src/main/resources/csl-styles/Gemfile.lock +++ b/src/main/resources/csl-styles/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/citation-style-language/Sheldon.git - revision: 09d0daebe0b6c76ccf9963f86e2e966b28a3ef46 + revision: c2cc508c57157ee7d00948e24c46e10e3f319d57 specs: sheldon (1.0.2) citeproc-ruby @@ -26,30 +26,30 @@ GEM diff-lcs (1.3) diffy (3.3.0) dotenv (2.7.5) - fuubar (2.4.1) + fuubar (2.5.0) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) mini_portile2 (2.4.0) namae (1.0.1) - nokogiri (1.10.4) + nokogiri (1.10.7) mini_portile2 (~> 2.4.0) ostruct (0.1.0) - rake (12.3.3) - reverse_markdown (1.1.0) + rake (13.0.1) + reverse_markdown (1.3.0) nokogiri - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.2) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.4) + rspec (3.9.0) + rspec-core (~> 3.9.0) + rspec-expectations (~> 3.9.0) + rspec-mocks (~> 3.9.0) + rspec-core (3.9.0) + rspec-support (~> 3.9.0) + rspec-expectations (3.9.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.1) + rspec-support (~> 3.9.0) + rspec-mocks (3.9.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.2) + rspec-support (~> 3.9.0) + rspec-support (3.9.0) ruby-progressbar (1.10.1) PLATFORMS @@ -64,7 +64,7 @@ DEPENDENCIES sheldon! RUBY VERSION - ruby 2.5.3p105 + ruby 2.6.5p114 BUNDLED WITH 1.17.3 diff --git a/src/main/resources/csl-styles/afte-journal.csl b/src/main/resources/csl-styles/afte-journal.csl new file mode 100644 index 00000000000..11ed6b2f6b5 --- /dev/null +++ b/src/main/resources/csl-styles/afte-journal.csl @@ -0,0 +1,227 @@ + + diff --git a/src/main/resources/csl-styles/apa-5th-edition.csl b/src/main/resources/csl-styles/apa-5th-edition.csl index e53978208e7..7e22c594594 100644 --- a/src/main/resources/csl-styles/apa-5th-edition.csl +++ b/src/main/resources/csl-styles/apa-5th-edition.csl @@ -2,7 +2,7 @@ diff --git a/src/main/resources/csl-styles/apa-annotated-bibliography.csl b/src/main/resources/csl-styles/apa-annotated-bibliography.csl index 0934aa51d41..ee69014eb7b 100644 --- a/src/main/resources/csl-styles/apa-annotated-bibliography.csl +++ b/src/main/resources/csl-styles/apa-annotated-bibliography.csl @@ -1,38 +1,20 @@ diff --git a/src/main/resources/csl-styles/apa-cv.csl b/src/main/resources/csl-styles/apa-cv.csl index 8b2ce1294bc..fd83806c0be 100644 --- a/src/main/resources/csl-styles/apa-cv.csl +++ b/src/main/resources/csl-styles/apa-cv.csl @@ -1,38 +1,20 @@ + \ No newline at end of file diff --git a/src/main/resources/csl-styles/apa-no-doi-no-issue.csl b/src/main/resources/csl-styles/apa-no-doi-no-issue.csl index 241f6b6e358..792f0774424 100644 --- a/src/main/resources/csl-styles/apa-no-doi-no-issue.csl +++ b/src/main/resources/csl-styles/apa-no-doi-no-issue.csl @@ -2,10 +2,10 @@ + \ No newline at end of file diff --git a/src/main/resources/csl-styles/apa.csl b/src/main/resources/csl-styles/apa.csl index 700cfc67754..0c0ed3caa30 100644 --- a/src/main/resources/csl-styles/apa.csl +++ b/src/main/resources/csl-styles/apa.csl @@ -1,37 +1,20 @@ + \ No newline at end of file diff --git a/src/main/resources/csl-styles/association-for-computing-machinery.csl b/src/main/resources/csl-styles/association-for-computing-machinery.csl index 71b3ae878c6..cc896a8c47d 100644 --- a/src/main/resources/csl-styles/association-for-computing-machinery.csl +++ b/src/main/resources/csl-styles/association-for-computing-machinery.csl @@ -13,7 +13,7 @@ - 2017-07-03T15:22:45+00:00 + 2019-12-18T11:27:24+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License @@ -125,7 +125,7 @@ - + @@ -137,6 +137,7 @@ + @@ -180,6 +181,12 @@ + + + + + + diff --git a/src/main/resources/csl-styles/berlin-school-of-economics-and-law-international-marketing-management.csl b/src/main/resources/csl-styles/berlin-school-of-economics-and-law-international-marketing-management.csl new file mode 100644 index 00000000000..ba1dcaaa7fa --- /dev/null +++ b/src/main/resources/csl-styles/berlin-school-of-economics-and-law-international-marketing-management.csl @@ -0,0 +1,201 @@ + + diff --git a/src/main/resources/csl-styles/bourgogne-franche-comte-nature.csl b/src/main/resources/csl-styles/bourgogne-franche-comte-nature.csl new file mode 100644 index 00000000000..0cacbadea3a --- /dev/null +++ b/src/main/resources/csl-styles/bourgogne-franche-comte-nature.csl @@ -0,0 +1,227 @@ + + diff --git a/src/main/resources/csl-styles/british-journal-of-political-science.csl b/src/main/resources/csl-styles/british-journal-of-political-science.csl index 2c70201a96a..766ebb202dc 100644 --- a/src/main/resources/csl-styles/british-journal-of-political-science.csl +++ b/src/main/resources/csl-styles/british-journal-of-political-science.csl @@ -18,7 +18,7 @@ 0007-1234 1469-2112 BJPS Style as updated per 6 March 2018 guidelines. - 2018-09-13T13:59:45+00:00 + 2019-12-23T10:58:34+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License @@ -51,6 +51,9 @@ + + + diff --git a/src/main/resources/csl-styles/budownictwo-i-architektura-pl.csl b/src/main/resources/csl-styles/budownictwo-i-architektura-pl.csl index ccf74dd7720..f1c542ab541 100644 --- a/src/main/resources/csl-styles/budownictwo-i-architektura-pl.csl +++ b/src/main/resources/csl-styles/budownictwo-i-architektura-pl.csl @@ -1,7 +1,8 @@ - diff --git a/src/main/resources/csl-styles/canadian-geotechnical-journal.csl b/src/main/resources/csl-styles/canadian-geotechnical-journal.csl index b2ee8d48f4d..c50e50f16e8 100644 --- a/src/main/resources/csl-styles/canadian-geotechnical-journal.csl +++ b/src/main/resources/csl-styles/canadian-geotechnical-journal.csl @@ -5,7 +5,7 @@ http://www.zotero.org/styles/canadian-geotechnical-journal - + Sebastian Karcher @@ -17,13 +17,21 @@ Libor Ansorge http://www.ansorge.website + + Patrick O'Brien, PhD + 0008-3674 1208-6010 - 2016-05-22T17:28:58+00:00 + 2019-12-12T13:45:56+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + + + available from + + @@ -38,8 +46,8 @@ - @@ -74,17 +82,16 @@ - + - - - - - + + + + - + @@ -93,7 +100,7 @@ - + @@ -116,19 +123,9 @@ - - - - - - - - - - - - - + + + diff --git a/src/main/resources/csl-styles/cell-research.csl b/src/main/resources/csl-styles/cell-research.csl index bba823e44d4..e90f480bd55 100644 --- a/src/main/resources/csl-styles/cell-research.csl +++ b/src/main/resources/csl-styles/cell-research.csl @@ -4,7 +4,7 @@ Cell Research http://www.zotero.org/styles/cell-research - + Sebastian Karcher diff --git a/src/main/resources/csl-styles/dependent/adansonia.csl b/src/main/resources/csl-styles/dependent/adansonia.csl new file mode 100644 index 00000000000..67b20f51b89 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/adansonia.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-agriculture-and-food.csl b/src/main/resources/csl-styles/dependent/aims-agriculture-and-food.csl new file mode 100644 index 00000000000..ae31edcc09d --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-agriculture-and-food.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-allergy-and-immunology.csl b/src/main/resources/csl-styles/dependent/aims-allergy-and-immunology.csl new file mode 100644 index 00000000000..6064b1247c8 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-allergy-and-immunology.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-bioengineering.csl b/src/main/resources/csl-styles/dependent/aims-bioengineering.csl new file mode 100644 index 00000000000..5fd820e6cad --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-bioengineering.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-biophysics.csl b/src/main/resources/csl-styles/dependent/aims-biophysics.csl new file mode 100644 index 00000000000..f5847e96cf8 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-biophysics.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-electronics-and-electrical-engineering.csl b/src/main/resources/csl-styles/dependent/aims-electronics-and-electrical-engineering.csl new file mode 100644 index 00000000000..c9a4022b222 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-electronics-and-electrical-engineering.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-energy.csl b/src/main/resources/csl-styles/dependent/aims-energy.csl new file mode 100644 index 00000000000..4f886832f34 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-energy.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-environmental-science.csl b/src/main/resources/csl-styles/dependent/aims-environmental-science.csl new file mode 100644 index 00000000000..cffbb04f136 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-environmental-science.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-genetics.csl b/src/main/resources/csl-styles/dependent/aims-genetics.csl new file mode 100644 index 00000000000..ffc314ffc76 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-genetics.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-geosciences.csl b/src/main/resources/csl-styles/dependent/aims-geosciences.csl new file mode 100644 index 00000000000..4c1c44c8422 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-geosciences.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-materials-science.csl b/src/main/resources/csl-styles/dependent/aims-materials-science.csl new file mode 100644 index 00000000000..1000b8d1f86 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-materials-science.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-mathematics.csl b/src/main/resources/csl-styles/dependent/aims-mathematics.csl new file mode 100644 index 00000000000..da912da020d --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-mathematics.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-medical-science.csl b/src/main/resources/csl-styles/dependent/aims-medical-science.csl new file mode 100644 index 00000000000..aa765c32c5b --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-medical-science.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-microbiology.csl b/src/main/resources/csl-styles/dependent/aims-microbiology.csl new file mode 100644 index 00000000000..9a5461b90bb --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-microbiology.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-molecular-science.csl b/src/main/resources/csl-styles/dependent/aims-molecular-science.csl new file mode 100644 index 00000000000..a8c30aec6cb --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-molecular-science.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-neuroscience.csl b/src/main/resources/csl-styles/dependent/aims-neuroscience.csl new file mode 100644 index 00000000000..d18d10bdb67 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-neuroscience.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/aims-public-health.csl b/src/main/resources/csl-styles/dependent/aims-public-health.csl new file mode 100644 index 00000000000..5db8848b6fb --- /dev/null +++ b/src/main/resources/csl-styles/dependent/aims-public-health.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/anthropozoologica.csl b/src/main/resources/csl-styles/dependent/anthropozoologica.csl new file mode 100644 index 00000000000..6b424ccd145 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/anthropozoologica.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/behavior-analysis-research-and-practice.csl b/src/main/resources/csl-styles/dependent/behavior-analysis-research-and-practice.csl new file mode 100644 index 00000000000..c874f4f8149 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/behavior-analysis-research-and-practice.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/military-psychology.csl b/src/main/resources/csl-styles/dependent/behavioral-development.csl similarity index 55% rename from src/main/resources/csl-styles/dependent/military-psychology.csl rename to src/main/resources/csl-styles/dependent/behavioral-development.csl index fe4e6969d51..f2ba10f8889 100644 --- a/src/main/resources/csl-styles/dependent/military-psychology.csl +++ b/src/main/resources/csl-styles/dependent/behavioral-development.csl @@ -1,16 +1,15 @@ diff --git a/src/main/resources/csl-styles/dependent/budownictwo-i-architektura-en.csl b/src/main/resources/csl-styles/dependent/budownictwo-i-architektura-en.csl deleted file mode 100644 index aea67f03591..00000000000 --- a/src/main/resources/csl-styles/dependent/budownictwo-i-architektura-en.csl +++ /dev/null @@ -1,19 +0,0 @@ - - diff --git a/src/main/resources/csl-styles/dependent/canadian-journal-of-behavioural-science.csl b/src/main/resources/csl-styles/dependent/canadian-journal-of-behavioural-science.csl index 838ddd1793e..961b83f292a 100644 --- a/src/main/resources/csl-styles/dependent/canadian-journal-of-behavioural-science.csl +++ b/src/main/resources/csl-styles/dependent/canadian-journal-of-behavioural-science.csl @@ -1,8 +1,8 @@ diff --git a/src/main/resources/csl-styles/dependent/cryptogamie-bryologie.csl b/src/main/resources/csl-styles/dependent/cryptogamie-bryologie.csl new file mode 100644 index 00000000000..cfc8916ded1 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/cryptogamie-bryologie.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/cryptogamie-mycologie.csl b/src/main/resources/csl-styles/dependent/cryptogamie-mycologie.csl new file mode 100644 index 00000000000..3663448b2e7 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/cryptogamie-mycologie.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/european-journal-of-health-psychology.csl b/src/main/resources/csl-styles/dependent/european-journal-of-health-psychology.csl new file mode 100644 index 00000000000..d352af21e62 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/european-journal-of-health-psychology.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/geodiversitas.csl b/src/main/resources/csl-styles/dependent/geodiversitas.csl new file mode 100644 index 00000000000..80b005f2abb --- /dev/null +++ b/src/main/resources/csl-styles/dependent/geodiversitas.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/green-finance.csl b/src/main/resources/csl-styles/dependent/green-finance.csl new file mode 100644 index 00000000000..bbb03310d5d --- /dev/null +++ b/src/main/resources/csl-styles/dependent/green-finance.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/institut-catholique-de-paris.csl b/src/main/resources/csl-styles/dependent/institut-catholique-de-paris.csl new file mode 100644 index 00000000000..a792f8c3915 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/institut-catholique-de-paris.csl @@ -0,0 +1,22 @@ + + diff --git a/src/main/resources/csl-styles/dependent/international-journal-of-oral-science.csl b/src/main/resources/csl-styles/dependent/international-journal-of-oral-science.csl index 6d12d16dab5..a1830491da1 100644 --- a/src/main/resources/csl-styles/dependent/international-journal-of-oral-science.csl +++ b/src/main/resources/csl-styles/dependent/international-journal-of-oral-science.csl @@ -5,7 +5,7 @@ International Journal of Oral Science http://www.zotero.org/styles/international-journal-of-oral-science - + diff --git a/src/main/resources/csl-styles/dependent/journal-of-latina-o-psychology.csl b/src/main/resources/csl-styles/dependent/journal-of-latina-o-psychology.csl index 22475008e08..d9c77493c18 100644 --- a/src/main/resources/csl-styles/dependent/journal-of-latina-o-psychology.csl +++ b/src/main/resources/csl-styles/dependent/journal-of-latina-o-psychology.csl @@ -1,16 +1,16 @@ diff --git a/src/main/resources/csl-styles/dependent/mathematical-biosciences-and-engineering.csl b/src/main/resources/csl-styles/dependent/mathematical-biosciences-and-engineering.csl new file mode 100644 index 00000000000..c4aa878e945 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/mathematical-biosciences-and-engineering.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/mathematics-in-engineering.csl b/src/main/resources/csl-styles/dependent/mathematics-in-engineering.csl new file mode 100644 index 00000000000..742f4d84cd6 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/mathematics-in-engineering.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/molecular-nutrition-and-food-research.csl b/src/main/resources/csl-styles/dependent/molecular-nutrition-and-food-research.csl deleted file mode 100644 index 26ba3f6e847..00000000000 --- a/src/main/resources/csl-styles/dependent/molecular-nutrition-and-food-research.csl +++ /dev/null @@ -1,22 +0,0 @@ - - diff --git a/src/main/resources/csl-styles/dependent/review-of-general-psychology.csl b/src/main/resources/csl-styles/dependent/motivation-science.csl similarity index 53% rename from src/main/resources/csl-styles/dependent/review-of-general-psychology.csl rename to src/main/resources/csl-styles/dependent/motivation-science.csl index d0889a1ec39..12d5acf307c 100644 --- a/src/main/resources/csl-styles/dependent/review-of-general-psychology.csl +++ b/src/main/resources/csl-styles/dependent/motivation-science.csl @@ -1,16 +1,16 @@ diff --git a/src/main/resources/csl-styles/dependent/naturae.csl b/src/main/resources/csl-styles/dependent/naturae.csl new file mode 100644 index 00000000000..c5efdeaf9e9 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/naturae.csl @@ -0,0 +1,16 @@ + + diff --git a/src/main/resources/csl-styles/dependent/practice-innovations.csl b/src/main/resources/csl-styles/dependent/practice-innovations.csl new file mode 100644 index 00000000000..d0ca17094f2 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/practice-innovations.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/psychology-and-neuroscience.csl b/src/main/resources/csl-styles/dependent/psychology-and-neuroscience.csl new file mode 100644 index 00000000000..536702da7b7 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/psychology-and-neuroscience.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/psychology-of-men-and-masculinity.csl b/src/main/resources/csl-styles/dependent/psychology-of-men-and-masculinity.csl index 10685ef009e..b32219ea603 100644 --- a/src/main/resources/csl-styles/dependent/psychology-of-men-and-masculinity.csl +++ b/src/main/resources/csl-styles/dependent/psychology-of-men-and-masculinity.csl @@ -1,8 +1,8 @@ diff --git a/src/main/resources/csl-styles/dependent/scholarship-of-teaching-and-learning-in-psychology.csl b/src/main/resources/csl-styles/dependent/scholarship-of-teaching-and-learning-in-psychology.csl new file mode 100644 index 00000000000..df503bcd91c --- /dev/null +++ b/src/main/resources/csl-styles/dependent/scholarship-of-teaching-and-learning-in-psychology.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/school-psychology-quarterly.csl b/src/main/resources/csl-styles/dependent/school-psychology-quarterly.csl index e2f70960915..c07a4e02fce 100644 --- a/src/main/resources/csl-styles/dependent/school-psychology-quarterly.csl +++ b/src/main/resources/csl-styles/dependent/school-psychology-quarterly.csl @@ -1,16 +1,16 @@ diff --git a/src/main/resources/csl-styles/dependent/the-humanistic-psychologist.csl b/src/main/resources/csl-styles/dependent/the-humanistic-psychologist.csl new file mode 100644 index 00000000000..b990e622880 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/the-humanistic-psychologist.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/translational-issues-in-psychological-science.csl b/src/main/resources/csl-styles/dependent/translational-issues-in-psychological-science.csl new file mode 100644 index 00000000000..3fa2d194a18 --- /dev/null +++ b/src/main/resources/csl-styles/dependent/translational-issues-in-psychological-science.csl @@ -0,0 +1,17 @@ + + diff --git a/src/main/resources/csl-styles/dependent/traumatology-an-international-journal.csl b/src/main/resources/csl-styles/dependent/traumatology-an-international-journal.csl index f77d787e820..1ff1a5b36e7 100644 --- a/src/main/resources/csl-styles/dependent/traumatology-an-international-journal.csl +++ b/src/main/resources/csl-styles/dependent/traumatology-an-international-journal.csl @@ -1,8 +1,8 @@ diff --git a/src/main/resources/csl-styles/din-1505-2-alphanumeric.csl b/src/main/resources/csl-styles/din-1505-2-alphanumeric.csl index 18c66983468..b78be2cdf8a 100644 --- a/src/main/resources/csl-styles/din-1505-2-alphanumeric.csl +++ b/src/main/resources/csl-styles/din-1505-2-alphanumeric.csl @@ -1,7 +1,7 @@ diff --git a/src/main/resources/csl-styles/instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abnt-initials.csl b/src/main/resources/csl-styles/instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abnt-initials.csl new file mode 100644 index 00000000000..db28e79522b --- /dev/null +++ b/src/main/resources/csl-styles/instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abnt-initials.csl @@ -0,0 +1,614 @@ + + diff --git a/src/main/resources/csl-styles/instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abnt.csl b/src/main/resources/csl-styles/instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abnt.csl new file mode 100644 index 00000000000..a3e34f1c8ac --- /dev/null +++ b/src/main/resources/csl-styles/instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abnt.csl @@ -0,0 +1,614 @@ + + diff --git a/src/main/resources/csl-styles/iso690-author-date-de.csl b/src/main/resources/csl-styles/iso690-author-date-de.csl new file mode 100644 index 00000000000..2ec6fd25bc1 --- /dev/null +++ b/src/main/resources/csl-styles/iso690-author-date-de.csl @@ -0,0 +1,581 @@ + + diff --git a/src/main/resources/csl-styles/iso690-full-note-cs.csl b/src/main/resources/csl-styles/iso690-full-note-cs.csl new file mode 100644 index 00000000000..f7adf459017 --- /dev/null +++ b/src/main/resources/csl-styles/iso690-full-note-cs.csl @@ -0,0 +1,593 @@ + + diff --git a/src/main/resources/csl-styles/iso690-full-note-with-ibid-ro.csl b/src/main/resources/csl-styles/iso690-full-note-with-ibid-ro.csl new file mode 100644 index 00000000000..aefe339c2a1 --- /dev/null +++ b/src/main/resources/csl-styles/iso690-full-note-with-ibid-ro.csl @@ -0,0 +1,603 @@ + + diff --git a/src/main/resources/csl-styles/journal-of-small-business-management.csl b/src/main/resources/csl-styles/journal-of-small-business-management.csl new file mode 100644 index 00000000000..490b2b0c04c --- /dev/null +++ b/src/main/resources/csl-styles/journal-of-small-business-management.csl @@ -0,0 +1,1498 @@ + + diff --git a/src/main/resources/csl-styles/jurnal-sains-farmasi-dan-klinis.csl b/src/main/resources/csl-styles/jurnal-sains-farmasi-dan-klinis.csl new file mode 100644 index 00000000000..ebc4249ee9c --- /dev/null +++ b/src/main/resources/csl-styles/jurnal-sains-farmasi-dan-klinis.csl @@ -0,0 +1,348 @@ + + diff --git a/src/main/resources/csl-styles/kidney-international.csl b/src/main/resources/csl-styles/kidney-international.csl deleted file mode 100644 index 8061490540e..00000000000 --- a/src/main/resources/csl-styles/kidney-international.csl +++ /dev/null @@ -1,172 +0,0 @@ - - diff --git a/src/main/resources/csl-styles/les-nouvelles-de-l-archeologie.csl b/src/main/resources/csl-styles/les-nouvelles-de-l-archeologie.csl index 9cace0de14b..d10aa39687f 100644 --- a/src/main/resources/csl-styles/les-nouvelles-de-l-archeologie.csl +++ b/src/main/resources/csl-styles/les-nouvelles-de-l-archeologie.csl @@ -54,8 +54,8 @@ diff --git a/src/main/resources/csl-styles/materials-express.csl b/src/main/resources/csl-styles/materials-express.csl new file mode 100644 index 00000000000..4879aa0efd6 --- /dev/null +++ b/src/main/resources/csl-styles/materials-express.csl @@ -0,0 +1,181 @@ + + diff --git a/src/main/resources/csl-styles/midwestern-baptist-theological-seminary.csl b/src/main/resources/csl-styles/midwestern-baptist-theological-seminary.csl new file mode 100644 index 00000000000..8fb1a643c84 --- /dev/null +++ b/src/main/resources/csl-styles/midwestern-baptist-theological-seminary.csl @@ -0,0 +1,1513 @@ + + diff --git a/src/main/resources/csl-styles/molecular-nutrition-and-food-research.csl b/src/main/resources/csl-styles/molecular-nutrition-and-food-research.csl new file mode 100644 index 00000000000..4319de8f3d0 --- /dev/null +++ b/src/main/resources/csl-styles/molecular-nutrition-and-food-research.csl @@ -0,0 +1,160 @@ + + diff --git a/src/main/resources/csl-styles/museum-national-dhistoire-naturelle.csl b/src/main/resources/csl-styles/museum-national-dhistoire-naturelle.csl new file mode 100644 index 00000000000..13c947bf2a5 --- /dev/null +++ b/src/main/resources/csl-styles/museum-national-dhistoire-naturelle.csl @@ -0,0 +1,306 @@ + + diff --git a/src/main/resources/csl-styles/renamed-styles.json b/src/main/resources/csl-styles/renamed-styles.json index db071560619..636fa7f03be 100644 --- a/src/main/resources/csl-styles/renamed-styles.json +++ b/src/main/resources/csl-styles/renamed-styles.json @@ -52,6 +52,7 @@ "brain-and-development-english-language": "brain-and-development", "british-ecological-society": "apa-old-doi-prefix", "british-volume-of-the-journal-of-bone-and-joint-surgery": "the-journal-of-bone-and-joint-surgery", + "budownictwo-i-architektura-en": "budownictwo-i-architektura-pl", "bulletin-of-materials-science": "springer-humanities-author-date", "bulletin-of-the-medical-library-association": "journal-of-the-medical-library-association", "canadian-journal-of-anaesthesia": "canadian-journal-of-anesthesia", diff --git a/src/main/resources/csl-styles/ritid.csl b/src/main/resources/csl-styles/ritid.csl new file mode 100644 index 00000000000..5ba403bb591 --- /dev/null +++ b/src/main/resources/csl-styles/ritid.csl @@ -0,0 +1,1353 @@ + + diff --git a/src/main/resources/csl-styles/ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-service-engineering.csl b/src/main/resources/csl-styles/ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-service-engineering.csl index 15db6be3b02..6864ca77578 100644 --- a/src/main/resources/csl-styles/ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-service-engineering.csl +++ b/src/main/resources/csl-styles/ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-service-engineering.csl @@ -12,19 +12,19 @@ sebastian.knop@rub.de - 2019-05-20T11:40:20+01:00 + 2019-12-18T15:42:00+01:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License - et&#160;al. + et al. abgerufen am und - et&#160;al. + et al. ᵗʰ ˢᵗ ⁿᵈ @@ -37,6 +37,7 @@ + @@ -102,10 +103,7 @@ - - - - + @@ -138,7 +136,7 @@ - + @@ -246,13 +244,13 @@ - + @@ -307,7 +305,7 @@ - + diff --git a/src/main/resources/csl-styles/spec/sheldon/items.json b/src/main/resources/csl-styles/spec/sheldon/items.json index bd359da6bef..889a19c8d2f 100644 --- a/src/main/resources/csl-styles/spec/sheldon/items.json +++ b/src/main/resources/csl-styles/spec/sheldon/items.json @@ -2,7 +2,7 @@ { "id": "HanckevarietiescapitalismConflict2007", "type": "book", - "title": "Beyond varieties of capitalism : Conflict, contradiction, and complementarities in the European economy", + "title": "Beyond varieties of capitalism: Conflict, contradiction, and complementarities in the European economy", "publisher": "Oxford University Press", "publisher-place": "Oxford and New York", "source": "Open WorldCat", @@ -96,11 +96,12 @@ "type": "article-journal", "title": "A data citation roadmap for scholarly data repositories", "container-title": "Scientific Data", + "container-title-short": "Sci. Data", "page": "28", "volume": "6", "issue": "1", "source": "Nature", - "abstract": "This article presents a practical roadmap for scholarly data repositories to implement data citation in accordance with the Joint Declaration of Data Citation Principles, a synopsis and harmonization of the recommendations of major science policy bodies. The roadmap was developed by the Repositories Expert Group, as part of the Data Citation Implementation Pilot (DCIP) project, an initiative of FORCE11.org and the NIH-funded BioCADDIE (\n https://biocaddie.org\n \n ) project. The roadmap makes 11 specific recommendations, grouped into three phases of implementation: a) required steps needed to support the Joint Declaration of Data Citation Principles, b) recommended steps that facilitate article/data publication workflows, and c) optional steps that further improve data citation support provided by data repositories. We describe the early adoption of these recommendations 18 months after they have first been published, looking specifically at implementations of machine-readable metadata on dataset landing pages.", + "abstract": "This article presents a practical roadmap for scholarly data repositories to implement data citation in accordance with the Joint Declaration of Data Citation Principles, a synopsis and harmonization of the recommendations of major science policy bodies. The roadmap was developed by the Repositories Expert Group, as part of the Data Citation Implementation Pilot (DCIP) project, an initiative of FORCE11.org and the NIH-funded BioCADDIE (https://biocaddie.org) project. The roadmap makes 11 specific recommendations, grouped into three phases of implementation: a) required steps needed to support the Joint Declaration of Data Citation Principles, b) recommended steps that facilitate article/data publication workflows, and c) optional steps that further improve data citation support provided by data repositories. We describe the early adoption of these recommendations 18 months after they have first been published, looking specifically at implementations of machine-readable metadata on dataset landing pages.", "URL": "http://www.nature.com/articles/s41597-019-0031-8", "DOI": "10.1038/s41597-019-0031-8", "ISSN": "2052-4463", @@ -171,4 +172,4 @@ }, "citation-number": 4 } -] \ No newline at end of file +] diff --git a/src/main/resources/csl-styles/surgical-neurology-international.csl b/src/main/resources/csl-styles/surgical-neurology-international.csl index b720c58eecb..f794bd3936e 100644 --- a/src/main/resources/csl-styles/surgical-neurology-international.csl +++ b/src/main/resources/csl-styles/surgical-neurology-international.csl @@ -1,11 +1,13 @@ - diff --git a/src/main/resources/csl-styles/universidade-de-sao-paulo-escola-de-comunicacoes-e-artes-abnt.csl b/src/main/resources/csl-styles/universidade-de-sao-paulo-escola-de-comunicacoes-e-artes-abnt.csl new file mode 100644 index 00000000000..682e01c27dc --- /dev/null +++ b/src/main/resources/csl-styles/universidade-de-sao-paulo-escola-de-comunicacoes-e-artes-abnt.csl @@ -0,0 +1,573 @@ + + diff --git a/src/main/resources/csl-styles/universidade-federal-do-rio-de-janeiro-instituto-alberto-luiz-coimbra-de-pos-graduacao-e-pesquisa-de-engenharia-abnt.csl b/src/main/resources/csl-styles/universidade-federal-do-rio-de-janeiro-instituto-alberto-luiz-coimbra-de-pos-graduacao-e-pesquisa-de-engenharia-abnt.csl new file mode 100644 index 00000000000..da8a9b7f667 --- /dev/null +++ b/src/main/resources/csl-styles/universidade-federal-do-rio-de-janeiro-instituto-alberto-luiz-coimbra-de-pos-graduacao-e-pesquisa-de-engenharia-abnt.csl @@ -0,0 +1,607 @@ + + diff --git a/src/main/resources/csl-styles/university-of-helsinki-faculty-of-theology.csl b/src/main/resources/csl-styles/university-of-helsinki-faculty-of-theology.csl index 5b3eb0bbfc0..47b0cda4685 100644 --- a/src/main/resources/csl-styles/university-of-helsinki-faculty-of-theology.csl +++ b/src/main/resources/csl-styles/university-of-helsinki-faculty-of-theology.csl @@ -1,49 +1,48 @@ - diff --git a/src/main/resources/csl-styles/university-of-lincoln-harvard.csl b/src/main/resources/csl-styles/university-of-lincoln-harvard.csl index 492c8bd9229..3ad984a52df 100644 --- a/src/main/resources/csl-styles/university-of-lincoln-harvard.csl +++ b/src/main/resources/csl-styles/university-of-lincoln-harvard.csl @@ -14,7 +14,7 @@ The Harvard author-date style, 2nd edition, as outlined by the library of the University of Lincoln. - 2019-03-26T13:11:32+00:00 + 2019-11-13T14:03:41+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License @@ -61,16 +61,18 @@ - - - - - - - - - - + + + + + + + + + + + + @@ -166,8 +168,14 @@ - - + + + + + + + + @@ -177,6 +185,12 @@ + + + + + + diff --git a/src/main/resources/csl-styles/weed-research.csl b/src/main/resources/csl-styles/weed-research.csl index 25bb79f07ba..67bcdb3fe36 100644 --- a/src/main/resources/csl-styles/weed-research.csl +++ b/src/main/resources/csl-styles/weed-research.csl @@ -42,7 +42,7 @@ - +