Class UifDictionaryIndex
java.lang.Object
org.kuali.rice.krad.datadictionary.uif.UifDictionaryIndex
- All Implemented Interfaces:
Runnable
Indexes
View bean entries for retrieval.
This is used to retrieve a View instance by its unique id.
Furthermore, view of certain types (that have a ViewTypeService
are indexed by their type to support retrieval of views based on parameters.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
ConstructorsConstructorDescriptionUifDictionaryIndex(org.springframework.beans.factory.support.DefaultListableBeanFactory ddBeans) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbuildTypeIndex(Map<String, String> typeParameters) Builds up an index string from the given Map of parametersprotected voidInitializes the view indexMapthen iterates through all the beans in the factory that implementView, adding them to the indexgetImmutableViewById(String viewId) Retrieves the view singleton from spring that has the given id.protected ViewTypeDictionaryIndexgetTypeIndex(UifConstants.ViewType viewType) Retrieves theViewTypeDictionaryIndexinstance for the given view type name.getViewById(String viewId) Retrieves the View instance with the given id.getViewByTypeIndex(UifConstants.ViewType viewTypeName, Map<String, String> indexKey) Retrieves aViewinstance that is of the given type based on the index keygetViewIdByTypeIndex(UifConstants.ViewType viewTypeName, Map<String, String> indexKey) Retrieves the id for the view that is associated with the given view type and index keyorg.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 voidindexViewForType(org.springframework.beans.PropertyValues propertyValues, String id) Performs additional indexing based on the view type associated with the view instance.voidrun()booleanviewByTypeExist(UifConstants.ViewType viewTypeName, Map<String, String> indexKey) Indicates whether aViewexists for the given view type and index information
-
Constructor Details
-
UifDictionaryIndex
public UifDictionaryIndex(org.springframework.beans.factory.support.DefaultListableBeanFactory ddBeans)
-
-
Method Details
-
run
public void run() -
getViewById
Retrieves the View instance with the given id.Invokes
getImmutableViewById(java.lang.String)to get the view singleton from spring then returns a copy.- Parameters:
viewId- the unique id for the view- Returns:
- View instance with the given id
- Throws:
DataDictionaryException- if view doesn't exist for id
-
getImmutableViewById
Retrieves the view singleton from spring that has the given id.- Parameters:
viewId- the unique id for the view- Returns:
- View instance with the given id
-
getViewByTypeIndex
Retrieves aViewinstance that is of the given type based on the index key- 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 or Null if one is not found
-
getViewIdByTypeIndex
Retrieves the id for the view that is associated with the given view type and index key- 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
-
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
-
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
-
buildViewIndicies
protected void buildViewIndicies()Initializes the view indexMapthen iterates through all the beans in the factory that implementView, adding them to the index -
indexViewForType
Performs additional indexing based on the view type associated with the view instance. TheViewTypeServiceassociated with the view type name on the instance is invoked to retrieve the parameter key/value pairs from the configured property values, which are then used to build up an index used to key the entry- Parameters:
propertyValues- - property values configured on the view bean definitionid- - id (or bean name if id was not set) for the view
-
getTypeIndex
Retrieves theViewTypeDictionaryIndexinstance for the given view type name. If one does not exist yet for the given name, a new instance is created- Parameters:
viewType- - name of the view type to retrieve index for- Returns:
- ViewTypeDictionaryIndex instance
-
buildTypeIndex
Builds up an index string from the given Map of parameters- Parameters:
typeParameters- - Map of parameters to use for index- Returns:
- String index
-