com.ibm.dse.base
Class Settings

java.lang.Object
  |
  +--com.ibm.dse.base.Settings

public class Settings
extends java.lang.Object

This class holds the values of all the external data. The data can come from the .INI file or from the HTML parameters of the initial applet and is stored in a KeyedCollection.


Field Summary
static java.lang.String COMPOSED_TAG
           
static java.lang.String FILE
           
static java.lang.String iniPathAndFileName
           
static int initialBufferSize
           
static java.lang.String MEMORY
           
static java.lang.String modularityDefaultValue
           
static java.lang.String MODULARITYGROUPED
           
static java.lang.String MODULARITYMIXED
           
static java.lang.String MODULARITYSPLIT
           
static java.lang.String sgmlFullPath
           
static boolean showProgressBar
           
 
Constructor Summary
Settings()
           
 
Method Summary
static void checkForOptionalExternalFiles()
          This method will check DSE.INI to see if processes, views, or typed data have been externalized.
static java.lang.String createFullPath(java.lang.String initialPath, java.lang.String sgmlPath, java.lang.String separator)
          Creates the full path
static java.lang.String createFullPathForURL(java.lang.String initialPath, java.lang.String sgmlPath, java.lang.String separator)
          Creates the full path for URL
static ExternalizerAccessor getExternalizerAccessor(java.lang.String kind)
          This method will create an instance of the ExternalizerAccessor for a particular "kind" of externalizer (processor, view, etc).
static Hashtable getExternalizerAccessors()
          Returns the externalizer accessors
static java.lang.String getIniFileName()
          Returns the title (name) of the INI file (without its path) For example: "DSE.INI"
static java.lang.String getIniPath()
          Returns the path of the INI file (without its file name) For example: "C:\DSE\"
static java.lang.String getIniPathAndFileName()
          Returns the path and file name of the INI file.
static java.lang.String getModularityValue()
          Gets the modularity value.
static KeyedCollection getSettings()
          Gets the settings.
static java.lang.String getSgmlContextFile()
          Gets the SGML Contexts file.
static java.lang.String getSgmlDataFile()
          Gets the SGML Data file.
static java.lang.String getSgmlFormatFile()
          Gets the SGML Formats file.
static java.lang.String getSgmlOperationFile()
          Gets the SGML Operations file.
static java.lang.String getSgmlPath()
          Returns the path to entity files.
static java.lang.String getSgmlProcessorFile()
          Gets the SGML Processor file.
static java.lang.Object[] getSgmlSelfDefinedOperation(java.lang.String aSelfDefinedOperationId)
          Gets the SGML self-defined operation file name corresponding to an operation id.
static java.lang.Object[] getSgmlSelfDefinedProcessor(java.lang.String aSelfDefinedProcessorId)
          Gets the SGML self-defined processor file name corresponding to a processor id.
static java.lang.Object[] getSgmlSelfDefinedView(java.lang.String aSelfDefinedViewId)
          Gets the SGML self-defined view file name corresponding to a view id.
static java.lang.String getSgmlServiceFile()
          Gets the SGML Services file.
static java.lang.String getSgmlTypeFile()
          Gets the SGML Typed Data file.
static java.lang.String getSgmlViewFile()
          Gets the SGML Views file.
static Vector getSimpleTags(java.lang.String aFileName, java.lang.String aKindOfFile)
          Returns the list of the simple tags used in each kind of file as an Vector.
static Hashtable getTagClassTableForContexts()
          Gets the table of tags for Contexts.
static Hashtable getTagClassTableForData()
          Gets the table of tags for Data.
static Hashtable getTagClassTableForFormats()
          Gets the table of tags for Formats.
static Hashtable getTagClassTableForOperations()
          Gets the table of tags for Operations.
static Hashtable getTagClassTableForProcessors()
          Gets the table of tags for Processors.
static Hashtable getTagClassTableForServices()
          Gets the table of tags for Services.
static Hashtable getTagClassTableForTypes()
          Gets the table of tags for Types.
static java.lang.String getTemporalFile()
          Gets a temporary file.
static java.lang.String getTID()
          Gets the TID.
static void initializeExternalizers()
          Initializes the externalizers.
static void initializeExternalizers(java.lang.String option)
          This method will read into memory all the generic external files and then link all of their references.
static void initializeExternalizersFromJar(java.lang.String option)
          This method will initialize the externalizers by reading from JAR files.
static void initializeExternalizersNotFromJar(java.lang.String option)
          This method will initialize the externalizers by reading them from text files.
static void initializeSplitExternalizers()
          This method must only be called when the modularity is "split".
static boolean isProcessorIncluded()
          This method returns the value of 'processorIncluded'
static boolean isTypeIncluded()
          This method returns the value of 'typeIncluded'
static boolean isViewIncluded()
          This method returns the value of 'viewIncluded'
static void linkReferences()
          This method will link all the references in all the external files to their correct tags.
static boolean readFromJar()
          Checks whether the contents came from a JAR.
static void reinitializeContext(java.lang.String option)
          Reinitializes the Contexts.
static void reinitializeData(java.lang.String option)
          Reinitializes the Data.
static void reinitializeFormat(java.lang.String option)
          Reinitializes the Formats.
static void reinitializeOperation(java.lang.String option)
          Reinitializes the Operations.
static void reinitializeProcessor(java.lang.String option)
          Reinitializes the Processors.
static void reinitializeService(java.lang.String option)
          Reinitializes the Services.
static void reinitializeType(java.lang.String option)
          Reinitializes the Types.
static void reinitializeView(java.lang.String option)
          Reinitializes the Views.
static void reset()
          Initializes the DSE.INI.
static void reset(java.io.BufferedInputStream aStream)
          Reads the .INI file and initializes the Settings class variable with all the information.
static void reset(java.lang.String initialPath)
          Reads the .INI file and then initializes the Setting class variables based on the file.
static void reset(java.net.URL aURL)
          Reads the .INI file and then initializes the Setting class variables based on the file.
static void resetExternalizers()
          Resets all the initializers.
static void resetSettings()
          Resets all the settings definitions.
static void resetSettings(java.util.Enumeration listTagId)
          Reset all the elements which appear in the enumeration.
static void resetSettings(java.lang.String aTagId)
          Resets the specified setting element located at first level inside the settings keyed collection.
protected static void resetSettings(java.lang.String aTagId, KeyedCollection newSettings)
          Resets the definition of the setting entity with id equals to aTagId.
static void resetTagClassTables()
          Initializes the tables that say what class is instantiated with every tag.
static void set(java.lang.String initialPath)
          Reads an additional .INI file.
static void setSettings(KeyedCollection aKeyedCollection)
          Sets the settings.
static void setTID(java.lang.String aTID)
          Sets the TID in the settings KeyedCollection.
static void setupObjectCache()
          This method will use the external parameters: initialization.enableFormatsCache initialization.enableOperationsCache They will be used to setup the cache for formats and operations.
static void showProgressBar(boolean aBoolean)
          Shows the progress bar if aBoolean is true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEMORY

public static final java.lang.String MEMORY

FILE

public static final java.lang.String FILE

MODULARITYGROUPED

public static final java.lang.String MODULARITYGROUPED

MODULARITYSPLIT

public static final java.lang.String MODULARITYSPLIT

MODULARITYMIXED

public static final java.lang.String MODULARITYMIXED

COMPOSED_TAG

public static java.lang.String COMPOSED_TAG

modularityDefaultValue

public static java.lang.String modularityDefaultValue

sgmlFullPath

public static java.lang.String sgmlFullPath

iniPathAndFileName

public static java.lang.String iniPathAndFileName

initialBufferSize

public static int initialBufferSize

showProgressBar

public static boolean showProgressBar
Constructor Detail

Settings

public Settings()
Method Detail

checkForOptionalExternalFiles

public static void checkForOptionalExternalFiles()
This method will check DSE.INI to see if processes, views, or typed data have been externalized. This method checks only for an entry corresponding to 'files.process', 'files.view' and 'files.typed'. If there is no entry for one of these files, then it is assumed that this entity has not been externalized.

createFullPath

public static java.lang.String createFullPath(java.lang.String initialPath,
                                              java.lang.String sgmlPath,
                                              java.lang.String separator)
Creates the full path
Parameters:
iniPath - java.lang.String
sgmlPath - java.lang.String
separator - java.lang.String
Returns:
java.lang.String

createFullPathForURL

public static java.lang.String createFullPathForURL(java.lang.String initialPath,
                                                    java.lang.String sgmlPath,
                                                    java.lang.String separator)
Creates the full path for URL
Parameters:
iniPath - java.lang.String
sgmlPath - java.lang.String
separator - java.lang.String
Returns:
java.lang.String

getExternalizerAccessor

public static ExternalizerAccessor getExternalizerAccessor(java.lang.String kind)
                                                    throws DSEObjectNotFoundException,
                                                           java.io.IOException
This method will create an instance of the ExternalizerAccessor for a particular "kind" of externalizer (processor, view, etc). The externalizer accessor is used simply to create a new instance of a particualr kind of externalizer (this reads in the external file) and then sets the appropriate externalizable class to point to it. The externalizer accessors are needed in order to break package dependencies

getExternalizerAccessors

public static Hashtable getExternalizerAccessors()
Returns the externalizer accessors

getIniFileName

public static java.lang.String getIniFileName()
Returns the title (name) of the INI file (without its path) For example: "DSE.INI"
Returns:
java.lang.String the title

getIniPath

public static java.lang.String getIniPath()
Returns the path of the INI file (without its file name) For example: "C:\DSE\"
Returns:
java.lang.String the title

getIniPathAndFileName

public static java.lang.String getIniPathAndFileName()
Returns the path and file name of the INI file. The method first checks to see if the iniPathAndFileName field has a value, and returns it, if not null. Next it starts looking for the DSE.INI file in the current directory. If it does not find the file, the method tries using the DSE environment variable. If it still does not find the file, it tries with the hardcoded path: C:/DSE. If you want to make a environment variable available to your application, you can run your application using the following as an example: java -DDSE=C:\MyPath MyStartingClass
Returns:
java.lang.String

getModularityValue

public static java.lang.String getModularityValue()
Gets the modularity value.
Returns:
java.lang.String

getSettings

public static KeyedCollection getSettings()
Gets the settings.
Returns:
com.ibm.dse.base.KeyedCollection

getSgmlContextFile

public static java.lang.String getSgmlContextFile()
                                           throws DSEObjectNotFoundException
Gets the SGML Contexts file.
Returns:
java.lang.String

getSgmlDataFile

public static java.lang.String getSgmlDataFile()
                                        throws DSEObjectNotFoundException
Gets the SGML Data file.
Returns:
java.lang.String

getSgmlFormatFile

public static java.lang.String getSgmlFormatFile()
                                          throws DSEObjectNotFoundException
Gets the SGML Formats file.
Returns:
java.lang.String

getSgmlOperationFile

public static java.lang.String getSgmlOperationFile()
                                             throws DSEObjectNotFoundException
Gets the SGML Operations file.
Returns:
java.lang.String

getSgmlPath

public static java.lang.String getSgmlPath()
                                    throws DSEObjectNotFoundException
Returns the path to entity files.
Returns:
java.lang.String

getSgmlProcessorFile

public static java.lang.String getSgmlProcessorFile()
                                             throws DSEObjectNotFoundException
Gets the SGML Processor file.
Returns:
java.lang.String

getSgmlSelfDefinedOperation

public static java.lang.Object[] getSgmlSelfDefinedOperation(java.lang.String aSelfDefinedOperationId)
Gets the SGML self-defined operation file name corresponding to an operation id.
Parameters:
aSelfDefinedOperationId - java.lang.String
Returns:
java.lang.Object[] Object[0] => Boolean indicating whether the self-defined operation is defined in the .INI file or not Object[1] => file name of the self-defined operation Object[2] => path of the self-defined operation file

getSgmlSelfDefinedProcessor

public static java.lang.Object[] getSgmlSelfDefinedProcessor(java.lang.String aSelfDefinedProcessorId)
Gets the SGML self-defined processor file name corresponding to a processor id.
Parameters:
aSelfDefinedProcessorId - java.lang.String
Returns:
java.lang.Object[] Object[0] => Boolean indicating whether the self-defined processor is defined in the .INI file or not Object[1] => file name of the self-defined processor Object[2] => path of the self-defined processor file

getSgmlSelfDefinedView

public static java.lang.Object[] getSgmlSelfDefinedView(java.lang.String aSelfDefinedViewId)
Gets the SGML self-defined view file name corresponding to a view id.
Parameters:
aSelfDefinedViewId - java.lang.String
Returns:
java.lang.Object[] Object[0] => Boolean indicating whether the self-defined view is defined in the .INI file or not Object[1] => file name of the self-defined view Object[2] => path of the self-defined view file

getSgmlServiceFile

public static java.lang.String getSgmlServiceFile()
                                           throws DSEObjectNotFoundException
Gets the SGML Services file.
Returns:
java.lang.String

getSgmlTypeFile

public static java.lang.String getSgmlTypeFile()
                                        throws DSEObjectNotFoundException
Gets the SGML Typed Data file.
Returns:
java.lang.String

getSgmlViewFile

public static java.lang.String getSgmlViewFile()
                                        throws DSEObjectNotFoundException
Gets the SGML Views file.
Returns:
java.lang.String

getSimpleTags

public static Vector getSimpleTags(java.lang.String aFileName,
                                   java.lang.String aKindOfFile)
                            throws java.io.IOException,
                                   DSEObjectNotFoundException
Returns the list of the simple tags used in each kind of file as an Vector.
Parameters:
boolean - isInitiallizationFile
aFileName - java.lang.String
aKindOfFile - java.lang.String
Returns:
java.util.Vector
Throws:
java.io.IOException -  
DSEObjectNotFoundException -  

getTagClassTableForContexts

public static Hashtable getTagClassTableForContexts()
Gets the table of tags for Contexts.
Returns:
Hashtable

getTagClassTableForData

public static Hashtable getTagClassTableForData()
Gets the table of tags for Data.
Returns:
java.util.Hashtable

getTagClassTableForFormats

public static Hashtable getTagClassTableForFormats()
Gets the table of tags for Formats.
Returns:
Hashtable

getTagClassTableForOperations

public static Hashtable getTagClassTableForOperations()
Gets the table of tags for Operations.
Returns:
Hashtable

getTagClassTableForProcessors

public static Hashtable getTagClassTableForProcessors()
Gets the table of tags for Processors.
Returns:
Hashtable

getTagClassTableForServices

public static Hashtable getTagClassTableForServices()
Gets the table of tags for Services.
Returns:
Hashtable

getTagClassTableForTypes

public static Hashtable getTagClassTableForTypes()
Gets the table of tags for Types.
Returns:
Hashtable

getTemporalFile

public static java.lang.String getTemporalFile()
Gets a temporary file.
Returns:
java.lang.String

getTID

public static java.lang.String getTID()
Gets the TID.
Returns:
java.lang.String

initializeExternalizers

public static void initializeExternalizers()
                                    throws java.io.IOException,
                                           DSEObjectNotFoundException
Initializes the externalizers.

initializeExternalizers

public static void initializeExternalizers(java.lang.String option)
                                    throws java.io.IOException,
                                           DSEObjectNotFoundException
This method will read into memory all the generic external files and then link all of their references. However, this method will not read into memory any self defined files. The FILE option has been deprecated as of the NIHOA release. Even if FILE option is requested, the MEMORY option will be used.

initializeExternalizersFromJar

public static void initializeExternalizersFromJar(java.lang.String option)
                                           throws java.io.IOException,
                                                  DSEObjectNotFoundException
This method will initialize the externalizers by reading from JAR files. The externalizer accessors will be used if they exist. Otherwise the hard coded externalizers will be used.

initializeExternalizersNotFromJar

public static void initializeExternalizersNotFromJar(java.lang.String option)
                                              throws java.io.IOException,
                                                     DSEObjectNotFoundException
This method will initialize the externalizers by reading them from text files. The externalizer accessors will be used if they exist. Otherwise the hard coded externalizers will be used.

initializeSplitExternalizers

public static void initializeSplitExternalizers()
                                         throws java.io.IOException,
                                                DSEObjectNotFoundException
This method must only be called when the modularity is "split". It will initialize all the externalizers to be empty (not null). The externalizer accessors will be used if they exist. Otherwise the hard coded externalizers will be used.

isProcessorIncluded

public static boolean isProcessorIncluded()
This method returns the value of 'processorIncluded'

isTypeIncluded

public static boolean isTypeIncluded()
This method returns the value of 'typeIncluded'

isViewIncluded

public static boolean isViewIncluded()
This method returns the value of 'viewIncluded'

linkReferences

public static void linkReferences()
                           throws java.io.IOException,
                                  DSEObjectNotFoundException
This method will link all the references in all the external files to their correct tags. For example: all refData tags will be replaced with the real tags they are referencing. If Typed Data is externalized then this method will create and link all the Types, Property Descriptors, Converters, and Validators.

readFromJar

public static boolean readFromJar()
Checks whether the contents came from a JAR.
Returns:
boolean

reinitializeContext

public static void reinitializeContext(java.lang.String option)
                                throws java.io.IOException,
                                       DSEObjectNotFoundException
Reinitializes the Contexts.

reinitializeData

public static void reinitializeData(java.lang.String option)
                             throws java.io.IOException,
                                    DSEObjectNotFoundException
Reinitializes the Data.

reinitializeFormat

public static void reinitializeFormat(java.lang.String option)
                               throws java.io.IOException,
                                      DSEObjectNotFoundException
Reinitializes the Formats.

reinitializeOperation

public static void reinitializeOperation(java.lang.String option)
                                  throws java.io.IOException,
                                         DSEObjectNotFoundException
Reinitializes the Operations.

reinitializeProcessor

public static void reinitializeProcessor(java.lang.String option)
                                  throws java.io.IOException,
                                         DSEObjectNotFoundException
Reinitializes the Processors.

reinitializeService

public static void reinitializeService(java.lang.String option)
                                throws java.io.IOException,
                                       DSEObjectNotFoundException
Reinitializes the Services.

reinitializeType

public static void reinitializeType(java.lang.String option)
                             throws java.io.IOException,
                                    DSEObjectNotFoundException
Reinitializes the Types.

reinitializeView

public static void reinitializeView(java.lang.String option)
                             throws java.io.IOException,
                                    DSEObjectNotFoundException
Reinitializes the Views.

reset

public static void reset()
                  throws java.io.IOException,
                         DSEObjectNotFoundException,
                         DSEException
Initializes the DSE.INI.

reset

public static void reset(java.io.BufferedInputStream aStream)
                  throws java.io.IOException,
                         DSEObjectNotFoundException,
                         DSEException
Reads the .INI file and initializes the Settings class variable with all the information. Externalizers must be reinitialized after this process since the data element is reused to set our own IniExternalizer pointing to the .INI file. If the .INI file is not present or if any error happens while initializing the Settings object that must be specified in the .INI, the Settings object is initialized to an empty KeyedCollection and its settings are given default values.

reset

public static void reset(java.lang.String initialPath)
                  throws java.io.IOException,
                         DSEObjectNotFoundException,
                         DSEException
Reads the .INI file and then initializes the Setting class variables based on the file. Externalizers must be reinitialized after this process since the data element is reused to set our own IniExternalizer pointing to the .INI file. If the .INI file is not present in the location pointed to by the DSE environment variable or if any error happens while initializing the Settings object, the Setting object is initialized to an empty KeyedCollection and its settings are given default values.

reset

public static void reset(java.net.URL aURL)
                  throws java.io.IOException,
                         DSEObjectNotFoundException,
                         DSEException
Reads the .INI file and then initializes the Setting class variables based on the file. Externalizers must be reinitialized after this process since the data element is reused to set our own IniExternalizer pointing to the .INI file. If the .INI file is not present in the location pointed to by the URL or if any error happens while initializing the Settings object, the Setting object is initialized to an empty KeyedCollection and its settings are given default values.

resetExternalizers

public static void resetExternalizers()
                               throws java.io.IOException,
                                      DSEObjectNotFoundException
Resets all the initializers.

resetSettings

public static void resetSettings()
                          throws java.io.IOException,
                                 DSEObjectNotFoundException
Resets all the settings definitions.
Throws:
java.io.IOException -  
DSEObjectNotFoundException -  

resetSettings

public static void resetSettings(java.lang.String aTagId)
                          throws java.io.IOException
Resets the specified setting element located at first level inside the settings keyed collection.
Parameters:
aTagId - java.lang.String
Throws:
java.io.IOException -  

resetSettings

protected static void resetSettings(java.lang.String aTagId,
                                    KeyedCollection newSettings)
                             throws java.io.IOException
Resets the definition of the setting entity with id equals to aTagId. The new definition is obtained from the keyed collection passed by parameter.
Parameters:
aTagId - java.lang.String
newSettings - com.ibm.dse.base.KeyedCollection
Throws:
java.io.IOException -  

resetSettings

public static void resetSettings(java.util.Enumeration listTagId)
                          throws java.io.IOException
Reset all the elements which appear in the enumeration.
Parameters:
listPath - java.util.Enumeration
Throws:
java.io.IOException -  

resetTagClassTables

public static void resetTagClassTables()
                                throws DSEObjectNotFoundException
Initializes the tables that say what class is instantiated with every tag. You can change these tables in the DSE.INI file

set

public static void set(java.lang.String initialPath)
                throws java.io.IOException,
                       DSEObjectNotFoundException
Reads an additional .INI file. All the .INI files must be read before initializing the externalizers.

setSettings

public static void setSettings(KeyedCollection aKeyedCollection)
Sets the settings.
Parameters:
aKeyedCollection - com.ibm.dse.base.KeyedCollection

setTID

public static void setTID(java.lang.String aTID)
Sets the TID in the settings KeyedCollection.

setupObjectCache

public static void setupObjectCache()
This method will use the external parameters: initialization.enableFormatsCache initialization.enableOperationsCache They will be used to setup the cache for formats and operations.

showProgressBar

public static void showProgressBar(boolean aBoolean)
Shows the progress bar if aBoolean is true.
Parameters:
aBoolean - boolean