Class AttributeQuery
- All Implemented Interfaces:
Serializable,Cloneable,Copyable,DictionaryBean,UifDictionaryBean
InputField to
pull data for updating the UI
There are two types of query types that can be configured and executed. The first is provided
completely by the framework using the LookupService and will perform a query
against the configured dataObjectClassName using the query parameters and return field mapping.
The second type will invoke a method that will perform the query. This can be configured using the
queryMethodToCall (if the method is on the view helper service), or using the queryMethodInvoker if
the method is on another class or object.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
Fields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompleteValidation(ValidationTrace tracer) voiddefaultQueryTarget(ViewHelperService viewHelperService) If the query is configured with a method and the target of that method is undefined, sets the target class to the class of the given view helper service.Fixed criteria that will be appended to the dynamic criteria generated for the query.Class name for the data object the query should be performed againstConfigures the query parameters by mapping fields in the view to properties on the data object class for the queryBuilds String for passing the queryFieldMapping Map as a Javascript object parameterList of field names that should be passed as arguments to the query methodBuilds String for passing the queryMethodArgumentFieldList as a Javascript ObjectConfigures the query method target class/object and method nameConfigures the name of the method that should be invoked to perform the queryMaps properties from the result object of the query to fields in the viewBuilds String for passing the returnFieldMapping Map as a Javascript object parameterCSS Style classes that should be applied to the return message.Message text to display along with the query resultList of property names to sort the query results by.booleanIndicates whether this attribute query is configured to invoke a custom method as opposed to running the general object query.booleanIndicates whether a message should be added to the query result object and displayed when the query return object is nullvoidsetAdditionalCriteria(Map<String, String> additionalCriteria) Setter for the query's additional criteria mapvoidsetDataObjectClassName(String dataObjectClassName) Setter for the query data object class namevoidsetQueryFieldMapping(Map<String, String> queryFieldMapping) Setter for the query parameter mappingvoidsetQueryMethodArgumentFieldList(List<String> queryMethodArgumentFieldList) Setter for the query method argument listvoidsetQueryMethodInvokerConfig(MethodInvokerConfig queryMethodInvokerConfig) Setter for the query method configvoidsetQueryMethodToCall(String queryMethodToCall) Setter for the query method namevoidsetRenderNotFoundMessage(boolean renderNotFoundMessage) Setter for the render not found message indicatorvoidsetReturnFieldMapping(Map<String, String> returnFieldMapping) Setter for the return field mappingvoidsetReturnMessageStyleClasses(String returnMessageStyleClasses) Setter for the return messages style classesvoidsetReturnMessageText(String returnMessageText) Setter for the return message textvoidsetSortPropertyNames(List<String> sortPropertyNames) Setter for the list of property names to sort results byvoidupdateQueryFieldMapping(BindingInfo bindingInfo) Adjusts the path on the query field mapping from property to match the binding path prefix of the givenBindingInfovoidupdateQueryMethodArgumentFieldList(BindingInfo bindingInfo) Adjusts the path on the query method arguments field list to match the binding path prefix of the givenBindingInfovoidupdateReturnFieldMapping(BindingInfo bindingInfo) Adjusts the path on the return field mapping to property to match the binding path prefix of the givenBindingInfoMethods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressionsMethods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
clone, copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCodeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode
-
Constructor Details
-
AttributeQuery
public AttributeQuery()
-
-
Method Details
-
defaultQueryTarget
If the query is configured with a method and the target of that method is undefined, sets the target class to the class of the given view helper service.- Parameters:
viewHelperService- instance of view helper to use as default for query methods
-
updateQueryFieldMapping
Adjusts the path on the query field mapping from property to match the binding path prefix of the givenBindingInfo- Parameters:
bindingInfo- binding info instance to copy binding path prefix from
-
updateReturnFieldMapping
Adjusts the path on the return field mapping to property to match the binding path prefix of the givenBindingInfo- Parameters:
bindingInfo- binding info instance to copy binding path prefix from
-
updateQueryMethodArgumentFieldList
Adjusts the path on the query method arguments field list to match the binding path prefix of the givenBindingInfo- Parameters:
bindingInfo- binding info instance to copy binding path prefix from
-
getQueryFieldMappingJsString
Builds String for passing the queryFieldMapping Map as a Javascript object parameter- Returns:
- js parameter string
-
getReturnFieldMappingJsString
Builds String for passing the returnFieldMapping Map as a Javascript object parameter- Returns:
- js parameter string
-
getQueryMethodArgumentFieldsJsString
Builds String for passing the queryMethodArgumentFieldList as a Javascript Object- Returns:
- js parameter string
-
hasConfiguredMethod
public boolean hasConfiguredMethod()Indicates whether this attribute query is configured to invoke a custom method as opposed to running the general object query. If either the query method to call is given, or the query method invoker is not null it is assumed the intention is to call a custom method- Returns:
- true if a custom method is configured, false if not
-
getDataObjectClassName
Class name for the data object the query should be performed against- Returns:
- data object class name
-
setDataObjectClassName
Setter for the query data object class name- Parameters:
dataObjectClassName-
-
getQueryFieldMapping
Configures the query parameters by mapping fields in the view to properties on the data object class for the queryEach map entry configures one parameter for the query, where the map key is the field name to pull the value from, and the map value is the property name on the object the parameter should populate.
- Returns:
- mapping of query parameters
-
setQueryFieldMapping
Setter for the query parameter mapping- Parameters:
queryFieldMapping-
-
getReturnFieldMapping
Maps properties from the result object of the query to fields in the viewEach map entry configures one return mapping, where the map key is the field name for the field to populate, and the map values is the name of the property on the result object to pull the value from
- Returns:
- return field mapping
-
setReturnFieldMapping
Setter for the return field mapping- Parameters:
returnFieldMapping-
-
getAdditionalCriteria
Fixed criteria that will be appended to the dynamic criteria generated for the query. Map key gives name of the property the criteria should apply to, and the map value is the value (literal) for the criteria. Standard lookup wildcards are allowed- Returns:
- field name/value pairs for query criteria
-
setAdditionalCriteria
Setter for the query's additional criteria map- Parameters:
additionalCriteria-
-
getSortPropertyNames
List of property names to sort the query results by. The sort will be performed on each property in the order they are contained within the list. Each property must be a valid property of the return query object (the data object in case of the general query)- Returns:
- property names
-
setSortPropertyNames
Setter for the list of property names to sort results by- Parameters:
sortPropertyNames-
-
isRenderNotFoundMessage
public boolean isRenderNotFoundMessage()Indicates whether a message should be added to the query result object and displayed when the query return object is null- Returns:
- true if not found message should be added, false otherwise
-
setRenderNotFoundMessage
public void setRenderNotFoundMessage(boolean renderNotFoundMessage) Setter for the render not found message indicator- Parameters:
renderNotFoundMessage-
-
getReturnMessageText
Message text to display along with the query result- Returns:
- literal message text
-
setReturnMessageText
Setter for the return message text- Parameters:
returnMessageText-
-
getReturnMessageStyleClasses
CSS Style classes that should be applied to the return message. Multiple style classes should be delimited by a space- Returns:
- style classes
-
setReturnMessageStyleClasses
Setter for the return messages style classes- Parameters:
returnMessageStyleClasses-
-
getQueryMethodToCall
Configures the name of the method that should be invoked to perform the queryShould contain only the method name (no parameters or return type). If only the query method name is configured it is assumed to be on the
ViewHelperServicefor the contained view.- Returns:
- query method name
-
setQueryMethodToCall
Setter for the query method name- Parameters:
queryMethodToCall-
-
getQueryMethodArgumentFieldList
List of field names that should be passed as arguments to the query methodEach entry in the list maps to a method parameter, in the other contained within the list. The value for the field within the view will be pulled and passed to the query method as an argument
- Returns:
- query method argument list
-
setQueryMethodArgumentFieldList
Setter for the query method argument list- Parameters:
queryMethodArgumentFieldList-
-
getQueryMethodInvokerConfig
Configures the query method target class/object and method nameWhen the query method is not contained on the
ViewHelperService, this can be configured for declaring the target class/object and method. The target class can be set in which case a new instance will be created and the given method invoked. Alternatively, the target object instance for the invocation can be given. Or finally a static method can be configured- Returns:
- query method config
-
setQueryMethodInvokerConfig
Setter for the query method config- Parameters:
queryMethodInvokerConfig-
-
completeValidation
- See Also:
-