Class AttributeQueryServiceImpl
java.lang.Object
org.kuali.rice.krad.uif.service.impl.AttributeQueryServiceImpl
- All Implemented Interfaces:
AttributeQueryService
Implementation of
AttributeQueryService that prepares the attribute queries and
delegates to the LookupService- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<?> executeAttributeQueryCriteria(AttributeQuery attributeQuery, Map<String, String> queryParameters, Map<String, String> additionalCriteria, List<String> wildcardAsLiteralPropertyNames) Prepares a query using the configured data object, parameters, and criteria, then executes the query and returns the result Collectionprotected ObjectexecuteAttributeQueryMethod(AttributeQuery attributeQuery, Map<String, String> queryParameters, boolean isSuggestQuery, String queryTerm) Prepares the method configured on the attribute query then performs the method invocationprotected ConfigurationServiceGets the configuration serviceprotected LookupServiceGets the lookup serviceperformFieldQuery(ViewPostMetadata viewPostMetadata, String fieldId, Map<String, String> queryParameters) Executes theAttributeQueryassociated with the field given by the id.performFieldSuggestQuery(ViewPostMetadata viewPostMetadata, String fieldId, String fieldTerm, Map<String, String> queryParameters) Executes theAttributeQueryassociated with theSuggestwidget within the field given by the Id.protected voidretrievePropertiesOnResults(AttributeQueryResult queryResult, Collection<?> results, Suggest.SuggestPostData suggestPostData) Instead of returning the full object this method fills in queryResult with data that contain the properties of each result object, as configured through the fieldSuggest, from the set of results.voidsetConfigurationService(ConfigurationService configurationService) Sets the configuration servicevoidsetLookupService(LookupService lookupService) Sets the lookup service
-
Constructor Details
-
AttributeQueryServiceImpl
public AttributeQueryServiceImpl()
-
-
Method Details
-
performFieldSuggestQuery
public AttributeQueryResult performFieldSuggestQuery(ViewPostMetadata viewPostMetadata, String fieldId, String fieldTerm, Map<String, String> queryParameters) Executes theAttributeQueryassociated with theSuggestwidget within the field given by the Id. The given Map of key/value pairs are used to populate the criteria part of the attribute query or as arguments to the query method. The fieldTerm parameter gives the current value of the field that should be matched on. The query is expected to return a list of values to suggest- Specified by:
performFieldSuggestQueryin interfaceAttributeQueryService- Parameters:
viewPostMetadata- - post metadata related to the fieldfieldId- - id for the attribute field to perform the query forfieldTerm- - the partial value of the query field to matchqueryParameters- - map of key/value pairs that are parameters to the query- Returns:
- AttributeQueryResult instance populated with the List<String> data field of result data
-
retrievePropertiesOnResults
protected void retrievePropertiesOnResults(AttributeQueryResult queryResult, Collection<?> results, Suggest.SuggestPostData suggestPostData) Instead of returning the full object this method fills in queryResult with data that contain the properties of each result object, as configured through the fieldSuggest, from the set of results.- Parameters:
queryResult- the queryResult to fill inresults- the set of original resultssuggestPostData- post data for the suggest widget
-
performFieldQuery
public AttributeQueryResult performFieldQuery(ViewPostMetadata viewPostMetadata, String fieldId, Map<String, String> queryParameters) Executes theAttributeQueryassociated with the field given by the id. The given Map of key/value pairs are used to populate the criteria part of the attribute query or as arguments to the query method. The query is expected to return a Map of field name/value pairs (unlike the suggest query which just returns values for one field)- Specified by:
performFieldQueryin interfaceAttributeQueryService- Parameters:
viewPostMetadata- - post metadata related to the fieldfieldId- - id for the attribute field to perform the query forqueryParameters- - map of key/value pairs that are parameters to the query- Returns:
- AttributeQueryResult instance populated with the Mapinvalid input: '<'String, String> of result field data
-
executeAttributeQueryMethod
protected Object executeAttributeQueryMethod(AttributeQuery attributeQuery, Map<String, String> queryParameters, boolean isSuggestQuery, String queryTerm) Prepares the method configured on the attribute query then performs the method invocation- Parameters:
attributeQuery- attribute query instance to executequeryParameters- map of query parameters that provide values for the method argumentsisSuggestQuery- indicates whether the query is for forming suggest optionsqueryTerm- if being called for a suggest, the term for the query field- Returns:
- type depends on method being invoked, could be AttributeQueryResult in which case the method has prepared the return result, or an Object that needs to be parsed for the result
-
executeAttributeQueryCriteria
protected Collection<?> executeAttributeQueryCriteria(AttributeQuery attributeQuery, Map<String, String> queryParameters, Map<String, String> additionalCriteria, List<String> wildcardAsLiteralPropertyNames) Prepares a query using the configured data object, parameters, and criteria, then executes the query and returns the result Collection- Parameters:
attributeQuery- attribute query instance to perform query forqueryParameters- map of parameters that will be used in the query criteriaadditionalCriteria- map of additional name/value pairs to add to the critierawildcardAsLiteralPropertyNames- - List of property names with wildcards disabled- Returns:
- results of query
-
getLookupService
Gets the lookup service- Returns:
- LookupService lookup service
-
setLookupService
Sets the lookup service- Parameters:
lookupService-
-
getConfigurationService
Gets the configuration service- Returns:
- configuration service
-
setConfigurationService
Sets the configuration service- Parameters:
configurationService-
-