Package org.dlese.dpc.schemedit
Class FrameworkRegistry
java.lang.Object
org.dlese.dpc.schemedit.FrameworkRegistry
- All Implemented Interfaces:
EventListener,MetadataVocabReloadListener
A map holding
MetaDataFramework instances,
and keyed by the short name (e.g., "adn") of each particular framework.The Registry is populated at system startup time. It reads framework config files and instantiates a MetaDataFramework instance for each one.
- Author:
- ostwald
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the FrameworkRegistry objectFrameworkRegistry(String configDirPath, String docRoot) Constructor for the FrameworkRegistry object for specified configuration directory and docRoot (used for debugging - docRoot is normally calculated from servletContext).FrameworkRegistry(ServletContext servletContext) FrameworkRegistry constructure with ServletContext -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the load errorsvoidClear the load warningsvoiddestroy()Destroys the loaded frameworksvoidInitialize each framework with information about which fields can be formatted using MUI Groups files.Return a list of formats for registered frameworks.Gets the directory in which framework config files are located.getFramework(String xmlFormat) Gets the framework for the specified xmlFormatbooleangetIsLoaded(String xmlFormat) Returns true if the framework for provided xmlFormat is currently loaded in this FrameworkRegistryGets the registered formats that are "item" frameworks (e.g., "adn", "dlese_anno", as opposed to frameworks used internally (e.g., "dcs_data") by the system.Gets the loadErrors attribute of the FrameworkRegistry objectGets the loadWarnings attribute of the FrameworkRegistry objectgetNames()Return the formats of the registered frameworks, excluding "dlese_collect"Gets the formats that are available to oai services, which are the itemFrameworks plus "dlese_collect"Returns a list of xmlFormats corresponding to framework config files that are present in the framework config directory, but are not currently loaded in the FrameworkRegistry objectvoidload()Loads the FrameworkRegistry by traversing the framework config files in the config directory.voidloadFramework(String xmlFormat) Loads the framework for specified xmlformat after finding the framework config filestatic voidNOT YET DOCUMENTEDvoidEvent handler for MetadataVocabReloadEvent registers MUI groups with appropriate frameworks and then re-renders the editors for frameworks that have registered MUI groups.voidRegister provided MetaDataFramework.intsize()The number of registered frameworkstoString()Return a string representation of the registry for debugging purposes.voidunregister(String xmlFormat) Remove the framework for provided xmlFormat from the registry
-
Constructor Details
-
FrameworkRegistry
public FrameworkRegistry()Constructor for the FrameworkRegistry object -
FrameworkRegistry
FrameworkRegistry constructure with ServletContext- Parameters:
servletContext- the servletContext
-
FrameworkRegistry
Constructor for the FrameworkRegistry object for specified configuration directory and docRoot (used for debugging - docRoot is normally calculated from servletContext).- Parameters:
configDirPath- path to directory containing framework config filesdocRoot- path to servlet baseDir
-
-
Method Details
-
getConfigDir
Gets the directory in which framework config files are located.- Returns:
- The configDir value
-
loadFramework
Loads the framework for specified xmlformat after finding the framework config file- Parameters:
xmlFormat- the xmlFormat for the framework (e.g., "adn")- Throws:
Exception- if the framework could not be loaded
-
load
public void load()Loads the FrameworkRegistry by traversing the framework config files in the config directory. -
getLoadErrors
Gets the loadErrors attribute of the FrameworkRegistry object- Returns:
- The loadErrors value
-
clearLoadErrors
public void clearLoadErrors()Clear the load errors -
getLoadWarnings
Gets the loadWarnings attribute of the FrameworkRegistry object- Returns:
- The loadWarnings value
-
clearLoadWarnings
public void clearLoadWarnings()Clear the load warnings -
metadataVocabReloaded
Event handler for MetadataVocabReloadEvent registers MUI groups with appropriate frameworks and then re-renders the editors for frameworks that have registered MUI groups.- Specified by:
metadataVocabReloadedin interfaceMetadataVocabReloadListener- Parameters:
event- NOT YET DOCUMENTED
-
extractMuiGroups
public void extractMuiGroups()Initialize each framework with information about which fields can be formatted using MUI Groups files. -
register
Register provided MetaDataFramework.- Parameters:
mdf- the framework to be loaded
-
unregister
Remove the framework for provided xmlFormat from the registry- Parameters:
xmlFormat- format (e.g., "adn") corresponding to a loaded framework
-
getFramework
Gets the framework for the specified xmlFormat- Parameters:
xmlFormat- format (e.g., "adn") corresponding to a loaded framework- Returns:
- The framework
-
size
public int size()The number of registered frameworks- Returns:
- the number of registered frameworks
-
getIsLoaded
Returns true if the framework for provided xmlFormat is currently loaded in this FrameworkRegistry- Parameters:
xmlFormat- e.g., ("adn")- Returns:
- true if framework is loaded.
-
getUnloadedFrameworks
Returns a list of xmlFormats corresponding to framework config files that are present in the framework config directory, but are not currently loaded in the FrameworkRegistry object- Returns:
- The unloadedFrameworks
-
toString
Return a string representation of the registry for debugging purposes. -
getAllFormats
Return a list of formats for registered frameworks.- Returns:
- The allFormats value
-
getItemFormats
Gets the registered formats that are "item" frameworks (e.g., "adn", "dlese_anno", as opposed to frameworks used internally (e.g., "dcs_data") by the system.- Returns:
- The itemFormats value
-
getOaiFormats
Gets the formats that are available to oai services, which are the itemFrameworks plus "dlese_collect"- Returns:
- The oaiFormats value
-
getNames
Return the formats of the registered frameworks, excluding "dlese_collect"- Returns:
- The names value
-
destroy
public void destroy()Destroys the loaded frameworks -
main
NOT YET DOCUMENTED- Parameters:
args- NOT YET DOCUMENTED
-