]> git.argeo.org Git - lgpl/argeo-commons.git/blob - jjs/cms.js
Prepare next development cycle
[lgpl/argeo-commons.git] / jjs / cms.js
1 var System = Java.type("java.lang.System")
2 var OsgiBuilder = Java.type("org.argeo.osgi.boot.OsgiBuilder");
3
4 var osgi = new OsgiBuilder();
5 // default bundles
6 osgi.start(2, "org.eclipse.equinox.http.servlet");
7 osgi.start(2, "org.eclipse.equinox.http.jetty");
8 osgi.start(2, "org.eclipse.equinox.metatype");
9 osgi.start(2, "org.eclipse.equinox.cm");
10 osgi.start(2, "org.eclipse.rap.rwt.osgi");
11 osgi.start(3, "org.argeo.cms");
12 osgi.start(4, "org.eclipse.gemini.blueprint.extender");
13 osgi.start(4, "org.eclipse.equinox.http.registry");
14 // specific properties
15 osgi.conf("org.eclipse.rap.workbenchAutostart", "false");
16 osgi.conf("org.eclipse.equinox.http.jetty.autostart", "false");
17 osgi.conf("org.osgi.framework.bootdelegation", "com.sun.jndi.ldap,"
18 + "com.sun.jndi.ldap.sasl," + "com.sun.security.jgss,"
19 + "com.sun.jndi.dns," + "com.sun.nio.file," + "com.sun.nio.sctp");
20
21 if (typeof app !== 'undefined') {
22 if (typeof appHome == 'undefined') {
23 var appHome = $ENV.HOME + "/.a2/var/lib/" + app;
24 }
25 if (typeof appConf == 'undefined') {
26 var appConf = $ENV.HOME + "/.a2/etc/" + app;
27 }
28 if (typeof policyFile == 'undefined') {
29 var policyFile = "node.policy";
30 }
31 osgi.conf("osgi.configuration.area", appHome + "/state");
32 osgi.conf("osgi.instance.area", appHome + "/data");
33 System.setProperty("java.security.manager", "");
34 System.setProperty("java.security.policy", "file://" + appConf + "/"
35 + policyFile);
36 System.setProperty("log4j.configuration", "file://" + appConf
37 + "/log4j.properties");
38 }
39
40 function openWorkbench() {
41 osgi.spring("org.argeo.cms.ui.workbench.rap");
42 var appUrl = "http://localhost:" + osgi.httpPort + "/ui/node";
43 $EXEC("/usr/bin/chromium-browser --app=" + appUrl);
44 // shutdown when the window is closed
45 osgi.shutdown();
46 }