From 5b34fe8d30cd203ef331f4878b3fdbe104fc0ad7 Mon Sep 17 00:00:00 2001 From: Zhouheng98 <127819870+Zhouheng98@users.noreply.github.com> Date: Sun, 5 Nov 2023 00:04:49 +1100 Subject: [PATCH 01/10] Enable journal information fetcher directly in popup (#10598) * fix-for-issue-10458 * l10n and minor code tweak * CHANGELOG.md * fix l10n --------- Co-authored-by: Christoph Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> --- CHANGELOG.md | 2 +- .../fieldeditors/JournalInfoOptInDialogHelper.java | 14 ++++++++++---- src/main/resources/l10n/JabRef_en.properties | 8 +++++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b45208a55f2..24c632a982d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue where the added protected term has unwanted leading and trailing whitespaces, where the formatted text has unwanted empty brackets and where the word at the cursor in the textbox can be added to the list. [#10415](https://github.com/JabRef/jabref/issues/10415) - We fixed an issue where in the merge dialog the file field of entries was not correctly merged when the first and second entry both contained values inside the file field. [#10572](https://github.com/JabRef/jabref/issues/10572) -- We fixed some small inconsistencies in the user interface. [#10507](https://github.com/JabRef/jabref/issues/10507) +- We fixed some small inconsistencies in the user interface. [#10507](https://github.com/JabRef/jabref/issues/10507) [#10458](https://github.com/JabRef/jabref/issues/10458) ### Removed diff --git a/src/main/java/org/jabref/gui/fieldeditors/JournalInfoOptInDialogHelper.java b/src/main/java/org/jabref/gui/fieldeditors/JournalInfoOptInDialogHelper.java index c811936a379..b1209ba95db 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/JournalInfoOptInDialogHelper.java +++ b/src/main/java/org/jabref/gui/fieldeditors/JournalInfoOptInDialogHelper.java @@ -15,12 +15,18 @@ public static boolean isJournalInfoEnabled(DialogService dialogService, EntryEdi } if (preferences.shouldEnableJournalPopup() == EntryEditorPreferences.JournalPopupEnabled.DISABLED) { - dialogService.notify( - Localization.lang("Please enable journal information fetching in %0 > %1", + boolean enableJournalPopup = dialogService.showConfirmationDialogAndWait( + Localization.lang("Enable Journal Information Fetching?"), + Localization.lang("Would you like to enable fetching of journal information? This can be changed later in %0 > %1.", Localization.lang("Preferences"), - Localization.lang("Web search")) + Localization.lang("Entry editor")), Localization.lang("Enable"), Localization.lang("Keep disabled") ); - return false; + + preferences.setEnableJournalPopup(enableJournalPopup + ? EntryEditorPreferences.JournalPopupEnabled.ENABLED + : EntryEditorPreferences.JournalPopupEnabled.DISABLED); + + return enableJournalPopup; } boolean journalInfoEnabled = dialogService.showConfirmationDialogAndWait( diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index e0c5c45f5cd..e780f69dcde 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -477,7 +477,6 @@ Year=Year ISSN\ or\ journal\ name\ required\ for\ fetching\ journal\ information=ISSN or journal name required for fetching journal information Fetch\ journal\ information\ online\ to\ show=Fetch journal information online to show Allow\ sending\ ISSN\ to\ a\ JabRef\ online\ service\ (SCimago)\ for\ fetching\ journal\ information=Allow sending ISSN to a JabRef online service (SCimago) for fetching journal information -Please\ enable\ journal\ information\ fetching\ in\ %0\ >\ %1=Please enable journal information fetching in %0 > %1 Categories=Categories ISSN=ISSN Publisher=Publisher @@ -2605,3 +2604,10 @@ Pushing\ citations\ to\ TeXShop\ is\ only\ possible\ on\ macOS\!=Pushing citatio Single\ instance=Single instance Enforce\ single\ JabRef\ instance\ (and\ allow\ remote\ operations)\ using\ port=Enforce single JabRef instance (and allow remote operations) using port + + +Enable\ Journal\ Information\ Fetching?=Enable Journal Information Fetching? +Would\ you\ like\ to\ enable\ fetching\ of\ journal\ information?\ This\ can\ be\ changed\ later\ in\ %0\ >\ %1.=Would you like to enable fetching of journal information? This can be changed later in %0 > %1. +Enable=Enable +Keep\ disabled=Keep disabled + From 86870cb04ea87b3848b60a735a4315ff5946f588 Mon Sep 17 00:00:00 2001 From: Guilherme Menezes Date: Sat, 4 Nov 2023 12:54:17 -0300 Subject: [PATCH 02/10] Add entry based on ISSN number #10124 (#10178) * Add: implementing the ISSN Fetcher * Add: implementing methods of IssnFetcher class * Substantially changes on IssnFetcher class * Substantial changes of IssnFetcher * Implementing the performSearchById method for IssnFetcher class * Saving changes for branch updating * Started to implement the ISSN search logic * Refactor the performSearchById method * Add the IssnFetcher on WebFetcher class and add unit tests * Implement search based on the ISSN number * Change the ISSN Checker validation of a valid checksum * refactor to use exiting journal info fetcher * reafactor * add button next to journal field * fix tests and checkstyle * arch test * Fuuu checkstyle --------- Co-authored-by: Siedlerchr --- .../jabref/gui/fieldeditors/FieldEditors.java | 4 +- .../jabref/gui/fieldeditors/ISSNEditor.fxml | 12 ++-- .../jabref/gui/fieldeditors/ISSNEditor.java | 16 +++++- .../gui/fieldeditors/ISSNEditorViewModel.java | 24 +++++++- .../identifier/IdentifierEditor.java | 28 ++++++---- .../jabref/logic/importer/WebFetchers.java | 28 ++++++---- .../logic/importer/fetcher/DOAJFetcher.java | 11 ++-- .../logic/importer/fetcher/IssnFetcher.java | 52 +++++++++++++++++ .../fetcher/JournalInformationFetcher.java | 3 +- .../fetcher/isbntobibtex/IsbnFetcher.java | 3 +- .../jabref/logic/integrity/ISSNChecker.java | 5 +- .../model/entry/field/FieldProperty.java | 1 + .../model/entry/field/StandardField.java | 2 +- .../jabref/model/entry/identifier/ISSN.java | 22 +++++++- .../logic/importer/WebFetchersTest.java | 3 + .../importer/fetcher/IssnFetcherTest.java | 56 +++++++++++++++++++ 16 files changed, 225 insertions(+), 45 deletions(-) create mode 100644 src/main/java/org/jabref/logic/importer/fetcher/IssnFetcher.java create mode 100644 src/test/java/org/jabref/logic/importer/fetcher/IssnFetcherTest.java diff --git a/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java b/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java index 5148990b3be..5e817d5291c 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java +++ b/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java @@ -65,6 +65,8 @@ public static FieldEditorFX getForField(final Field field, return new JournalEditor(field, suggestionProvider, fieldCheckers); } else if (fieldProperties.contains(FieldProperty.DOI) || fieldProperties.contains(FieldProperty.EPRINT) || fieldProperties.contains(FieldProperty.ISBN)) { return new IdentifierEditor(field, suggestionProvider, fieldCheckers); + } else if (fieldProperties.contains(FieldProperty.ISSN)) { + return new ISSNEditor(field, suggestionProvider, fieldCheckers); } else if (field == StandardField.OWNER) { return new OwnerEditor(field, suggestionProvider, fieldCheckers); } else if (field == StandardField.GROUPS) { @@ -97,8 +99,6 @@ public static FieldEditorFX getForField(final Field field, return new KeywordsEditor(field, suggestionProvider, fieldCheckers, preferences, undoManager); } else if (field == InternalField.KEY_FIELD) { return new CitationKeyEditor(field, suggestionProvider, fieldCheckers, databaseContext); - } else if (field == StandardField.ISSN) { - return new ISSNEditor(field, suggestionProvider, fieldCheckers); } else { // default return new SimpleEditor(field, suggestionProvider, fieldCheckers, preferences, isMultiLine, undoManager); diff --git a/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.fxml b/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.fxml index 021a0f24f60..44d70fb78c4 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.fxml +++ b/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.fxml @@ -3,13 +3,11 @@ - - + - - + diff --git a/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.java b/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.java index db100d37416..7fc01a07c4a 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.java @@ -1,5 +1,7 @@ package org.jabref.gui.fieldeditors; +import java.util.Optional; + import javax.swing.undo.UndoManager; import javafx.fxml.FXML; @@ -8,6 +10,7 @@ import javafx.scene.layout.HBox; import org.jabref.gui.DialogService; +import org.jabref.gui.StateManager; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.fieldeditors.contextmenu.DefaultMenu; import org.jabref.gui.util.TaskExecutor; @@ -23,11 +26,14 @@ public class ISSNEditor extends HBox implements FieldEditorFX { @FXML private ISSNEditorViewModel viewModel; @FXML private EditorTextArea textArea; @FXML private Button journalInfoButton; + @FXML private Button fetchInformationByIdentifierButton; @Inject private DialogService dialogService; @Inject private PreferencesService preferencesService; @Inject private UndoManager undoManager; @Inject private TaskExecutor taskExecutor; + @Inject private StateManager stateManager; + private Optional entry = Optional.empty(); public ISSNEditor(Field field, SuggestionProvider suggestionProvider, @@ -43,7 +49,9 @@ public ISSNEditor(Field field, fieldCheckers, taskExecutor, dialogService, - undoManager); + undoManager, + stateManager, + preferencesService); textArea.textProperty().bindBidirectional(viewModel.textProperty()); textArea.initContextMenu(new DefaultMenu(textArea)); @@ -57,6 +65,7 @@ public ISSNEditorViewModel getViewModel() { @Override public void bindToEntry(BibEntry entry) { + this.entry = Optional.of(entry); viewModel.bindToEntry(entry); } @@ -70,6 +79,11 @@ public void requestFocus() { textArea.requestFocus(); } + @FXML + private void fetchInformationByIdentifier() { + entry.ifPresent(viewModel::fetchBibliographyInformation); + } + @FXML private void showJournalInfo() { if (JournalInfoOptInDialogHelper.isJournalInfoEnabled(dialogService, preferencesService.getEntryEditorPreferences())) { diff --git a/src/main/java/org/jabref/gui/fieldeditors/ISSNEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/ISSNEditorViewModel.java index 4784580409d..89cbf76e949 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/ISSNEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/ISSNEditorViewModel.java @@ -5,14 +5,23 @@ import javafx.scene.control.Button; import org.jabref.gui.DialogService; +import org.jabref.gui.StateManager; import org.jabref.gui.autocompleter.SuggestionProvider; +import org.jabref.gui.mergeentries.FetchAndMergeEntry; import org.jabref.gui.util.TaskExecutor; import org.jabref.logic.integrity.FieldCheckers; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; +import org.jabref.preferences.PreferencesService; public class ISSNEditorViewModel extends AbstractEditorViewModel { private final TaskExecutor taskExecutor; private final DialogService dialogService; + private final UndoManager undoManager; + private final StateManager stateManager; + private final PreferencesService preferencesService; public ISSNEditorViewModel( Field field, @@ -20,13 +29,26 @@ public ISSNEditorViewModel( FieldCheckers fieldCheckers, TaskExecutor taskExecutor, DialogService dialogService, - UndoManager undoManager) { + UndoManager undoManager, + StateManager stateManager, + PreferencesService preferencesService) { super(field, suggestionProvider, fieldCheckers, undoManager); this.taskExecutor = taskExecutor; this.dialogService = dialogService; + this.undoManager = undoManager; + this.stateManager = stateManager; + this.preferencesService = preferencesService; } public void showJournalInfo(Button journalInfoButton) { PopOverUtil.showJournalInfo(journalInfoButton, entry, dialogService, taskExecutor); } + + public void fetchBibliographyInformation(BibEntry bibEntry) { + stateManager.getActiveDatabase().ifPresentOrElse( + databaseContext -> new FetchAndMergeEntry(databaseContext, taskExecutor, preferencesService, dialogService, undoManager) + .fetchAndMerge(bibEntry, StandardField.ISSN), + () -> dialogService.notify(Localization.lang("No library selected")) + ); + } } diff --git a/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java b/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java index c05501335b6..7afd5d23fde 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java @@ -23,13 +23,16 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.injection.Injector; import com.airhacks.afterburner.views.ViewLoader; import jakarta.inject.Inject; +import static org.jabref.model.entry.field.StandardField.DOI; +import static org.jabref.model.entry.field.StandardField.EPRINT; +import static org.jabref.model.entry.field.StandardField.ISBN; + public class IdentifierEditor extends HBox implements FieldEditorFX { @FXML private BaseIdentifierEditorViewModel viewModel; @@ -53,14 +56,18 @@ public IdentifierEditor(Field field, // but we need the injected vars to create the viewmodels. Injector.registerExistingAndInject(this); - if (StandardField.DOI == field) { - this.viewModel = new DoiIdentifierEditorViewModel(suggestionProvider, fieldCheckers, dialogService, taskExecutor, preferencesService, undoManager, stateManager); - } else if (StandardField.ISBN == field) { - this.viewModel = new ISBNIdentifierEditorViewModel(suggestionProvider, fieldCheckers, dialogService, taskExecutor, preferencesService, undoManager, stateManager); - } else if (StandardField.EPRINT == field) { - this.viewModel = new EprintIdentifierEditorViewModel(suggestionProvider, fieldCheckers, dialogService, taskExecutor, preferencesService, undoManager); - } else { - throw new IllegalStateException(String.format("Unable to instantiate a view model for identifier field editor '%s'", field.getDisplayName())); + switch (field) { + case DOI -> + this.viewModel = new DoiIdentifierEditorViewModel(suggestionProvider, fieldCheckers, dialogService, taskExecutor, preferencesService, undoManager, stateManager); + case ISBN -> + this.viewModel = new ISBNIdentifierEditorViewModel(suggestionProvider, fieldCheckers, dialogService, taskExecutor, preferencesService, undoManager, stateManager); + case EPRINT -> + this.viewModel = new EprintIdentifierEditorViewModel(suggestionProvider, fieldCheckers, dialogService, taskExecutor, preferencesService, undoManager); + + case null, default -> { + assert field != null; + throw new IllegalStateException(String.format("Unable to instantiate a view model for identifier field editor '%s'", field.getDisplayName())); + } } ViewLoader.view(this) @@ -74,7 +81,7 @@ public IdentifierEditor(Field field, lookupIdentifierButton.setTooltip( new Tooltip(Localization.lang("Look up %0", field.getDisplayName()))); - if (field.equals(StandardField.DOI)) { + if (field.equals(DOI)) { textArea.initContextMenu(EditorMenus.getDOIMenu(textArea, dialogService, preferencesService)); } else { textArea.initContextMenu(new DefaultMenu(textArea)); @@ -89,7 +96,6 @@ public BaseIdentifierEditorViewModel getViewModel() { @Override public void bindToEntry(BibEntry entry) { - this.entry = Optional.of(entry); viewModel.bindToEntry(entry); } diff --git a/src/main/java/org/jabref/logic/importer/WebFetchers.java b/src/main/java/org/jabref/logic/importer/WebFetchers.java index 6a7b0f7d07d..344fa6399b3 100644 --- a/src/main/java/org/jabref/logic/importer/WebFetchers.java +++ b/src/main/java/org/jabref/logic/importer/WebFetchers.java @@ -28,6 +28,7 @@ import org.jabref.logic.importer.fetcher.IEEE; import org.jabref.logic.importer.fetcher.INSPIREFetcher; import org.jabref.logic.importer.fetcher.IacrEprintFetcher; +import org.jabref.logic.importer.fetcher.IssnFetcher; import org.jabref.logic.importer.fetcher.LOBIDFetcher; import org.jabref.logic.importer.fetcher.LibraryOfCongress; import org.jabref.logic.importer.fetcher.MathSciNet; @@ -51,8 +52,10 @@ import org.jabref.model.entry.identifier.Identifier; import org.jabref.preferences.FilePreferences; +import static org.jabref.model.entry.field.StandardField.DOI; import static org.jabref.model.entry.field.StandardField.EPRINT; import static org.jabref.model.entry.field.StandardField.ISBN; +import static org.jabref.model.entry.field.StandardField.ISSN; public class WebFetchers { @@ -62,16 +65,18 @@ private WebFetchers() { public static Optional getIdBasedFetcherForField(Field field, ImportFormatPreferences importFormatPreferences) { IdBasedFetcher fetcher; - if (field == StandardField.DOI) { - fetcher = new DoiFetcher(importFormatPreferences); - } else if (field == ISBN) { - fetcher = new IsbnFetcher(importFormatPreferences); - // .addRetryFetcher(new EbookDeIsbnFetcher(importFormatPreferences)); - // .addRetryFetcher(new DoiToBibtexConverterComIsbnFetcher(importFormatPreferences)); - } else if (field == EPRINT) { - fetcher = new ArXivFetcher(importFormatPreferences); - } else { - return Optional.empty(); + switch (field) { + case DOI -> + fetcher = new DoiFetcher(importFormatPreferences); + case ISBN -> + fetcher = new IsbnFetcher(importFormatPreferences); + case EPRINT -> + fetcher = new ArXivFetcher(importFormatPreferences); + case ISSN -> + fetcher = new IssnFetcher(); + case null, default -> { + return Optional.empty(); + } } return Optional.of(fetcher); } @@ -162,7 +167,8 @@ public static SortedSet getEntryBasedFetchers(ImporterPrefere set.add(new AstrophysicsDataSystem(importFormatPreferences, importerPreferences)); set.add(new DoiFetcher(importFormatPreferences)); set.add(new IsbnFetcher(importFormatPreferences)); - // .addRetryFetcher(new EbookDeIsbnFetcher(importFormatPreferences))); + set.add(new IssnFetcher()); + // .addRetryFetcher(new EbookDeIsbnFetcher(importFormatPreferences))); // .addRetryFetcher(new DoiToBibtexConverterComIsbnFetcher(importFormatPreferences))); set.add(new MathSciNet(importFormatPreferences)); set.add(new CrossRef()); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java index 815996d311f..8898c730253 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java @@ -55,10 +55,10 @@ public DOAJFetcher(ImportFormatPreferences preferences) { */ public static BibEntry parseBibJSONtoBibtex(JSONObject bibJsonEntry, Character keywordSeparator) { // Fields that are directly accessible at the top level BibJson object - Field[] singleFields = {StandardField.YEAR, StandardField.TITLE, StandardField.ABSTRACT, StandardField.MONTH}; + List singleFields = List.of(StandardField.YEAR, StandardField.TITLE, StandardField.ABSTRACT, StandardField.MONTH); // Fields that are accessible in the journal part of the BibJson object - Field[] journalSingleFields = {StandardField.PUBLISHER, StandardField.NUMBER, StandardField.VOLUME}; + List journalSingleFields = List.of(StandardField.PUBLISHER, StandardField.NUMBER, StandardField.VOLUME); BibEntry entry = new BibEntry(StandardEntryType.Article); @@ -155,13 +155,10 @@ public static BibEntry parseBibJSONtoBibtex(JSONObject bibJsonEntry, Character k return entry; } - public static URIBuilder addPath(URIBuilder base, String subPath) { + public static void addPath(URIBuilder base, String subPath) { // slightly altered version based on https://gist.github.com/enginer/230e2dc2f1d213a825d5 - if (StringUtil.isBlank(subPath) || "/".equals(subPath)) { - return base; - } else { + if (!StringUtil.isBlank(subPath) && !"/".equals(subPath)) { base.setPath(appendSegmentToPath(base.getPath(), subPath)); - return base; } } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IssnFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/IssnFetcher.java new file mode 100644 index 00000000000..11f85d12304 --- /dev/null +++ b/src/main/java/org/jabref/logic/importer/fetcher/IssnFetcher.java @@ -0,0 +1,52 @@ +package org.jabref.logic.importer.fetcher; + +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +import org.jabref.logic.importer.EntryBasedFetcher; +import org.jabref.logic.importer.FetcherException; +import org.jabref.logic.importer.IdBasedFetcher; +import org.jabref.logic.journals.JournalInformation; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; + +/** + * Fetcher to generate the BibTex entry from an ISSN. + * As an ISSN ist just a journal identifier, so we only return journal title and publisher + * The idea is to use the {@link JournalInformationFetcher} to do a request for a given ISSN. + */ + +public class IssnFetcher implements EntryBasedFetcher, IdBasedFetcher { + + private final JournalInformationFetcher journalInformationFetcher; + + public IssnFetcher() { + this.journalInformationFetcher = new JournalInformationFetcher(); + } + + @Override + public List performSearch(BibEntry entry) throws FetcherException { + Optional issn = entry.getField(StandardField.ISSN); + if (issn.isPresent()) { + Optional journalInformation = journalInformationFetcher.getJournalInformation(issn.get(), ""); + return journalInformation.map(journalInfo -> journalInformationToBibEntry(journalInfo, issn.get())).stream().toList(); + } + return Collections.emptyList(); + } + + @Override + public String getName() { + return "ISSN"; + } + + @Override + public Optional performSearchById(String identifier) throws FetcherException { + Optional journalInformation = journalInformationFetcher.getJournalInformation(identifier, ""); + return journalInformation.map(journalInfo -> journalInformationToBibEntry(journalInfo, identifier)); + } + + private BibEntry journalInformationToBibEntry(JournalInformation journalInfo, String issn) { + return new BibEntry().withField(StandardField.JOURNALTITLE, journalInfo.title()).withField(StandardField.PUBLISHER, journalInfo.publisher()).withField(StandardField.ISSN, issn); + } +} diff --git a/src/main/java/org/jabref/logic/importer/fetcher/JournalInformationFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/JournalInformationFetcher.java index 7d12875b7c9..279edc6594a 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/JournalInformationFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/JournalInformationFetcher.java @@ -31,6 +31,7 @@ public class JournalInformationFetcher implements WebFetcher { public static final String NAME = "Journal Information"; private static final Logger LOGGER = LoggerFactory.getLogger(JournalInformationFetcher.class); + // Uses JabRef Online APIs private static final String API_URL = "https://jabref.org/api"; private static final Pattern QUOTES_BRACKET_PATTERN = Pattern.compile("[\"\\[\\]]"); @@ -90,7 +91,7 @@ private JournalInformation parseResponse(JSONObject responseJsonObject) throws F try { if (responseJsonObject.has("errors")) { JSONArray errors = responseJsonObject.optJSONArray("errors"); - if (errors != null && errors.length() > 0) { + if (errors != null && !errors.isEmpty()) { JSONObject error = errors.getJSONObject(0); String errorMessage = error.optString("message", ""); LOGGER.error("Error accessing catalog: {}", errorMessage); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcher.java index 23344ddbba9..c449320075d 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcher.java @@ -34,13 +34,12 @@ public class IsbnFetcher implements EntryBasedFetcher, IdBasedFetcher { private static final Logger LOGGER = LoggerFactory.getLogger(IsbnFetcher.class); private static final Pattern NEWLINE_SPACE_PATTERN = Pattern.compile("\\n|\\r\\n|\\s"); protected final ImportFormatPreferences importFormatPreferences; - private final OpenLibraryIsbnFetcher openLibraryIsbnFetcher; private final List retryIsbnFetcher; private final GvkFetcher gvkIbsnFetcher; public IsbnFetcher(ImportFormatPreferences importFormatPreferences) { this.importFormatPreferences = importFormatPreferences; - this.openLibraryIsbnFetcher = new OpenLibraryIsbnFetcher(importFormatPreferences); + OpenLibraryIsbnFetcher openLibraryIsbnFetcher = new OpenLibraryIsbnFetcher(importFormatPreferences); this.gvkIbsnFetcher = new GvkFetcher(importFormatPreferences); this.retryIsbnFetcher = new ArrayList<>(); this.addRetryFetcher(openLibraryIsbnFetcher); diff --git a/src/main/java/org/jabref/logic/integrity/ISSNChecker.java b/src/main/java/org/jabref/logic/integrity/ISSNChecker.java index 23502ec9e8a..f7205d195b5 100644 --- a/src/main/java/org/jabref/logic/integrity/ISSNChecker.java +++ b/src/main/java/org/jabref/logic/integrity/ISSNChecker.java @@ -22,10 +22,9 @@ public Optional checkValue(String value) { return Optional.of(Localization.lang("incorrect format")); } - if (issn.isValidChecksum()) { - return Optional.empty(); - } else { + if (!issn.isValidChecksum()) { return Optional.of(Localization.lang("incorrect control digit")); } + return Optional.empty(); } } diff --git a/src/main/java/org/jabref/model/entry/field/FieldProperty.java b/src/main/java/org/jabref/model/entry/field/FieldProperty.java index cba4a76714b..19356f4dccb 100644 --- a/src/main/java/org/jabref/model/entry/field/FieldProperty.java +++ b/src/main/java/org/jabref/model/entry/field/FieldProperty.java @@ -10,6 +10,7 @@ public enum FieldProperty { FILE_EDITOR, GENDER, ISBN, + ISSN, JOURNAL_NAME, LANGUAGE, MONTH, diff --git a/src/main/java/org/jabref/model/entry/field/StandardField.java b/src/main/java/org/jabref/model/entry/field/StandardField.java index 0e568838fb5..c286ca6ea3c 100644 --- a/src/main/java/org/jabref/model/entry/field/StandardField.java +++ b/src/main/java/org/jabref/model/entry/field/StandardField.java @@ -66,7 +66,7 @@ public enum StandardField implements Field { INTRODUCTION("introduction", FieldProperty.PERSON_NAMES), ISBN("isbn", "ISBN", FieldProperty.ISBN, FieldProperty.VERBATIM), ISRN("isrn", "ISRN", FieldProperty.VERBATIM), - ISSN("issn", "ISSN", FieldProperty.VERBATIM), + ISSN("issn", "ISSN", FieldProperty.ISSN, FieldProperty.VERBATIM), ISSUE("issue"), ISSUETITLE("issuetitle"), ISSUESUBTITLE("issuesubtitle"), diff --git a/src/main/java/org/jabref/model/entry/identifier/ISSN.java b/src/main/java/org/jabref/model/entry/identifier/ISSN.java index 5063536eda9..7050a74687c 100644 --- a/src/main/java/org/jabref/model/entry/identifier/ISSN.java +++ b/src/main/java/org/jabref/model/entry/identifier/ISSN.java @@ -1,10 +1,15 @@ package org.jabref.model.entry.identifier; +import java.net.URI; import java.util.Objects; +import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; -public class ISSN { +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; + +public class ISSN implements Identifier { private static final Pattern ISSN_PATTERN = Pattern.compile("^\\d{4}-\\d{3}[\\dxX]$"); private static final Pattern ISSN_PATTERN_NODASH = Pattern.compile("^(\\d{4})(\\d{3}[\\dxX])$"); @@ -48,4 +53,19 @@ public boolean isValidChecksum() { } return ((((sum % 11) + control) - '0') == 11) || ((sum % 11) == 0); } + + @Override + public String getNormalized() { + return issnString; + } + + @Override + public Field getDefaultField() { + return StandardField.ISSN; + } + + @Override + public Optional getExternalURI() { + return Optional.empty(); + } } diff --git a/src/test/java/org/jabref/logic/importer/WebFetchersTest.java b/src/test/java/org/jabref/logic/importer/WebFetchersTest.java index ffa6314fff7..cf9b302c15d 100644 --- a/src/test/java/org/jabref/logic/importer/WebFetchersTest.java +++ b/src/test/java/org/jabref/logic/importer/WebFetchersTest.java @@ -11,6 +11,7 @@ import org.jabref.logic.importer.fetcher.GoogleScholar; import org.jabref.logic.importer.fetcher.GrobidCitationFetcher; import org.jabref.logic.importer.fetcher.GvkFetcher; +import org.jabref.logic.importer.fetcher.IssnFetcher; import org.jabref.logic.importer.fetcher.JstorFetcher; import org.jabref.logic.importer.fetcher.MrDLibFetcher; import org.jabref.logic.importer.fetcher.isbntobibtex.DoiToBibtexConverterComIsbnFetcher; @@ -78,6 +79,8 @@ void getIdBasedFetchersReturnsAllFetcherDerivingFromIdBasedFetcher() { expected.remove(EbookDeIsbnFetcher.class); expected.remove(GvkFetcher.class); expected.remove(DoiToBibtexConverterComIsbnFetcher.class); + // Remove special ISSN fetcher only suitable for journal lookup + expected.remove(IssnFetcher.class); // Remove the following, because they don't work at the moment expected.remove(JstorFetcher.class); expected.remove(GoogleScholar.class); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IssnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IssnFetcherTest.java new file mode 100644 index 00000000000..684e01ecc63 --- /dev/null +++ b/src/test/java/org/jabref/logic/importer/fetcher/IssnFetcherTest.java @@ -0,0 +1,56 @@ +package org.jabref.logic.importer.fetcher; + +import java.util.List; +import java.util.Optional; + +import org.jabref.logic.importer.FetcherException; +import org.jabref.logic.importer.ImportFormatPreferences; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; +import org.jabref.preferences.BibEntryPreferences; +import org.jabref.testutils.category.FetcherTest; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@FetcherTest +class IssnFetcherTest { + + private IssnFetcher fetcher; + private BibEntry bibEntry; + + @BeforeEach + void setUp() { + ImportFormatPreferences importPrefs = mock(ImportFormatPreferences.class); + BibEntryPreferences bibEntryPrefs = mock(BibEntryPreferences.class); + when(importPrefs.bibEntryPreferences()).thenReturn(bibEntryPrefs); + + fetcher = new IssnFetcher(); + + bibEntry = new BibEntry() + .withField(StandardField.ISSN, "15454509") + .withField(StandardField.JOURNALTITLE, "Annual Review of Biochemistry") + .withField(StandardField.PUBLISHER, "Annual Reviews Inc."); + } + + @Test + void performSearchByEntry() throws FetcherException { + List fetchedEntry = fetcher.performSearch(bibEntry); + assertEquals(List.of(bibEntry), fetchedEntry); + } + + @Test + void performSearchById() throws FetcherException { + Optional fetchedEntry = fetcher.performSearchById("15454509"); + assertEquals(Optional.of(bibEntry), fetchedEntry); + } + + @Test + void getName() { + assertEquals("ISSN", fetcher.getName()); + } +} From 245e75ec5e5c5ce5e39c02b6e0abfa84dafca481 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sat, 4 Nov 2023 17:38:43 +0100 Subject: [PATCH 03/10] change codecov (#10616) * change codecov * Update metrics only on main branch * Also checkout only on main --- .github/workflows/tests.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 03914a7cbb1..e1be0f8c869 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -304,6 +304,7 @@ jobs: steps: - name: Check secrets presence id: checksecrets + if: github.ref == 'refs/heads/main' shell: bash run: | if [ "$CODECOV_TOKEN" == "" ]; then @@ -312,25 +313,31 @@ jobs: echo "secretspresent=YES" >> $GITHUB_OUTPUT fi env: - SNAPCRAFT_LOGIN_FILE: ${{ secrets.CODECOV_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Checkout source + if: github.ref == 'refs/heads/main' uses: actions/checkout@v4 with: submodules: 'true' show-progress: 'false' - name: Set up JDK + if: github.ref == 'refs/heads/main' uses: actions/setup-java@v3 with: java-version: 21.0.1 distribution: 'liberica' cache: 'gradle' - name: Update test coverage metrics - if: steps.checksecrets.outputs.secretspresent == 'YES' - run: xvfb-run --auto-servernum ./gradlew jacocoTestReport && bash <(curl -s https://codecov.io/bash); + if: (github.ref == 'refs/heads/main') && (steps.checksecrets.outputs.secretspresent == 'YES') + run: xvfb-run --auto-servernum ./gradlew jacocoTestReport env: CI: "true" CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} DBMS: "postgresql" + - uses: codecov/codecov-action@v3 + if: (github.ref == 'refs/heads/main') && (steps.checksecrets.outputs.secretspresent == 'YES') + with: + token: ${{ secrets.CODECOV_TOKEN }} # This is https://github.com/marketplace/actions/gradle-wrapper-validation # It ensures that the jar file is from gradle and not by a strange third party. gradlevalidation: From 837fc1ed0489d32f0d3d264167bd7c3b319936bc Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Mon, 6 Nov 2023 05:42:43 +0100 Subject: [PATCH 04/10] Change linter (#10614) --- .github/workflows/check-links.yaml | 22 --------- .github/workflows/check-links.yml | 35 ++++++++++++++ .gitignore | 2 + .lycheeignore | 14 ++++++ CHANGELOG.md | 14 +++--- PRIVACY.md | 4 +- buildres/LICENSE_with_Privacy.md | 6 +-- docs/code-howtos/IntelliJ.md | 2 +- docs/code-howtos/index.md | 2 +- docs/code-howtos/javafx.md | 2 +- .../openoffice/code-reorganization.md | 27 +++++------ docs/code-howtos/remote-storage.md | 2 +- docs/code-howtos/tools.md | 6 +-- docs/contributing.md | 2 +- .../0009-use-plain-junit5-for-testing.md | 2 +- .../development-strategy.md | 4 +- docs/teaching.md | 11 ++--- external-libraries.md | 2 +- lychee.toml | 1 + mlc_config.json | 46 ------------------- .../importer/fetcher/MedlineFetcher.java | 2 +- 21 files changed, 96 insertions(+), 112 deletions(-) delete mode 100644 .github/workflows/check-links.yaml create mode 100644 .github/workflows/check-links.yml create mode 100644 .lycheeignore create mode 100644 lychee.toml delete mode 100644 mlc_config.json diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml deleted file mode 100644 index d570d9cb07e..00000000000 --- a/.github/workflows/check-links.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Check external href links in the documentation - -on: - schedule: - # Run on the first of each month at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07) - - cron: "0 9 1 * *" - workflow_dispatch: - -jobs: - markdown-link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - show-progress: 'false' - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'no' - config-file: 'mlc_config.json' - folder-path: 'docs/' - file-path: './README.md' diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml new file mode 100644 index 00000000000..a121d295643 --- /dev/null +++ b/.github/workflows/check-links.yml @@ -0,0 +1,35 @@ +name: Check external href links in the documentation + +on: + push: + paths: + - '.github/workflows/check-links.yml' + - '**/*.md' + schedule: + # Run on the first of each month at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07) + - cron: "0 9 1 * *" + workflow_dispatch: + +concurrency: + group: "${{ github.workflow }}-${{ github.head_ref }}" + cancel-in-progress: true + +jobs: + lychee: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + show-progress: 'false' + - name: Restore lychee cache + uses: actions/cache@v3 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v1.8.0 + with: + fail: true + args: --max-concurrency 1 --cache --no-progress --exclude-all-private './**/*.md' diff --git a/.gitignore b/.gitignore index 72603d9dc08..28c62cbe9f0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ src/main/gen/ src/main/generated/ src-gen/ +.lycheecache + # generated by https://plugins.jetbrains.com/plugin/15991-plantuml-diagram-generator *.puml diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 00000000000..8d3f2072f17 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,14 @@ +https://arxiv.org/ +https://contribute.jabref.org/ +https://donations.jabref.org/ +https://pubs.acs.org/ +https://web.archive.org/ +https://www.researchgate.net/privacy-policy +https://www.sciencedirect.com/ + +https://github.com/koppor/jabref/issue +https://github.com/koppor/jabref/pull +https://github.com/JabRef/jabref/issue +https://github.com/JabRef/jabref/pull + +0005-example.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 24c632a982d..55d8ccfcdb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,7 +92,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We added "Attach file from URL" to right-click context menu to download and store a file with the reference library. [#9646](https://github.com/JabRef/jabref/issues/9646) - We enabled updating an existing entry with data from InspireHEP. [#9351](https://github.com/JabRef/jabref/issues/9351) - We added a fetcher for the Bibliotheksverbund Bayern (experimental). [#9641](https://github.com/JabRef/jabref/pull/9641) -- We added support for more biblatex date formats for parsing dates. [#2753](https://github.com/JabRef/issues/2753) +- We added support for more biblatex date formats for parsing dates. [#2753](https://github.com/JabRef/jabref/issues/2753) - We added support for multiple languages for exporting to and importing references from MS Office. [#9699](https://github.com/JabRef/jabref/issues/9699) - We enabled scrolling in the groups list when dragging a group on another group. [#2869](https://github.com/JabRef/jabref/pull/2869) - We added the option to automatically download online files when a new entry is created from an existing ID (e.g., DOI). The option can be disabled in the preferences under "Import and Export". [#9756](https://github.com/JabRef/jabref/issues/9756) @@ -686,7 +686,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue with toggle of special fields does not work for sorted entries [#7016](https://github.com/JabRef/jabref/issues/7016) - We fixed an issue with the default path of external application. [#7641](https://github.com/JabRef/jabref/issues/7641) - We fixed an issue where urls must be embedded in a style tag when importing EndNote style Xml files. Now it can parse url with or without a style tag. [#6199](https://github.com/JabRef/jabref/issues/6199) -- We fixed an issue where the article title with colon fails to download the arXiv link (pdf file). [#7660](https://github.com/JabRef/issues/7660) +- We fixed an issue where the article title with colon fails to download the arXiv link (pdf file). [#7660](https://github.com/JabRef/jabref/issues/7660) - We fixed an issue where the keybinding for delete entry did not work on the main table [7580](https://github.com/JabRef/jabref/pull/7580) - We fixed an issue where the RFC fetcher is not compatible with the draft [7305](https://github.com/JabRef/jabref/issues/7305) - We fixed an issue where duplicate files (both file names and contents are the same) is downloaded and add to linked files [#6197](https://github.com/JabRef/jabref/issues/6197) @@ -788,7 +788,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv ### Added - We added a new fetcher to enable users to search mEDRA DOIs [#6602](https://github.com/JabRef/jabref/issues/6602) -- We added a new fetcher to enable users to search "[Collection of Computer Science Bibliographies](https://liinwww.ira.uka.de/bibliography/index.html)". [#6638](https://github.com/JabRef/jabref/issues/6638) +- We added a new fetcher to enable users to search "[Collection of Computer Science Bibliographies](https://en.wikipedia.org/wiki/Collection_of_Computer_Science_Bibliographies)". [#6638](https://github.com/JabRef/jabref/issues/6638) - We added default values for delimiters in Add Subgroup window [#6624](https://github.com/JabRef/jabref/issues/6624) - We improved responsiveness of general fields specification dialog window. [#6604](https://github.com/JabRef/jabref/issues/6604) - We added support for importing ris file and load DOI [#6530](https://github.com/JabRef/jabref/issues/6530) @@ -881,7 +881,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue about duplicated group color indicators [#6175](https://github.com/JabRef/jabref/issues/6175) - We fixed an issue where entries with the entry type Misc from an imported aux file would not be saved correctly to the bib file on disk [#6405](https://github.com/JabRef/jabref/issues/6405) - We fixed an issue where percent sign ('%') was not formatted properly by the HTML formatter [#6753](https://github.com/JabRef/jabref/issues/6753) -- We fixed an issue with the [SAO/NASA Astrophysics Data System](https://docs.jabref.org/collect/import-using-online-bibliographic-database/ads) fetcher where `\textbackslash` appeared at the end of the abstract. +- We fixed an issue with the [SAO/NASA Astrophysics Data System](https://docs.jabref.org/collect/add-entry-using-an-id#sao-nasa-a-ds) fetcher where `\textbackslash` appeared at the end of the abstract. - We fixed an issue with the Science Direct fetcher where PDFs could not be downloaded. Fixes [#5860](https://github.com/JabRef/jabref/issues/5860) - We fixed an issue with the Library of Congress importer. - We fixed the [link to the external libraries listing](https://github.com/JabRef/jabref/blob/master/external-libraries.md) in the about dialog @@ -891,7 +891,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We removed the option of the "enforce legal key". [#6295](https://github.com/JabRef/jabref/issues/6295) - We removed the obsolete `External programs / Open PDF` section in the preferences, as the default application to open PDFs is now set in the `Manage external file types` dialog. [#6130](https://github.com/JabRef/jabref/pull/6130) -- We removed the option to configure whether a `.bib.bak` file should be generated upon save. It is now always enabled. Documentation at . [#6092](https://github.com/JabRef/jabref/issues/6092) +- We removed the option to configure whether a `.bib.bak` file should be generated upon save. It is now always enabled. Documentation at . [#6092](https://github.com/JabRef/jabref/issues/6092) - We removed the built-in list of IEEE journal abbreviations using BibTeX strings. If you still want to use them, you have to download them separately from . ## [5.0] – 2020-03-06 @@ -1021,7 +1021,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv ### Removed - We removed some obsolete notifications. [#5555](https://github.com/JabRef/jabref/issues/5555) -- We removed an internal step in the [ISBN-to-BibTeX fetcher](https://docs.jabref.org/import-using-publication-identifiers/isbntobibtex): The [ISBN to BibTeX Converter](https://manas.tungare.name/software/isbn-to-bibtex) by [@manastungare](https://github.com/manastungare) is not used anymore, because it is offline: "people using this tool have not been generating enough sales for Amazon." +- We removed an internal step in the [ISBN-to-BibTeX fetcher](https://docs.jabref.org/collect/add-entry-using-an-id#isbn): The [ISBN to BibTeX Converter](https://manas.tungare.name/software/isbn-to-bibtex) by [@manastungare](https://github.com/manastungare) is not used anymore, because it is offline: "people using this tool have not been generating enough sales for Amazon." - We removed the option to control the default drag and drop behaviour. You can use the modifier keys (like CtrL or Alt) instead. ## [5.0-alpha] – 2019-08-25 @@ -1054,7 +1054,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - Change default icon for groups to a circle because a colored version of the old icon was hard to distinguish from its black counterpart. - In the main table, the context menu appears now when you press the "context menu" button on the keyboard. [feature request in the forum](https://discourse.jabref.org/t/how-to-enable-keyboard-context-key-windows) - We added icons to the group side panel to quickly switch between `union` and `intersection` group view mode. [#3269](https://github.com/JabRef/jabref/issues/3269). -- We use `https` for [fetching from most online bibliographic database](https://docs.jabref.org/import-using-online-bibliographic-database). +- We use `https` for [fetching from most online bibliographic database](https://docs.jabref.org/collect/import-using-online-bibliographic-database). - We changed the default keyboard shortcuts for moving between entries when the entry editor is active to ̀alt + up/down. - Opening a new file now prompts the directory of the currently selected file, instead of the directory of the last opened file. - Window state is saved on close and restored on start. diff --git a/PRIVACY.md b/PRIVACY.md index d7a1ca68b48..91df8163523 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -46,7 +46,7 @@ These third-party services are the following: | [arXiv.org](https://arxiv.org/) | | | [Bibliotheksverbund Bayern](https://www.bib-bvb.de/) | | | [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/) | | -| [Collection of Computer Science Bibliographies](http://liinwww.ira.uka.de/) | **currently unavailable**, offline | +| [Collection of Computer Science Bibliographies](https://en.wikipedia.org/wiki/Collection_of_Computer_Science_Bibliographies) | **currently unavailable**, offline | | [CrossRef](https://www.crossref.org/) | | | [dblp](https://dblp.uni-trier.de/) | | | [Directory of Open Access Books](https://www.doabooks.org/) | | @@ -62,7 +62,7 @@ These third-party services are the following: | [Library of Congress](https://lccn.loc.gov/) | | | [National Library of Medicine](https://www.ncbi.nlm.nih.gov/) | | | [MathSciNet](http://www.ams.org/mathscinet) | | -| [mEDRA](https://medra.org/) | | +| [mEDRA](https://www.medra.org/) | | | [Mr. DLib](https://mr-dlib.org/) [1] | | | [Openlibrary](https://openlibrary.org) | | | [ResearchGate](https://www.researchgate.net/) | | diff --git a/buildres/LICENSE_with_Privacy.md b/buildres/LICENSE_with_Privacy.md index 41264b1efcc..291dd3e5f34 100644 --- a/buildres/LICENSE_with_Privacy.md +++ b/buildres/LICENSE_with_Privacy.md @@ -1,6 +1,6 @@ MIT License -Copyright © 2003-2021 [JabRef Authors](https://github.com/JabRef/jabref/blob/master/AUTHORS) +Copyright © 2003-2021 JabRef Authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -89,7 +89,7 @@ Service;Privacy Policy [arXiv.org](https://arxiv.org/); [Bibliotheksverbund Bayern](https://www.bib-bvb.de/); [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/); -[Collection of Computer Science Bibliographies](http://liinwww.ira.uka.de/);**currently unavailable**, offline +[Collection of Computer Science Bibliographies](https://en.wikipedia.org/wiki/Collection_of_Computer_Science_Bibliographies);**currently unavailable**, offline [CrossRef](https://www.crossref.org/); [dblp](https://dblp.uni-trier.de/); [Directory of Open Access Books](https://www.doabooks.org/); @@ -105,7 +105,7 @@ Service;Privacy Policy [Library of Congress](https://lccn.loc.gov/); [National Library of Medicine](https://www.ncbi.nlm.nih.gov/); [MathSciNet](http://www.ams.org/mathscinet); -[mEDRA](https://medra.org/); +[mEDRA](https://www.medra.org/); [Mr. DLib](https://mr-dlib.org/) [1]; [Openlibrary](https://openlibrary.org); [ResearchGate](https://www.researchgate.net/); diff --git a/docs/code-howtos/IntelliJ.md b/docs/code-howtos/IntelliJ.md index 5cac3dac319..be1e13d611c 100644 --- a/docs/code-howtos/IntelliJ.md +++ b/docs/code-howtos/IntelliJ.md @@ -17,7 +17,7 @@ Did you know that [IntelliJ allows for reformatting selected code](https://www.j ## Show variable values in IntelliJ -1. Go to a test case (example: [`org.jabref.model.entry.BibEntryTest#settingTypeToNullThrowsException`](https://github.com/JabRef/jabref/blob/refine-intellij-howto/src/test/java/org/jabref/model/entry/BibEntryTest.java#L52-L52) +1. Go to a test case (example: [`org.jabref.model.entry.BibEntryTest#settingTypeToNullThrowsException`](https://github.com/JabRef/jabref/blob/main/src/test/java/org/jabref/model/entry/BibEntryTest.java#L52-L52) 2. Set the breakpoint to the first line 3. Execute the test 4. Go to the settings of the debugger and activate "Show Variable Values in Editor" and "Show Method Return Values" diff --git a/docs/code-howtos/index.md b/docs/code-howtos/index.md index fff2c645b44..eb11987445d 100644 --- a/docs/code-howtos/index.md +++ b/docs/code-howtos/index.md @@ -5,7 +5,7 @@ has_children: true # Code Howtos This page provides some development support in the form of howtos. -See also [High Level Documentation](../getting-into-thecode/high-level-documentation.md). +See also [High Level Documentation](../getting-into-the-code/high-level-documentation.md). ## Generic code how tos diff --git a/docs/code-howtos/javafx.md b/docs/code-howtos/javafx.md index c045b12fc12..2dfb8514351 100644 --- a/docs/code-howtos/javafx.md +++ b/docs/code-howtos/javafx.md @@ -62,7 +62,7 @@ The goal of the MVVM architecture is to separate the state/behavior from the app The only class which access model and logic classes is the ViewModel. Controller and View have only access the ViewModel and never the backend. The ViewModel does not know the Controller or View. -More details about the MVVM pattern can be found in [an article by Microsoft](https://msdn.microsoft.com/en-us/magazine/dd419663.aspx) and in [an article focusing on the implementation with JavaFX](http://blog.buildpath.de/javafx-decouple-the-view-and-its-behavior-to-create-a-testable-ui/). +More details about the MVVM pattern can be found in [an article by Microsoft](https://msdn.microsoft.com/en-us/magazine/dd419663.aspx) and in [an article focusing on the implementation with JavaFX](https://web.archive.org/web/20140825151304/http://blog.buildpath.de/javafx-decouple-the-view-and-its-behavior-to-create-a-testable-ui/). ## An example diff --git a/docs/code-howtos/openoffice/code-reorganization.md b/docs/code-howtos/openoffice/code-reorganization.md index c9c37fe47d8..d7bd01a1244 100644 --- a/docs/code-howtos/openoffice/code-reorganization.md +++ b/docs/code-howtos/openoffice/code-reorganization.md @@ -29,15 +29,15 @@ Why * `OOListUtil`: some utilities working on List * `uno` : helpers for various tasks via UNO.\ These are conceptually independent of JabRef code and logic. - * `ootext` : to separate decisions on the format of references and citation marks from the actual insertion into the document, the earlier method [OOUtil.insertOOFormattedTextAtCurrentLocation](https://github.com/JabRef/jabref/blob/475b2989ffa8ec61c3327c62ed8f694149f83220/src/main/java/org/jabref/logic/openoffice/OOUtil.java#L112) was extended to handle new tags that describe actions earlier done in code. - * This became [OOTextIntoOO.write](https://github.com/antalk2/jabref/blob/122d5133fa6c7b44245c5ba5600d398775718664/src/main/java/org/jabref/model/openoffice/ootext/OOTextIntoOO.java#L149) + * `ootext` : to separate decisions on the format of references and citation marks from the actual insertion into the document, the earlier method `OOUtil.insertOOFormattedTextAtCurrentLocation` was extended to handle new tags that describe actions earlier done in code. + * This became `OOTextIntoOO.write` * `(change)` Now all output to the document goes through this, not only those from Layout. This allows the citation markers and `jstyle:Title` to use these tags. * This allows some backward-compatible extensions to jstyle.\ - `(change)` [Added](https://github.com/antalk2/jabref/blob/122d5133fa6c7b44245c5ba5600d398775718664/src/main/java/org/jabref/logic/openoffice/style/OOBibStyle.java#L92) some extra keywords, in `{prefix}_MARKUP_BEFORE`, `{prefix}_MARKUP_AFTER` pairs to allow bracketing some parts of citation marks with text and/or open/close tag pairs. - * [OOFormat](https://github.com/antalk2/jabref/blob/improve-reversibility-rebased-03/src/main/java/org/jabref/model/openoffice/ootext/OOFormat.java) contains helpers to create the appropriate tags - * [OOText](https://github.com/antalk2/jabref/blob/improve-reversibility-rebased-03/src/main/java/org/jabref/model/openoffice/ootext/OOText.java) formalizes the distinction from `String`. I did not change `String` to `OOText` in old code, (in particular in OOStyle). + `(change)` Added some extra keywords, in `{prefix}_MARKUP_BEFORE`, `{prefix}_MARKUP_AFTER` pairs to allow bracketing some parts of citation marks with text and/or open/close tag pairs. + * `OOFormat` contains helpers to create the appropriate tags + * `OOText` formalizes the distinction from `String`. I did not change `String` to `OOText` in old code, (in particular in OOStyle). * `rangesort` : ordering objects that have an `XTextRange`, optionally with an extra integer to break ties. - * `RangeSort.partitionAndSortRanges` : since `XTextRangeCompare` can only compare `XTextRange` values in the same `XText`, we partition them accordingly and only sort within each partiion. + * `RangeSort.partitionAndSortRanges` : since `XTextRangeCompare` can only compare `XTextRange` values in the same `XText`, we partition them accordingly and only sort within each partition. * `RangeSortable` (interface), `RangeSortEntry` (implements) :\ When we replace `XTextRange` of citation marks in footnotes with the range of the footnote mark, multiple citation marks may be mapped to the same location. To preserve the order between these, `RangeSortable` allows this order to be indicated by returning appropriate indices from `getIndexInPosition` * `RangeSortVisual` : sort in top-to-bottom left-to-right order.\ @@ -61,12 +61,12 @@ At the core, * a list of citations (`citationsInStorageOrder`) * an identifier `CitationGroupId cgid` * this allows to refer to the group - * also used to associate the group to its citation markers location (outside the style part, in [Backend](https://github.com/antalk2/jabref/blob/fed0952cbdaf7a76bcb09b3db5ac48f34f5ca388/src/main/java/org/jabref/logic/openoffice/backend/Backend52.java#L46)) + * also used to associate the group to its citation markers location (outside the style part, in `Backend52`) * `OODataModel dataModel` is here, in order to handle old (Jabref5.2) structure where pageInfo belonged to CitationGroup not Citation * `referenceMarkNameForLinking` is optional: can be used to crosslink to the citation marker from the bibliography. * `CitationGroups` represents the collection of citation groups.\ Processing starts with creating a `CitationGroups` instance from the data stored in the document. -* `CitedKey` represents a cited source, with ordered backreferences (using `CitationPath`) to the correponding citations. +* `CitedKey` represents a cited source, with ordered back references (using `CitationPath`) to the corresponding citations. * `CitedKeys` is just an order-preserving collection of `CitedKeys` that also supports lookup by `citationKey`. While producing citation markers, we also create a corresponding `CitedKeys` instance, and store it in `CitationGroups.bibliography`. This is already sorted, its entries have `uniqueLetter` or `number` assigned, but not converted to markup yet. Common processing steps: @@ -79,10 +79,11 @@ Common processing steps: We can create a `CitedKeys` instance (`bibliography`) according to this order. * For citations numbered in order of first appearance we number the sources and distribute the numbers to the corresponding citations. * For citations numbered in order of bibliography, we sort the bibliography, number, distribute. -* For author-year citations we have to decide on the letters `uniqueLetter` used to distinguish sources. This needs order of first appearance of the sources and recognizing clashing citation markers. This is done in logic, in [`OOProcessAuthorYearMarkers.createUniqueLetters()`](https://github.com/antalk2/jabref/blob/122d5133fa6c7b44245c5ba5600d398775718664/src/main/java/org/jabref/logic/openoffice/style/OOProcessAuthorYearMarkers.java#L49) -* We also mark first appearance of each source ([`setIsFirstAppearanceOfSourceInCitations`](https://github.com/antalk2/jabref/blob/fed0952cbdaf7a76bcb09b3db5ac48f34f5ca388/src/main/java/org/jabref/logic/openoffice/style/OOProcessAuthorYearMarkers.java#L146)) +* For author-year citations we have to decide on the letters `uniqueLetter` used to distinguish sources. This needs order of first appearance of the sources and recognizing clashing citation markers. This is done in logic, in `OOProcessAuthorYearMarkers.createUniqueLetters()` +* We also mark first appearance of each source (`setIsFirstAppearanceOfSourceInCitations`) + +The entry point for this processing is: `OOProcess.produceCitationMarkers`. -The entry point for this processing is: [`OOProcess.produceCitationMarkers`](https://github.com/antalk2/jabref/blob/fed0952cbdaf7a76bcb09b3db5ac48f34f5ca388/src/main/java/org/jabref/logic/openoffice/style/OOProcess.java#L69).\ It fills * each `CitationGroup.citationMarker` @@ -94,7 +95,7 @@ It fills * `StyleLoader` : not changed (knows about default styles) Used by GUI * `OOPreFormatter` : LaTeX code to unicode and OOText tags. (not changed) * `OOBibStyle` : is mostly concerned by loading/parsing jstyle files and presenting its pieces to the rest. Originally it also contains code to format numeric and author-year citation markers. - * Details of their new implementations are in [`OOBibStyleGetNumCitationMarker`](https://github.com/antalk2/jabref/blob/improve-reversibility-rebased-03/src/main/java/org/jabref/logic/openoffice/style/OOBibStyleGetNumCitationMarker.java) and [`OOBibStyleGetCitationMarker`](https://github.com/antalk2/jabref/blob/improve-reversibility-rebased-03/src/main/java/org/jabref/logic/openoffice/style/OOBibStyleGetCitationMarker.java) + * Details of their new implementations are in `OOBibStyleGetNumCitationMarker` and `OOBibStyleGetCitationMarker` * The new implementations * support pageInfo for each citation * support unresolved citations @@ -106,7 +107,7 @@ It fills * `CitationMarkerNumericBibEntry` * `CitationMarkerNormEntry`\ describe their expected input entries. -* [`OOProcess.produceCitationMarkers`](https://github.com/antalk2/jabref/blob/fed0952cbdaf7a76bcb09b3db5ac48f34f5ca388/src/main/java/org/jabref/logic/openoffice/style/OOProcess.java#L69) is the main entry point for style application. Calls to specific implementations in `OOProcessCitationKeyMarkers`, `OOProcessNumericMarkers` and `OOProcessAuthorYearMarkers` according to jstyle flags. +* `OOProcess.produceCitationMarkers` is the main entry point for style application. Calls to specific implementations in `OOProcessCitationKeyMarkers`, `OOProcessNumericMarkers` and `OOProcessAuthorYearMarkers` according to jstyle flags. ## logic/backend diff --git a/docs/code-howtos/remote-storage.md b/docs/code-howtos/remote-storage.md index 0f845913aa5..01a402afc79 100644 --- a/docs/code-howtos/remote-storage.md +++ b/docs/code-howtos/remote-storage.md @@ -12,4 +12,4 @@ JabRef supports kinds of remote storage: The first one is the more modern approach allowing offline-work. The second approach makes use of the SQL features of databases and require direct online connections. -More details in [JabDrive](remote-storeage-jabdrive.md) and [SQL Storage](remote-storage-sql.md) respectively. +More details in [JabDrive](remote-storage-jabdrive.md) and [SQL Storage](remote-storage-sql.md) respectively. diff --git a/docs/code-howtos/tools.md b/docs/code-howtos/tools.md index c4e9853a21f..f2b344da05a 100644 --- a/docs/code-howtos/tools.md +++ b/docs/code-howtos/tools.md @@ -16,9 +16,9 @@ This page lists some software we consider useful. Here, we collect some helpful git hints -* [https://github.com/blog/2019-how-to-undo-almost-anything-with-git](https://github.com/blog/2019-how-to-undo-almost-anything-with-git) -* [https://github.com/RichardLitt/docs/blob/master/amending-a-commit-guide.md](https://github.com/RichardLitt/docs/blob/master/amending-a-commit-guide.md) -* awesome hints and tools regarding git: [https://github.com/dictcp/awesome-git](https://github.com/dictcp/awesome-git) +* +* [So you need to change your commit](https://github.com/RichardLitt/knowledge/blob/master/github/amending-a-commit-guide.md#so-you-need-to-change-your-commit) +* awesome hints and tools regarding git: ### Rebase everything as one commit on main diff --git a/docs/contributing.md b/docs/contributing.md index bd187bf1f3f..06451efcbc9 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -78,7 +78,7 @@ Actual :[Opens\ JabRef's\ Twitter\ page (src\main\java\org\jabref\gui\JabRefFr Add the above snippet to the English translation file located at `src/main/resources/l10n/JabRef_en.properties`. [Crowdin](https://crowdin.com/project/jabref) will automatically pick up the new string and add it to the other translations. -You can also directly run the specific test in your IDE. The test "LocalizationConsistencyTest" is placed under `src/test/java/org.jabref.logic.l10n/LocalizationConsistencyTest.java`. Find more information in the [JabRef developer docs](https://devdocs.jabref.org/getting-into-the-code/code-howtos#using-localization-correctly). +You can also directly run the specific test in your IDE. The test "LocalizationConsistencyTest" is placed under `src/test/java/org.jabref.logic.l10n/LocalizationConsistencyTest.java`. Find more information in the [JabRef developer docs](code-howtos/localization.md). #### When adding a library diff --git a/docs/decisions/0009-use-plain-junit5-for-testing.md b/docs/decisions/0009-use-plain-junit5-for-testing.md index 3d88c5989e3..5ca034a33cd 100644 --- a/docs/decisions/0009-use-plain-junit5-for-testing.md +++ b/docs/decisions/0009-use-plain-junit5-for-testing.md @@ -34,7 +34,7 @@ Chosen option: "Plain JUnit5", because comes out best \(see below\). ### Plain JUnit5 Homepage: -JabRef testing guidelines: +JabRef testing guidelines: <../testing.md> Example: diff --git a/docs/getting-into-the-code/development-strategy.md b/docs/getting-into-the-code/development-strategy.md index 8fddcd79b47..b58387ba1c8 100644 --- a/docs/getting-into-the-code/development-strategy.md +++ b/docs/getting-into-the-code/development-strategy.md @@ -12,7 +12,7 @@ To ensure high code-quality, * We follow the principles of [Effective Java](https://www.oreilly.com/library/view/effective-java-3rd/9780134686097/). * We use [Design Patterns](https://java-design-patterns.com/patterns/) when applicable. * We document our design decisions using the lightweight architectural decision records [MADR](https://adr.github.io/madr/). -* We review each external pull request by at least two [JabRef Core Developers](https://github.com/JabRef/jabref/blob/main/MAINTAINERS/README.md). +* We review each external pull request by at least two [JabRef Core Developers](https://github.com/JabRef/jabref/blob/main/MAINTAINERS). Read on about our automated quality checks at [Code Quality](../code-howtos/code-quality.md). @@ -35,7 +35,7 @@ Other branches are used for discussing improvements with the help of [pull reque ## How JabRef acquires contributors -* We participate in [Hacktoberfest](https://hacktoberfest.digitalocean.com). See [https://www.jabref.org/hacktoberfest/](https://www.jabref.org/hacktoberfest/) for details. +* We participate in [Hacktoberfest](https://www.hacktoberfest.com). * We participate in [Google Summer of Code](https://developers.google.com/open-source/gsoc/). ## Historical notes diff --git a/docs/teaching.md b/docs/teaching.md index dedc12bde3f..6c617826f50 100644 --- a/docs/teaching.md +++ b/docs/teaching.md @@ -21,7 +21,6 @@ By using JabRef as training object in exercises and labs, students can level-up implementation effort, testing effort, and "issue understanding effort". The latter category is important, because some issues are "quick wins" and others need thorough thinking. - In general, all issues of JabRef are free to take. Be aware that the difficulty of bugs and feature vary. For the brave, the [Bug Board](https://github.com/orgs/JabRef/projects/7) or the [Feature Board](https://github.com/JabRef/jabref/projects/6) provide other issue sources. @@ -34,7 +33,7 @@ By using JabRef as training object in exercises and labs, students can level-up 6. Students address review feedback 7. Students submit pull request 8. Code reviews by JabRef maintainers -9. Students address feedback and learn more about good coding practices by incoporating feedback +9. Students address feedback and learn more about good coding practices by incorporating feedback 10. Students update their pull request 11. Pull request is merged @@ -50,19 +49,19 @@ There is no special process for student contributions. We want to discuss it nev The process for accepting contributions is as below. The syntax is [BPMN](https://en.wikipedia.org/wiki/Business\_Process\_Model\_and\_Notation) modeled using [bpmn.io](https://bpmn.io). -[![process]()](https://github.com/JabRef/jabref/tree/ed275b62fe7dac57a086e43802e36deb93c63e31/docs/images/contribution-process-reviews.svg) +[![process](images/contribution-process-reviews.svg)](https://raw.githubusercontent.com/JabRef/jabref/main/docs/images/contribution-process-reviews.svg) In short, the contribution is **reviewed by two JabRef developers**. Typically, they have constructive feedback on their contribution. This means, that the contributors get comments on their contribution enabling them to level-up their coding skill. Incorporating improvements takes time, too. The benefit is two-fold: a) contributors improve their coding skills and b) JabRef's code quality improves. All in all, we ask to respect the aims of the JabRef team and to reserve time to incorporate the reviewer's comments. GitHub describes that in their page [Understanding the GitHub flow](https://guides.github.com/introduction/flow/): -[![GitHub flow]()](https://github.com/JabRef/jabref/tree/ed275b62fe7dac57a086e43802e36deb93c63e31/docs/images/github-flow.png) +[![GitHub flow](images/github-flow.png)](https://raw.githubusercontent.com/JabRef/jabref/main/docs/images/github-flow.png) ## Process for Java newcomers Newcomers contributing in the context of a university teaching experience are invited to follow the process described above. In case the capacity of the instructing university allows, we propose a three-step approach. First, the contributors prepare their contribution as usual. Then, they submit the pull request _to a separate repository_. There, the instructor reviews the pull request and provides feedback. This happens in a loop until the instructor shows the green light. Then, the pull request can be submitted to the main JabRef repository. This will help to reduce the load on the JabRef team and improve the quality of the initial pull request. -[![process with instructor]()](https://github.com/JabRef/jabref/tree/ed275b62fe7dac57a086e43802e36deb93c63e31/docs/images/contribution-process-reviews-with-instructor.svg) +[![process with instructor](images/contribution-process-reviews-with-instructor.svg)](https://raw.githubusercontent.com/JabRef/jabref/main/docs/images/contribution-process-reviews-with-instructor.svg) ## Past courses @@ -129,7 +128,7 @@ Course "Programming and Software Development" as part of the [BSc Software Engin Course [DD2480 Software Engineering Fundamentals](https://www.kth.se/student/kurser/kurs/DD2480?l=en) -* Summary: Groups of students from three to five persons experienced the whole software engineering process within a week: From the requirements specification to the final pull request. +* Summary: Groups of students from three to five persons experienced the whole software engineering process within a week: From the requirements' specification to the final pull request. * Successfully run in 2020 ### Portuguese diff --git a/external-libraries.md b/external-libraries.md index 6e68aa9bd68..f3d05010490 100644 --- a/external-libraries.md +++ b/external-libraries.md @@ -4,7 +4,7 @@ This document lists the fonts, icons, and libraries used by JabRef. This file is manually kept in sync with build.gradle and the binary jars contained in the lib/ directory. One can list all dependencies by using Gradle task `dependencyReport`. -It generates the file [build/reports/project/dependencies.txt](build/reports/project/dependencies.txt). +It generates the file `build/reports/project/dependencies.txt`. Below, there is a howto to generate the content at "Sorted list of runtime dependencies output by gradle". ## Legend diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 00000000000..ffc6ffe8716 --- /dev/null +++ b/lychee.toml @@ -0,0 +1 @@ +exclude_path = ["build/", "buildres/abbrv.jabref.org", "out/", "src/main/resources/csl-locales", "src/main/resources/csl-styles"] diff --git a/mlc_config.json b/mlc_config.json deleted file mode 100644 index e4ae50df899..00000000000 --- a/mlc_config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "ignorePatterns": [ - { - "pattern": "autohotkey.com" - }, - { - "pattern": "baeldung.com" - }, - { - "pattern": "^CONTRIBUTING\\.md" - }, - { - "pattern": "^https://codecov\\.io/" - }, - { - "pattern": "^https://dl\\.acm\\.org" - }, - { - "pattern": "^https://github\\.com" - }, - { - "pattern": "^https://.*\\.jabref\\.org" - }, - { - "pattern": "^https://sourcespy\\.com/.*" - }, - { - "pattern": "^http://purl\\.org/net/bibteXMP" - }, - { - "pattern": "tldrlegal.com" - }, - { - "pattern": "^https://web\\.archive\\.org" - }, - { - "pattern": "^https://www\\.slant\\.co/" - }, - { - "pattern": "^http://localhost" - }, - { - "pattern": "^https://demo.teamscale.com" - } - ] -} diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java index f0cf950e1eb..900122f2594 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java @@ -43,7 +43,7 @@ /** * Fetch or search from PubMed www.ncbi.nlm.nih.gov * The MedlineFetcher fetches the entries from the PubMed database. - * See docs.jabref.org for a detailed documentation of the available fields. + * See docs.jabref.org for a detailed documentation of the available fields. */ public class MedlineFetcher implements IdBasedParserFetcher, SearchBasedFetcher { private static final Logger LOGGER = LoggerFactory.getLogger(MedlineFetcher.class); From 8287a6f0462dce4e3a6ade2258e30a28f3ed1348 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:55:06 +0000 Subject: [PATCH 05/10] Bump com.tngtech.archunit:archunit-junit5-api from 1.1.0 to 1.2.0 Bumps [com.tngtech.archunit:archunit-junit5-api](https://github.com/TNG/ArchUnit) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/TNG/ArchUnit/releases) - [Commits](https://github.com/TNG/ArchUnit/compare/v1.1.0...v1.2.0) --- updated-dependencies: - dependency-name: com.tngtech.archunit:archunit-junit5-api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6e1338369a0..e9f9d5f3c5f 100644 --- a/build.gradle +++ b/build.gradle @@ -242,7 +242,7 @@ dependencies { testImplementation 'org.xmlunit:xmlunit-core:2.9.1' testImplementation 'org.xmlunit:xmlunit-matchers:2.9.1' testRuntimeOnly 'com.tngtech.archunit:archunit-junit5-engine:1.1.0' - testImplementation 'com.tngtech.archunit:archunit-junit5-api:1.1.0' + testImplementation 'com.tngtech.archunit:archunit-junit5-api:1.2.0' testImplementation "org.testfx:testfx-core:4.0.16-alpha" testImplementation "org.testfx:testfx-junit5:4.0.16-alpha" testImplementation "org.hamcrest:hamcrest-library:2.2" From e5467a048c97eb4e48c55b4b1f8d8c280e0c3c19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:55:12 +0000 Subject: [PATCH 06/10] Bump com.dlsc.gemsfx:gemsfx from 1.84.0 to 1.90.0 Bumps [com.dlsc.gemsfx:gemsfx](https://github.com/dlsc-software-consulting-gmbh/GemsFX) from 1.84.0 to 1.90.0. - [Release notes](https://github.com/dlsc-software-consulting-gmbh/GemsFX/releases) - [Changelog](https://github.com/dlsc-software-consulting-gmbh/GemsFX/blob/master/CHANGELOG.md) - [Commits](https://github.com/dlsc-software-consulting-gmbh/GemsFX/commits/v1.90.0) --- updated-dependencies: - dependency-name: com.dlsc.gemsfx:gemsfx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6e1338369a0..23f1911d32a 100644 --- a/build.gradle +++ b/build.gradle @@ -174,7 +174,7 @@ dependencies { implementation('com.tobiasdiez:easybind:2.2.1-SNAPSHOT') implementation 'org.fxmisc.flowless:flowless:0.7.1' implementation 'org.fxmisc.richtext:richtextfx:0.11.1' - implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '1.84.0') { + implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '1.90.0') { exclude module: 'javax.inject' // Split package, use only jakarta.inject exclude group: 'org.apache.logging.log4j' } From 924b573a9deba5338e43a4508022d426d8cbd289 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:55:17 +0000 Subject: [PATCH 07/10] Bump org.fxmisc.flowless:flowless from 0.7.1 to 0.7.2 Bumps [org.fxmisc.flowless:flowless](https://github.com/FXMisc/Flowless) from 0.7.1 to 0.7.2. - [Release notes](https://github.com/FXMisc/Flowless/releases) - [Changelog](https://github.com/FXMisc/Flowless/blob/master/CHANGELOG.md) - [Commits](https://github.com/FXMisc/Flowless/compare/v0.7.1...v0.7.2) --- updated-dependencies: - dependency-name: org.fxmisc.flowless:flowless dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6e1338369a0..27354d16d1d 100644 --- a/build.gradle +++ b/build.gradle @@ -172,7 +172,7 @@ dependencies { implementation 'com.github.sialcasa.mvvmFX:mvvmfx-validation:f195849ca9' //jitpack implementation 'de.saxsys:mvvmfx:1.8.0' implementation('com.tobiasdiez:easybind:2.2.1-SNAPSHOT') - implementation 'org.fxmisc.flowless:flowless:0.7.1' + implementation 'org.fxmisc.flowless:flowless:0.7.2' implementation 'org.fxmisc.richtext:richtextfx:0.11.1' implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '1.84.0') { exclude module: 'javax.inject' // Split package, use only jakarta.inject From a44cbd9a060ce2c9f8c0cf45f02c859b51b9105a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:55:33 +0000 Subject: [PATCH 08/10] Bump org.junit.jupiter:junit-jupiter from 5.10.0 to 5.10.1 Bumps [org.junit.jupiter:junit-jupiter](https://github.com/junit-team/junit5) from 5.10.0 to 5.10.1. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.0...r5.10.1) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6e1338369a0..cde14aea7f7 100644 --- a/build.gradle +++ b/build.gradle @@ -235,7 +235,7 @@ dependencies { // implementation 'org.glassfish.jersey.media:jersey-media-json-gson:3.1.1' testImplementation 'io.github.classgraph:classgraph:4.8.163' - testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' testImplementation 'org.junit.platform:junit-platform-launcher:1.10.0' testImplementation 'org.mockito:mockito-core:5.6.0' From fe9483a9be7a89da9265d76858ef6dbd61663b0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:05:41 +0000 Subject: [PATCH 09/10] Bump org.jsoup:jsoup from 1.16.1 to 1.16.2 (#10625) Bumps [org.jsoup:jsoup](https://github.com/jhy/jsoup) from 1.16.1 to 1.16.2. - [Release notes](https://github.com/jhy/jsoup/releases) - [Changelog](https://github.com/jhy/jsoup/blob/master/CHANGES) - [Commits](https://github.com/jhy/jsoup/compare/jsoup-1.16.1...jsoup-1.16.2) --- updated-dependencies: - dependency-name: org.jsoup:jsoup dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6e1338369a0..c0ef9a56e90 100644 --- a/build.gradle +++ b/build.gradle @@ -181,7 +181,7 @@ dependencies { implementation 'org.controlsfx:controlsfx:11.1.2' - implementation 'org.jsoup:jsoup:1.16.1' + implementation 'org.jsoup:jsoup:1.16.2' implementation 'com.konghq:unirest-java:3.14.5' implementation 'org.slf4j:slf4j-api:2.0.9' From a88772d878cde3ea11e3117c2ced2bd5584eb758 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Mon, 6 Nov 2023 17:05:45 +0100 Subject: [PATCH 10/10] fix tests --- .../fetcher/transformers/IEEEQueryTransformerTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java index b9673370292..91f2fccce28 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java @@ -46,7 +46,7 @@ public void convertJournalFieldPrefix() throws Exception { QueryNode luceneQuery = new StandardSyntaxParser().parse(queryString, AbstractQueryTransformer.NO_EXPLICIT_FIELD); transformer.transformLuceneQuery(luceneQuery); - assertEquals("\"Nature\"", transformer.getJournal().get()); + assertEquals(Optional.of("Nature"), transformer.getJournal()); } @Override @@ -60,8 +60,8 @@ public void convertYearField() throws Exception { QueryNode luceneQuery = new StandardSyntaxParser().parse(queryString, AbstractQueryTransformer.NO_EXPLICIT_FIELD); transformer.transformLuceneQuery(luceneQuery); - assertEquals(2021, transformer.getStartYear()); - assertEquals(2021, transformer.getEndYear()); + assertEquals(Optional.of(2021), transformer.getStartYear()); + assertEquals(Optional.of(2021), transformer.getEndYear()); } @Override @@ -72,8 +72,8 @@ public void convertYearRangeField() throws Exception { QueryNode luceneQuery = new StandardSyntaxParser().parse(queryString, AbstractQueryTransformer.NO_EXPLICIT_FIELD); transformer.transformLuceneQuery(luceneQuery); - assertEquals(2018, transformer.getStartYear()); - assertEquals(2021, transformer.getEndYear()); + assertEquals(Optional.of(2018), transformer.getStartYear()); + assertEquals(Optional.of(2021), transformer.getEndYear()); } private static Stream getTitleTestData() {