Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into refactor-prefs-calls
Browse files Browse the repository at this point in the history
* upstream/master: (36 commits)
  Fix remembering password for sql db (#7154)
  Update to libre office 7.0.3 (#7150)
  Add IdBasedSearchFetcher to jstor (#7145)
  Squashed 'src/main/resources/csl-styles/' changes from 55200d0..a20406d
  Bump antlr4-runtime from 4.8-1 to 4.9 (#7136)
  Bump antlr4 from 4.8-1 to 4.9 (#7138)
  Bump mariadb-java-client from 2.7.0 to 2.7.1 (#7134)
  Bump classgraph from 4.8.90 to 4.8.92 (#7139)
  Bump mockito-core from 3.6.0 to 3.6.28 (#7135)
  Bump gittools/actions from v0.9.6 to v0.9.7 (#7144)
  Bump checkstyle from 8.37 to 8.38 (#7142)
  Add missing author
  Fix document viewer not showing first page (#7132)
  Add githandler mock to crawler test to fix NPE (#7133)
  Searchbar glyph icon colors in Dark Theme [FIXED] (#7131)
  Fix binding issue for the regex and case sensitive search buttons (#7125)
  Enable automated cross library search using a cross library query lan… (#7124)
  Add tracking
  Update Java Version
  Welcome Dominik ✌
  ...
  • Loading branch information
Siedlerchr committed Dec 5, 2020
2 parents bf36959 + 4031104 commit 0d03690
Show file tree
Hide file tree
Showing 106 changed files with 7,805 additions and 704 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cleanup_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
echo "##[set-output name=branch;]$(echo ${{ github.event.pull_request.head.ref }})"
- name: Delete folder on builds.jabref.org
if: ${{ steps.checksecrets.outputs.secretspresent }}
uses: appleboy/[email protected].3
uses: appleboy/[email protected].4
with:
script: rm -rf /var/www/builds.jabref.org/www/${{ steps.extract_branch.outputs.branch }} || true
host: build-upload.jabref.org
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ jobs:
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected].6
uses: gittools/actions/gitversion/[email protected].7
with:
versionSpec: "5.x"
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected].6
uses: gittools/actions/gitversion/[email protected].7
- name: Set up JDK 15 for linux and mac
uses: actions/setup-java@v1
with:
Expand Down Expand Up @@ -161,12 +161,12 @@ jobs:
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected].6
uses: gittools/actions/gitversion/[email protected].7
with:
versionSpec: '5.x'
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected].6
uses: gittools/actions/gitversion/[email protected].7
- name: Get linux binaries
uses: actions/download-artifact@master
with:
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ Luis Romero
Mairieli Wessel
Malik Atalla
Malte Deiseroth
Manas Singh
Manuel Siebeneicher
Manuel Wtfjoke
Marcel Luethi
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ to the page field for cases where the page numbers are missing. [#7019](https://
- We added a new formatter to output shorthand month format. [#6579](https://github.com/JabRef/jabref/issues/6579)
- We added support for the new Microsoft Edge browser in all platforms. [#7056](https://github.com/JabRef/jabref/pull/7056)
- We reintroduced emacs/bash-like keybindings. [#6017](https://github.com/JabRef/jabref/issues/6017)
- We added a feature to provide automated cross library search using a cross library query language. This provides support for the search step of systematic literature reviews (SLRs). [koppor#369](https://github.com/koppor/jabref/issues/369)

### Changed

Expand Down Expand Up @@ -73,6 +74,9 @@ inserting new citations in a OpenOffic/LibreOffice document. [#6957](https://git
- We fixed an issue where errors from imports were not shown to the user [#7084](https://github.com/JabRef/jabref/pull/7084)
- We fixed an issue where the EndNote XML Import would fail on empty keywords tags [forum#2387](https://discourse.jabref.org/t/importing-in-unknown-format-fails-to-import-xml-library-from-bookends-export/2387)
- We fixed an issue where the color of groups of type "free search expression" not persisting after restarting the application [#6999](https://github.com/JabRef/jabref/issues/6999)
- We fixed an issue where modifications in the source tab where not saved without switching to another field before saving the library [#6622](https://github.com/JabRef/jabref/issues/6622)
- We fixed an issue where the "Document Viewer" did not show the first page of the opened pdf document and did not show the correct total number of pages [#7108](https://github.com/JabRef/jabref/issues/7108)
- We fixed an issue where the password for a shared SQL database was not remembered [#6869](https://github.com/JabRef/jabref/issues/6869)

### Removed

Expand Down
1 change: 1 addition & 0 deletions DEVELOPERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Tobias Diez (since 2015)
Christoph Schwentker (since 2016)
Linus Dietz (since 2017)
Carl Christian Snethlage (since 2020)
Dominik Voigt (since 2020)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ We will discuss improvements with you and agree to merge them once the [develope

If you want a step-by-step walk-through on how to set-up your workspace, please check [this guideline](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace).

To compile JabRef from source, you need a Java Development Kit 14 and `JAVA_HOME` pointing to this JDK.
To compile JabRef from source, you need a Java Development Kit 15 and `JAVA_HOME` pointing to this JDK.
To run it, just execute `gradlew run`.
When you want to develop, it is necessary to generate additional sources using `gradlew generateSource`
and then generate the Eclipse `gradlew eclipse`.
Expand Down
34 changes: 10 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ repositories {
}

configurations {
libreoffice
antlr3
antlr4
// TODO: Remove the following workaround for split error messages such as
Expand Down Expand Up @@ -117,29 +116,25 @@ dependencies {

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

// For Java 9+ compatibility, we include a bundled version of the libreoffice libraries
// See https://bugs.documentfoundation.org/show_bug.cgi?id=117331#c8 for background information
// Use the task bundleLibreOffice to update the bundled jar
// DO NOT CHANGE THE libreoffice PREFIX
libreoffice 'org.libreoffice:juh:6.4.3'
libreoffice 'org.libreoffice:jurt:6.4.3'
libreoffice 'org.libreoffice:ridl:6.4.3'
libreoffice 'org.libreoffice:unoil:6.4.3'
implementation 'org.libreoffice:libreoffice:7.0.3'
implementation 'org.libreoffice:unoloader:7.0.3'

implementation 'io.github.java-diff-utils:java-diff-utils:4.9'
implementation 'info.debatty:java-string-similarity:2.0.0'

antlr3 'org.antlr:antlr:3.5.2'
implementation 'org.antlr:antlr-runtime:3.5.2'

antlr4 'org.antlr:antlr4:4.8-1'
implementation 'org.antlr:antlr4-runtime:4.8-1'
antlr4 'org.antlr:antlr4:4.9'
implementation 'org.antlr:antlr4-runtime:4.9'

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

implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.7.0'
implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '5.9.0.202009080501-r'

implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.7.1'

implementation 'org.postgresql:postgresql:42.2.18'

Expand Down Expand Up @@ -197,15 +192,15 @@ dependencies {
implementation 'com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:0.62.2'
implementation 'com.vladsch.flexmark:flexmark-ext-gfm-tasklist:0.62.2'

testImplementation 'io.github.classgraph:classgraph:4.8.90'
testImplementation 'io.github.classgraph:classgraph:4.8.92'
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.0'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.7.0'
testImplementation 'org.junit.platform:junit-platform-launcher:1.7.0'

testImplementation 'net.bytebuddy:byte-buddy-parent:1.10.18'
testRuntime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT'
testRuntime group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '3.0.0-SNAPSHOT'
testImplementation 'org.mockito:mockito-core:3.6.0'
testImplementation 'org.mockito:mockito-core:3.6.28'
testImplementation 'org.xmlunit:xmlunit-core:2.8.1'
testImplementation 'org.xmlunit:xmlunit-matchers:2.8.1'
testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.14.1'
Expand All @@ -214,7 +209,7 @@ dependencies {
testImplementation "org.testfx:testfx-junit5:4.0.17-alpha-SNAPSHOT"
testImplementation "org.hamcrest:hamcrest-library:2.2"

checkstyle 'com.puppycrawl.tools:checkstyle:8.37'
checkstyle 'com.puppycrawl.tools:checkstyle:8.38'
xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.3'
jython 'org.python:jython-standalone:2.7.2'
}
Expand Down Expand Up @@ -765,13 +760,4 @@ task downloadDependencies {
}
}

task bundleLibreOffice(type: Jar) {
from configurations.libreoffice.collect { zipTree it }

manifest {
attributes 'Automatic-Module-Name': 'org.jabref.thirdparty.libreoffice'
}

destinationDir = file('lib')
archiveName = 'libreoffice.jar'
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ It is strongly recommend that you have git installed.

### IDE

We suggest [IntelliJ IDEA](https://www.jetbrains.com/idea/).
We suggest [IntelliJ IDEA](https://www.jetbrains.com/idea/?from=jabref).
For advanced users, [Eclipse](https://eclipse.org/) \(`2020-09` or newer\) is also possible.

#### IntelliJ
Expand Down
Binary file removed lib/libreoffice.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
requires applicationinsights.core;

// Libre Office
requires org.jabref.thirdparty.libreoffice;
requires org.libreoffice.uno;

// Other modules
requires commons.logging;
Expand Down Expand Up @@ -91,4 +91,5 @@
requires com.h2database.mvstore;
requires lucene.queryparser;
requires lucene.core;
requires org.eclipse.jgit;
}
10 changes: 10 additions & 0 deletions src/main/java/org/jabref/gui/Dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,13 @@
#preferencesContainer .tab-pane > .tab-header-area > .tab-header-background {
-fx-background-color: -jr-background;
}

.mainToolbar .search-field .toggle-button .glyph-icon {
-fx-fill: -jr-search-text;
-fx-text-fill: -jr-search-text;
}

.mainToolbar .search-field .toggle-button:selected .glyph-icon {
-fx-fill: derive(-jr-search-text, 80%);
-fx-text-fill: derive(-jr-search-text, 80%);
}
8 changes: 5 additions & 3 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,9 @@ private MenuBar createMenu() {
new SeparatorMenuItem(),

factory.createMenuItem(StandardActions.SEND_AS_EMAIL, new SendAsEMailAction(dialogService, stateManager)),
pushToApplicationMenuItem
pushToApplicationMenuItem,
new SeparatorMenuItem(),
factory.createMenuItem(StandardActions.START_SYSTEMATIC_LITERATURE_REVIEW, new StartLiteratureReviewAction(this, Globals.getFileUpdateMonitor(), Globals.prefs.getWorkingDir(), Globals.TASK_EXECUTOR))
);

SidePaneComponent webSearch = sidePaneManager.getComponent(SidePaneType.WEB_SEARCH);
Expand Down Expand Up @@ -991,7 +993,7 @@ public void addParserResult(ParserResult parserResult, boolean focusPanel) {
* This method causes all open LibraryTabs to set up their tables anew. When called from PreferencesDialogViewModel,
* this updates to the new settings.
* We need to notify all tabs about the changes to avoid problems when changing the column set.
* */
*/
public void setupAllTables() {
tabbedPane.getTabs().forEach(tab -> {
LibraryTab libraryTab = (LibraryTab) tab;
Expand All @@ -1012,7 +1014,7 @@ private ContextMenu createTabContextMenu(KeyBindingRepository keyBindingReposito
new SeparatorMenuItem(),
factory.createMenuItem(StandardActions.OPEN_DATABASE_FOLDER, new OpenDatabaseFolder()),
factory.createMenuItem(StandardActions.OPEN_CONSOLE, new OpenConsoleAction(stateManager))
);
);

return contextMenu;
}
Expand Down
82 changes: 82 additions & 0 deletions src/main/java/org/jabref/gui/StartLiteratureReviewAction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package org.jabref.gui;

import java.io.IOException;
import java.nio.file.Path;
import java.util.Optional;

import org.jabref.gui.actions.SimpleCommand;
import org.jabref.gui.importer.actions.OpenDatabaseAction;
import org.jabref.gui.util.BackgroundTask;
import org.jabref.gui.util.FileDialogConfiguration;
import org.jabref.gui.util.TaskExecutor;
import org.jabref.logic.crawler.Crawler;
import org.jabref.logic.crawler.git.GitHandler;
import org.jabref.logic.importer.ParseException;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.util.FileUpdateMonitor;
import org.jabref.preferences.JabRefPreferences;

import org.eclipse.jgit.api.errors.GitAPIException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class StartLiteratureReviewAction extends SimpleCommand {
private static final Logger LOGGER = LoggerFactory.getLogger(StartLiteratureReviewAction.class);
private final JabRefFrame frame;
private final DialogService dialogService;
private final FileUpdateMonitor fileUpdateMonitor;
private final Path workingDirectory;
private final TaskExecutor taskExecutor;

public StartLiteratureReviewAction(JabRefFrame frame, FileUpdateMonitor fileUpdateMonitor, Path standardWorkingDirectory, TaskExecutor taskExecutor) {
this.frame = frame;
this.dialogService = frame.getDialogService();
this.fileUpdateMonitor = fileUpdateMonitor;
this.workingDirectory = getInitialDirectory(standardWorkingDirectory);
this.taskExecutor = taskExecutor;
}

@Override
public void execute() {
FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder()
.withInitialDirectory(workingDirectory)
.build();

Optional<Path> studyDefinitionFile = dialogService.showFileOpenDialog(fileDialogConfiguration);
if (studyDefinitionFile.isEmpty()) {
// Do nothing if selection was canceled
return;
}
final Crawler crawler;
try {
crawler = new Crawler(studyDefinitionFile.get(), new GitHandler(studyDefinitionFile.get().getParent()), fileUpdateMonitor, JabRefPreferences.getInstance().getImportFormatPreferences(), JabRefPreferences.getInstance().getSavePreferences(), new BibEntryTypesManager());
} catch (IOException | ParseException | GitAPIException e) {
LOGGER.error("Error during reading of study definition file.", e);
dialogService.showErrorDialogAndWait(Localization.lang("Error during reading of study definition file."), e);
return;
}
BackgroundTask.wrap(() -> {
crawler.performCrawl();
return 0; // Return any value to make this a callable instead of a runnable. This allows throwing exceptions.
})
.onFailure(e -> {
LOGGER.error("Error during persistence of crawling results.");
dialogService.showErrorDialogAndWait(Localization.lang("Error during persistence of crawling results."), e);
})
.onSuccess(unused -> new OpenDatabaseAction(frame).openFile(Path.of(studyDefinitionFile.get().getParent().toString(), "studyResult.bib"), true))
.executeWith(taskExecutor);
}

/**
* @return Path of current panel database directory or the standard working directory
*/
private Path getInitialDirectory(Path standardWorkingDirectory) {
if (frame.getBasePanelCount() == 0) {
return standardWorkingDirectory;
} else {
Optional<Path> databasePath = frame.getCurrentLibraryTab().getBibDatabaseContext().getDatabasePath();
return databasePath.map(Path::getParent).orElse(standardWorkingDirectory);
}
}
}
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/actions/StandardActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public enum StandardActions implements Action {
PARSE_LATEX(Localization.lang("Search for citations in LaTeX files..."), IconTheme.JabRefIcons.LATEX_CITATIONS),
NEW_SUB_LIBRARY_FROM_AUX(Localization.lang("New sublibrary based on AUX file") + "...", Localization.lang("New BibTeX sublibrary") + Localization.lang("This feature generates a new library based on which entries are needed in an existing LaTeX document."), IconTheme.JabRefIcons.NEW),
WRITE_XMP(Localization.lang("Write XMP metadata to PDFs"), Localization.lang("Will write XMP metadata to the PDFs linked from selected entries."), KeyBinding.WRITE_XMP),
START_SYSTEMATIC_LITERATURE_REVIEW(Localization.lang("Start systematic literature review")),
OPEN_DATABASE_FOLDER(Localization.lang("Reveal in file explorer")),
OPEN_FOLDER(Localization.lang("Open folder"), Localization.lang("Open folder"), KeyBinding.OPEN_FOLDER),
OPEN_FILE(Localization.lang("Open file"), Localization.lang("Open file"), IconTheme.JabRefIcons.FILE, KeyBinding.OPEN_FILE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;
import java.util.Objects;

import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ListProperty;
Expand Down Expand Up @@ -55,9 +56,11 @@ public DocumentViewerViewModel(StateManager stateManager) {
}
});

maxPages.bindBidirectional(
// we need to wrap this in run later so that the max pages number is correctly shown
Platform.runLater(() -> {
maxPages.bindBidirectional(
EasyBind.wrapNullable(currentDocument).selectProperty(DocumentViewModel::maxPagesProperty));

});
setCurrentEntries(this.stateManager.getSelectedEntries());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Image render(int width, int height) {

@Override
public int getPageNumber() {
return pageNumber;
return pageNumber + 1;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public ObservableList<DocumentPageViewModel> getPages() {
List<PdfDocumentPageViewModel> pdfPages = new ArrayList<>();
// There is apparently no neat way to get the page number from a PDPage...thus this old-style for loop
for (int i = 0; i < pages.getCount(); i++) {
pdfPages.add(new PdfDocumentPageViewModel(pages.get(i), i + 1, document));
pdfPages.add(new PdfDocumentPageViewModel(pages.get(i), i, document));
}
return FXCollections.observableArrayList(pdfPages);
}
Expand Down
Loading

0 comments on commit 0d03690

Please sign in to comment.