|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.validation.DataBinder org.springframework.web.bind.WebDataBinder org.springframework.web.bind.ServletRequestDataBinder org.kuali.rice.krad.web.bind.UifServletRequestDataBinder
public class UifServletRequestDataBinder
Override of ServletRequestDataBinder in order to hook in the UifBeanPropertyBindingResult which instantiates a custom BeanWrapperImpl, and to initialize the view.
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
LOG
|
Fields inherited from class org.springframework.web.bind.WebDataBinder |
---|
DEFAULT_FIELD_DEFAULT_PREFIX, DEFAULT_FIELD_MARKER_PREFIX |
Fields inherited from class org.springframework.validation.DataBinder |
---|
DEFAULT_AUTO_GROW_COLLECTION_LIMIT, DEFAULT_OBJECT_NAME, logger |
Constructor Summary | |
---|---|
UifServletRequestDataBinder(Object target)
|
|
UifServletRequestDataBinder(Object target,
String name)
|
Method Summary | |
---|---|
protected Set<String> |
assembleAutoLinkingPaths(String path,
Link autoLink)
A helper method which simply assembles a set of property paths for the given Link annotation which should
be auto linked. |
void |
bind(javax.servlet.ServletRequest request)
Calls UifFormBase.preBind(HttpServletRequest) , Performs data binding
from servlet request parameters to the form, initializes view object, then calls
UifFormBase.postBind(javax.servlet.http.HttpServletRequest) |
protected Set<String> |
determineRootAutoLinkingPaths(Class<?> rootObjectType,
String path,
Set<Class<?>> scanned)
Determines the root property paths relative to the given root object type against which to perform automatic linking. |
protected void |
executeAutomaticLinking(javax.servlet.ServletRequest request,
UifFormBase form)
Performs automatic reference linking of the given form based on the properties on the form for which linking is enabled. |
protected List<org.kuali.rice.krad.web.bind.UifServletRequestDataBinder.AutoLinkTarget> |
extractAutoLinkTargets(Set<String> autoLinkingPaths)
Uses the binding result on this data binder to determine the targets on the form that automatic linking should be performed against. |
DataObjectService |
getDataObjectService()
|
protected org.springframework.validation.AbstractPropertyBindingResult |
getInternalBindingResult()
Allows for the setting attributes to use to find the data dictionary data from Kuali |
protected View |
getViewByType(javax.servlet.ServletRequest request,
UifFormBase form)
Attempts to get a view instance by looking for a view type name in the request or the form and querying that view type with the request parameters |
protected View |
getViewFromPreviousModel(UifFormBase form)
Attempts to get a view instance based on the view id stored on the form (which might not be populated from the request but remaining from session) |
ViewService |
getViewService()
|
void |
initBeanPropertyAccess()
Allows for a custom binding result class. |
void |
initDirectFieldAccess()
Disallows direct field access for Kuali |
boolean |
isAutoLinking()
|
boolean |
isChangeTracking()
|
void |
setAutoLinking(boolean autoLinking)
|
void |
setDataObjectService(DataObjectService dataObjectService)
|
Methods inherited from class org.springframework.web.bind.ServletRequestDataBinder |
---|
addBindValues, closeNoCatch |
Methods inherited from class org.springframework.web.bind.WebDataBinder |
---|
bindMultipart, bindMultipartFiles, checkFieldDefaults, checkFieldMarkers, doBind, getEmptyValue, getFieldDefaultPrefix, getFieldMarkerPrefix, isBindEmptyMultipartFiles, setBindEmptyMultipartFiles, setFieldDefaultPrefix, setFieldMarkerPrefix |
Methods inherited from class org.springframework.validation.DataBinder |
---|
addValidators, applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, convertIfNecessary, findCustomEditor, getAllowedFields, getAutoGrowCollectionLimit, getBindingErrorProcessor, getBindingResult, getConversionService, getDisallowedFields, getErrors, getObjectName, getPropertyAccessor, getPropertyEditorRegistry, getRequiredFields, getSimpleTypeConverter, getTarget, getTypeConverter, getValidator, getValidators, isAllowed, isAutoGrowNestedPaths, isIgnoreInvalidFields, isIgnoreUnknownFields, registerCustomEditor, registerCustomEditor, replaceValidators, setAllowedFields, setAutoGrowCollectionLimit, setAutoGrowNestedPaths, setBindingErrorProcessor, setConversionService, setDisallowedFields, setExtractOldValueForEditor, setIgnoreInvalidFields, setIgnoreUnknownFields, setMessageCodesResolver, setRequiredFields, setValidator, validate, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger LOG
Constructor Detail |
---|
public UifServletRequestDataBinder(Object target)
public UifServletRequestDataBinder(Object target, String name)
Method Detail |
---|
public void initBeanPropertyAccess()
initBeanPropertyAccess
in class org.springframework.validation.DataBinder
DataBinder.initBeanPropertyAccess()
protected org.springframework.validation.AbstractPropertyBindingResult getInternalBindingResult()
getInternalBindingResult
in class org.springframework.validation.DataBinder
DataBinder.getInternalBindingResult()
public void initDirectFieldAccess()
initDirectFieldAccess
in class org.springframework.validation.DataBinder
DataBinder.initDirectFieldAccess()
public void bind(javax.servlet.ServletRequest request)
UifFormBase.preBind(HttpServletRequest)
, Performs data binding
from servlet request parameters to the form, initializes view object, then calls
UifFormBase.postBind(javax.servlet.http.HttpServletRequest)
The view is initialized by first looking for the viewId
parameter in the request. If found, the view is
retrieved based on this id. If the id is not present, then an attempt is made to find a view by type. In order
to retrieve a view based on type, the view request parameter viewTypeName
must be present. If all else
fails and the viewId is populated on the form (could be populated from a previous request), this is used to
retrieve the view.
bind
in class org.springframework.web.bind.ServletRequestDataBinder
request
- - HTTP Servlet Request instanceprotected void executeAutomaticLinking(javax.servlet.ServletRequest request, UifFormBase form)
Linking will only be performed if change tracking and auto linking are enabled on this data binder.
request
- request instanceform
- form instance against which to perform automatic linkingprotected Set<String> determineRootAutoLinkingPaths(Class<?> rootObjectType, String path, Set<Class<?>> scanned)
This will be determined based on the presence of Link
annotations on the given root object type.
This method is invoked recursively as it walks the class structure looking for Link annotations. It uses the path
and scanned arguments to keep track of how deep into the structure the scanning is and to prevent infinite
recursion.
rootObjectType
- the root object type from which to perform the scan for auto-linking pathspath
- the current property path relative to the original root object type at which the scan began, if null
then we are scanning from the root-most object type. Each recursive call of this method will append
a new property to this pathscanned
- used to track classes that have already been scanned and prevent infinite recursion
protected Set<String> assembleAutoLinkingPaths(String path, Link autoLink)
Link
annotation which should
be auto linked.
path
- the property path from the top-most root class to where the Link annotation was found during the scanautoLink
- the Link annotation which is being processed
Link
annotationprotected List<org.kuali.rice.krad.web.bind.UifServletRequestDataBinder.AutoLinkTarget> extractAutoLinkTargets(Set<String> autoLinkingPaths)
Only those property paths for which auto linking is enabled and which were actually modified during the execution of this data binding will be returned from this method.
autoLinkingPaths
- a set of paths relative to the form class for which auto-linking has been enabled
AutoLinkTarget
objects which contain an object to be linked and which properties on
that object were modified during this data binding executionprotected View getViewByType(javax.servlet.ServletRequest request, UifFormBase form)
request
- request instance to pull parameters fromform
- form instance to pull values from
protected View getViewFromPreviousModel(UifFormBase form)
form
- form instance to pull view id from
public boolean isChangeTracking()
public boolean isAutoLinking()
public void setAutoLinking(boolean autoLinking)
public ViewService getViewService()
public DataObjectService getDataObjectService()
public void setDataObjectService(DataObjectService dataObjectService)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |