forked from JabRef/jabref
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sharelatex Integration #445
Draft
koppor
wants to merge
67
commits into
main
Choose a base branch
from
sharelatex
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
1b545e4
Sharelatex Integration
Siedlerchr db29578
For debug purposes, add system out println
Siedlerchr 446d914
Merge branch 'master' into sharelatex
koppor 867679d
Merge remote-tracking branch 'origin/master' into sharelatex
koppor 418aaad
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr 74ce5b9
Added classes for prefs
Siedlerchr 0222168
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr 6e64369
set buttn txt to logging in
Siedlerchr 0af05f0
Improve setting of enabled/diabled actions
Siedlerchr 67f08a9
Fix checkstyle
Siedlerchr 48dc385
Merge remote-tracking branch 'origin/master' into sharelatex
koppor c360278
Improve preferences handling
Siedlerchr e45e206
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr a9d1632
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr fac2c3d
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr 74151de
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr c91fe49
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr 06685dd
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr 23bf919
fix build
Siedlerchr dfe262d
commit
Siedlerchr ada867a
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr a8855fa
Add method for getting entry from position
lenhard 093140a
Merge branch 'sharelatex' of github.com:JabRef/jabref into sharelatex
Siedlerchr 855cd54
get position from json update message
Siedlerchr 49b2c41
only parse if > 0
Siedlerchr 65f7bb2
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr b6d2984
Refactor ShareLatexPreferences
lenhard 4920b9f
Merge branch 'sharelatex' of github.com:JabRef/jabref into sharelatex
lenhard 10f1bad
improve parsing
Siedlerchr 3eadbfb
Merge branch 'sharelatex' of github.com:JabRef/jabref into sharelatex
Siedlerchr 0ae5f11
unncessary import
Siedlerchr 172a03e
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr 61177b2
Implement first version of entries merging
Siedlerchr 99aaa1f
fix checkstyle
Siedlerchr 954f3ab
Merge remote-tracking branch 'origin/master' into sharelatex
koppor 4223da5
add missing dependencies
Siedlerchr 61a97a0
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr 23a49da
add missing diff match patch
Siedlerchr d473102
remove controller
Siedlerchr 961a97d
fix action
Siedlerchr 9e5e176
fix some more stuff
Siedlerchr cd82f04
fix compile errors
Siedlerchr 8f214f1
Merge remote-tracking branch 'origin/master' into sharelatex
koppor 017f40e
Merge remote-tracking branch 'origin/master' into sharelatex
koppor 6a4d206
Merge remote-tracking branch 'origin/master' into sharelatex
koppor 5d1fd79
Update code
koppor aa9f58d
Merge remote-tracking branch 'origin/master' into sharelatex
koppor ecb2690
Compilefix and working to show the dialog
koppor e320d9b
Refactor FXML and other gui elements to current architecture
Siedlerchr 45d7fd1
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr 807efee
add logger
Siedlerchr c72c6cc
add missing tyrus grizzly container
Siedlerchr d08943d
fix import in test and checkstyle
Siedlerchr ba10c02
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr be8b374
Merge remote-tracking branch 'upstream/master' into sharelatex
Siedlerchr 850044e
fix build error
Siedlerchr 46fa009
add menu item for sending wholecontent
Siedlerchr a1e5b9e
try with cookies
Siedlerchr 43a802d
Fix minor issues
k3KAW8Pnf7mkmdSMPHz27 16bb727
Merge remote-tracking branch 'origin/main' into sharelatex
koppor 93c3752
Fix class name (and checkstyle)
koppor 677a9ee
Merge remote-tracking branch 'origin/sharelatex' into sharelatex
koppor 76ecebc
Add some notes on overleaf testing
koppor f654e2d
Merge remote-tracking branch 'origin/main' into sharelatex
koppor a8c32d5
Merge remote-tracking branch 'origin/main' into sharelatex
koppor 6e4cf32
Fix checkstyle - and switch from ACL to slf4j
koppor d1cea1c
Compile fix
koppor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,20 @@ | ||
# Notes on the overleaf implementation | ||
|
||
Local setup of overleaf: | ||
|
||
1. Download <https://github.com/overleaf/overleaf/blob/master/docker-compose.yml>. | ||
2. Adapt `volumes` (<https://github.com/overleaf/overleaf/blob/245fc120e6d50e8ee02d5900b8d6a8d6d8b9135c/docker-compose.yml#L20>). | ||
3. Execute `docker compose up`. | ||
4. Open <http://localhost/launchpad> to create the administrator user. | ||
5. Create the test user <jabref@example.org>. | ||
6. Copy the displayed password reset URL | ||
7. Open your browser in a private session. | ||
8. Go to the URL copied in step 6 and set the password `jabref`. | ||
9. Create a latex project with the example. | ||
|
||
After a successful setup, one can use <http://localhost> as "Server Address". | ||
|
||
After a session execute `docker compose down` | ||
|
||
More information on Overleaf is available at <https://github.com/overleaf/overleaf/wiki/Quick-Start-Guide>. | ||
|
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
21 changes: 21 additions & 0 deletions
21
src/main/java/org/jabref/gui/actions/DisconnectFromSharelatexAction.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,21 @@ | ||
package org.jabref.gui.actions; | ||
|
||
import java.awt.event.ActionEvent; | ||
|
||
import javax.swing.AbstractAction; | ||
import javax.swing.Action; | ||
|
||
import org.jabref.gui.Globals; | ||
|
||
public class DisconnectFromSharelatexAction extends AbstractAction { | ||
|
||
public DisconnectFromSharelatexAction() { | ||
super(); | ||
putValue(Action.NAME, "Disconnect from ShareLaTeX"); | ||
} | ||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) { | ||
Globals.shareLatexManager.disconnectAndCloseConnection(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/org/jabref/gui/actions/SendChangesToShareLatexAction.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,15 @@ | ||
package org.jabref.gui.actions; | ||
|
||
import org.jabref.gui.Globals; | ||
import org.jabref.gui.StateManager; | ||
import org.jabref.logic.sharelatex.ShareLatexManager; | ||
|
||
public class SendChangesToShareLatexAction extends SimpleCommand { | ||
|
||
@Override | ||
public void execute() { | ||
ShareLatexManager manager = Globals.shareLatexManager; | ||
StateManager stateManager = Globals.stateManager; | ||
manager.sendNewDatabaseContent(stateManager.getActiveDatabase().get()); | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
src/main/java/org/jabref/gui/actions/SynchronizeWithShareLatexAction.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,11 @@ | ||
package org.jabref.gui.actions; | ||
|
||
import org.jabref.gui.sharelatex.ShareLatexLoginDialogView; | ||
|
||
public class SynchronizeWithShareLatexAction extends SimpleCommand { | ||
|
||
@Override | ||
public void execute() { | ||
new ShareLatexLoginDialogView().showAndWait(); | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
src/main/java/org/jabref/gui/sharelatex/ShareLatexLoginDialog.fxml
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,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.ButtonBar?> | ||
<?import javafx.scene.control.ButtonType?> | ||
<?import javafx.scene.control.DialogPane?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.PasswordField?> | ||
<?import javafx.scene.control.TextField?> | ||
<?import javafx.scene.layout.BorderPane?> | ||
<?import javafx.scene.layout.ColumnConstraints?> | ||
<?import javafx.scene.layout.GridPane?> | ||
<?import javafx.scene.layout.RowConstraints?> | ||
|
||
<DialogPane prefHeight="220.0" prefWidth="362.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.sharelatex.ShareLatexLoginDialogView"> | ||
<content> | ||
<BorderPane prefHeight="200.0" prefWidth="402.0"> | ||
<center> | ||
<GridPane alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="140.0" prefWidth="270.0"> | ||
<columnConstraints> | ||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="10.0" prefWidth="100.0" /> | ||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="100.0" /> | ||
</columnConstraints> | ||
<rowConstraints> | ||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | ||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | ||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | ||
</rowConstraints> | ||
<children> | ||
<Label text="Server Address" /> | ||
<TextField id="tbAddress" fx:id="tbAddress" prefHeight="25.0" prefWidth="174.0" text="https://www.overleaf.com" GridPane.columnIndex="1" /> | ||
<TextField id="tbUsername" fx:id="tbUsername" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | ||
<Label alignment="CENTER_RIGHT" text="%Username" GridPane.rowIndex="1" /> | ||
<Label text="%Password" GridPane.rowIndex="2" /> | ||
<PasswordField id="tbPassword" fx:id="tbPassword" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | ||
</children> | ||
</GridPane> | ||
</center> | ||
</BorderPane> | ||
</content> | ||
<buttonTypes> | ||
<ButtonType fx:constant="CLOSE"/> | ||
<ButtonType fx:id="connectButton" buttonData="OK_DONE" text="%Connect"/> | ||
</buttonTypes> | ||
</DialogPane> |
81 changes: 81 additions & 0 deletions
81
src/main/java/org/jabref/gui/sharelatex/ShareLatexLoginDialogView.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,81 @@ | ||
package org.jabref.gui.sharelatex; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.control.Alert.AlertType; | ||
import javafx.scene.control.Button; | ||
import javafx.scene.control.ButtonType; | ||
import javafx.scene.control.PasswordField; | ||
import javafx.scene.control.TextField; | ||
|
||
import org.jabref.gui.DialogService; | ||
import org.jabref.gui.FXDialog; | ||
import org.jabref.gui.Globals; | ||
import org.jabref.gui.util.BaseDialog; | ||
import org.jabref.gui.util.ControlHelper; | ||
import org.jabref.logic.l10n.Localization; | ||
import org.jabref.logic.sharelatex.ShareLatexManager; | ||
import org.jabref.logic.sharelatex.SharelatexConnectionProperties; | ||
|
||
import com.airhacks.afterburner.views.ViewLoader; | ||
import jakarta.inject.Inject; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class ShareLatexLoginDialogView extends BaseDialog<Void> { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(ShareLatexLoginDialogView.class); | ||
|
||
@FXML private TextField tbAddress; | ||
@FXML private TextField tbUsername; | ||
@FXML private PasswordField tbPassword; | ||
@FXML private ButtonType connectButton; | ||
|
||
private final Button btnLogin; | ||
@Inject private ShareLatexManager manager; | ||
@Inject private DialogService dialogService; | ||
|
||
private SharelatexConnectionProperties props; | ||
|
||
public ShareLatexLoginDialogView() { | ||
ViewLoader.view(this) | ||
.load() | ||
.setAsDialogPane(this); | ||
|
||
ControlHelper.setAction(connectButton, this.getDialogPane(), event -> signIn()); | ||
btnLogin = (Button) this.getDialogPane().lookupButton(connectButton); | ||
} | ||
|
||
@FXML | ||
private void initialize() { | ||
} | ||
|
||
@FXML | ||
private void signIn() { | ||
btnLogin.setText(Localization.lang("Logging in...")); | ||
try { | ||
String result = manager.login(tbAddress.getText(), tbUsername.getText(), tbPassword.getText()); | ||
if (result.contains("incorrect")) { | ||
FXDialog dlg = new FXDialog(AlertType.ERROR); | ||
dlg.setContentText("Your email or password is incorrect. Please try again"); | ||
dlg.showAndWait(); | ||
} else { | ||
// TODO: Replace with PreferencesService later | ||
|
||
props = new SharelatexConnectionProperties(Globals.prefs.getShareLatexPreferences()); | ||
|
||
props.setUrl(tbAddress.getText()); | ||
props.setUser(tbUsername.getText()); | ||
props.setPassword(tbPassword.getText()); | ||
|
||
manager.setConnectionProperties(props); | ||
|
||
ShareLatexProjectDialogView dlgprojects = new ShareLatexProjectDialogView(); | ||
dlgprojects.show(); | ||
this.close(); | ||
} | ||
} catch (Exception e) { | ||
LOGGER.error("Problems connectiong", e); | ||
dialogService.showErrorDialogAndWait(e); | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/org/jabref/gui/sharelatex/ShareLatexProjectDialog.fxml
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,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.ButtonType?> | ||
<?import javafx.scene.control.ButtonBar?> | ||
<?import javafx.scene.control.DialogPane?> | ||
<?import javafx.scene.control.TableColumn?> | ||
<?import javafx.scene.control.TableView?> | ||
<?import javafx.scene.layout.BorderPane?> | ||
|
||
<DialogPane prefHeight="494.0" prefWidth="397.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.sharelatex.ShareLatexProjectDialogView"> | ||
<content> | ||
<BorderPane> | ||
<top> | ||
<TableView fx:id="tblProjects" BorderPane.alignment="CENTER"> | ||
<columns> | ||
<TableColumn fx:id="colActive" prefWidth="75.0" text="Active" /> | ||
<TableColumn fx:id="colTitle" prefWidth="75.0" text="Title" /> | ||
<TableColumn fx:id="colFirstName" prefWidth="75.0" text="First Name" /> | ||
<TableColumn fx:id="colLastName" prefWidth="75.0" text="Last Name" /> | ||
<TableColumn fx:id="colLastModified" prefWidth="75.0" text="Last modified" /> | ||
</columns> | ||
</TableView> | ||
</top> | ||
</BorderPane> | ||
</content> | ||
<buttonTypes> | ||
<ButtonType fx:constant="CLOSE"/> | ||
<ButtonType fx:id="syncButton" buttonData="OK_DONE" text="%Synchronize Library"/> | ||
</buttonTypes> | ||
</DialogPane> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to put this in the ctor:
ViewLoader.view(this)
.load()
.setAsDialogPane(this);