project35.mda.config
Class Project35ConfigurationReader

java.lang.Object
  extended by project35.mda.config.Project35ConfigurationReader
All Implemented Interfaces:
SchemaConceptPropertyManager

public class Project35ConfigurationReader
extends java.lang.Object
implements SchemaConceptPropertyManager

this is the class that holds configuration data that the XML Schema can't express. The configuration reader reads a configuration file which conforms with the XML Schema for the Project35 Configuration Tool. It reads parts of the file and stores the data in a collection of data container classes, usually ending in "..Configuration.java". Once the configuration reader is intialised, it is used by other parts of the Project35 application to lookup configuration options for application features such as menus, or schema concepts


Copyright (c) 2008 Kevin Garwood for Project35. The original code was developed by Kevin Garwood for the University of Manchester. Revisions have been made for Project35, a project that is independent of that institution. This code is licensed under the Academic Free License version 3.0. The code attribution for the original code is included here:

Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.


Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Constructor Summary
Project35ConfigurationReader()
           
 
Method Summary
 void addComponentSchema(ComponentSchemaConfiguration componentSchemaConfiguration)
           
 void addRecordConfiguration(RecordConfiguration recordConfiguration)
           
 AttributeFieldConfiguration getAttributeFieldConfiguration(java.lang.String recordClassName, java.lang.String fieldName)
           
 ComponentSchemaConfiguration[] getComponentSchemaConfigurations()
           
 SchemaConceptConfiguration getConfigurationRecord(java.lang.String recordClassName, java.lang.String fieldName)
          provides a lookup method for getting configuration data on a particular field in a record.
 CustomMenuConfiguration[] getCustomMenuConfigurations()
           
 java.lang.String getDateFormat()
           
 java.lang.String getDialogTitle()
           
 DocumentValidationServiceConfiguration[] getDocumentValidationServiceConfigurations()
           
 EditFieldConfiguration getEditFieldConfiguration(java.lang.String recordClassName, java.lang.String fieldName)
           
 EditMenuConfiguration getEditMenuConfiguration()
           
 FileLauncher getFileLauncher()
           
 FileMenuConfiguration getFileMenuConfiguration()
           
 GeneralDisplayPropertiesConfiguration getGeneralDisplayPropertiesConfiguration()
           
 HelpMenuConfiguration getHelpMenuConfiguration()
           
 ListFieldConfiguration getListFieldConfiguration(java.lang.String recordClassName, java.lang.String fieldName)
           
 OptionsMenuConfiguration getOptionsMenuConfiguration()
           
 RecordConfiguration[] getRecordConfigurations()
           
 SessionManager getSessionManager()
           
 java.lang.String getStyleSheet()
           
 java.lang.String getTopLevelElementName()
          Returns the name of the top level element in case that the schema is ambiguous that is has several global elements.
 ViewMenuConfiguration getViewMenuConfiguration()
           
 boolean ignoreSchemaLocation()
           
 void parseExtensionLauncherRegistry(java.io.InputStream extensionLauncherStream)
           
 void parseMainConfigurationFile(java.io.InputStream inputStream, java.net.URL documentDirectory, java.net.URL resourceDirectory)
           
 void parseSessionFile(java.io.File favouritesFile)
           
 void setComponentSchemas(java.util.ArrayList componentSchemas)
           
 void setCustomMenuConfigurations(java.util.ArrayList customMenuConfigurations)
           
 void setDateFormat(java.lang.String dateFormat)
           
 void setDefaultValues(RecordModel recordModel)
           
 void setDialogTitle(java.lang.String dialogTitle)
           
 void setDocumentValidationServiceConfigurations(java.util.ArrayList documentValidationServiceConfigurations)
           
 void setEnableClassLoader(boolean enableClassLoader)
           
 void setFileMenuConfiguration(FileMenuConfiguration fileMenuConfiguration)
           
 void setGeneralDisplayPropertiesConfiguration(GeneralDisplayPropertiesConfiguration generalDisplayPropertiesConfiguration)
           
 void setHelpMenuConfiguration(HelpMenuConfiguration helpMenuConfiguration)
           
 void setIgnoreSchemaLocation(boolean ignoreSchemaLocation)
           
 void setRecordConfigurations(java.util.ArrayList recordConfigurations)
           
 void setStyleSheet(java.lang.String styleSheet)
          sets the style sheet used by the configuration file
 void setTopLevelElementName(java.lang.String topLevelElementName)
          Sets the name of the top level element in case that the schema is ambiguous that is has several global elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Project35ConfigurationReader

public Project35ConfigurationReader()
Method Detail

getComponentSchemaConfigurations

public ComponentSchemaConfiguration[] getComponentSchemaConfigurations()

ignoreSchemaLocation

public boolean ignoreSchemaLocation()

getFileMenuConfiguration

public FileMenuConfiguration getFileMenuConfiguration()

getEditMenuConfiguration

public EditMenuConfiguration getEditMenuConfiguration()

getOptionsMenuConfiguration

public OptionsMenuConfiguration getOptionsMenuConfiguration()

getViewMenuConfiguration

public ViewMenuConfiguration getViewMenuConfiguration()

getHelpMenuConfiguration

public HelpMenuConfiguration getHelpMenuConfiguration()

getCustomMenuConfigurations

public CustomMenuConfiguration[] getCustomMenuConfigurations()

getConfigurationRecord

public SchemaConceptConfiguration getConfigurationRecord(java.lang.String recordClassName,
                                                         java.lang.String fieldName)
provides a lookup method for getting configuration data on a particular field in a record.

Specified by:
getConfigurationRecord in interface SchemaConceptPropertyManager
Parameters:
recordClassName - the record tag name
fieldName - the field tag name. For Configuration records that describe the record-level attributes, fieldName will be "null"

getAttributeFieldConfiguration

public AttributeFieldConfiguration getAttributeFieldConfiguration(java.lang.String recordClassName,
                                                                  java.lang.String fieldName)
Specified by:
getAttributeFieldConfiguration in interface SchemaConceptPropertyManager

getEditFieldConfiguration

public EditFieldConfiguration getEditFieldConfiguration(java.lang.String recordClassName,
                                                        java.lang.String fieldName)
Specified by:
getEditFieldConfiguration in interface SchemaConceptPropertyManager

getListFieldConfiguration

public ListFieldConfiguration getListFieldConfiguration(java.lang.String recordClassName,
                                                        java.lang.String fieldName)
Specified by:
getListFieldConfiguration in interface SchemaConceptPropertyManager

getTopLevelElementName

public java.lang.String getTopLevelElementName()
Returns the name of the top level element in case that the schema is ambiguous that is has several global elements. Returns null if no top level element name was defined.

Returns:
the name of the top level element in case that the schema is ambiguous.

getDialogTitle

public java.lang.String getDialogTitle()

getSessionManager

public SessionManager getSessionManager()

getFileLauncher

public FileLauncher getFileLauncher()
Specified by:
getFileLauncher in interface SchemaConceptPropertyManager

getRecordConfigurations

public RecordConfiguration[] getRecordConfigurations()

getStyleSheet

public java.lang.String getStyleSheet()

getDateFormat

public java.lang.String getDateFormat()

getDocumentValidationServiceConfigurations

public DocumentValidationServiceConfiguration[] getDocumentValidationServiceConfigurations()

getGeneralDisplayPropertiesConfiguration

public GeneralDisplayPropertiesConfiguration getGeneralDisplayPropertiesConfiguration()

setDefaultValues

public void setDefaultValues(RecordModel recordModel)
Specified by:
setDefaultValues in interface SchemaConceptPropertyManager

setEnableClassLoader

public void setEnableClassLoader(boolean enableClassLoader)

setIgnoreSchemaLocation

public void setIgnoreSchemaLocation(boolean ignoreSchemaLocation)

parseMainConfigurationFile

public void parseMainConfigurationFile(java.io.InputStream inputStream,
                                       java.net.URL documentDirectory,
                                       java.net.URL resourceDirectory)
                                throws java.lang.Exception
Throws:
java.lang.Exception

parseSessionFile

public void parseSessionFile(java.io.File favouritesFile)
                      throws javax.xml.parsers.ParserConfigurationException,
                             Project35Exception,
                             org.xml.sax.SAXException,
                             java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
Project35Exception
org.xml.sax.SAXException
java.io.IOException

parseExtensionLauncherRegistry

public void parseExtensionLauncherRegistry(java.io.InputStream extensionLauncherStream)
                                    throws javax.xml.parsers.ParserConfigurationException,
                                           Project35Exception,
                                           org.xml.sax.SAXException,
                                           java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
Project35Exception
org.xml.sax.SAXException
java.io.IOException

addRecordConfiguration

public void addRecordConfiguration(RecordConfiguration recordConfiguration)

setRecordConfigurations

public void setRecordConfigurations(java.util.ArrayList recordConfigurations)

setTopLevelElementName

public void setTopLevelElementName(java.lang.String topLevelElementName)
Sets the name of the top level element in case that the schema is ambiguous that is has several global elements.

Parameters:
topLevelElementName - the name of the top level element.

addComponentSchema

public void addComponentSchema(ComponentSchemaConfiguration componentSchemaConfiguration)

setComponentSchemas

public void setComponentSchemas(java.util.ArrayList componentSchemas)

setHelpMenuConfiguration

public void setHelpMenuConfiguration(HelpMenuConfiguration helpMenuConfiguration)

setFileMenuConfiguration

public void setFileMenuConfiguration(FileMenuConfiguration fileMenuConfiguration)

setDateFormat

public void setDateFormat(java.lang.String dateFormat)

setStyleSheet

public void setStyleSheet(java.lang.String styleSheet)
sets the style sheet used by the configuration file


setDialogTitle

public void setDialogTitle(java.lang.String dialogTitle)

setDocumentValidationServiceConfigurations

public void setDocumentValidationServiceConfigurations(java.util.ArrayList documentValidationServiceConfigurations)

setGeneralDisplayPropertiesConfiguration

public void setGeneralDisplayPropertiesConfiguration(GeneralDisplayPropertiesConfiguration generalDisplayPropertiesConfiguration)

setCustomMenuConfigurations

public void setCustomMenuConfigurations(java.util.ArrayList customMenuConfigurations)