-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into refactor-prefs-calls
* 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
Showing
106 changed files
with
7,805 additions
and
704 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
src/main/java/org/jabref/gui/StartLiteratureReviewAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.