From 32ab2ae391458ee3782b0acfdaabdf11cb2094ed Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Wed, 28 Jan 2015 11:28:01 +0000 Subject: [PATCH] Starts workbench thanks to a fragment git-svn-id: https://svn.argeo.org/commons/trunk@7716 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- demo/argeo_node_rap.properties | 4 +- .../org/argeo/cms/internal/kernel/Kernel.java | 37 ++++++++----------- org.argeo.eclipse.ui.workbench.rap/.project | 20 ++++++++++ .../META-INF/spring/osgi.xml | 19 ++++++++++ org.argeo.eclipse.ui.workbench.rap/bnd.bnd | 4 ++ org.argeo.eclipse.ui.workbench.rap/pom.xml | 11 ++++++ pom.xml | 1 + 7 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 org.argeo.eclipse.ui.workbench.rap/.project create mode 100644 org.argeo.eclipse.ui.workbench.rap/META-INF/spring/osgi.xml create mode 100644 org.argeo.eclipse.ui.workbench.rap/bnd.bnd create mode 100644 org.argeo.eclipse.ui.workbench.rap/pom.xml diff --git a/demo/argeo_node_rap.properties b/demo/argeo_node_rap.properties index 7c3b662b2..49c4108c9 100644 --- a/demo/argeo_node_rap.properties +++ b/demo/argeo_node_rap.properties @@ -14,11 +14,11 @@ org.eclipse.equinox.http.registry,\ org.osgi.service.http.port=7070 org.eclipse.equinox.http.jetty.log.stderr.threshold=info -org.eclipse.equinox.http.jetty.context.path=/ui +#org.eclipse.equinox.http.jetty.context.path=/ui argeo.i18n.availableLocales=en,fr,de,ru,ar eclipse.registry.MultiLanguage=true log4j.configuration=file:../../log4j.properties osgi.console.enable.builtin=true -org.eclipse.rap.workbenchAutostart=true \ No newline at end of file +org.eclipse.rap.workbenchAutostart=false \ No newline at end of file diff --git a/org.argeo.cms/src/org/argeo/cms/internal/kernel/Kernel.java b/org.argeo.cms/src/org/argeo/cms/internal/kernel/Kernel.java index 4b893f13d..848206f5c 100644 --- a/org.argeo.cms/src/org/argeo/cms/internal/kernel/Kernel.java +++ b/org.argeo.cms/src/org/argeo/cms/internal/kernel/Kernel.java @@ -1,7 +1,5 @@ package org.argeo.cms.internal.kernel; -import java.util.Hashtable; - import javax.jcr.RepositoryFactory; import org.apache.commons.logging.Log; @@ -10,8 +8,6 @@ import org.argeo.ArgeoException; import org.argeo.jackrabbit.OsgiJackrabbitRepositoryFactory; import org.argeo.security.core.InternalAuthentication; import org.eclipse.rap.rwt.application.ApplicationConfiguration; -import org.eclipse.rap.rwt.osgi.ApplicationLauncher; -import org.eclipse.rap.ui.internal.servlet.WorkbenchApplicationConfiguration; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; import org.springframework.security.core.context.SecurityContextHolder; @@ -27,10 +23,9 @@ import org.springframework.security.core.context.SecurityContextHolder; *
  • OS access
  • * */ -@SuppressWarnings("restriction") final class Kernel { private final static Log log = LogFactory.getLog(Kernel.class); - private static final String PROP_WORKBENCH_AUTOSTART = "org.eclipse.rap.workbenchAutostart"; +// private static final String PROP_WORKBENCH_AUTOSTART = "org.eclipse.rap.workbenchAutostart"; private final BundleContext bundleContext; @@ -64,11 +59,11 @@ final class Kernel { repositoryFactory, null); nodeHttp.publish(); - if ("false".equals(bundleContext - .getProperty(PROP_WORKBENCH_AUTOSTART))) { - WorkbenchApplicationConfiguration wac = new WorkbenchApplicationConfiguration(); - registerWorkbench(wac); - } +// if ("false".equals(bundleContext +// .getProperty(PROP_WORKBENCH_AUTOSTART))) { +// WorkbenchApplicationConfiguration wac = new WorkbenchApplicationConfiguration(); +// registerWorkbench(wac); +// } } catch (Exception e) { log.error("Cannot initialize Argeo CMS", e); throw new ArgeoException("Cannot initialize", e); @@ -95,16 +90,16 @@ final class Kernel { + (duration % 1000) + "s ##"); } - private void registerWorkbench(final WorkbenchApplicationConfiguration wac) { - new Thread("Worbench Launcher") { - public void run() { - Hashtable props = new Hashtable(); - props.put(ApplicationLauncher.PROPERTY_CONTEXT_NAME, "ui"); - workbenchReg = bundleContext.registerService( - ApplicationConfiguration.class, wac, props); - } - }.start(); - } +// private void registerWorkbench(final WorkbenchApplicationConfiguration wac) { +// new Thread("Worbench Launcher") { +// public void run() { +// Hashtable props = new Hashtable(); +// props.put(ApplicationLauncher.PROPERTY_CONTEXT_NAME, "ui"); +// workbenchReg = bundleContext.registerService( +// ApplicationConfiguration.class, wac, props); +// } +// }.start(); +// } private void directorsCut() { final long ms = 128l + (long) (Math.random() * 128d); diff --git a/org.argeo.eclipse.ui.workbench.rap/.project b/org.argeo.eclipse.ui.workbench.rap/.project new file mode 100644 index 000000000..751e9d794 --- /dev/null +++ b/org.argeo.eclipse.ui.workbench.rap/.project @@ -0,0 +1,20 @@ + + + org.argeo.eclipse.ui.workbench.rap + + + + + + org.eclipse.pde.ManifestBuilder + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.PluginNature + + diff --git a/org.argeo.eclipse.ui.workbench.rap/META-INF/spring/osgi.xml b/org.argeo.eclipse.ui.workbench.rap/META-INF/spring/osgi.xml new file mode 100644 index 000000000..206a72ad2 --- /dev/null +++ b/org.argeo.eclipse.ui.workbench.rap/META-INF/spring/osgi.xml @@ -0,0 +1,19 @@ + + + + + + + + + + \ No newline at end of file diff --git a/org.argeo.eclipse.ui.workbench.rap/bnd.bnd b/org.argeo.eclipse.ui.workbench.rap/bnd.bnd new file mode 100644 index 000000000..1b2939e64 --- /dev/null +++ b/org.argeo.eclipse.ui.workbench.rap/bnd.bnd @@ -0,0 +1,4 @@ +Bundle-SymbolicName: org.argeo.eclipse.ui.workbench.rap;singleton:=true +Bundle-ActivationPolicy: lazy + +Fragment-Host: org.eclipse.rap.ui.workbench diff --git a/org.argeo.eclipse.ui.workbench.rap/pom.xml b/org.argeo.eclipse.ui.workbench.rap/pom.xml new file mode 100644 index 000000000..eea1f60c7 --- /dev/null +++ b/org.argeo.eclipse.ui.workbench.rap/pom.xml @@ -0,0 +1,11 @@ + + 4.0.0 + + org.argeo.commons + 2.1.13-SNAPSHOT + argeo-commons + .. + + org.argeo.eclipse.ui.workbench.rap + Commons Eclipse UI Workbench RAP + diff --git a/pom.xml b/pom.xml index 464b30736..faf7d18e6 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ org.argeo.cms org.argeo.eclipse.ui.workbench + org.argeo.eclipse.ui.workbench.rap org.argeo.security.ui org.argeo.security.ui.admin -- 2.30.2