Commit 54fdfc75 authored by Marco Descher's avatar Marco Descher

[17137] COAd via component, remove console application

parent 486a7eb9
Pipeline #12453 passed with stages
in 4 minutes and 53 seconds
......@@ -29,8 +29,8 @@ import ch.elexis.core.constants.ElexisSystemPropertyConstants;
import ch.elexis.core.constants.Preferences;
import ch.elexis.core.data.activator.CoreHub;
import ch.elexis.core.data.events.ElexisEventDispatcher;
import ch.elexis.core.data.extension.AbstractCoreOperationAdvisor;
import ch.elexis.core.data.extension.CoreOperationExtensionPoint;
import ch.elexis.core.data.extension.CoreOperationAdvisorHolder;
import ch.elexis.core.data.extension.ICoreOperationAdvisor;
import ch.elexis.core.data.preferences.CorePreferenceInitializer;
import ch.elexis.core.data.util.LocalLock;
import ch.elexis.core.services.IElexisDataSource;
......@@ -44,7 +44,7 @@ public class Desk implements IApplication {
private Logger log = LoggerFactory.getLogger(Desk.class);
private static Map<String, String> args = null;
protected static AbstractCoreOperationAdvisor cod = null;
protected static ICoreOperationAdvisor cod = null;
/**
* @since 3.0.0 log-in has been moved from ApplicationWorkbenchAdvisor to this method
......@@ -56,7 +56,7 @@ public class Desk implements IApplication {
new CoreEventListenerRegistrar();
// Check if we "are complete" - throws Error if not
cod = CoreOperationExtensionPoint.getCoreOperationAdvisor();
cod = CoreOperationAdvisorHolder.get();
if(System.getProperty(ElexisSystemPropertyConstants.OPEN_DB_WIZARD)!=null) {
cod.requestDatabaseConnectionConfiguration();
......
......@@ -24,8 +24,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ch.elexis.core.data.events.ElexisEventDispatcher;
import ch.elexis.core.data.extension.AbstractCoreOperationAdvisor;
import ch.elexis.core.data.extension.CoreOperationExtensionPoint;
import ch.elexis.core.data.extension.CoreOperationAdvisorHolder;
import ch.elexis.core.ui.Hub;
import ch.elexis.core.ui.UiDesk;
import ch.elexis.core.ui.actions.GlobalActions;
......@@ -42,9 +41,6 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
private Logger log = LoggerFactory.getLogger(ApplicationWorkbenchAdvisor.class.getName());
protected static AbstractCoreOperationAdvisor cod =
CoreOperationExtensionPoint.getCoreOperationAdvisor();
@Override
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
final IWorkbenchWindowConfigurer configurer){
......@@ -68,10 +64,10 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
public IAdaptable getDefaultPageInput(){
return super.getDefaultPageInput();
}
@Override
public String getInitialWindowPerspectiveId(){
String initPerspective = cod.getInitialPerspective();
String initPerspective = CoreOperationAdvisorHolder.get().getInitialPerspective();
// avoid that nothing opens up after login in case the stored perspective can't be found
IPerspectiveRegistry perspectiveRegistry =
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ch.elexis.core.console.application</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
<setAttribute key="additional_plugins"/>
<booleanAttribute key="append.args" value="true"/>
<stringAttribute key="application" value="ch.elexis.core.console.application.ConsoleApplication"/>
<booleanAttribute key="askclear" value="true"/>
<booleanAttribute key="automaticAdd" value="false"/>
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="false"/>
<booleanAttribute key="clearws" value="true"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/ConsoleWithCoreDataOnly (OSX)"/>
<booleanAttribute key="default" value="false"/>
<stringAttribute key="featureDefaultLocation" value="workspace"/>
<stringAttribute key="featurePluginResolution" value="workspace"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../runtime-coredataonly"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dch.elexis.username=test -Dch.elexis.password=test"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<setAttribute key="selected_features">
<setEntry value="ch.elexis.core.common.feature:default"/>
</setAttribute>
<stringAttribute key="selected_target_plugins" value="bcprov@default:default,ch.qos.logback.classic*1.0.7@default:default,ch.qos.logback.core*1.0.7@default:default,com.ibm.icu@default:default,com.mysql.jdbc@default:default,javax.servlet@default:default,log4j@default:default,org.apache.commons.logging@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.cocoa.macosx.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.ui.workbench@default:default,org.h2@default:default,org.jdom@default:default,org.postgresql@default:default,slf4j.api@default:default,slf4j.jcl@default:false,slf4j.log4j12@default:false"/>
<stringAttribute key="selected_workspace_plugins" value="ch.elexis.core.console.application@default:default,ch.elexis.core.data@default:default,ch.elexis.core@default:default,ch.rgw.utility@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="true"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
<booleanAttribute key="useProduct" value="false"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
<booleanAttribute key="append.args" value="true"/>
<stringAttribute key="application" value="ch.elexis.core.console.application.ConsoleApplication"/>
<booleanAttribute key="askclear" value="false"/>
<booleanAttribute key="automaticAdd" value="false"/>
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="false"/>
<booleanAttribute key="clearws" value="true"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/ConsoleWithCoreDataOnly (Windows 64)"/>
<booleanAttribute key="default" value="false"/>
<booleanAttribute key="includeOptional" value="false"/>
<stringAttribute key="location" value="${workspace_loc}/../runtime-coredataonly"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dch.elexis.username=test -Dch.elexis.password=test"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<stringAttribute key="selected_target_plugins" value="bcprov@default:default,bouncycastle.bcprov-jdk14@default:default,ch.qos.logback.classic@default:default,ch.qos.logback.core@default:default,ch.qos.logback.slf4j@default:default,com.eclipsesource.jaxrs.consumer@default:default,com.eclipsesource.jaxrs.jersey-min@default:default,com.google.code.gson@default:default,com.google.guava@default:default,com.ibm.icu@default:default,com.mysql.jdbc@default:default,javax.annotation@default:default,javax.inject@default:default,javax.servlet@default:default,javax.xml@default:default,log4j@default:default,org.apache.batik.css@default:default,org.apache.batik.util.gui@default:default,org.apache.batik.util@default:default,org.apache.commons.codec*1.9.0.v20170208-1614@default:default,org.apache.commons.dbcp@default:default,org.apache.commons.io@default:default,org.apache.commons.jxpath@default:default,org.apache.commons.lang@default:default,org.apache.commons.logging@default:default,org.apache.commons.pool@default:default,org.eclipse.ant.core@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.win32.x86@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources.win32.x86@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.annotations@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.emf.xpath@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface@default:default,org.eclipse.osgi.compatibility.state@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.win32.win32.x86@default:default,org.eclipse.swt@default:default,org.eclipse.team.core@default:default,org.eclipse.ui.workbench@default:default,org.h2@default:default,org.hamcrest.core@default:default,org.hamcrest.library@default:default,org.jdom@default:default,org.junit@default:default,org.postgresql@default:default,org.slf4j.api@default:default,org.slf4j.log4j@default:default,org.slf4j.nop@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil@default:default,org.w3c.dom.svg@default:default,slf4j.api@default:default,slf4j.jcl@default:false,slf4j.log4j12@default:false"/>
<stringAttribute key="selected_workspace_plugins" value="ch.elexis.core.console.application@default:default,ch.elexis.core.data.tests@default:default,ch.elexis.core.data@default:default,ch.elexis.core.findings@default:default,ch.elexis.core.logging.default_configuration@default:default,ch.elexis.core@default:default,ch.rgw.utility.tests@default:default,ch.rgw.utility@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
<booleanAttribute key="useProduct" value="false"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
<setAttribute key="additional_plugins">
<setEntry value="org.apache.felix.gogo.command:0.8.0.v201108120515:default:true"/>
<setEntry value="org.apache.felix.gogo.runtime:0.8.0.v201108120515:default:true"/>
<setEntry value="org.apache.felix.gogo.shell:0.8.0.v201110170705:default:true"/>
<setEntry value="org.eclipse.equinox.console:1.0.0.v20120522-1841:default:true"/>
<setEntry value="org.slf4j.api:1.7.2.v20121108-1250:default:false"/>
<setEntry value="uk.org.lidalia.sysout-over-slf4j:1.0.2:default:true"/>
</setAttribute>
<booleanAttribute key="append.args" value="true"/>
<stringAttribute key="application" value="ch.elexis.core.console.application.ConsoleApplication"/>
<booleanAttribute key="askclear" value="true"/>
<booleanAttribute key="automaticAdd" value="false"/>
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="false"/>
<booleanAttribute key="clearws" value="true"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/ConsoleWithCoreDataOnly (linux.x86_64)"/>
<booleanAttribute key="default" value="false"/>
<stringAttribute key="featureDefaultLocation" value="workspace"/>
<stringAttribute key="featurePluginResolution" value="workspace"/>
<booleanAttribute key="includeOptional" value="false"/>
<stringAttribute key="location" value="${workspace_loc}/../runtime-"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -debug"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dch.elexis.username=test -Dch.elexis.password=test"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<setAttribute key="selected_features">
<setEntry value="ch.elexis.core.common.feature:default"/>
<setEntry value="ch.elexis.core.logging.feature:default"/>
</setAttribute>
<stringAttribute key="selected_target_plugins" value="bcprov@default:default,bouncycastle.bcprov-jdk14@default:default,ch.qos.logback.classic*1.0.7@default:default,ch.qos.logback.core*1.0.7@default:default,com.ibm.icu@default:default,com.mysql.jdbc@default:default,dom4j@default:default,javax.servlet@default:default,javax.xml@default:default,jaxen@default:default,jdom@default:default,jul.to.slf4j@default:default,org.apache.commons.dbcp@default:default,org.apache.commons.logging@default:default,org.apache.commons.pool@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.xerces@default:default,org.apache.xml.resolver@default:default,org.apache.xml.serializer@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.h2@default:default,org.hamcrest.core@default:default,org.jdom@default:default,org.junit@default:default,org.postgresql@default:default,org.slf4j.api@default:default,org.slf4j.jcl@default:default,org.slf4j.log4j@default:default,org.slf4j.nop@default:false,slf4j.api@default:default,slf4j.jcl@default:false,slf4j.log4j12@default:false,xerces.Impl@default:default,xml-resolver@default:default,xom@default:default,xpp3.min@default:default"/>
<stringAttribute key="selected_workspace_plugins" value="ch.elexis.core.console.application@default:default,ch.elexis.core.data.tests@default:false,ch.elexis.core.data@default:default,ch.elexis.core.logging.default_configuration@1:false,ch.elexis.core@default:default,ch.rgw.utility.tests@default:false,ch.rgw.utility@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
<booleanAttribute key="useProduct" value="false"/>
</launchConfiguration>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Elexis Console Application
Bundle-SymbolicName: ch.elexis.core.console.application;singleton:=true
Bundle-Version: 3.2.0.qualifier
Bundle-Vendor: elexis.info
Require-Bundle: org.eclipse.core.runtime,
ch.elexis.core;bundle-version="3.0.0",
ch.elexis.core.data;bundle-version="3.0.0",
ch.rgw.utility;bundle-version="3.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Import-Package: org.slf4j
source.. = src/
javacDefaultEncoding.. = UTF-8
bin.includes = META-INF/,\
.,\
plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="ch.elexis.core.data.coreOperation">
<coreOperation
advisor="ch.elexis.core.console.application.CoreOperationAdvisor">
</coreOperation>
</extension>
<extension
id="ConsoleApplication"
name="Elexis Console Application"
point="org.eclipse.core.runtime.applications">
<application
cardinality="singleton-global"
thread="main"
visible="true">
<run
class="ch.elexis.core.console.application.Application">
</run>
</application>
</extension>
</plugin>
h1. Elexis Console Application
**Initial implementation by** "MEDEVIT":www.medevit.at
This application runs a bare Elexis on the console. It demonstrates the headless running capabilities of @ch.elexis.core.data@.
This allows to access an Elexis database without starting a full graphical system.
In order to use this plugin as unit test starting point for the core, please add your
testing code to @ch.elexis.core.console.application.test@.
To start the application right click on @ConsoleWithCoreDataOnly.launch@ and select @Run As@.
h2. Start parameters
The following start parameters are supported within @Run Configuration / Arguments / VM Arguments@:
|_. Mode Description |_. Parameter Combination |
| Pass Login Params | @-Dch.elexis.username=007 -Dch.elexis.password=topsecret@ |
| Run From Scratch | @-Delexis-run-mode=RunFromScratch -Dch.elexis.username=007 -Dch.elexis.password=topsecret@ |
| Set Database Connection | @-Dch.elexis.dbFlavor=postgresql -Dch.elexis.dbSpec=jdbc:postgresql://192.168.0.3:5432/elexis -Dch.elexis.dbUser=elexisuser -Dch.elexis.dbPw=elexis@ |
/*******************************************************************************
* Copyright (c) 2013 MEDEVIT <office@medevit.at>.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* MEDEVIT <office@medevit.at> - initial API and implementation
******************************************************************************/
package ch.elexis.core.console.application;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ch.elexis.core.console.application.test.ApplicationTestCode;
import ch.elexis.core.constants.ElexisSystemPropertyConstants;
import ch.elexis.core.data.activator.CoreHub;
import ch.elexis.core.data.extension.CoreOperationExtensionPoint;
import ch.elexis.core.exceptions.PersistenceException;
import ch.elexis.data.Kontakt;
import ch.elexis.data.PersistentObject;
import ch.elexis.data.Query;
/**
* The main application class as referenced by the org.eclipse.core.runtime.applications extension
* point.
*/
public class Application implements IApplication {
private Logger log = LoggerFactory.getLogger(Application.class);
@Override
public Object start(IApplicationContext context) throws Exception{
// register ElexisEvent and MessageEvent listeners
log.debug("Registering " + CoreEventListenerRegistrar.class.getName());
new CoreEventListenerRegistrar();
// Check if we "are complete" - throws Error if not
CoreOperationExtensionPoint.getCoreOperationAdvisor();
// connect to the database
try {
if (PersistentObject.connect(CoreHub.localCfg) == false)
log.error(PersistentObject.class.getName() + " initialization failed.");
} catch (PersistenceException pe) {
log.error("Initialization error", pe);
pe.printStackTrace();
System.exit(1);
}
// check connection by logging number of contact entries
Query<Kontakt> qbe = new Query<>(Kontakt.class);
log.debug("Number of contacts in DB: " + qbe.execute().size());
// log-in
String username = System.getProperty(ElexisSystemPropertyConstants.LOGIN_USERNAME);
String password = System.getProperty(ElexisSystemPropertyConstants.LOGIN_PASSWORD);
log.debug("Starting Login as " + username);
if (username != null && password != null) {
if (!CoreHub.login(username, password.toCharArray())) {
log.error("Authentication failed. Exiting.");
System.exit(1);
}
} else {
log.error("Does not support interactive log-in, please use system properties");
System.exit(1);
}
// check if there is a valid user
if ((CoreHub.getLoggedInContact() == null) || !CoreHub.getLoggedInContact().isValid()) {
// no valid user, exit (don't consider this as an error)
log.warn("Exit because no valid user logged-in");
PersistentObject.disconnect();
System.exit(0);
}
// call the static test method to perform tasks, after return program
// exits
ApplicationTestCode.performApplicationTest();
log.debug("Exiting");
return null;
}
@Override
public void stop(){}
}
/*******************************************************************************
* Copyright (c) 2013 MEDEVIT <office@medevit.at>.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* MEDEVIT <office@medevit.at> - initial API and implementation
******************************************************************************/
package ch.elexis.core.console.application;
import ch.elexis.core.console.application.listeners.ElexisStatusEventEventListener;
import ch.elexis.core.console.application.listeners.MessageEventListener;
import ch.elexis.core.data.events.ElexisEventDispatcher;
import ch.elexis.core.data.events.ElexisEventListener;
public class CoreEventListenerRegistrar {
private ElexisEventListener eeli_messageEvent;
private ElexisEventListener eeli_elexisEvent;
public CoreEventListenerRegistrar(){
eeli_messageEvent = new MessageEventListener();
eeli_elexisEvent = new ElexisStatusEventEventListener();
ElexisEventDispatcher.getInstance().addListeners(eeli_messageEvent, eeli_elexisEvent);
}
}
/*******************************************************************************
* Copyright (c) 2013 MEDEVIT <office@medevit.at>.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* MEDEVIT <office@medevit.at> - initial API and implementation
******************************************************************************/
package ch.elexis.core.console.application;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ch.elexis.core.constants.ElexisSystemPropertyConstants;
import ch.elexis.core.data.activator.CoreHub;
import ch.elexis.core.data.extension.AbstractCoreOperationAdvisor;
import ch.elexis.core.data.util.IRunnableWithProgress;
import ch.elexis.core.data.util.SqlRunner;
public class CoreOperationAdvisor extends AbstractCoreOperationAdvisor {
private Logger log = LoggerFactory.getLogger(CoreOperationAdvisor.class);
@Override
public void requestDatabaseConnectionConfiguration(){
System.out.println("CoreOperationAdvisor: requestDatabaseConnectionConfiguration()");
}
@Override
public void requestInitialMandatorConfiguration(){
System.out.println("CoreOperationAdvisor: requestInitialMandatorConfiguration()");
}
@Override
public void adaptForUser(){
System.out.println("CoreOperationAdvisor: adaptForUser()");
}
@Override
public boolean openQuestion(String title, String message){
System.out.println("CoreOperationAdvisor: openQuestion()");
return false;
}
@Override
public void openInformation(String title, String message){
System.out.println("CoreOperationAdvisor: openInformation()");
}
public void performLogin(Object shell){
String username = System.getProperty(ElexisSystemPropertyConstants.LOGIN_USERNAME);
String password = System.getProperty(ElexisSystemPropertyConstants.LOGIN_PASSWORD);
if (username != null && password != null) {
/* Allow bypassing the login dialog, eg. for automated GUI-tests.
* Example: when having a demoDB you may login directly by passing
* -vmargs -Dch.elexis.username=test -Dch.elexis.password=test
* as command line parameters to elexis.
*/
log.error("Bypassing LoginDialog with username " + username);
if (!CoreHub.login(username, password.toCharArray())) {
log.error("Authentication failed. Exiting");
}
}
}
@Override
public String getInitialPerspective(){
System.out.println("CoreOperationAdvisor: getInitialPerspective()");
return null;
}
@Override
public boolean performDatabaseUpdate(String[] array, String pluginId){
return new SqlRunner(array, pluginId).runSql();
}
@Override
public void showProgress(IRunnableWithProgress irwp, String taskName){
System.out.println("CoreOperationAdvisor: showProgress() taskName ["+taskName+"]");
}
}
/*******************************************************************************
* Copyright (c) 2013 MEDEVIT <office@medevit.at>.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* MEDEVIT <office@medevit.at> - initial API and implementation
******************************************************************************/
package ch.elexis.core.console.application.listeners;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ch.elexis.core.data.events.ElexisEvent;
import ch.elexis.core.data.events.ElexisEventListenerImpl;
import ch.elexis.core.data.status.ElexisStatus;
/**
* Listens to Elexis status events of highest priority, such as exception or operational error
* messages. Depending on the situation these may or may not be presented to the user.
*/
public class ElexisStatusEventEventListener extends ElexisEventListenerImpl {
private Logger log = LoggerFactory.getLogger(ElexisStatusEventEventListener.class.getName());
public ElexisStatusEventEventListener(){
super(null, ElexisStatus.class, ElexisEvent.EVENT_ELEXIS_STATUS, ElexisEvent.PRIORITY_SYNC);
}
@Override
public void run(ElexisEvent ev){
ElexisStatus es = (ElexisStatus) ev.getGenericObject();
log.info("StatusEvent [PLUGIN] " + es.getPlugin() + " [MESSAGE] " + es.getMessage()
+ " [EXCEPTION] " + es.getException());
}
}
/*******************************************************************************
* Copyright (c) 2013 MEDEVIT <office@medevit.at>.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* MEDEVIT <office@medevit.at> - initial API and implementation
******************************************************************************/
package ch.elexis.core.console.application.listeners;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ch.elexis.core.data.events.ElexisEvent;
import ch.elexis.core.data.events.ElexisEventListenerImpl;
import ch.elexis.core.data.interfaces.events.MessageEvent;
/**
* Listens to generic MessageEvents thrown by the core that should be presented to the user.
*/
public class MessageEventListener extends ElexisEventListenerImpl {
private Logger log = LoggerFactory.getLogger(MessageEventListener.class.getName());
public MessageEventListener(){
super(null, MessageEvent.class, ElexisEvent.EVENT_NOTIFICATION, ElexisEvent.PRIORITY_SYNC);
}
@Override
public void run(ElexisEvent ev){
MessageEvent me = (MessageEvent) ev.getGenericObject();
log.debug("MessageEvent [" + me.mt + "] [" + me.title + "] [" + me.message + "]");
}
}
/**
* This package contains the listeners required to operate a base Elexis 3 system.
* Listeners in this package have to be registered at startup with the {@link ch.elexis.core.data.events.ElexisEventDispatcher}.
*/
package ch.elexis.core.console.application.listeners;
\ No newline at end of file
/*******************************************************************************
* Copyright (c) 2013 MEDEVIT <office@medevit.at>.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* MEDEVIT <office@medevit.at> - initial API and implementation
******************************************************************************/
package ch.elexis.core.console.application.test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ch.elexis.data.Konsultation;
import ch.elexis.data.Patient;
import ch.elexis.data.Prescription;
import ch.elexis.data.Query;
/**
* This class contains a the static method {@link #performApplicationTest()}, which is being called
* after startup and login. It may contain test code to be executed. Elexis is closed after this
* method returns.
*/
public class ApplicationTestCode {
static Logger log = LoggerFactory.getLogger(ApplicationTestCode.class.getName());
public static void performApplicationTest(){