public class AttributeQuery extends UifDictionaryBeanBase implements Serializable
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.
componentCode, namespaceCode
Constructor and Description |
---|
AttributeQuery() |
Modifier and Type | Method and Description |
---|---|
void |
completeValidation(ValidationTrace tracer) |
void |
defaultQueryTarget(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.
|
Map<String,String> |
getAdditionalCriteria()
Fixed criteria that will be appended to the dynamic criteria generated
for the query.
|
String |
getDataObjectClassName()
Class name for the data object the query should be performed against
|
Map<String,String> |
getQueryFieldMapping()
Configures the query parameters by mapping fields in the view
to properties on the data object class for the query
|
String |
getQueryFieldMappingJsString()
Builds String for passing the queryFieldMapping Map as a Javascript object
parameter
|
List<String> |
getQueryMethodArgumentFieldList()
List of field names that should be passed as arguments to the query method
|
String |
getQueryMethodArgumentFieldsJsString()
Builds String for passing the queryMethodArgumentFieldList as a Javascript Object
|
MethodInvokerConfig |
getQueryMethodInvokerConfig()
Configures the query method target class/object and method name
|
String |
getQueryMethodToCall()
Configures the name of the method that should be invoked to perform
the query
|
Map<String,String> |
getReturnFieldMapping()
Maps properties from the result object of the query to
fields in the view
|
String |
getReturnFieldMappingJsString()
Builds String for passing the returnFieldMapping Map as a Javascript object
parameter
|
String |
getReturnMessageStyleClasses()
CSS Style classes that should be applied to the return message.
|
String |
getReturnMessageText()
Message text to display along with the query result
|
List<String> |
getSortPropertyNames()
List of property names to sort the query results by.
|
boolean |
hasConfiguredMethod()
Indicates whether this attribute query is configured to invoke a custom
method as opposed to running the general object query.
|
boolean |
isRenderNotFoundMessage()
Indicates whether a message should be added to the query result
object and displayed when the query return object is null
|
void |
setAdditionalCriteria(Map<String,String> additionalCriteria)
Setter for the query's additional criteria map
|
void |
setDataObjectClassName(String dataObjectClassName)
Setter for the query data object class name
|
void |
setQueryFieldMapping(Map<String,String> queryFieldMapping)
Setter for the query parameter mapping
|
void |
setQueryMethodArgumentFieldList(List<String> queryMethodArgumentFieldList)
Setter for the query method argument list
|
void |
setQueryMethodInvokerConfig(MethodInvokerConfig queryMethodInvokerConfig)
Setter for the query method config
|
void |
setQueryMethodToCall(String queryMethodToCall)
Setter for the query method name
|
void |
setRenderNotFoundMessage(boolean renderNotFoundMessage)
Setter for the render not found message indicator
|
void |
setReturnFieldMapping(Map<String,String> returnFieldMapping)
Setter for the return field mapping
|
void |
setReturnMessageStyleClasses(String returnMessageStyleClasses)
Setter for the return messages style classes
|
void |
setReturnMessageText(String returnMessageText)
Setter for the return message text
|
void |
setSortPropertyNames(List<String> sortPropertyNames)
Setter for the list of property names to sort results by
|
void |
updateQueryFieldMapping(BindingInfo bindingInfo)
Adjusts the path on the query field mapping from property to match the binding
path prefix of the given
BindingInfo |
void |
updateQueryMethodArgumentFieldList(BindingInfo bindingInfo)
Adjusts the path on the query method arguments field list to match the binding
path prefix of the given
BindingInfo |
void |
updateReturnFieldMapping(BindingInfo bindingInfo)
Adjusts the path on the return field mapping to property to match the binding
path prefix of the given
BindingInfo |
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
clone, copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode
public AttributeQuery()
public void defaultQueryTarget(ViewHelperService viewHelperService)
viewHelperService
- instance of view helper to use as default for query methodspublic void updateQueryFieldMapping(BindingInfo bindingInfo)
BindingInfo
bindingInfo
- binding info instance to copy binding path prefix frompublic void updateReturnFieldMapping(BindingInfo bindingInfo)
BindingInfo
bindingInfo
- binding info instance to copy binding path prefix frompublic void updateQueryMethodArgumentFieldList(BindingInfo bindingInfo)
BindingInfo
bindingInfo
- binding info instance to copy binding path prefix frompublic String getQueryFieldMappingJsString()
public String getReturnFieldMappingJsString()
public String getQueryMethodArgumentFieldsJsString()
public boolean hasConfiguredMethod()
public String getDataObjectClassName()
public void setDataObjectClassName(String dataObjectClassName)
dataObjectClassName
- public Map<String,String> getQueryFieldMapping()
Each 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.
public void setQueryFieldMapping(Map<String,String> queryFieldMapping)
queryFieldMapping
- public Map<String,String> getReturnFieldMapping()
Each 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
public void setReturnFieldMapping(Map<String,String> returnFieldMapping)
returnFieldMapping
- public Map<String,String> getAdditionalCriteria()
public void setAdditionalCriteria(Map<String,String> additionalCriteria)
additionalCriteria
- public List<String> getSortPropertyNames()
public void setSortPropertyNames(List<String> sortPropertyNames)
sortPropertyNames
- public boolean isRenderNotFoundMessage()
public void setRenderNotFoundMessage(boolean renderNotFoundMessage)
renderNotFoundMessage
- public String getReturnMessageText()
public void setReturnMessageText(String returnMessageText)
returnMessageText
- public String getReturnMessageStyleClasses()
public void setReturnMessageStyleClasses(String returnMessageStyleClasses)
returnMessageStyleClasses
- public String getQueryMethodToCall()
Should 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 ViewHelperService
for the contained view.
public void setQueryMethodToCall(String queryMethodToCall)
queryMethodToCall
- public List<String> getQueryMethodArgumentFieldList()
Each 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
public void setQueryMethodArgumentFieldList(List<String> queryMethodArgumentFieldList)
queryMethodArgumentFieldList
- public MethodInvokerConfig getQueryMethodInvokerConfig()
When 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
public void setQueryMethodInvokerConfig(MethodInvokerConfig queryMethodInvokerConfig)
queryMethodInvokerConfig
- public void completeValidation(ValidationTrace tracer)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.