Web-4-All v3.00 Plug-in API Specification

ca.utoronto.atrc.web4all
Class ControlHub

java.lang.Object
  extended byca.utoronto.atrc.web4all.ControlHub
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.lang.Runnable, Web4AllConstants

public class ControlHub
extends java.lang.Object
implements Web4AllConstants, java.awt.event.ActionListener, java.lang.Runnable

Control Hub of the Web4-4-All system. The Control Hub coordinates activity among the Preference Loader, the Preferences Wizard Manager, the Configuration Manager, and the plug-ins.


Field Summary
static java.lang.String CONTEXT_ID_VAL
          Key for fetching the value of the context ID.
protected static boolean DEBUG
          Static flag to control the output of debug information.
static java.lang.String LIP_CONTENTYPE_LOCATION_VAL
          Key for fetching the location of the LIP Contentype schema.
static java.lang.String LOCALE_PROP
          For notifying property change listeners that the locale has changed.
static java.lang.String MAIN_WINDOW_PROP
          For notifying property change listeners that the main window has been allocated.
static java.lang.String NO_BUTTON_CMD
          Action command for the "No" push button in an alert.
static java.lang.String OK_BUTTON_CMD
          Action command for the "Ok" push button.
static java.lang.String SCHEMA_LOCATION_VAL
          Key for fetching the location of the schema.
static java.lang.String SCHEMA_VERSION_VAL
          Key for fetching the version of the schema.
static int SPLASH_HEIGHT
          Height of the splash screen.
static int SPLASH_WIDTH
          Width of the splash screen.
static java.lang.String THIRD_PARTY_FOLDER
          Base name of the 3rd party folder.
static java.lang.String XMLNS_VAL
          Key to the xml schema namespace.
static java.lang.String XMLNS_XSI_VAL
          Key to the xml instance document namespace.
static java.lang.String YES_BUTTON_CMD
          Action command for the "Yes" push button in an alert.
 
Fields inherited from interface ca.utoronto.atrc.web4all.Web4AllConstants
AK_GENERIC, AK_GENERIC_RESIZABLE_KEYS, ALPHA_LAYOUT_EXTERNAL, ALPHA_LAYOUT_INTERNAL, ALT_KEYBOARD, ALT_POINTING, AP_GENERIC, AP_GENERIC_ABS_POINT, AP_GENERIC_ACCEL, AP_GENERIC_BUTTON_EXT, AP_GENERIC_DBLCLICK, AP_GENERIC_HAND, AP_GENERIC_REL_POINT, AP_GENERIC_SPEED, APP_ID, APP_NAME, APP_PRIORITY, APP_TYPE, APP_VERSION, APPLICATION, BRAILLE, BRL_GENERIC, BRL_GENERIC_DOT_PRESSURE, BRL_GENERIC_GRADE, BRL_GENERIC_MARK_BOLD, BRL_GENERIC_MARK_COLOR, BRL_GENERIC_MARK_HIGHLIGHT, BRL_GENERIC_MARK_ITALIC, BRL_GENERIC_MARK_STRIKEOUT, BRL_GENERIC_MARK_UNDERLINE, BRL_GENERIC_NUM_CELLS, BRL_GENERIC_NUM_DOTS, BRL_GENERIC_STATUS_CELL, CI_CODE, CI_CODE_EXT, CI_CODE_RATE, CI_CODE_SELECT, CI_CODE_SWITCH_NUM, CI_CODE_TERM, CI_SWITCH_TYPE, CODED_INPUT, CONFIG_CLASS_SUFFIX, CONTEXT, CONTEXT_ID, CONTROL, DISPLAY, EXEC_SUFFIX, INI_SUFFIX, KE_GENERIC, KE_GENERIC_AUTO_DELAY, KE_GENERIC_AUTO_RATE, KE_GENERIC_DEBOUNCE, KE_GENERIC_DEBOUNCE_INTERVAL, KE_GENERIC_LAYOUT, KE_GENERIC_REPEAT, KE_GENERIC_SLOW, KE_GENERIC_SLOW_INTERVAL, KE_GENERIC_STICKY, KEYBOARD_ENHANCED, ME_GENERIC, ME_GENERIC_ACCEL, ME_GENERIC_DEVICE, ME_GENERIC_SPEED, MOUSE_EMULATION, OK_GENERIC, OK_GENERIC_AUTO_SCAN, OK_GENERIC_AUTO_SCAN_INIT_DELAY, OK_GENERIC_AUTO_SCAN_REPEAT, OK_GENERIC_CODE_SELECTION, OK_GENERIC_DIRECTED_SCAN, OK_GENERIC_DWELL_TIME, OK_GENERIC_INVERSE_SCAN, OK_GENERIC_KEY_HEIGHT, OK_GENERIC_KEY_SOUND, OK_GENERIC_KEY_SPACING, OK_GENERIC_KEY_WIDTH, OK_GENERIC_LAYOUT, OK_GENERIC_POINT_CLICK, OK_GENERIC_POINT_DWELL, OK_GENERIC_SCAN_SPEED, OK_GENERIC_SCAN_SWITCH_DELAY, OK_GENERIC_SWITCH, OK_GENERIC_SWITCH_DELAY, OK_GENERIC_SWITCH_NUM, OK_GENERIC_SWITCH_TYPE, ONSCREEN_KEYBOARD, PARAM_NAME, PARAM_VALUE, PARAMETER, PREDICT_COMMAND, PREDICT_NUM_CHOICES, PREDICT_PERSONAL_LEXICON, PREDICT_WORD, PREDICT_WORD_COMPLETE, PREDICTION, PREF_LANG, PREFS_CLASS_SUFFIX, PREFS_DTD_NAME, PRODUCT_NAME_SUFFIX, ROOT_DATUM, SCREEN_ENHANCE, SCREEN_READER, SE_GENERIC, SE_GENERIC_BG_COLOUR, SE_GENERIC_CARET, SE_GENERIC_CURSOR_COLOUR, SE_GENERIC_CURSOR_SIZE, SE_GENERIC_CURSOR_TRAILS, SE_GENERIC_FG_COLOUR, SE_GENERIC_FOCUS, SE_GENERIC_FONT_FACE, SE_GENERIC_FONT_SIZE, SE_GENERIC_GENERIC_FACE, SE_GENERIC_HI_COLOUR, SE_GENERIC_INVERT_COLOURS, SE_GENERIC_MAGNIFICATION, SE_GENERIC_MOUSE, SE_GENERIC_TRACKING, SR_GENERIC, SR_GENERIC_LINK, SR_GENERIC_PITCH, SR_GENERIC_SPEECH_RATE, SR_GENERIC_VOLUME, TEXT_READING_HIGHLITE, TR_GENERIC, TR_GENERIC_ALT, TR_GENERIC_HIGHLITE, TR_GENERIC_PITCH, TR_GENERIC_READING_UNIT, TR_GENERIC_SPEECH_RATE, TR_GENERIC_TABBING, TR_GENERIC_VOLUME, VA_GENERIC, VA_GENERIC_CAPTIONS, VA_GENERIC_SYSTEM_SOUNDS, VAL_ATT, VISUAL_ALERT, VOICE_REC, VR_GENERIC, VR_GENERIC_COMMAND_CONTROL, VR_GENERIC_CONTROLS_WINDOW, VR_GENERIC_DICTATION, VR_GENERIC_FEEDBACK, VR_GENERIC_MIC_GAIN, VR_GENERIC_MOUSE, VR_GENERIC_VOCABULARY, VR_GENERIC_VOICE_PROFILE_EXT
 
Constructor Summary
ControlHub(java.lang.String inDirectory)
          Constructor -- must initialize with the path to the directory from which the Web-4-All system was launched.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handle button presses on the splash screen.
 void addPropertyChangeListener(java.beans.PropertyChangeListener inListener)
          Allow PropertyChangeListeners to add themselves.
static java.lang.String createXMLString(java.lang.String inFileName)
          Utility for reading an XML file into memory.
protected  void deiconifySplashScreen()
          Deiconify the main window.
protected  void flushLookupTables()
          Flush the "appType" and "appID" lookup tables, and their contents.
 java.util.Vector get3rdPartyAppIds(java.lang.String inAppType)
          Given an application type, return a list of application IDs for that type.
 java.util.Vector get3rdPartyAppTypes(java.lang.String inAppID)
          Given an application ID, return the application type codes for that ID, if any.
 java.lang.String get3rdPartyConfigClass(java.lang.String inAppID)
          Given an application ID, return the class name of the SetterLauncher for that application, if any.
 java.lang.String get3rdPartyExecutable(java.lang.String inAppID)
          Given an application ID, return the full path to the exectuable for that application, if any.
protected  java.net.URL get3rdPartyFolderUrl()
          Retrieve the URL to the third party folder.
 java.lang.String get3rdPartyFullProductName(java.lang.String inAppID)
          Given an application ID, retrieve the user-friendly string that provides a name for that application.
 java.lang.String get3rdPartyIni(java.lang.String inAppID)
          Given an application ID, return the full path to the initialization file for that application.
 java.lang.String get3rdPartyPrefsClass(java.lang.String inAppID)
          Given an application ID, return the class name of the preferences wizard plug-in for that application, if any.
 java.util.ResourceBundle get3rdPartyProperties(java.lang.String inAppID)
          Given an application ID, return all of its properties.
 java.lang.String getGlobalProperty(java.lang.String inKey)
          Retrieve a Web-4-All global property value.
 java.lang.String getHomeDirectory()
          Retrieve the full path to the home directory.
 java.util.Locale getLocale()
          Return current Locale in use by Web-4-All.
 java.lang.String getPrefElementName(java.lang.String inKey)
          Retrieve an ACCLIP preference element name given its key.
 java.lang.String getPrefElementNameKey(java.lang.String inElementName)
          Retrieve a preference element name's key, given its ACCLIP name.
static ControlHub getSharedInstance()
          Acquire the shared instance of the ControlHub, if any.
static ControlHub getSharedInstance(boolean inCreateFlag, java.lang.String inDirectory)
          Acquire the shared instance of ControlHub.
protected  void iconifySplashScreen()
          Minimize the main window.
protected  void initPWM()
          Utility to create the Preferences Wizard Manager and it's main window.
 java.lang.String kickIt(java.lang.String inPrefs, PrefsLoaderAPI inPrefsLoader)
          The main entry point that a preferences loader uses to engage the control hub.
 org.w3c.dom.Element lastChance3rdPartyPrefs(java.lang.String appType, java.util.Vector appsNotLaunched)
          Attempt to find at least one technology that matches the given type.
protected  void load3rdPartyProps()
          Find and load all of the plug-in properties files.
static void main(java.lang.String[] args)
          A main for running the Web-4-All system without using a smart card -- mostly for debugging.
protected  void makePrefsDom(java.lang.String inPrefsStr)
          Parse the given XML ACCLIP string into a DOM.
 void removePropertyChangeListener(java.beans.PropertyChangeListener inListener)
          Allow PropertyChangeListeners to remove themselves.
 void run()
          Run the built-in preferences wizard.
 void savePrefs()
          Write the preferences, if any, back to the storage medium.
 void setLocale(java.util.Locale inLocale)
          Inform the Web-4-All system of a change in language preference, including notifying any property change listeners.
static int showOptionDialog(java.awt.Component inParent, java.lang.String inMessage, java.lang.String inTitle, int inMessageType)
          Utility for showing a confirmation dialogue or an alert.
protected  void showSplashScreen()
          Show the main window.
static ControlHub startWeb4All(java.lang.String inDirectory, PrefsLoaderAPI inPrefsLoader)
          Allocate a copy of the Control Hub, and launch the Web-4-All system.
 void stopIt()
          Stop Web-4-All and return it to its initial state.
static void stopWeb4All()
          Static method to shut down the shared instance of Web-4-All.
 boolean thirdPartyAppExists(java.lang.String inAppID)
          Utility to determine if a third party application/technology exists on the system.
 void updateLanguagePref(java.util.Locale inLocale)
          Inform the Web-4-All system of a change in language preference.
 void updateStatusMessage(java.lang.String inMessage)
          Alter the current status message within the main window.
 int updateStatusMessage(java.lang.String inMessage, int inMessageType)
          Show either an alert modal dialogue or a confirmation modal dialogue containing the given message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THIRD_PARTY_FOLDER

public static final java.lang.String THIRD_PARTY_FOLDER
Base name of the 3rd party folder. This is not a full or partial path; it is just the name of the folder.

See Also:
Constant Field Values

XMLNS_VAL

public static final java.lang.String XMLNS_VAL
Key to the xml schema namespace.

See Also:
Constant Field Values

XMLNS_XSI_VAL

public static final java.lang.String XMLNS_XSI_VAL
Key to the xml instance document namespace.

See Also:
Constant Field Values

SCHEMA_LOCATION_VAL

public static final java.lang.String SCHEMA_LOCATION_VAL
Key for fetching the location of the schema.

See Also:
Constant Field Values

LIP_CONTENTYPE_LOCATION_VAL

public static final java.lang.String LIP_CONTENTYPE_LOCATION_VAL
Key for fetching the location of the LIP Contentype schema.

See Also:
Constant Field Values

SCHEMA_VERSION_VAL

public static final java.lang.String SCHEMA_VERSION_VAL
Key for fetching the version of the schema.

See Also:
Constant Field Values

CONTEXT_ID_VAL

public static final java.lang.String CONTEXT_ID_VAL
Key for fetching the value of the context ID.

See Also:
Constant Field Values

YES_BUTTON_CMD

public static final java.lang.String YES_BUTTON_CMD
Action command for the "Yes" push button in an alert.

See Also:
Constant Field Values

NO_BUTTON_CMD

public static final java.lang.String NO_BUTTON_CMD
Action command for the "No" push button in an alert.

See Also:
Constant Field Values

OK_BUTTON_CMD

public static final java.lang.String OK_BUTTON_CMD
Action command for the "Ok" push button.

See Also:
Constant Field Values

LOCALE_PROP

public static final java.lang.String LOCALE_PROP
For notifying property change listeners that the locale has changed.

See Also:
Constant Field Values

MAIN_WINDOW_PROP

public static final java.lang.String MAIN_WINDOW_PROP
For notifying property change listeners that the main window has been allocated.

See Also:
Constant Field Values

SPLASH_HEIGHT

public static final int SPLASH_HEIGHT
Height of the splash screen.

See Also:
Constant Field Values

SPLASH_WIDTH

public static final int SPLASH_WIDTH
Width of the splash screen.

See Also:
Constant Field Values

DEBUG

protected static final boolean DEBUG
Static flag to control the output of debug information.

See Also:
Constant Field Values
Constructor Detail

ControlHub

public ControlHub(java.lang.String inDirectory)
Constructor -- must initialize with the path to the directory from which the Web-4-All system was launched.

Parameters:
inDirectory - Full path to Web4All's home directory.
Method Detail

startWeb4All

public static ControlHub startWeb4All(java.lang.String inDirectory,
                                      PrefsLoaderAPI inPrefsLoader)
Allocate a copy of the Control Hub, and launch the Web-4-All system.

Parameters:
inDirectory - Full path to the directory that Web-4-All is in.
inPrefsLoader - The preferences loader -- implements interface PrefsLoaderAPI.
See Also:
stopWeb4All(), PrefsLoaderAPI

stopWeb4All

public static void stopWeb4All()
Static method to shut down the shared instance of Web-4-All. This will also close and dipose of the main window, and set the shared instance to null.

See Also:
startWeb4All(String,PrefsLoaderAPI)

getSharedInstance

public static ControlHub getSharedInstance()
Acquire the shared instance of the ControlHub, if any.

Returns:
The shared instance, if there is one; null otherwise.
See Also:
getSharedInstance(boolean,String)

getSharedInstance

public static ControlHub getSharedInstance(boolean inCreateFlag,
                                           java.lang.String inDirectory)
Acquire the shared instance of ControlHub. If there is no shared instance, this will allocate one if requested.

Parameters:
inCreateFlag - If true, and no shared instance of ControlHub exists, then this will create one. If false and there is no shared instance, then none will be created.
inDirectory - Full path to Web4All's home directory. Used only if inCreateFlag is true.
Returns:
The shared instance, if there is one, or one was created; null otherwise.
See Also:
getSharedInstance(), startWeb4All(String,PrefsLoaderAPI)

showOptionDialog

public static int showOptionDialog(java.awt.Component inParent,
                                   java.lang.String inMessage,
                                   java.lang.String inTitle,
                                   int inMessageType)
Utility for showing a confirmation dialogue or an alert. This is a wrapper around JOptionPane.showOptionDialog() where the Control Hub's custom option buttons are used instead of the JOptionPane default set. DO NOT use this if the dialogue is to update the status message -- use one of the updateStatusMessage() methods instead.

Parameters:
inParent - The Component whose Window will be the parent of the JDialog presented.
inMessage - The status message itself. If null or empty, any current status will be simply erased.
inTitle - The title for the JDialog.
inMessageType - One of JOptionPane.ERROR_MESSAGE, or JOptionPane.QUESTION_MESSAGE. If the former, JOptionPane.showMessageDialog() is used. If the latter, JOptionPane.showConfirmationDialog() is used.
Returns:
If a confirmation dialogue is presented, the return value is either JOptionPane.YES_OPTION or JOptionPane.NO_OPTION.
See Also:
updateStatusMessage(String), updateStatusMessage(String,int)

getGlobalProperty

public java.lang.String getGlobalProperty(java.lang.String inKey)
                                   throws java.util.MissingResourceException
Retrieve a Web-4-All global property value.

Parameters:
inKey - The global property name.
Returns:
The property value.
Throws:
java.util.MissingResourceException

kickIt

public java.lang.String kickIt(java.lang.String inPrefs,
                               PrefsLoaderAPI inPrefsLoader)
The main entry point that a preferences loader uses to engage the control hub.

Parameters:
inPrefs - The XML preferences as a String.
inPrefsLoader - The preferences loader -- implements interface PrefsLoaderAPI.
Returns:
Either new XML preferences, or a modified version.
See Also:
startWeb4All(String,PrefsLoaderAPI), stopIt(), PrefsLoaderAPI

stopIt

public void stopIt()
Stop Web-4-All and return it to its initial state. If possible, the work station is re-configured to its default state. Internal data is flushed. The only method a caller should invoke after stopIt() is kickIt().

See Also:
kickIt(String,PrefsLoaderAPI), stopWeb4All()

updateStatusMessage

public void updateStatusMessage(java.lang.String inMessage)
Alter the current status message within the main window. Whatever is passed in, including null, will replace any current status message.

Parameters:
inMessage - The status message itself. If null or empty, any current status is erased.
See Also:
updateStatusMessage(String,int)

updateStatusMessage

public int updateStatusMessage(java.lang.String inMessage,
                               int inMessageType)
Show either an alert modal dialogue or a confirmation modal dialogue containing the given message. The message is also used to update the status message in the main window.

Parameters:
inMessage - The status message itself. If null or empty, any current status is erased.
inMessageType - One of JOptionPane.ERROR_MESSAGE, or JOptionPane.QUESTION_MESSAGE. If the former, JOptionPane.showMessageDialog() is used. If the latter, JOptionPane.showConfirmationDialog() is used.
Returns:
If a confirmation dialogue is presented, the return value is either JOptionPane.YES_OPTION or JOptionPane.NO_OPTION.
See Also:
showOptionDialog(Component,String,String,int), updateStatusMessage(String)

setLocale

public void setLocale(java.util.Locale inLocale)
Inform the Web-4-All system of a change in language preference, including notifying any property change listeners.

Parameters:
inLocale - The new Locale.
See Also:
updateLanguagePref(Locale), getLocale()

updateLanguagePref

public void updateLanguagePref(java.util.Locale inLocale)
Inform the Web-4-All system of a change in language preference.

Parameters:
inLocale - The new Locale.
See Also:
setLocale(Locale), getLocale()

getLocale

public java.util.Locale getLocale()
Return current Locale in use by Web-4-All. This can be the user's preferred locale. If no preferences set, this will default to the system locale.

Returns:
The current Locale.

thirdPartyAppExists

public boolean thirdPartyAppExists(java.lang.String inAppID)
Utility to determine if a third party application/technology exists on the system.

Parameters:
inAppID - The application ID whose executable is checked for exsistence.
Returns:
true if the executable associated with inAppID is on the system; false otherwise.

iconifySplashScreen

protected void iconifySplashScreen()
Minimize the main window.


deiconifySplashScreen

protected void deiconifySplashScreen()
Deiconify the main window.


showSplashScreen

protected void showSplashScreen()
Show the main window. As a side effect, the main window is created, if it does not exist.


makePrefsDom

protected void makePrefsDom(java.lang.String inPrefsStr)
Parse the given XML ACCLIP string into a DOM. The DOM is stored internally.

Parameters:
inPrefsStr - The preferences as a String.

getPrefElementName

public java.lang.String getPrefElementName(java.lang.String inKey)
                                    throws java.util.MissingResourceException
Retrieve an ACCLIP preference element name given its key. This can also be used to retrieve some ACCLIP attribute names. The keys are defined in the Web4AllConstants interface.

Parameters:
inKey - The key to the element's name.
Returns:
The element name, if found.
Throws:
java.util.MissingResourceException
See Also:
Web4AllConstants, getPrefElementNameKey(String)

getPrefElementNameKey

public java.lang.String getPrefElementNameKey(java.lang.String inElementName)
                                       throws java.util.MissingResourceException
Retrieve a preference element name's key, given its ACCLIP name. The keys are defined in the Web4AllConstants interface.

Parameters:
inElementName - The name of an element.
Returns:
The element name's key, if found.
Throws:
java.util.MissingResourceException
See Also:
Web4AllConstants, getPrefElementName(String)

get3rdPartyFolderUrl

protected java.net.URL get3rdPartyFolderUrl()
Retrieve the URL to the third party folder.

Returns:
The URL to the third party folder, or null, if unspecified.

getHomeDirectory

public java.lang.String getHomeDirectory()
Retrieve the full path to the home directory. This is the directory in which Web-4-All resides.

Returns:
The full path to the home directory, as a String.

get3rdPartyAppIds

public java.util.Vector get3rdPartyAppIds(java.lang.String inAppType)
Given an application type, return a list of application IDs for that type. This provides identifiers of the technologies available on the system that have declared themselves as of a certain type. The return value is a clone of the types held internatlly.

Parameters:
inAppType - The application type key (String).
Returns:
A Vector of application ID's that correspond to the given type, or null if no technology is of the given type.

get3rdPartyAppTypes

public java.util.Vector get3rdPartyAppTypes(java.lang.String inAppID)
                                     throws java.util.MissingResourceException
Given an application ID, return the application type codes for that ID, if any. This is done by searching the application types for that ID, and, if it is found, adding the type to the returned Vector. If none are found, a MissingResourceException is thrown.

Parameters:
inAppID - The application ID (String).
Returns:
The application types as a Vector of String.
Throws:
java.util.MissingResourceException

get3rdPartyPrefsClass

public java.lang.String get3rdPartyPrefsClass(java.lang.String inAppID)
                                       throws java.util.MissingResourceException
Given an application ID, return the class name of the preferences wizard plug-in for that application, if any. This is done by first looking up the properties for that ID, and, if they are found, looking up the preferences property within. If either step fails, a MissingResourceException is thrown.

Parameters:
inAppID - The application ID (String).
Returns:
The full name of the wizard class as a String.
Throws:
java.util.MissingResourceException - Unrecognized ID, or no preferences wizard plug-in for that ID.
See Also:
ThirdPartyPrefsWizard

get3rdPartyConfigClass

public java.lang.String get3rdPartyConfigClass(java.lang.String inAppID)
                                        throws java.util.MissingResourceException
Given an application ID, return the class name of the SetterLauncher for that application, if any. This is accomplished by first looking up the properties for the given ID, and, if they are found, looking up the configuration property within. If either step fails, a MissingResourceException is thrown.

Parameters:
inAppID - The application ID (String).
Returns:
The full name of the configuration plug-in class as a String.
Throws:
java.util.MissingResourceException - Unrecognized ID, or no configuration plug-in for that ID.
See Also:
SetterLauncher

get3rdPartyExecutable

public java.lang.String get3rdPartyExecutable(java.lang.String inAppID)
                                       throws java.util.MissingResourceException
Given an application ID, return the full path to the exectuable for that application, if any. This is done by first looking up the properties for the given ID, and, if they are found, looking up the executable property within. If either step fails, a MissingResourceException is thrown.

Parameters:
inAppID - The application ID (String).
Returns:
The full name of the configurator class as a String.
Throws:
java.util.MissingResourceException - Unrecognized ID, or no executable for that ID.

get3rdPartyIni

public java.lang.String get3rdPartyIni(java.lang.String inAppID)
                                throws java.util.MissingResourceException
Given an application ID, return the full path to the initialization file for that application. This is done by first looking up the properties for that ID, and, if they are found, looking up the ".ini" property. If either step fails, a MissingResourceException is thrown.

Parameters:
inAppID - The application ID (String).
Returns:
The path to the ".ini" file as a String.
Throws:
java.util.MissingResourceException - Unrecognized ID, or no ".ini" property for that ID.

get3rdPartyFullProductName

public java.lang.String get3rdPartyFullProductName(java.lang.String inAppID)
Given an application ID, retrieve the user-friendly string that provides a name for that application. This is done by first looking up the properties for that ID, and, if they are found, looking up the product name property within. If either step fails, a MissingResourceException is thrown.

Parameters:
inAppID - The application ID (String).
Returns:
The product name as a String.
Throws:
java.util.MissingResourceException - Unrecognized ID, or no full product name for that ID.

get3rdPartyProperties

public java.util.ResourceBundle get3rdPartyProperties(java.lang.String inAppID)
                                               throws java.util.MissingResourceException
Given an application ID, return all of its properties. These are read-only, and is provided in order that third parties have access to whatever extra properties they placed into their properties file.

Parameters:
inAppID - The application ID (String).
Returns:
The ResourceBundle requested; throws an exception if not found.
Throws:
java.util.MissingResourceException - Unknown ID.

load3rdPartyProps

protected void load3rdPartyProps()
Find and load all of the plug-in properties files.


lastChance3rdPartyPrefs

public org.w3c.dom.Element lastChance3rdPartyPrefs(java.lang.String appType,
                                                   java.util.Vector appsNotLaunched)
Attempt to find at least one technology that matches the given type. Use this because other known applications do not exist on the system, and you are trying to find one of the correct type.

This takes an application type and a list of applications. It returns the first application of that type that is not in the list and that exists on the system. Otherwise, it return null. The application list is a list of application ID's. The return value is an "application" Element as defined by the ACCLIP. This element is created and placed within a new mini-document that is separate from the user's main preferences document.

Parameters:
appType - The application type.
appsNotLaunched - A vector containing appID's of applications that are not on the system.
Returns:
A third party application element for a technology that does exist on the system. (e.g., <application name="EpiScreen" priority="1"/>)

savePrefs

public void savePrefs()
Write the preferences, if any, back to the storage medium. The Preferences Loader is invoked to do the actual work.

See Also:
PrefsLoaderAPI

flushLookupTables

protected void flushLookupTables()
Flush the "appType" and "appID" lookup tables, and their contents.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener inListener)
Allow PropertyChangeListeners to add themselves.

Parameters:
inListener - The PropertyChangeListener to add.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener inListener)
Allow PropertyChangeListeners to remove themselves.

Parameters:
inListener - The PropertyChangeListener to remove.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handle button presses on the splash screen. If the the edit button is pressed, pass control to the Preferences Wizard Manager. If the cancel button is pressed, pass control to the Configuration Manager, either to cancel the current configuration, or configure it with the currrent preferences. Finally, handle a shutdown command by passing control to the preference loader to clean up and exit.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - ActionEvent that called us.

run

public void run()
Run the built-in preferences wizard. Because the wizard is modal, it must execute in a separate thread when invoked from a user interface button press. The sequence of events are:
  1. the Preference Wizard Manager presents the built-in preference wizard,
  2. the new preferences are written via the Preferences Loader,
  3. the Configuration Manager is invoked to configure the system with the new preferences.

Specified by:
run in interface java.lang.Runnable
See Also:
actionPerformed(ActionEvent)

initPWM

protected void initPWM()
Utility to create the Preferences Wizard Manager and it's main window.


main

public static void main(java.lang.String[] args)
A main for running the Web-4-All system without using a smart card -- mostly for debugging. It has two modes of operation. In both modes, it reads/writes ACCLIP preferences to and from the local hard drive.

For debugging the Web-4-All system, it takes all of its information from the command line, optionally using the low-memory binding version of the preferences, optionally displaying the properties of the specified configuration plug-in and optionally using the name of the given file as the location of the preferences. If the latter is not provided, the file name defaults to "prefs.xml".

In "menu" mode, all the other arguments are ignored, a file menu is built and this behaves like a traditional GUI app. However, only the preferences wizard is ever engaged to create/read/edit/save preferences files.

Which mode is used depends on the contents of Web4All.properties which can specify a PrefsLoaderAPI object to use to load/save the preferences. Currently, if the class specified matches the MenuPrefsLoader, then Web-4-All is launched in menu mode. Otherwise, Web-4-All is launched in debug mode.

Parameters:
args - usage: java ca.utoronto.atrc.web4all.ControlHub [-lowmem] [-appID id] [prefs_file]
  • lowmem: use low memory binding
  • appID: display information about the plug-in for the application identified by appID
  • prefs_file: name of the disk file to read/write

createXMLString

public static java.lang.String createXMLString(java.lang.String inFileName)
Utility for reading an XML file into memory. The contents of the file are not parsed, but simply retrieved and stored as a java.lang.String.

Parameters:
inFileName - The file name. This can be a full or relative path to the file
Returns:
The contents of the file as a String.

Web-4-All v3.00 Plug-in API Specification