org.kuali.rice.krad.uif.service.impl
Class AttributeQueryServiceImpl

java.lang.Object
  extended by org.kuali.rice.krad.uif.service.impl.AttributeQueryServiceImpl
All Implemented Interfaces:
AttributeQueryService

public class AttributeQueryServiceImpl
extends Object
implements AttributeQueryService

Implementation of AttributeQueryService that prepares the attribute queries and delegates to the LookupService

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
AttributeQueryServiceImpl()
           
 
Method Summary
protected  Collection<?> executeAttributeQueryCriteria(AttributeQuery attributeQuery, Map<String,String> queryParameters, Map<String,String> additionalCriteria)
          Prepares a query using the configured data object, parameters, and criteria, then executes the query and returns the result Collection
protected  Object executeAttributeQueryMethod(View view, AttributeQuery attributeQuery, Map<String,String> queryParameters, boolean isSuggestQuery, String queryTerm)
          Prepares the method configured on the attribute query then performs the method invocation
protected  ConfigurationService getConfigurationService()
          Gets the configuration service
protected  LookupService getLookupService()
          Gets the lookup service
 AttributeQueryResult performFieldQuery(View view, String fieldId, Map<String,String> queryParameters)
          Executes the AttributeQuery associated with the field given by the id.
 AttributeQueryResult performFieldSuggestQuery(View view, String fieldId, String fieldTerm, Map<String,String> queryParameters)
          Executes the AttributeQuery associated with the Suggest widget within the field given by the Id.
 void setConfigurationService(ConfigurationService configurationService)
          Sets the configuration service
 void setLookupService(LookupService lookupService)
          Sets the lookup service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeQueryServiceImpl

public AttributeQueryServiceImpl()
Method Detail

performFieldSuggestQuery

public AttributeQueryResult performFieldSuggestQuery(View view,
                                                     String fieldId,
                                                     String fieldTerm,
                                                     Map<String,String> queryParameters)
Description copied from interface: AttributeQueryService
Executes the AttributeQuery associated with the Suggest widget 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:
performFieldSuggestQuery in interface AttributeQueryService
Parameters:
view - - view instance for which the field belongs
fieldId - - id for the attribute field to perform the query for
fieldTerm - - the partial value of the query field to match
queryParameters - - map of key/value pairs that are parameters to the query
Returns:
AttributeQueryResult instance populated with the List data field of result data
See Also:
org.kuali.rice.krad.uif.service.AttributeQueryService#performFieldSuggestQuery( org.kuali.rice.krad.uif.view.View, java.lang.String, java.lang.String, java.util.Map)

performFieldQuery

public AttributeQueryResult performFieldQuery(View view,
                                              String fieldId,
                                              Map<String,String> queryParameters)
Description copied from interface: AttributeQueryService
Executes the AttributeQuery associated 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:
performFieldQuery in interface AttributeQueryService
Parameters:
view - - view instance for which the field belongs
fieldId - - id for the attribute field to perform the query for
queryParameters - - map of key/value pairs that are parameters to the query
Returns:
AttributeQueryResult instance populated with the Map of result field data
See Also:
org.kuali.rice.krad.uif.service.AttributeQueryService#performFieldQuery(org.kuali.rice.krad.uif.view.View, java.lang.String, java.util.Map)

executeAttributeQueryMethod

protected Object executeAttributeQueryMethod(View view,
                                             AttributeQuery attributeQuery,
                                             Map<String,String> queryParameters,
                                             boolean isSuggestQuery,
                                             String queryTerm)
Prepares the method configured on the attribute query then performs the method invocation

Parameters:
view - - view instance the field is contained within
attributeQuery - - attribute query instance to execute
queryParameters - - map of query parameters that provide values for the method arguments
isSuggestQuery - - indicates whether the query is for forming suggest options
queryTerm - - if being called for a suggest, the term for the query field
Returns:
Object 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)
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 for
queryParameters - - map of parameters that will be used in the query criteria
additionalCriteria - - map of additional name/value pairs to add to the critiera
Returns:
Collection results of query

getLookupService

protected LookupService getLookupService()
Gets the lookup service

Returns:
LookupService lookup service

setLookupService

public void setLookupService(LookupService lookupService)
Sets the lookup service

Parameters:
lookupService -

getConfigurationService

protected ConfigurationService getConfigurationService()
Gets the configuration service

Returns:
ConfigurationService configuration service

setConfigurationService

public void setConfigurationService(ConfigurationService configurationService)
Sets the configuration service

Parameters:
configurationService -


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.