public class UifDictionaryIndex extends Object implements Runnable
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.
Constructor and Description |
---|
UifDictionaryIndex(DefaultListableBeanFactory ddBeans) |
Modifier and Type | Method and Description |
---|---|
protected String |
buildTypeIndex(Map<String,String> typeParameters)
Builds up an index string from the given Map of parameters
|
protected void |
buildViewIndicies()
Initializes the view index
Map then iterates through all the
beans in the factory that implement View , adding them to the
index |
View |
getImmutableViewById(String viewId)
Gets a view instance from the pool or factory but does not replace the view, meant for view readonly
access (not running the lifecycle but just checking configuration)
|
protected ViewTypeDictionaryIndex |
getTypeIndex(UifConstants.ViewType viewType)
Retrieves the
ViewTypeDictionaryIndex instance for the given
view type name. |
View |
getViewById(String viewId)
Retrieves the View instance with the given id
|
View |
getViewByTypeIndex(UifConstants.ViewType viewTypeName,
Map<String,String> indexKey)
Retrieves a
View instance that is of the given type based on
the index key |
String |
getViewIdByTypeIndex(UifConstants.ViewType viewTypeName,
Map<String,String> indexKey)
Retrieves the id for the view that is associated with the given view type and index key
|
org.springframework.beans.PropertyValues |
getViewPropertiesById(String viewId)
Retrieves the configured property values for the view bean definition associated with the given id
|
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
index
|
List<View> |
getViewsForType(UifConstants.ViewType viewTypeName)
Gets all
View prototypes configured for the given view type
name |
protected void |
indexViewForType(org.springframework.beans.PropertyValues propertyValues,
String id)
Performs additional indexing based on the view type associated with the view instance.
|
void |
run() |
boolean |
viewByTypeExist(UifConstants.ViewType viewTypeName,
Map<String,String> indexKey)
Indicates whether a
View exists for the given view type and index information |
public UifDictionaryIndex(DefaultListableBeanFactory ddBeans)
public View getViewById(String viewId)
First an attempt is made to get a cached view (if one exists). If found it is pulled from the cache and cloned to preserve the integrity of the cache. If not already cached, one is built by Spring from the bean factory and then cloned.
viewId
- the unique id for the viewDataDictionaryException
- if view doesn't exist for idpublic View getImmutableViewById(String viewId)
viewId
- the unique id for the viewpublic View getViewByTypeIndex(UifConstants.ViewType viewTypeName, Map<String,String> indexKey)
View
instance that is of the given type based on
the index keyviewTypeName
- - 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 instancepublic String getViewIdByTypeIndex(UifConstants.ViewType viewTypeName, Map<String,String> indexKey)
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 instancepublic boolean viewByTypeExist(UifConstants.ViewType viewTypeName, Map<String,String> indexKey)
View
exists for the given view type and index informationviewTypeName
- - 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 instancepublic org.springframework.beans.PropertyValues getViewPropertiesById(String viewId)
Since 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
viewId
- - id for the view to retrievepublic org.springframework.beans.PropertyValues getViewPropertiesByType(UifConstants.ViewType viewTypeName, Map<String,String> indexKey)
Since 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
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 instancepublic List<View> getViewsForType(UifConstants.ViewType viewTypeName)
View
prototypes configured for the given view type
nameviewTypeName
- - view type name to retrieveprotected void buildViewIndicies()
Map
then iterates through all the
beans in the factory that implement View
, adding them to the
indexprotected void indexViewForType(org.springframework.beans.PropertyValues propertyValues, String id)
ViewTypeService
associated 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 entrypropertyValues
- - property values configured on the view bean definitionid
- - id (or bean name if id was not set) for the viewprotected ViewTypeDictionaryIndex getTypeIndex(UifConstants.ViewType viewType)
ViewTypeDictionaryIndex
instance for the given
view type name. If one does not exist yet for the given name, a new
instance is createdviewType
- - name of the view type to retrieve index forprotected String buildTypeIndex(Map<String,String> typeParameters)
typeParameters
- - Map of parameters to use for indexCopyright © 2005–2016 The Kuali Foundation. All rights reserved.