Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into changemergesdialog
Browse files Browse the repository at this point in the history
* upstream/master: (21 commits)
  New Crowdin translations (#5729)
  Update license of Oracle JDBC
  Changes string representation when detecting custom entry types. (#5741)
  Try to fix GitVersion
  Also run workflow on tag creation
  Add README.md with an initial help to work on command line para… (#5720)
  Bugfix for Multiscreen (#5738)
  Fix #2868 - keep source groups selected after drag and drop
  retrigger build
  Squashed 'src/main/resources/csl-styles/' changes from f71cd32..49a1841
  try to fix pull of csl styles
  try to fix csl update
  Fixed untranslated Strings issue #5701
  Fix #5603 - account for file extension in file name length (#5726)
  New translations JabRef_en.properties (French)
  Bump unirest-java from 3.2.00 to 3.3.00
  Bump postgresql from 42.2.8 to 42.2.9
  Bump tika-core from 1.22 to 1.23
  Fix upload to GitHub artifacts (#5712)
  Try to fix csl update (#5718)
  ...
  • Loading branch information
Siedlerchr committed Dec 14, 2019
2 parents 743554a + 2e056e6 commit 21b4de3
Show file tree
Hide file tree
Showing 68 changed files with 4,850 additions and 399 deletions.
5 changes: 5 additions & 0 deletions .github/failure-csl-update
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Error while updating citation styles
labels: code-quality, dependencies
---
[Update of citation styles failed!](https://github.com/JabRef/jabref/actions?query=workflow%3A%22Refresh+Citation+Style+Language+Files%22)
12 changes: 6 additions & 6 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Deployment

on: [push]
on: [create, push]

jobs:
deploy:
Expand Down Expand Up @@ -94,11 +94,6 @@ jobs:
export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}"
./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage
shell: bash
- name: Add installer as artifact
uses: actions/upload-artifact@master
with:
name: JabRef-${{ matrix.displayName }}
path: build/distribution
- name: Package application image
run: ${{ matrix.archivePortable }}
shell: bash
Expand All @@ -115,6 +110,11 @@ jobs:
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"}
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"}
shell: pwsh
- name: Upload to GitHub workflow artifacts store
uses: actions/upload-artifact@master
with:
name: JabRef-${{ matrix.displayName }}
path: build/distribution
- name: Upload to builds.jabref.org
uses: garygrossgarten/github-action-scp@release
with:
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/refresh-csl-subtrees.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v1
uses: actions/checkout@v2-beta
with:
ref: master
- name: Add csl-styles remote
run: git remote add -f csl-styles https://github.com/citation-style-language/styles.git
- name: Update csl-styles
run: git subtree pull --prefix src/main/resources/csl-styles csl-styles master --squash
run: |
git checkout master
git subtree pull --prefix src/main/resources/csl-styles csl-styles master --squash
- name: Add csl-locales remote
run: git remote add -f csl-locales https://github.com/citation-style-language/locales.git
- name: Update csl-locales
run: git subtree pull --prefix src/main/resources/csl-locales csl-locales master --squash
run: |
git checkout master
git subtree pull --prefix src/main/resources/csl-locales csl-locales master --squash
- uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Report issues
if: failure()
uses: JasonEtco/create-an-issue@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/failure-csl-update.md
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- The "Automatically set file links" feature now follows symbolic links. [#5664](https://github.com/JabRef/jabref/issues/5664)
- After successful import of one or multiple bib entries the main table scrolls to the first imported entry [#5383](https://github.com/JabRef/jabref/issues/5383)
- We fixed an exception which occurred when an invalid jstyle was loaded. [#5452](https://github.com/JabRef/jabref/issues/5452)
- We fixed an issue where the command line arguments `importBibtex` and `importToOpen` did not import into the currently open library, but opened a new one. [#5537](https://github.com/JabRef/jabref/issues/5537)
- We fixed an error where the preview theme did not adapt to the "Dark" mode [#5463](https://github.com/JabRef/jabref/issues/5463)
- We fixed an issue where the merge dialog showed the wrong text colour in "Dark" mode [#5516](https://github.com/JabRef/jabref/issues/5516)
- We fixed visibility issues with the scrollbar and group selection highlight in "Dark" mode, and enabled "Dark" mode for the OpenOffice preview in the style selection window. [#5522](https://github.com/JabRef/jabref/issues/5522)
Expand All @@ -70,6 +71,10 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where the side pane was not remembering its position. [#5615](https://github.com/JabRef/jabref/issues/5615)
- We fixed an issue where JabRef could not interact with [Oracle XE](https://www.oracle.com/de/database/technologies/appdev/xe.html) in the [shared SQL database setup](https://docs.jabref.org/collaborative-work/sqldatabase).
- We fixed an issue where the toolbar icons were hidden on smaller screens.
- We fixed an issue where renaming referenced files for bib entries with long titles was not possible. [#5603](https://github.com/JabRef/jabref/issues/5603)
- We fixed an issue where a window which is on an external screen gets unreachable when external screen is removed. [#5037](https://github.com/JabRef/jabref/issues/5037)
- We fixed a bug where the selection of groups was lost after drag and drop. [#2868](https://github.com/JabRef/jabref/issues/2868)
- We fixed an issue where the custom entry types didn't show the correct display name [#5651](https://github.com/JabRef/jabref/issues/5651)

### Removed

Expand Down
10 changes: 9 additions & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
assembly-versioning-format: '{major}.{minor}.{buildmetadata}'
assembly-versioning-format: '{major}.{minor}.{WeightedPreReleaseNumber}'
assembly-informational-format: '{major}.{minor}{PreReleaseTagWithDash}--{CommitDate}--{ShortSha}'

branches:
master:
regex: ^master
mode: ContinuousDelivery
tag: beta
increment: Minor
pre-release-weight: 30000 # 0 after stable release, 15000 before alpha release, 30000 before beta release, 50000 before stable release
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ JabRef supports you in every step of your research work.
- Attach related documents: 20 different kinds of documents supported out of the box, completely customizable and extendable
- Automatically rename and move associated documents according to customizable rules
- Keep track of what you read: ranking, priority, printed, quality-assured

#### Cite

- Native [BibTeX] and [Biblatex] support
- Cite-as-you-write functionality for external applications such as Emacs, Kile, LyX, Texmaker, TeXstudio, Vim and WinEdt.
- Format references in one of the many thousand built-in citation styles or create your style
- Support for Word and LibreOffice/OpenOffice for inserting and formatting citations

#### Share

- Many built-in export options or create your export format
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ dependencies {

compile group: 'org.apache.commons', name: 'commons-csv', version: '1.7'

compile group: 'org.apache.tika', name: 'tika-core', version: '1.22'
compile group: 'org.apache.tika', name: 'tika-core', version: '1.23'

// required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635
compile 'org.bouncycastle:bcprov-jdk15on:1.64'
Expand All @@ -142,7 +142,7 @@ dependencies {

compile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.5.2'

compile 'org.postgresql:postgresql:42.2.8'
compile 'org.postgresql:postgresql:42.2.9'

compile ('com.oracle.ojdbc:ojdbc10:19.3.0.0') {
// causing module issues
Expand All @@ -169,7 +169,7 @@ dependencies {
compile 'org.controlsfx:controlsfx:11.0.1'

compile 'org.jsoup:jsoup:1.12.1'
compile 'com.konghq:unirest-java:3.2.00'
compile 'com.konghq:unirest-java:3.3.00'

compile 'org.slf4j:slf4j-api:2.0.0-alpha1'
compile group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '3.0.0-SNAPSHOT'
Expand Down
41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Develop JabRef

This page presents all development informatation around JabRef. For users documentation see <https://docs.jabref.org>.

## Command Line

The package `org.jabref.cli` is responsible for handling the command line options.

During development, one can configure IntelliJ to pass command line paramters:

![IntelliJ-run-configuration](images/intellij-run-configuration-command-line.png)

Passing command line arguments using gradle is currently not possible as all arguments (such as `-Dfile.encoding=windows-1252`) are passed to the application.

Without jlink, it is not possible to generate a fat jar any more. During development, the capabilities of the IDE has to be used.

## Groups

UML diagram showing aspects of groups: [Groups.uml](Gropus.uml).

## Decision Records

This log lists the decisions for JabRef.

<!-- adrlog -->

- [ADR-0000](0000-use-markdown-architectural-decision-records.md) - Use Markdown Architectural Decision Records
- [ADR-0001](0001-use-crowdin-for-translations.md) - Use Crowdin for translations
- [ADR-0002](0002-use-slf4j-for-logging.md) - Use slf4j together with log4j2 for logging
- [ADR-0003](0003-use-gradle-as-build-tool.md) - Use Gradle as build tool
- [ADR-0003](0003-use-openjson-as-replacement-for-org-json.md) - Use openjson as replacement for org.json
- [ADR-0004](0004-use-mariadb-connector.md) - Use MariaDB Connector
- [ADR-0005](0005-fully-support-utf8-only-for-latex-files.md) - Fully Support UTF-8 Only For LaTeX Files
- [ADR-0006](0006-only-translated-strings-in-language-file.md) - Only translated strings in language file
- [ADR-0007](0007-human-readable-changelog.md) - Provide a human-readable changelog

<!-- adrlogstop -->

For new ADRs, please use [docs/template.md](docs/template.md) as basis.
More information on MADR is available at <https://adr.github.io/madr/>.
General information about architectural decision records is available at <https://adr.github.io/>.
21 changes: 0 additions & 21 deletions docs/adr/README.md

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions external-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ License: MIT

Id: com.oracle.ojdbc:ojdbc10
Project: Oracle's JDBC drivers
URL: https://medium.com/oracledevs/oracle-jdbc-drivers-on-maven-central-64fcf724d8b
License: Proprietary
URL: https://repo1.maven.org/maven2/com/oracle/ojdbc/ojdbc10/19.3.0.0/ojdbc10-19.3.0.0.pom
License: Oracle Free Use Terms and Conditions (FUTC)

Id: com.sibvisions.external.jvxfx:DnDTabPane
Project: Drag'n'Drop TabPane
Expand Down
112 changes: 78 additions & 34 deletions src/main/java/org/jabref/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import java.io.File;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.stage.Screen;
import javafx.stage.Stage;

import org.jabref.gui.BasePanel;
Expand Down Expand Up @@ -40,12 +41,14 @@ public class JabRefGUI {

private final List<ParserResult> bibDatabases;
private final boolean isBlank;
private boolean correctedWindowPos;
private final List<ParserResult> failed = new ArrayList<>();
private final List<ParserResult> toOpenTab = new ArrayList<>();

public JabRefGUI(Stage mainStage, List<ParserResult> databases, boolean isBlank) {
this.bibDatabases = databases;
this.isBlank = isBlank;
this.correctedWindowPos = false;
mainFrame = new JabRefFrame(mainStage);

openWindow(mainStage);
Expand All @@ -62,12 +65,21 @@ private void openWindow(Stage mainStage) {
// Restore window location and/or maximised state
if (Globals.prefs.getBoolean(JabRefPreferences.WINDOW_MAXIMISED)) {
mainStage.setMaximized(true);
} else if (Screen.getScreens().size() == 1 && isWindowPositionOutOfBounds()) {
//corrects the Window, if its outside of the mainscreen
LOGGER.debug("The Jabref Window is outside the Main Monitor\n");
mainStage.setX(0);
mainStage.setY(0);
mainStage.setWidth(1024);
mainStage.setHeight(768);
correctedWindowPos = true;
} else {
mainStage.setX(Globals.prefs.getDouble(JabRefPreferences.POS_X));
mainStage.setY(Globals.prefs.getDouble(JabRefPreferences.POS_Y));
mainStage.setWidth(Globals.prefs.getDouble(JabRefPreferences.SIZE_X));
mainStage.setHeight(Globals.prefs.getDouble(JabRefPreferences.SIZE_Y));
}
printWindowState(mainStage);

// We create a decoration pane ourselves for performance reasons
// (otherwise it has to be injected later, leading to a complete redraw/relayout of the complete scene)
Expand All @@ -82,7 +94,11 @@ private void openWindow(Stage mainStage) {
mainStage.show();

mainStage.setOnCloseRequest(event -> {
saveWindowState(mainStage);
if (!correctedWindowPos) {
//saves the window position only if its not corrected -> the window will rest at the old Position,
//if the external Screen is connected again.
saveWindowState(mainStage);
}
boolean reallyQuit = mainFrame.quit();
if (!reallyQuit) {
event.consume();
Expand All @@ -97,6 +113,13 @@ private void openDatabases() {
openLastEditedDatabases();
}

// Remove invalid databases
List<ParserResult> invalidDatabases = bibDatabases.stream()
.filter(ParserResult::isInvalid)
.collect(Collectors.toList());
failed.addAll(invalidDatabases);
bibDatabases.removeAll(invalidDatabases);

// passed file (we take the first one) should be focused
String focusedFile = bibDatabases.stream()
.findFirst()
Expand All @@ -106,40 +129,34 @@ private void openDatabases() {

// Add all bibDatabases databases to the frame:
boolean first = false;
if (!bibDatabases.isEmpty()) {
for (Iterator<ParserResult> parserResultIterator = bibDatabases.iterator(); parserResultIterator.hasNext();) {
ParserResult pr = parserResultIterator.next();
// Define focused tab
if (pr.getFile().filter(path -> path.getAbsolutePath().equals(focusedFile)).isPresent()) {
first = true;
}
for (ParserResult pr : bibDatabases) {
// Define focused tab
if (pr.getFile().filter(path -> path.getAbsolutePath().equals(focusedFile)).isPresent()) {
first = true;
}

if (pr.isInvalid()) {
failed.add(pr);
parserResultIterator.remove();
} else if (pr.getDatabase().isShared()) {
try {
new SharedDatabaseUIManager(mainFrame).openSharedDatabaseFromParserResult(pr);
} catch (SQLException | DatabaseNotSupportedException | InvalidDBMSConnectionPropertiesException |
NotASharedDatabaseException e) {
pr.getDatabaseContext().clearDatabaseFile(); // do not open the original file
pr.getDatabase().clearSharedDatabaseID();

LOGGER.error("Connection error", e);
mainFrame.getDialogService().showErrorDialogAndWait(
Localization.lang("Connection error"),
Localization.lang("A local copy will be opened."),
e);
}
toOpenTab.add(pr);
} else if (pr.toOpenTab()) {
// things to be appended to an opened tab should be done after opening all tabs
// add them to the list
toOpenTab.add(pr);
} else {
mainFrame.addParserResult(pr, first);
first = false;
if (pr.getDatabase().isShared()) {
try {
new SharedDatabaseUIManager(mainFrame).openSharedDatabaseFromParserResult(pr);
} catch (SQLException | DatabaseNotSupportedException | InvalidDBMSConnectionPropertiesException |
NotASharedDatabaseException e) {
pr.getDatabaseContext().clearDatabaseFile(); // do not open the original file
pr.getDatabase().clearSharedDatabaseID();

LOGGER.error("Connection error", e);
mainFrame.getDialogService().showErrorDialogAndWait(
Localization.lang("Connection error"),
Localization.lang("A local copy will be opened."),
e);
}
toOpenTab.add(pr);
} else if (pr.toOpenTab()) {
// things to be appended to an opened tab should be done after opening all tabs
// add them to the list
toOpenTab.add(pr);
} else {
mainFrame.addParserResult(pr, first);
first = false;
}
}

Expand Down Expand Up @@ -187,6 +204,33 @@ private void saveWindowState(Stage mainStage) {
Globals.prefs.putDouble(JabRefPreferences.POS_Y, mainStage.getY());
Globals.prefs.putDouble(JabRefPreferences.SIZE_X, mainStage.getWidth());
Globals.prefs.putDouble(JabRefPreferences.SIZE_Y, mainStage.getHeight());
printWindowState(mainStage);
}

/**
* outprints the Data from the Screen
* (only in debug mode)
* @param mainStage
*/
private void printWindowState(Stage mainStage) {
StringBuilder bob = new StringBuilder();
bob.append("SCREEN DATA:");
bob.append("mainStage.WINDOW_MAXIMISED: " + mainStage.isMaximized() + "\n");
bob.append("mainStage.POS_X: " + mainStage.getX() + "\n");
bob.append("mainStage.POS_Y: " + mainStage.getY() + "\n");
bob.append("mainStage.SIZE_X: " + mainStage.getWidth() + "\n");
bob.append("mainStages.SIZE_Y: " + mainStage.getHeight() + "\n");
LOGGER.debug(bob.toString());
}

/**
* Tests if the window coordinates are out of the mainscreen
* @return outbounds
*/
private boolean isWindowPositionOutOfBounds() {

return !Screen.getPrimary().getBounds().contains(Globals.prefs.getDouble(JabRefPreferences.POS_X) , Globals.prefs.getDouble(JabRefPreferences.POS_Y));

}

private void openLastEditedDatabases() {
Expand Down
Loading

0 comments on commit 21b4de3

Please sign in to comment.