diff --git a/owlplug-client/pom.xml b/owlplug-client/pom.xml
index 86f2a64e..72198a9b 100644
--- a/owlplug-client/pom.xml
+++ b/owlplug-client/pom.xml
@@ -57,11 +57,23 @@
org.springframework.boot
spring-boot-starter
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+
+
+
+
org.springframework
spring-web
-
+
org.springframework.boot
spring-boot-starter-data-jpa
@@ -72,6 +84,11 @@
spring-boot-starter-cache
+
+ org.springframework.boot
+ spring-boot-starter-jetty
+
+
org.springframework.boot
spring-boot-starter-test
diff --git a/owlplug-client/src/main/java/com/owlplug/OwlPlug.java b/owlplug-client/src/main/java/com/owlplug/OwlPlug.java
index 015cc891..47e93d4f 100644
--- a/owlplug-client/src/main/java/com/owlplug/OwlPlug.java
+++ b/owlplug-client/src/main/java/com/owlplug/OwlPlug.java
@@ -59,6 +59,7 @@ public class OwlPlug extends Application {
@Autowired
private Environment environment;
+ private Preferences preferences = Preferences.userRoot().node("com.owlplug.user");
private ConfigurableApplicationContext context;
private Parent rootNode;
@@ -73,6 +74,10 @@ public void init() throws Exception {
try {
SpringApplicationBuilder builder = new SpringApplicationBuilder(OwlPlug.class);
builder.headless(false);
+
+ if(preferences.getBoolean(ApplicationDefaults.DEVELOPER_MODE_ENABLED_KEY, false)) {
+ builder.profiles("dev-mode");
+ }
context = builder.run(getParameters().getRaw().toArray(new String[0]));
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/MainView.fxml"));
@@ -93,6 +98,10 @@ public void init() throws Exception {
throw e;
} catch (Exception e) {
log.error("OwlPlug could not be started", e);
+ if(preferences.getBoolean(ApplicationDefaults.DEVELOPER_MODE_ENABLED_KEY, false)) {
+ log.info("Disabling developer mode after unexpected error during startup");
+ preferences.putBoolean(ApplicationDefaults.DEVELOPER_MODE_ENABLED_KEY, false);
+ }
notifyPreloader(new PreloaderProgressMessage("error", "OwlPlug could not be started"));
throw e;
}
@@ -146,7 +155,7 @@ public DataSource datasource() throws PropertyVetoException {
*/
@Bean
public Preferences getPreference() {
- return Preferences.userRoot().node("com.owlplug.user");
+ return preferences;
}
diff --git a/owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java b/owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java
index 155f37d3..b4bd2731 100644
--- a/owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java
+++ b/owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java
@@ -82,6 +82,7 @@ public class ApplicationDefaults {
public static final String STORE_SUBDIRECTORY_ENABLED = "STORE_SUBDIRECTORY_ENABLED";
public static final String FIRST_LAUNCH_KEY = "FIRST_LAUNCH_KEY";
public static final String APPLICATION_STATE_KEY = "APPLICATION_STATE_KEY";
+ public static final String DEVELOPER_MODE_ENABLED_KEY = "DEVELOPER_MODE_ENABLED_KEY";
/**
* Creates a new ApplicationDefaults.
diff --git a/owlplug-client/src/main/java/com/owlplug/core/components/WebServerContext.java b/owlplug-client/src/main/java/com/owlplug/core/components/WebServerContext.java
new file mode 100644
index 00000000..adddcd8f
--- /dev/null
+++ b/owlplug-client/src/main/java/com/owlplug/core/components/WebServerContext.java
@@ -0,0 +1,53 @@
+package com.owlplug.core.components;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class WebServerContext {
+
+ private int port;
+ @Value("${server.host:@null}")
+ private String host;
+ @Value("${server.contextPath:/}")
+ private String contextPath;
+
+ private boolean serverStarted;
+
+ public int getPort() {
+ return port;
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ public String getContextPath() {
+ return contextPath;
+ }
+
+ public void setContextPath(String contextPath) {
+ this.contextPath = contextPath;
+ }
+
+ public boolean isServerStarted() {
+ return serverStarted;
+ }
+
+ public void setServerStarted(boolean serverStarted) {
+ this.serverStarted = serverStarted;
+ }
+
+ public String getUrl() {
+ return "http://" + this.host + ":" + this.port + this.contextPath;
+ }
+
+}
diff --git a/owlplug-client/src/main/java/com/owlplug/core/components/WebServerEventListener.java b/owlplug-client/src/main/java/com/owlplug/core/components/WebServerEventListener.java
new file mode 100644
index 00000000..07afc85a
--- /dev/null
+++ b/owlplug-client/src/main/java/com/owlplug/core/components/WebServerEventListener.java
@@ -0,0 +1,22 @@
+package com.owlplug.core.components;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.web.context.WebServerInitializedEvent;
+import org.springframework.context.ApplicationListener;
+import org.springframework.stereotype.Component;
+
+@Component
+public class WebServerEventListener implements ApplicationListener {
+
+ @Autowired
+ private WebServerContext webServerContext;
+
+ @Override
+ public void onApplicationEvent(WebServerInitializedEvent event) {
+ webServerContext.setPort(event.getWebServer().getPort());
+ webServerContext.setServerStarted(true);
+
+
+ }
+
+}
diff --git a/owlplug-client/src/main/java/com/owlplug/core/controllers/OptionsController.java b/owlplug-client/src/main/java/com/owlplug/core/controllers/OptionsController.java
index d3eae62b..6d16d045 100644
--- a/owlplug-client/src/main/java/com/owlplug/core/controllers/OptionsController.java
+++ b/owlplug-client/src/main/java/com/owlplug/core/controllers/OptionsController.java
@@ -26,6 +26,7 @@
import com.jfoenix.controls.JFXTextField;
import com.jfoenix.controls.JFXToggleButton;
import com.owlplug.core.components.ApplicationDefaults;
+import com.owlplug.core.components.WebServerContext;
import com.owlplug.core.services.NativeHostService;
import com.owlplug.core.services.OptionsService;
import com.owlplug.core.utils.PlatformUtils;
@@ -46,6 +47,8 @@ public class OptionsController extends BaseController {
private OptionsService optionsService;
@Autowired
private NativeHostService nativeHostService;
+ @Autowired
+ private WebServerContext webServerContext;
@FXML
private JFXToggleButton vst2ToggleButton;
@@ -88,6 +91,14 @@ public class OptionsController extends BaseController {
private Label storeDirectorySeperator;
@FXML
private Hyperlink owlplugWebsiteLink;
+
+ @FXML
+ private JFXCheckBox devModeCheckBox;
+ @FXML
+ private JFXTextField devModeTextField;
+ @FXML
+ private JFXButton devModeButton;
+
/**
* FXML initialize method.
@@ -211,6 +222,19 @@ public void initialize() {
owlplugWebsiteLink.setOnAction(e -> {
PlatformUtils.openDefaultBrowser(owlplugWebsiteLink.getText());
});
+
+
+ devModeCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> {
+ this.getPreferences().putBoolean(ApplicationDefaults.DEVELOPER_MODE_ENABLED_KEY, newValue);
+ devModeTextField.setVisible(newValue);
+ devModeButton.setVisible(newValue);
+ });
+
+ devModeButton.setOnAction(e -> {
+ if(webServerContext.isServerStarted()) {
+ PlatformUtils.openDefaultBrowser(webServerContext.getUrl());
+ }
+ });
refreshView();
}
@@ -237,6 +261,21 @@ public void refreshView() {
if(!storeByCreatorCheckBox.isSelected()){
storeByCreatorLabel.setVisible(false);
}
+
+ devModeCheckBox.setSelected(this.getPreferences().getBoolean(ApplicationDefaults.DEVELOPER_MODE_ENABLED_KEY, false));
+ if(devModeCheckBox.isSelected()) {
+ devModeTextField.setVisible(true);
+ devModeButton.setVisible(true);
+
+ } else {
+ devModeTextField.setVisible(false);
+ devModeButton.setVisible(false);
+ }
+
+ if(webServerContext.isServerStarted()) {
+ devModeTextField.setText(webServerContext.getUrl());
+ }
+
}
}
diff --git a/owlplug-client/src/main/java/com/owlplug/core/controllers/PluginsController.java b/owlplug-client/src/main/java/com/owlplug/core/controllers/PluginsController.java
index 7673fce3..83bc93e2 100644
--- a/owlplug-client/src/main/java/com/owlplug/core/controllers/PluginsController.java
+++ b/owlplug-client/src/main/java/com/owlplug/core/controllers/PluginsController.java
@@ -19,6 +19,18 @@
package com.owlplug.core.controllers;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.prefs.Preferences;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+
import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXTabPane;
import com.jfoenix.controls.JFXTextField;
@@ -26,7 +38,6 @@
import com.owlplug.core.components.ApplicationDefaults;
import com.owlplug.core.components.CoreTaskFactory;
import com.owlplug.core.controllers.dialogs.NewLinkController;
-import com.owlplug.core.dao.PluginDAO;
import com.owlplug.core.dao.SymlinkDAO;
import com.owlplug.core.model.IDirectory;
import com.owlplug.core.model.Plugin;
@@ -36,12 +47,7 @@
import com.owlplug.core.ui.CustomTreeCell;
import com.owlplug.core.ui.FilterableTreeItem;
import com.owlplug.core.utils.FileUtils;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.prefs.Preferences;
+
import javafx.beans.binding.Bindings;
import javafx.fxml.FXML;
import javafx.scene.control.TreeCell;
@@ -49,10 +55,6 @@
import javafx.scene.control.TreeView;
import javafx.scene.image.ImageView;
import javafx.util.Callback;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
@Controller
public class PluginsController extends BaseController {
@@ -62,8 +64,6 @@ public class PluginsController extends BaseController {
@Autowired
private PluginService pluginService;
@Autowired
- private PluginDAO pluginDAO;
- @Autowired
private SymlinkDAO symlinkDAO;
@Autowired
private NodeInfoController nodeInfoController;
@@ -159,7 +159,7 @@ public TreeCell