public class FrameworkRegistry extends java.lang.Object implements MetadataVocabReloadListener
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.
Constructor and Description |
---|
FrameworkRegistry()
Constructor for the FrameworkRegistry object
|
FrameworkRegistry(javax.servlet.ServletContext servletContext)
FrameworkRegistry constructure with ServletContext
|
FrameworkRegistry(java.lang.String configDirPath,
java.lang.String docRoot)
Constructor for the FrameworkRegistry object for specified configuration
directory and docRoot (used for debugging - docRoot is normally calculated
from servletContext).
|
Modifier and Type | Method and Description |
---|---|
void |
clearLoadErrors()
Clear the load errors
|
void |
clearLoadWarnings()
Clear the load warnings
|
void |
destroy()
Destroys the loaded frameworks
|
void |
extractMuiGroups()
Initialize each framework with information about which fields can be
formatted using MUI Groups files.
|
java.util.List |
getAllFormats()
Return a list of formats for registered frameworks.
|
java.io.File |
getConfigDir()
Gets the directory in which framework config files are located.
|
MetaDataFramework |
getFramework(java.lang.String xmlFormat)
Gets the framework for the specified xmlFormat
|
boolean |
getIsLoaded(java.lang.String xmlFormat)
Returns true if the framework for provided xmlFormat is currently loaded in
this FrameworkRegistry
|
java.util.List |
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.
|
ErrorLog |
getLoadErrors()
Gets the loadErrors attribute of the FrameworkRegistry object
|
ErrorLog |
getLoadWarnings()
Gets the loadWarnings attribute of the FrameworkRegistry object
|
java.util.List |
getNames()
Return the formats of the registered frameworks, excluding "dlese_collect"
|
java.util.List |
getOaiFormats()
Gets the formats that are available to oai services, which are the
itemFrameworks plus "dlese_collect"
|
java.util.List |
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
|
void |
load()
Loads the FrameworkRegistry by traversing the framework config files in the
config directory.
|
void |
loadFramework(java.lang.String xmlFormat)
Loads the framework for specified xmlformat after finding the framework
config file
|
static void |
main(java.lang.String[] args)
NOT YET DOCUMENTED
|
void |
metadataVocabReloaded(MetadataVocabReloadEvent event)
Event handler for MetadataVocabReloadEvent registers MUI groups with
appropriate frameworks and then re-renders the editors for frameworks that
have registered MUI groups.
|
void |
register(MetaDataFramework mdf)
Register provided MetaDataFramework.
|
int |
size()
The number of registered frameworks
|
java.lang.String |
toString()
Return a string representation of the registry for debugging purposes.
|
void |
unregister(java.lang.String xmlFormat)
Remove the framework for provided xmlFormat from the registry
|
public FrameworkRegistry()
public FrameworkRegistry(javax.servlet.ServletContext servletContext)
servletContext
- the servletContextpublic FrameworkRegistry(java.lang.String configDirPath, java.lang.String docRoot)
configDirPath
- path to directory containing framework config filesdocRoot
- path to servlet baseDirpublic java.io.File getConfigDir()
public void loadFramework(java.lang.String xmlFormat) throws java.lang.Exception
xmlFormat
- the xmlFormat for the framework (e.g., "adn")java.lang.Exception
- if the framework could not be loadedpublic void load()
public ErrorLog getLoadErrors()
public void clearLoadErrors()
public ErrorLog getLoadWarnings()
public void clearLoadWarnings()
public void metadataVocabReloaded(MetadataVocabReloadEvent event)
metadataVocabReloaded
in interface MetadataVocabReloadListener
event
- NOT YET DOCUMENTEDpublic void extractMuiGroups()
public void register(MetaDataFramework mdf)
mdf
- the framework to be loadedpublic void unregister(java.lang.String xmlFormat)
xmlFormat
- format (e.g., "adn") corresponding to a loaded frameworkpublic MetaDataFramework getFramework(java.lang.String xmlFormat)
xmlFormat
- format (e.g., "adn") corresponding to a loaded frameworkpublic int size()
public boolean getIsLoaded(java.lang.String xmlFormat)
xmlFormat
- e.g., ("adn")public java.util.List getUnloadedFrameworks()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List getAllFormats()
public java.util.List getItemFormats()
public java.util.List getOaiFormats()
public java.util.List getNames()
public void destroy()
public static void main(java.lang.String[] args)
args
- NOT YET DOCUMENTED