gui.help
Class AbstractHelpFileStorageManager

java.lang.Object
  extended by gui.help.AbstractHelpFileStorageManager
Direct Known Subclasses:
JARHelpFileStorageManager, LocalHelpFileStorageManager

public abstract class AbstractHelpFileStorageManager
extends java.lang.Object

A generic interface that allows the JAPModel to maintain a consistent file storage layer when the path for external help files changes. It also allows to obtain information about storage processes via the observer pattern.

Author:
Simon Pecher

Field Summary
static java.lang.String HELP_DIR_EXISTS
           
static java.lang.String HELP_FOLDER
           
static java.lang.String HELP_INVALID_NOREAD
           
static java.lang.String HELP_INVALID_NOWRITE
           
static java.lang.String HELP_INVALID_NULL
           
static java.lang.String HELP_INVALID_PATH_NOT_EXISTS
           
static java.lang.String HELP_JONDO_EXISTS
           
static java.lang.String HELP_NESTED
           
static java.lang.String HELP_NO_DIR
           
static java.lang.String HELP_VALID
           
static java.lang.String HELP_VIRTUAL
           
private  java.util.Hashtable m_hashLocalisedHelpDirs
           
 
Constructor Summary
AbstractHelpFileStorageManager()
           
 
Method Summary
abstract  boolean ensureMostRecentVersion(java.lang.String helpPath)
           
 boolean extractHelpFiles(java.lang.String a_extractionPath)
           
 java.lang.String getInitPath()
           
 java.lang.String getLocalisedHelpDir()
           
abstract  java.util.Observable getStorageObservable()
          returns an observable object which allows ViewObjects to display storage processes, i.e.
abstract  boolean handleHelpPathChanged(java.lang.String oldHelpPath, java.lang.String newHelpPath, boolean a_bIgnoreExistingHelpDir)
          Performs the specific file storage operation to maintain a consistent file storage state when the help path changes
abstract  boolean helpInstallationExists(java.lang.String helpPath)
           
abstract  java.lang.String helpPathValidityCheck(java.lang.String absolutePath, boolean a_bIgnoreExistingHelpDir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HELP_INVALID_NULL

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

HELP_INVALID_PATH_NOT_EXISTS

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

HELP_INVALID_NOWRITE

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

HELP_INVALID_NOREAD

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

HELP_NO_DIR

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

HELP_DIR_EXISTS

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

HELP_JONDO_EXISTS

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

HELP_NESTED

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

HELP_VIRTUAL

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

HELP_VALID

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

m_hashLocalisedHelpDirs

private java.util.Hashtable m_hashLocalisedHelpDirs

HELP_FOLDER

public static final java.lang.String HELP_FOLDER
See Also:
Constant Field Values
Constructor Detail

AbstractHelpFileStorageManager

public AbstractHelpFileStorageManager()
Method Detail

getLocalisedHelpDir

public final java.lang.String getLocalisedHelpDir()

extractHelpFiles

public boolean extractHelpFiles(java.lang.String a_extractionPath)

handleHelpPathChanged

public abstract boolean handleHelpPathChanged(java.lang.String oldHelpPath,
                                              java.lang.String newHelpPath,
                                              boolean a_bIgnoreExistingHelpDir)
Performs the specific file storage operation to maintain a consistent file storage state when the help path changes

Parameters:
oldHelpPath - the path of the help files before the change.
newHelpPath - the path where the help files shall be installed
a_bIgnoreExistingHelpDir - true if any existing directory named help will be removed in the installation folder
Returns:
true if the storage layer could be maintained consistent, false otherwise. In the latter case the file storage layer must be in the same state as if there has not been a change at all.

helpPathValidityCheck

public abstract java.lang.String helpPathValidityCheck(java.lang.String absolutePath,
                                                       boolean a_bIgnoreExistingHelpDir)

getStorageObservable

public abstract java.util.Observable getStorageObservable()
returns an observable object which allows ViewObjects to display storage processes, i.e. to display the file installation progress in a JProgressBar

Returns:
an observable object from which to obtain storage process informations or null if the manager has no such object associated with it.

ensureMostRecentVersion

public abstract boolean ensureMostRecentVersion(java.lang.String helpPath)

helpInstallationExists

public abstract boolean helpInstallationExists(java.lang.String helpPath)

getInitPath

public java.lang.String getInitPath()