phenote.config
Class Config

java.lang.Object
  extended by phenote.config.Config

public class Config
extends java.lang.Object


Field Summary
static java.lang.String defaultLogConfigFile
           
static java.lang.String FLYBASE_DEFAULT_CONFIG_FILE
           
 
Method Summary
 void addFieldConfig(FieldConfig fc)
           
(package private)  phenote.config.xml.FieldDocument.Field addNewFieldBean()
          Adds & returns xml Field bean
 boolean autoUpdateIsEnabled()
           
static void changeConfig(java.lang.String newCfgFile)
           
 boolean compareStatementEnabled()
           
 boolean dataInputServletIsEnabled()
           
(package private)  FieldConfig getAllFieldCfg(java.lang.String fieldName)
          should first check field with datatag if has one, and if not then label as label may not be unique - fix this - only uses label at the moment
 java.util.List<FieldConfig> getAllFieldCfgs()
           
(package private)  int getAllFieldIndex(FieldConfig fc)
          get index of field config in enabled field config list - returns -1 if not in there -- ex?
 java.util.List<OntologyConfig> getAllOntologies()
           
 AnnotationMappingDriver getAnnotMappingDriver()
          mapping for character to obo annot, used for OBO_ANNOTATION character mode meaningless in pure character mode, returns BasicAnnotationMappingDriver by default
 phenote.config.xml.AutocompleteSettingsDocument.AutocompleteSettings getAutocompleteSettings()
           
 phenote.config.xml.CharacterModeDocument.CharacterMode.Mode.Enum getCharacterMode()
          returns enum from character mode xml bean itself - why not right?
 java.util.List<CharField> getCharFieldsForSyntaxAbbrev(java.lang.String abb)
          kinda silly to return list?? so there are 2 fields for "Tag" which perhaps is silly but thats whats happening so need to deal with it
 java.lang.String getConfigAuthor()
           
 java.lang.String getConfigDesc()
           
 java.lang.String getConfigName()
           
 java.util.List<DataAdapterI> getDataAdapters()
          Returns enabled data adapters - empty list if none enabled
 DataAdapterI getDefaultFileAdapter()
          LoadSaveMangr uses if no extension works.
 phenote.config.xml.GroupDocument.Group getDefaultGroup()
           
 CharField getEnbldCharField(int index)
           
 java.util.List<FieldConfig> getEnbldFieldCfgs()
          OntologyDataAdapter calls this to figure which ontologies to load This is a list of enabled fields - does not include disabled fields! retname getEnabledFieldConfigs?
 int getEnbldFieldsNum()
           
 int getEnbldFieldsNum(java.lang.String group)
           
 java.util.Collection<org.obo.dataadapter.OBDSQLDatabaseAdapter.OBDSQLDatabaseAdapterConfiguration> getExternalDatabaseConfigs()
           
 java.util.Collection<java.lang.String> getExternalDatabasePaths()
           
 int getFieldColwidth(int index)
           
 java.util.List<phenote.config.xml.GroupDocument.Group> getFieldGroups()
           
 java.lang.String getFieldLabel(int index, java.lang.String group)
          Gives name of field at index, 0 based (for table heading)
 java.util.List<java.lang.String> getFieldsInGroup(java.lang.String groupName)
           
(package private)  java.util.List<DataAdapterConfig> getFileAdapConfigs()
           
 GroupAdapterI getGroupAdapter(java.lang.String groupStr)
          returns null if group adapter for group not found - ex?
(package private)  java.lang.String getLogConfigFile()
           
 java.net.URL getLogConfigUrl()
           
 int getMinCompChars(int fieldIndex)
           
 java.lang.String getMyPhenoteConfigString()
          Get config file string that is in my-phenote file - throw io exception if file doesnt exist.
 java.util.List<NCBIDataAdapterI> getNCBIDataAdapters()
           
 OntologyMakerI getOntMaker(java.lang.String group)
           
 java.util.List<OntologyMakerI> getOntMakers()
           
 phenote.config.xml.OntologyFileDocument.OntologyFile getOntologyFileByHandle(java.lang.String handle)
           
 phenote.config.xml.OntologyFileDocument.OntologyFile[] getOntologyList()
           
(package private)  phenote.config.xml.PhenoteConfigurationDocument getPhenoDocBean()
           
 QueryableDataAdapterI getQueryableDataAdapter()
          Just get first one thats enabled - for now assume theres one
(package private)  java.util.List<DataAdapterConfig> getQueryAdapCfgs()
          all configs for query adaps - enabled or not
(package private)  java.lang.String getReposUrlDir()
           
 java.lang.String getSyntaxAbbrevForCharField(CharField cf)
           
 phenote.config.xml.TerminologyDefinitionsDocument.TerminologyDefinitions getTerminologyDefs()
          This will retrieve all of the ontology/terminology definitions in a configuration file.
 java.lang.String getTitleForGroup(java.lang.String groupName)
          Returns null if group w groupName doesnt exist
 phenote.config.xml.TerminologyDefinitionsDocument.TerminologyDefinitions.Update.Enum getUpdateTerminologies()
          This method will make the "update ontologies" flag pase.
 int getUpdateTimer()
           
 boolean hasDataAdapters()
           
 boolean hasEnbldCharField(int index)
           
(package private)  boolean hasFieldCfgAll(FieldConfig fc)
          returns true if has field config with same name - contents may differ
 boolean hasGroupAdapter(java.lang.String group)
           
 boolean hasNCBIAdapter()
           
 boolean hasOntMakerForGroup(java.lang.String group)
          returns whether have term maker for given group - there could also be a term maker manager?
 boolean hasOntMakers()
           
 boolean hasQueryableDataAdapter()
           
(package private)  void insertFieldConfig(int index, FieldConfig fc)
          adds to both field config list and xml beans field list
static Config inst()
           
 boolean isConfigModified()
           
 boolean isInitialized()
           
 boolean isVisible(CharField cf)
           
 void loadConstraints()
          load up all constraints from config into ConstraintManager, from constaint list as well as required config fields
 void loadDefaultConfigFile()
          Changed this to actually do updating of config file by default given that this is now the route in from webstart, without this users will never get config updates - eventually get more sophisticated - give user options of updateFromDefault, revertToMain/Default or personal/ignoreMain/dontupdate
 void loadDefaultFlybaseConfigFile()
          if all else fails revert to flybase which should be there
static Config makeConfigFromFile(java.lang.String file)
           
static Config newInstance(java.lang.String name, java.lang.String displayName)
           
static void reset()
           
 void saveModifiedConfig()
           
 void setAutocompleteSettings()
           
 void setAutoUpdate(boolean enable)
           
 void setConfigAuthor(java.lang.String author)
           
 void setConfigDesc(java.lang.String desc)
           
 void setConfigFile(java.lang.String configFile)
          This is setting config file with nothing to do with personal config this is for the servlet where config file location is set in web.xml
 void setConfigModified(boolean setting)
           
 void setConfigName(java.lang.String name)
           
 void setDataInputServletIsEnabled(boolean enable)
           
 void setFieldColwidth(int index, int width)
           
 void setOntologyList(phenote.config.xml.OntologyFileDocument.OntologyFile[] ontologyList)
           
 void setOverwriteConfigFile(java.lang.String configFile)
          -c from command line does this - should be always but isnt???
 void setTermHistory(boolean setter)
           
 void setTerminologyDefs(phenote.config.xml.TerminologyDefinitionsDocument.TerminologyDefinitions termDefs)
           
 void setUpdateTerminologies(phenote.config.xml.TerminologyDefinitionsDocument.TerminologyDefinitions.Update.Enum updateStatus)
           
 void setUpdateTimer(int seconds)
           
 void setUvicGraphIsEnabled(boolean enable)
           
 boolean shouldUseFieldPanelTabs()
           
 boolean showLoadingScreen()
          Loading screen is the elephant splash screen that displays when phenote is initializing ontologies & such at startup.
 boolean termHistoryIsEnabled()
           
 java.lang.String toString()
           
 void updateConfigFileWithNewVersion(java.lang.String configFile)
          This is for when phenote is first installed and one of the default config files is used - the -i option if you will.
 boolean uvicGraphIsEnabled()
          config flag for enabling uvic shrimp dag graph
static void writeMyPhenoteDefaultFile(java.lang.String newDefaultFileString)
          Write name of config file loaded out to .phenote/conf/my-phenote.cfg for use by future startups with no config specified Throws ConfigException if fails to find file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FLYBASE_DEFAULT_CONFIG_FILE

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

defaultLogConfigFile

public static final java.lang.String defaultLogConfigFile
See Also:
Constant Field Values
Method Detail

inst

public static Config inst()

reset

public static void reset()

newInstance

public static Config newInstance(java.lang.String name,
                                 java.lang.String displayName)

makeConfigFromFile

public static Config makeConfigFromFile(java.lang.String file)
                                 throws ConfigException
Throws:
ConfigException

isInitialized

public boolean isInitialized()

isConfigModified

public boolean isConfigModified()

setConfigModified

public void setConfigModified(boolean setting)

saveModifiedConfig

public void saveModifiedConfig()

setConfigFile

public void setConfigFile(java.lang.String configFile)
                   throws ConfigException
This is setting config file with nothing to do with personal config this is for the servlet where config file location is set in web.xml

Throws:
ConfigException

changeConfig

public static void changeConfig(java.lang.String newCfgFile)
                         throws ConfigException
Throws:
ConfigException

updateConfigFileWithNewVersion

public void updateConfigFileWithNewVersion(java.lang.String configFile)
                                    throws ConfigException
This is for when phenote is first installed and one of the default config files is used - the -i option if you will. The initial config file will get copied to .phenote/my-phenote.cfg if it doesnt already exist. if it exists then this file is ignored

Throws:
ConfigException

setOverwriteConfigFile

public void setOverwriteConfigFile(java.lang.String configFile)
                            throws ConfigException
-c from command line does this - should be always but isnt???

Throws:
ConfigException

loadDefaultConfigFile

public void loadDefaultConfigFile()
                           throws ConfigException
Changed this to actually do updating of config file by default given that this is now the route in from webstart, without this users will never get config updates - eventually get more sophisticated - give user options of updateFromDefault, revertToMain/Default or personal/ignoreMain/dontupdate

Throws:
ConfigException

loadDefaultFlybaseConfigFile

public void loadDefaultFlybaseConfigFile()
                                  throws ConfigException
if all else fails revert to flybase which should be there

Throws:
ConfigException

getMyPhenoteConfigString

public java.lang.String getMyPhenoteConfigString()
                                          throws java.io.IOException
Get config file string that is in my-phenote file - throw io exception if file doesnt exist. todo: should also throw ex if doesnt have a valid file in it?

Throws:
java.io.IOException

writeMyPhenoteDefaultFile

public static void writeMyPhenoteDefaultFile(java.lang.String newDefaultFileString)
                                      throws ConfigException
Write name of config file loaded out to .phenote/conf/my-phenote.cfg for use by future startups with no config specified Throws ConfigException if fails to find file

Throws:
ConfigException

getExternalDatabasePaths

public java.util.Collection<java.lang.String> getExternalDatabasePaths()

getExternalDatabaseConfigs

public java.util.Collection<org.obo.dataadapter.OBDSQLDatabaseAdapter.OBDSQLDatabaseAdapterConfiguration> getExternalDatabaseConfigs()

hasDataAdapters

public boolean hasDataAdapters()

getFileAdapConfigs

java.util.List<DataAdapterConfig> getFileAdapConfigs()

getDataAdapters

public java.util.List<DataAdapterI> getDataAdapters()
Returns enabled data adapters - empty list if none enabled


getDefaultFileAdapter

public DataAdapterI getDefaultFileAdapter()
LoadSaveMangr uses if no extension works. Returns null if no data adapters loaded Otherwise returns 1st enabled adapter. Todo: add isdefault config


uvicGraphIsEnabled

public boolean uvicGraphIsEnabled()
config flag for enabling uvic shrimp dag graph


setUvicGraphIsEnabled

public void setUvicGraphIsEnabled(boolean enable)

dataInputServletIsEnabled

public boolean dataInputServletIsEnabled()

setDataInputServletIsEnabled

public void setDataInputServletIsEnabled(boolean enable)

termHistoryIsEnabled

public boolean termHistoryIsEnabled()

setTermHistory

public void setTermHistory(boolean setter)

autoUpdateIsEnabled

public boolean autoUpdateIsEnabled()

setAutoUpdate

public void setAutoUpdate(boolean enable)

getUpdateTimer

public int getUpdateTimer()

setUpdateTimer

public void setUpdateTimer(int seconds)

shouldUseFieldPanelTabs

public boolean shouldUseFieldPanelTabs()

getCharacterMode

public phenote.config.xml.CharacterModeDocument.CharacterMode.Mode.Enum getCharacterMode()
returns enum from character mode xml bean itself - why not right?


getAnnotMappingDriver

public AnnotationMappingDriver getAnnotMappingDriver()
mapping for character to obo annot, used for OBO_ANNOTATION character mode meaningless in pure character mode, returns BasicAnnotationMappingDriver by default


getAutocompleteSettings

public phenote.config.xml.AutocompleteSettingsDocument.AutocompleteSettings getAutocompleteSettings()

setAutocompleteSettings

public void setAutocompleteSettings()

getLogConfigUrl

public java.net.URL getLogConfigUrl()
                             throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

getLogConfigFile

java.lang.String getLogConfigFile()

addNewFieldBean

phenote.config.xml.FieldDocument.Field addNewFieldBean()
Adds & returns xml Field bean


getEnbldFieldsNum

public int getEnbldFieldsNum()

getEnbldFieldsNum

public int getEnbldFieldsNum(java.lang.String group)

getFieldLabel

public java.lang.String getFieldLabel(int index,
                                      java.lang.String group)
Gives name of field at index, 0 based (for table heading)


getFieldColwidth

public int getFieldColwidth(int index)

setFieldColwidth

public void setFieldColwidth(int index,
                             int width)

getMinCompChars

public int getMinCompChars(int fieldIndex)

hasEnbldCharField

public boolean hasEnbldCharField(int index)

getEnbldCharField

public CharField getEnbldCharField(int index)

getEnbldFieldCfgs

public java.util.List<FieldConfig> getEnbldFieldCfgs()
OntologyDataAdapter calls this to figure which ontologies to load This is a list of enabled fields - does not include disabled fields! retname getEnabledFieldConfigs?


getAllFieldCfgs

public java.util.List<FieldConfig> getAllFieldCfgs()

getAllOntologies

public java.util.List<OntologyConfig> getAllOntologies()

hasFieldCfgAll

boolean hasFieldCfgAll(FieldConfig fc)
returns true if has field config with same name - contents may differ


getAllFieldCfg

FieldConfig getAllFieldCfg(java.lang.String fieldName)
should first check field with datatag if has one, and if not then label as label may not be unique - fix this - only uses label at the moment


isVisible

public boolean isVisible(CharField cf)

getCharFieldsForSyntaxAbbrev

public java.util.List<CharField> getCharFieldsForSyntaxAbbrev(java.lang.String abb)
                                                       throws ConfigException
kinda silly to return list?? so there are 2 fields for "Tag" which perhaps is silly but thats whats happening so need to deal with it

Throws:
ConfigException

getSyntaxAbbrevForCharField

public java.lang.String getSyntaxAbbrevForCharField(CharField cf)

getReposUrlDir

java.lang.String getReposUrlDir()

getPhenoDocBean

phenote.config.xml.PhenoteConfigurationDocument getPhenoDocBean()

hasQueryableDataAdapter

public boolean hasQueryableDataAdapter()

hasNCBIAdapter

public boolean hasNCBIAdapter()

getQueryableDataAdapter

public QueryableDataAdapterI getQueryableDataAdapter()
Just get first one thats enabled - for now assume theres one


getNCBIDataAdapters

public java.util.List<NCBIDataAdapterI> getNCBIDataAdapters()

getQueryAdapCfgs

java.util.List<DataAdapterConfig> getQueryAdapCfgs()
all configs for query adaps - enabled or not


addFieldConfig

public void addFieldConfig(FieldConfig fc)

getAllFieldIndex

int getAllFieldIndex(FieldConfig fc)
get index of field config in enabled field config list - returns -1 if not in there -- ex?


insertFieldConfig

void insertFieldConfig(int index,
                       FieldConfig fc)
adds to both field config list and xml beans field list


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getConfigName

public java.lang.String getConfigName()

setConfigName

public void setConfigName(java.lang.String name)

getConfigDesc

public java.lang.String getConfigDesc()

setConfigDesc

public void setConfigDesc(java.lang.String desc)

getConfigAuthor

public java.lang.String getConfigAuthor()

setConfigAuthor

public void setConfigAuthor(java.lang.String author)

showLoadingScreen

public boolean showLoadingScreen()
Loading screen is the elephant splash screen that displays when phenote is initializing ontologies & such at startup. The current LoadingScreen can go into threadlock and seize up phenote so need ability to disable it defaults to true (false?)


getFieldGroups

public java.util.List<phenote.config.xml.GroupDocument.Group> getFieldGroups()

getFieldsInGroup

public java.util.List<java.lang.String> getFieldsInGroup(java.lang.String groupName)

getTitleForGroup

public java.lang.String getTitleForGroup(java.lang.String groupName)
Returns null if group w groupName doesnt exist


getDefaultGroup

public phenote.config.xml.GroupDocument.Group getDefaultGroup()

hasGroupAdapter

public boolean hasGroupAdapter(java.lang.String group)

getGroupAdapter

public GroupAdapterI getGroupAdapter(java.lang.String groupStr)
returns null if group adapter for group not found - ex?


hasOntMakerForGroup

public boolean hasOntMakerForGroup(java.lang.String group)
returns whether have term maker for given group - there could also be a term maker manager?


getOntMaker

public OntologyMakerI getOntMaker(java.lang.String group)

hasOntMakers

public boolean hasOntMakers()

getOntMakers

public java.util.List<OntologyMakerI> getOntMakers()

compareStatementEnabled

public boolean compareStatementEnabled()

getTerminologyDefs

public phenote.config.xml.TerminologyDefinitionsDocument.TerminologyDefinitions getTerminologyDefs()
This will retrieve all of the ontology/terminology definitions in a configuration file. Included here will be all ontology files, their handle, repository location, and whether or not to update.

Returns:
An object that defines all ontologies/terminologies utilized in the configuration, together with a convenience flag to indicate whether to update some, none, or all ontologies.

setTerminologyDefs

public void setTerminologyDefs(phenote.config.xml.TerminologyDefinitionsDocument.TerminologyDefinitions termDefs)

getOntologyList

public phenote.config.xml.OntologyFileDocument.OntologyFile[] getOntologyList()
Returns:
This returns the an array of ontologies themselves, including the file names, and other metadata (such as version, etc.)

setOntologyList

public void setOntologyList(phenote.config.xml.OntologyFileDocument.OntologyFile[] ontologyList)

getUpdateTerminologies

public phenote.config.xml.TerminologyDefinitionsDocument.TerminologyDefinitions.Update.Enum getUpdateTerminologies()
This method will make the "update ontologies" flag pase.

Returns:
Convenience method to determine the global status of updating ontology files. This will either be None, Some, or All ontologies. This defaults to None if not set in the configuration.

getOntologyFileByHandle

public phenote.config.xml.OntologyFileDocument.OntologyFile getOntologyFileByHandle(java.lang.String handle)

setUpdateTerminologies

public void setUpdateTerminologies(phenote.config.xml.TerminologyDefinitionsDocument.TerminologyDefinitions.Update.Enum updateStatus)

loadConstraints

public void loadConstraints()
load up all constraints from config into ConstraintManager, from constaint list as well as required config fields