Skip to content

Commit f4b0aa2

Browse files
committed
added Dcom.openfin.demo.licenseKey
1 parent 5c88f58 commit f4b0aa2

File tree

3 files changed

+43
-4
lines changed

3 files changed

+43
-4
lines changed
421 Bytes
Binary file not shown.

release/run.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
java -cp lib/hamcrest-core-1.3.jar;lib/hamcrest-library-1.1.jar;lib/jetty-client-9.4.18.v20190429.jar;lib/jetty-http-9.4.18.v20190429.jar;lib/jetty-io-9.4.18.v20190429.jar;lib/jetty-util-9.4.18.v20190429.jar;lib/jetty-xml-9.4.18.v20190429.jar;lib/jna-4.5.1.jar;lib/jna-platform-4.5.1.jar;lib/json-20160810.jar;lib/junit-4.11.jar;lib/mockito-core-1.9.5.jar;lib/objenesis-1.0.jar;lib/openfin-desktop-java-adapter-8.0.11-SNAPSHOT.jar;lib/openfin-desktop-java-example-7.1.1-tests.jar;lib/openfin-desktop-java-example-7.1.1.jar;lib/openfin-snap-dock-1.0.0.1.jar;lib/slf4j-api-1.7.21.jar;lib/slf4j-jdk14-1.6.1.jar;lib/slf4j-log4j12-1.7.18.jar;lib/TableLayout-20050920.jar;lib/websocket-api-9.4.18.v20190429.jar;lib/websocket-client-9.4.18.v20190429.jar;lib/websocket-common-9.4.18.v20190429.jar -Djava.util.logging.config.file=logging.properties -Dcom.openfin.temp=%LocalAppData%\OpenFin\temp -Dcom.openfin.demo.version=stable com.openfin.desktop.demo.OpenFinDesktopDemo
1+
java -cp lib/hamcrest-core-1.3.jar;lib/hamcrest-library-1.1.jar;lib/jetty-client-9.4.18.v20190429.jar;lib/jetty-http-9.4.18.v20190429.jar;lib/jetty-io-9.4.18.v20190429.jar;lib/jetty-util-9.4.18.v20190429.jar;lib/jetty-xml-9.4.18.v20190429.jar;lib/jna-4.5.1.jar;lib/jna-platform-4.5.1.jar;lib/json-20160810.jar;lib/junit-4.11.jar;lib/mockito-core-1.9.5.jar;lib/objenesis-1.0.jar;lib/openfin-desktop-java-adapter-8.0.11-SNAPSHOT.jar;lib/openfin-desktop-java-example-7.1.1-tests.jar;lib/openfin-desktop-java-example-7.1.1.jar;lib/openfin-snap-dock-1.0.0.1.jar;lib/slf4j-api-1.7.21.jar;lib/slf4j-jdk14-1.6.1.jar;lib/slf4j-log4j12-1.7.18.jar;lib/TableLayout-20050920.jar;lib/websocket-api-9.4.18.v20190429.jar;lib/websocket-client-9.4.18.v20190429.jar;lib/websocket-common-9.4.18.v20190429.jar -Djava.util.logging.config.file=logging.properties -Dcom.openfin.temp=%LocalAppData%\OpenFin\temp -Dcom.openfin.demo.version=stable -Dcom.openfin.demo.licenseKey=123456 com.openfin.desktop.demo.OpenFinDesktopDemo
22

src/main/java/com/openfin/desktop/demo/OpenFinDesktopDemo.java

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import java.util.ArrayList;
2323
import java.util.HashMap;
2424

25+
import jdk.nashorn.internal.scripts.JO;
26+
import org.json.JSONArray;
2527
import org.json.JSONObject;
2628
import org.slf4j.Logger;
2729
import org.slf4j.LoggerFactory;
@@ -140,13 +142,50 @@ private void initDesktopConnection() throws DesktopException {
140142
}
141143
this.runtimeConfiguration.setAdditionalRuntimeArguments("--v=1 "); // enable additional logging
142144
this.runtimeConfiguration.setDevToolsPort(9090);
143-
this.runtimeConfiguration.setLicenseKey("my-license-key");
145+
146+
JSONObject startupApp = new JSONObject();
147+
startupApp.put("uuid", "DEMO-JAVA");
148+
startupApp.put("name", "DEMO-JAVA");
149+
startupApp.put("url", "https://cdn.openfin.co/process-manager/index.html");
150+
startupApp.put("autoShow", true);
151+
152+
String licenseKey = java.lang.System.getProperty("com.openfin.demo.licenseKey");
153+
if (licenseKey != null) {
154+
this.runtimeConfiguration.setLicenseKey(licenseKey);
155+
}
144156
JSONObject myconfig = new JSONObject();
145-
myconfig.put("key1", "value1");
146-
myconfig.put("PI", 3.14);
157+
// this.runtimeConfiguration.setManifestLocation("https://cdn.openfin.co/process-manager/app.json");
158+
// myconfig.put("key1", "value1");
159+
// myconfig.put("PI", 3.14);
147160
this.runtimeConfiguration.addConfigurationItem("myconfig", myconfig);
148161
}
149162

163+
private void addCustomConfig(JSONObject startupApp) {
164+
JSONObject defaultDomainSettings = new JSONObject();
165+
JSONArray rules = new JSONArray();
166+
JSONObject rule1 = new JSONObject();
167+
JSONArray matchList = new JSONArray();
168+
matchList.put("*/*.example.com");
169+
rule1.put("match", matchList);
170+
JSONObject options = new JSONObject();
171+
JSONObject downloadSettings = new JSONObject();
172+
JSONArray downloadSettingsRules = new JSONArray();
173+
JSONObject downloadSettingsRule1 = new JSONObject();
174+
JSONArray matchList1 = new JSONArray();
175+
matchList1.put("*://*/*.png");
176+
matchList1.put("*://*/*.jpg");
177+
downloadSettingsRule1.put("match", matchList1);
178+
downloadSettingsRule1.put("behavior", "no-prompt");
179+
downloadSettingsRules.put(downloadSettingsRule1);
180+
downloadSettings.put("rules", downloadSettingsRules);
181+
options.put("downloadSettings", downloadSettings);
182+
rule1.put("options", options);
183+
rules.put(rule1);
184+
defaultDomainSettings.put("rules", rules);
185+
startupApp.put("defaultDomainSettings", defaultDomainSettings);
186+
this.runtimeConfiguration.setStartupApp(startupApp);
187+
}
188+
150189
private JPanel layoutLeftPanel() {
151190
JPanel panel = new JPanel();
152191
double size[][] = {{TableLayout.FILL}, {160, 30, TableLayout.FILL}};

0 commit comments

Comments
 (0)