Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis
Class Hub

java.lang.Object
  extended by AbstractUIPlugin
      extended by ch.elexis.Hub

public class Hub
extends AbstractUIPlugin

Diese Klasse ist der OSGi-Activator und steuert somit Start und Ende der Anwendung. Ganz früh (vor dem Initialisieren der anwendung) und ganz spät (unmittelbar vor dem Entfernen der Anwendung) notwendige Schritte müssen hier durchgeführt werden. Ausserdem werden hier globale Variablen und Konstanten angelegt.


Nested Class Summary
static interface Hub.ShutdownJob
          A job that executes during stop() of the plugin (that means after the workbench is shut down
 
Field Summary
static AccessControl acl
          Die zentrale Zugriffskontrolle
static Mandant actMandant
          Der Mandant, auf dessen namen die aktuellen Handlungen gehen
static Anwender actUser
          Der aktuell angemeldete Anwender
static java.lang.String APPLICATION_NAME
           
static java.lang.String COMMAND_PREFIX
           
static java.lang.String DBVersion
           
 boolean DEBUGMODE
           
static boolean ecc
          Suche externe Config - poor mans dependency -> see ch.elexis.ElexisConfigurationConstants.java
static Settings globalCfg
          Globale Einstellungen (Werden in der Datenbank gespeichert)
static Heartbeat heart
          Heartbeat
static Settings localCfg
          Lokale Einstellungen (Werden in der Registry bzw. ~/.java gespeichert)
static Log log
          Zentrale Logdatei
static GlobalActions mainActions
          Globale Aktionen
static Settings mandantCfg
          Mandantspezifische EInstellungen (Werden in der Datenbank gespeichert)
static PreferenceInitializer pin
          Der Initialisierer für die Voreinstellungen
static Hub plugin
          Das Singleton-Objekt dieser Klasse
static java.lang.String PLUGIN_ID
           
static PersistentObjectFactory poFactory
          Factory für interne PersistentObjects
static java.lang.String SWTBOTTEST_KEY
           
static Settings userCfg
          Anwenderspezifische Einstellungen (Werden in der Datenbank gespeichert)
static java.lang.String Version
           
 
Constructor Summary
Hub()
          Constructor.
 
Method Summary
static void addShutdownJob(Hub.ShutdownJob job)
          Add a ShutdownJob to the list of jobs that has to be done after the Elexis workbench was shut down.
static Shell getActiveShell()
          get the currently active Shell.
static java.lang.String getBasePath()
          get the base directory of this currently running elexis application
static java.lang.String getCfgVariant()
          Return the name of a config instance, the user chose.
static java.lang.String getId()
           
static ImageDescriptor getImageDescriptor(java.lang.String path)
          Returns an image descriptor for the image file at the given plug-in relative path.
static java.util.List<Mandant> getMandantenList()
          get a list of all mandators known to this system
static Hub getPlugin()
           
static java.lang.String getRevision(boolean withDate)
          Revisionsnummer und Erstellungsdatum dieser Instanz ermitteln.
static int getSystemLogLevel()
           
static java.io.File getTempDir()
          Return a directory suitable for temporary files.
static java.util.List<Anwender> getUserList()
          get a list af all users known to this system
static java.lang.String getWorkstationId()
          get an identifier for this workstation.
static java.io.File getWritableUserDir()
          return a directory suitable for plugin specific configuration data.
static void postShutdown()
          Programmende
static void setMandant(Mandant m)
           
 void setUserDir(java.io.File dir)
           
static void setWindowText(Patient pat)
           
 void start(BundleContext context)
           
 void startUpBundle()
          Hier stehen Aktionen, die ganz früh, noch vor dem Starten der Workbench, durchgeführt werden sollen.
 void stop(BundleContext context)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUGMODE

public final boolean DEBUGMODE

APPLICATION_NAME

public static final java.lang.String APPLICATION_NAME
See Also:
Constant Field Values

PLUGIN_ID

public static final java.lang.String PLUGIN_ID
See Also:
Constant Field Values

COMMAND_PREFIX

public static final java.lang.String COMMAND_PREFIX
See Also:
Constant Field Values

Version

public static final java.lang.String Version
See Also:
Constant Field Values

DBVersion

public static final java.lang.String DBVersion
See Also:
Constant Field Values

SWTBOTTEST_KEY

public static final java.lang.String SWTBOTTEST_KEY
See Also:
Constant Field Values

ecc

public static boolean ecc
Suche externe Config - poor mans dependency -> see ch.elexis.ElexisConfigurationConstants.java


plugin

public static Hub plugin
Das Singleton-Objekt dieser Klasse


localCfg

public static Settings localCfg
Lokale Einstellungen (Werden in der Registry bzw. ~/.java gespeichert)


globalCfg

public static Settings globalCfg
Globale Einstellungen (Werden in der Datenbank gespeichert)


userCfg

public static Settings userCfg
Anwenderspezifische Einstellungen (Werden in der Datenbank gespeichert)


mandantCfg

public static Settings mandantCfg
Mandantspezifische EInstellungen (Werden in der Datenbank gespeichert)


log

public static Log log
Zentrale Logdatei


mainActions

public static GlobalActions mainActions
Globale Aktionen


actUser

public static Anwender actUser
Der aktuell angemeldete Anwender


actMandant

public static Mandant actMandant
Der Mandant, auf dessen namen die aktuellen Handlungen gehen


acl

public static final AccessControl acl
Die zentrale Zugriffskontrolle


pin

public static final PreferenceInitializer pin
Der Initialisierer für die Voreinstellungen


poFactory

public static final PersistentObjectFactory poFactory
Factory für interne PersistentObjects


heart

public static Heartbeat heart
Heartbeat

Constructor Detail

Hub

public Hub()
Constructor. No Eclipse dependend initializations here because the Platform has not been iniatialized fully yet

Method Detail

getPlugin

public static Hub getPlugin()

getSystemLogLevel

public static int getSystemLogLevel()

start

public void start(BundleContext context)
           throws java.lang.Exception
Throws:
java.lang.Exception

stop

public void stop(BundleContext context)
          throws java.lang.Exception
Throws:
java.lang.Exception

startUpBundle

public void startUpBundle()
Hier stehen Aktionen, die ganz früh, noch vor dem Starten der Workbench, durchgeführt werden sollen.


postShutdown

public static void postShutdown()
Programmende


setMandant

public static void setMandant(Mandant m)

setWindowText

public static void setWindowText(Patient pat)

getImageDescriptor

public static ImageDescriptor getImageDescriptor(java.lang.String path)
Returns an image descriptor for the image file at the given plug-in relative path.

Parameters:
path - the path
Returns:
the image descriptor

getId

public static java.lang.String getId()

getWorkstationId

public static java.lang.String getWorkstationId()
get an identifier for this workstation. This is unique within the network this station resides, and it is human-readable

Returns:

getRevision

public static java.lang.String getRevision(boolean withDate)
Revisionsnummer und Erstellungsdatum dieser Instanz ermitteln. Dazu wird die beim letzten Commit von Subversion geänderte Variable LastChangedRevision untersucht, und fürs Datum das von ANT beim build eingetragene Datum gesucht. Wenn diese Instanz nicht von ANT erstellt wurde, handelt es sich um eine Entwicklerversion, welche unter Eclipse-Kontrolle abläuft. Note: Obsoleted with change to mercurial


getBasePath

public static java.lang.String getBasePath()
get the base directory of this currently running elexis application

Returns:
the topmost directory of this application or null if this information could not be retrieved

getUserList

public static java.util.List<Anwender> getUserList()
get a list af all users known to this system


getMandantenList

public static java.util.List<Mandant> getMandantenList()
get a list of all mandators known to this system


getActiveShell

public static Shell getActiveShell()
get the currently active Shell. If no such Shell exists, it will be created using dhe default Display.

Returns:
always a valid shell. Never null

addShutdownJob

public static void addShutdownJob(Hub.ShutdownJob job)
Add a ShutdownJob to the list of jobs that has to be done after the Elexis workbench was shut down.

Parameters:
job -

setUserDir

public void setUserDir(java.io.File dir)

getWritableUserDir

public static java.io.File getWritableUserDir()
return a directory suitable for plugin specific configuration data. If no such dir exists, it will be created. If it could not be created, the application will refuse to start.

Returns:
a directory that exists always and is always writable and readable for plugins of the currently running elexis instance. Caution: this directory is not necessarily shared among different OS-Users. In Windows it is normally %USERPROFILE%\elexis, in Linux ~./elexis

getTempDir

public static java.io.File getTempDir()
Return a directory suitable for temporary files. Most probably this will be a default tempdir provided by the os. If none such exists, it will be the user dir.

Returns:
always a valid and writable directory.

getCfgVariant

public static java.lang.String getCfgVariant()
Return the name of a config instance, the user chose. This is just the valuie of the -Dconfig=xx runtime value or "default" if no -Dconfig was set


Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis