Class DataDictionary
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.beans.factory.support.DefaultListableBeanFactoryprotected DataDictionaryIndexprotected DataDictionaryMapperprotected org.springframework.util.StopWatchprotected UifDictionaryIndex -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigFileLocation(String namespaceCode, String location) Adds a location of files or a individual resource to the data dictionaryvoidaddModuleDictionaryFile(String namespaceCode, String location) Adds a file location to the list of dictionary files for the given namespace codevoidaddModuleDictionaryFile(String namespaceCode, org.springframework.core.io.Resource location) booleanIndicates whether the data dictionary contains a bean with the given idgetAllInactivationBlockingMetadatas(Class blockedClass) getBeanNamesForNamespace(String namespaceCode) Retrieves the list of dictionary bean names that are associated with the given namespace codegetBusinessObjectEntry(String className) Deprecated.getBusinessObjectEntryForConcreteClass(String className) This method gets the business object entry for a concrete classgetDataObjectEntry(String className) getDictionaryBean(String beanName) Returns an object from the dictionary by its spring bean namegetDictionaryBeanProperty(String beanName, String propertyName) Returns a property value for the bean with the given name from the dictionary.getDictionaryObjectEntry(String className) getDictionaryPrototype(String beanName) Returns a prototype object from the dictionary by its spring bean namegetDocumentEntry(String documentTypeDDKey) Returns the KNS document entry for the given lookup key.protected org.springframework.core.io.ResourcegetFileResource(String sourceName) getImmutableViewById(String viewId) Returns the View entry identified by the given id, meant for view readonly access (not running the lifecycle but just checking configuration)getMaintenanceDocumentEntryForBusinessObjectClass(Class<?> businessObjectClass) Note: only MaintenanceDocuments are indexed by businessObject Class This is a special case that is referenced in one location.Mapping of namespace codes to dictionary files that are associated with that namespaceOrder modules should be loaded into the dictionarygetNamespaceForBeanDefinition(String beanName) Retrieves the namespace code the given bean name is associated withgetViewById(String viewId) Returns the View entry identified by the given idgetViewByTypeIndex(UifConstants.ViewType viewTypeName, Map<String, String> indexKey) Returns View instance identified by the view type name and indexgetViewIdByTypeIndex(UifConstants.ViewType viewTypeName, Map<String, String> indexKey) Returns the view id for the view that matches the given view type and indexorg.springframework.beans.PropertyValuesgetViewPropertiesById(String viewId) Retrieves the configured property values for the view bean definition associated with the given idorg.springframework.beans.PropertyValuesgetViewPropertiesByType(UifConstants.ViewType viewTypeName, Map<String, String> indexKey) Retrieves the configured property values for the view bean definition associated with the given type and indexgetViewsForType(UifConstants.ViewType viewTypeName) Gets allViewprototypes configured for the given view type nameprotected voidindexSource(String namespaceCode, File dir) protected voidindexSource(String namespaceCode, String sourceName) Processes a given source for XML files to populate the dictionary withvoidloadDictionaryBeans(org.springframework.beans.factory.support.DefaultListableBeanFactory beans, Map<String, List<org.springframework.core.io.Resource>> moduleDictionaryFiles, DataDictionaryIndex index) Populates and processes the dictionary bean factory based on the configured filesvoidPopulates and processes the dictionary bean factory based on the configured files and performs indexingvoidThis method gathers beans of type BeanOverride and invokes each one's performOverride() method.protected voidInvokes post processors and builds indexes for the beans contained in the dictionaryprotected StringproduceErrorReport(List<ErrorReport> errorReports, boolean hasErrors) voidSets the DataDictionaryMappervoidsetModuleDictionaryFiles(Map<String, List<org.springframework.core.io.Resource>> moduleDictionaryFiles) Setter for the map of module dictionary filesvoidsetModuleLoadOrder(List<String> moduleLoadOrder) Setter for the list of namespace codes indicating the module load ordervoidbooleanviewByTypeExist(UifConstants.ViewType viewTypeName, Map<String, String> indexKey) Indicates whether aViewexists for the given view type and index information
-
Field Details
-
ddBeans
protected org.springframework.beans.factory.support.DefaultListableBeanFactory ddBeans -
ddIndex
-
uifIndex
-
ddMapper
-
moduleDictionaryFiles
-
moduleLoadOrder
-
timer
protected org.springframework.util.StopWatch timer
-
-
Constructor Details
-
DataDictionary
public DataDictionary()
-
-
Method Details
-
parseDataDictionaryConfigurationFiles
public void parseDataDictionaryConfigurationFiles()Populates and processes the dictionary bean factory based on the configured files and performs indexing -
loadDictionaryBeans
public void loadDictionaryBeans(org.springframework.beans.factory.support.DefaultListableBeanFactory beans, Map<String, List<org.springframework.core.io.Resource>> moduleDictionaryFiles, DataDictionaryIndex index) Populates and processes the dictionary bean factory based on the configured files- Parameters:
beans- - The bean factory for the dictionary beanmoduleDictionaryFiles- - List of bean xml filesindex- - Index of the data dictionary beans
-
performDictionaryPostProcessing
protected void performDictionaryPostProcessing()Invokes post processors and builds indexes for the beans contained in the dictionary -
validateDD
public void validateDD() -
produceErrorReport
-
addConfigFileLocation
Adds a location of files or a individual resource to the data dictionaryThe location can either be an XML file on the classpath or a file or folder location within the file system. If a folder location is given, the folder and all sub-folders will be traversed and any XML files will be added to the dictionary
- Parameters:
namespaceCode- - namespace the beans loaded from the location should be associated withlocation- - classpath resource or file system location- Throws:
IOException
-
indexSource
Processes a given source for XML files to populate the dictionary with- Parameters:
namespaceCode- - namespace the beans loaded from the location should be associated withsourceName- - a file system or classpath resource locator- Throws:
IOException
-
getFileResource
-
indexSource
-
addModuleDictionaryFile
Adds a file location to the list of dictionary files for the given namespace code- Parameters:
namespaceCode- - namespace to add location forlocation- - file or resource location to add
-
addModuleDictionaryFile
public void addModuleDictionaryFile(String namespaceCode, org.springframework.core.io.Resource location) -
getModuleDictionaryFiles
Mapping of namespace codes to dictionary files that are associated with that namespace- Returns:
- Map<String, List<Resource>> where map key is namespace code, and value is list of dictionary file locations
-
setModuleDictionaryFiles
public void setModuleDictionaryFiles(Map<String, List<org.springframework.core.io.Resource>> moduleDictionaryFiles) Setter for the map of module dictionary files -
getModuleLoadOrder
Order modules should be loaded into the dictionaryModules are loaded in the order they are found in this list. If not explicitly set, they will be loaded in the order their dictionary file locations are added
- Returns:
- List<String> list of namespace codes indicating the module load order
-
setModuleLoadOrder
Setter for the list of namespace codes indicating the module load order -
setDataDictionaryMapper
Sets the DataDictionaryMapper- Parameters:
mapper- the datadictionary mapper
-
getBusinessObjectEntry
Deprecated.- Returns:
- BusinessObjectEntry for the named class, or null if none exists
-
getDataObjectEntry
- Returns:
- BusinessObjectEntry for the named class, or null if none exists
-
getBusinessObjectEntryForConcreteClass
This method gets the business object entry for a concrete class- Returns:
- business object entry
-
getBusinessObjectClassNames
- Returns:
- List of businessObject classnames
-
getBusinessObjectEntries
- Returns:
- Map of (classname, BusinessObjectEntry) pairs
-
getDataObjectEntries
-
getDictionaryObjectEntry
- Returns:
- DataDictionaryEntryBase for the named class, or null if none exists
-
getDocumentEntry
Returns the KNS document entry for the given lookup key. The documentTypeDDKey is interpreted successively in the following ways until a mapping is found (or none if found):- KEW/workflow document type
- business object class name
- maintainable class name
- Parameters:
documentTypeDDKey- the KEW/workflow document type name- Returns:
- the KNS DocumentEntry if it exists
-
getMaintenanceDocumentEntryForBusinessObjectClass
public MaintenanceDocumentEntry getMaintenanceDocumentEntryForBusinessObjectClass(Class<?> businessObjectClass) Note: only MaintenanceDocuments are indexed by businessObject Class This is a special case that is referenced in one location. Do we need another map for this stuff??- Returns:
- DocumentEntry associated with the given Class, or null if there is none
-
getDocumentEntries
-
getViewById
Returns the View entry identified by the given id- Parameters:
viewId- unique id for view- Returns:
- View instance associated with the id
-
getImmutableViewById
Returns the View entry identified by the given id, meant for view readonly access (not running the lifecycle but just checking configuration)- Parameters:
viewId- unique id for view- Returns:
- View instance associated with the id
-
getViewByTypeIndex
Returns View instance identified by the view type name and index- Parameters:
viewTypeName- - type name for the viewindexKey- - Map of index key parameters, these are the parameters the indexer used to index the view initially and needs to identify an unique view instance- Returns:
- View instance that matches the given index
-
getViewIdByTypeIndex
Returns the view id for the view that matches the given view type and index- Parameters:
viewTypeName- type name for the viewindexKey- Map of index key parameters, these are the parameters the indexer used to index the view initially and needs to identify an unique view instance- Returns:
- id for the view that matches the view type and index or null if a match is not found
-
viewByTypeExist
Indicates whether aViewexists for the given view type and index information- Parameters:
viewTypeName- - type name for the viewindexKey- - Map of index key parameters, these are the parameters the indexer used to index the view initially and needs to identify an unique view instance- Returns:
- boolean true if view exists, false if not
-
getViewsForType
Gets allViewprototypes configured for the given view type name- Parameters:
viewTypeName- - view type name to retrieve- Returns:
- List<View> view prototypes with the given type name, or empty list
-
getDictionaryBean
Returns an object from the dictionary by its spring bean name- Parameters:
beanName- id or name for the bean definition- Returns:
- Object object instance created or the singleton being maintained
-
containsDictionaryBean
Indicates whether the data dictionary contains a bean with the given id- Parameters:
id- id of the bean to check for- Returns:
- boolean true if dictionary contains bean, false otherwise
-
getDictionaryPrototype
Returns a prototype object from the dictionary by its spring bean name- Parameters:
beanName- id or name for the bean definition- Returns:
- Object object instance created
-
getDictionaryBeanProperty
Returns a property value for the bean with the given name from the dictionary.- Parameters:
beanName- id or name for the bean definitionpropertyName- name of the property to retrieve, must be a valid property configured on the bean definition- Returns:
- Object property value for property
-
getViewPropertiesById
Retrieves the configured property values for the view bean definition associated with the given idSince constructing the View object can be expensive, when metadata only is needed this method can be used to retrieve the configured property values. Note this looks at the merged bean definition
- Parameters:
viewId- - id for the view to retrieve- Returns:
- PropertyValues configured on the view bean definition, or null if view is not found
-
getViewPropertiesByType
public org.springframework.beans.PropertyValues getViewPropertiesByType(UifConstants.ViewType viewTypeName, Map<String, String> indexKey) Retrieves the configured property values for the view bean definition associated with the given type and indexSince constructing the View object can be expensive, when metadata only is needed this method can be used to retrieve the configured property values. Note this looks at the merged bean definition
- Parameters:
viewTypeName- - type name for the viewindexKey- - Map of index key parameters, these are the parameters the indexer used to index the view initially and needs to identify an unique view instance- Returns:
- PropertyValues configured on the view bean definition, or null if view is not found
-
getBeanNamesForNamespace
Retrieves the list of dictionary bean names that are associated with the given namespace code- Parameters:
namespaceCode- - namespace code to retrieve associated bean names for- Returns:
- List<String> bean names associated with the namespace
-
getNamespaceForBeanDefinition
Retrieves the namespace code the given bean name is associated with- Parameters:
beanName- - name of the dictionary bean to find namespace code for- Returns:
- String namespace code the bean is associated with, or null if a namespace was not found
-
getAllInactivationBlockingMetadatas
-
performBeanOverrides
public void performBeanOverrides()This method gathers beans of type BeanOverride and invokes each one's performOverride() method.
-