Class AttributeQueryServiceImpl

java.lang.Object
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 Details

    • AttributeQueryServiceImpl

      public AttributeQueryServiceImpl()
  • Method Details

    • performFieldSuggestQuery

      public AttributeQueryResult performFieldSuggestQuery(ViewPostMetadata viewPostMetadata, String fieldId, String fieldTerm, Map<String,String> queryParameters)
      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:
      viewPostMetadata - - post metadata related to the field
      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<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 in
      results - the set of original results
      suggestPostData - post data for the suggest widget
    • performFieldQuery

      public AttributeQueryResult performFieldQuery(ViewPostMetadata viewPostMetadata, String fieldId, Map<String,String> queryParameters)
      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:
      viewPostMetadata - - post metadata related to the field
      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 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 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:
      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 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
      wildcardAsLiteralPropertyNames - - List of property names with wildcards disabled
      Returns:
      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 org.kuali.rice.core.api.config.property.ConfigurationService getConfigurationService()
      Gets the configuration service
      Returns:
      configuration service
    • setConfigurationService

      public void setConfigurationService(org.kuali.rice.core.api.config.property.ConfigurationService configurationService)
      Sets the configuration service
      Parameters:
      configurationService -