org.kuali.rice.krad.uif.widget
Class Inquiry

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      extended by org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
          extended by org.kuali.rice.krad.uif.component.ComponentBase
              extended by org.kuali.rice.krad.uif.widget.WidgetBase
                  extended by org.kuali.rice.krad.uif.widget.Inquiry
All Implemented Interfaces:
Serializable, DictionaryBean, UifDictionaryBean, Component, ScriptEventSupport, Widget, org.springframework.core.Ordered

public class Inquiry
extends WidgetBase

Widget for rendering an Inquiry link or DirectInquiry action field

The inquiry widget will render a button for the field value when that field is editable. When read only the widget will create a link on the display value. It points to the associated inquiry view for the field. The inquiry can be configured to point to a certain InquiryView, or the framework will attempt to associate the field with a inquiry based on its metadata (in particular its relationships in the model).

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
static String INQUIRY_TITLE_PREFIX
           
 
Fields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
Inquiry()
           
 
Method Summary
 void buildInquiryLink(Object dataObject, String propertyName, Class<?> inquiryObjectClass, Map<String,String> inquiryParams)
          Builds the inquiry link based on the given inquiry class and parameters
 String createTitleText(Class<?> dataObjectClass)
          Gets text to prepend to the inquiry link title
 String getBaseInquiryUrl()
          Returns the URL for the inquiry for which parameters will be added
 List<Component> getComponentsForLifecycle()
          List of components that are contained within the component and should be sent through the lifecycle
 String getDataObjectClassName()
          Full class name the inquiry should be provided for
 Action getDirectInquiryAction()
          Action that will be rendered next to the field for a direct inquiry
 Link getInquiryLink()
          Link that will be rendered for an inquiry
 Map<String,String> getInquiryParameters()
          Map that determines what properties from a calling view will be sent to properties on the inquiry data object
 String getViewName()
          When multiple target inquiry views exists for the same data object class, the view name can be set to determine which one to use
 boolean isEnableDirectInquiry()
          Indicates that the direct inquiry will not be rendered
protected  boolean isParentReadOnly()
          Determines whether a normal or direct inquiry should be enabled
 void performFinalize(View view, Object model, Component parent)
          The following finalization is done here: progressiveRender and conditionalRefresh variables are processed if set If any of the style properties were given, sets the style string on the style property Set the skipInTabOrder flag for nested components
 void setBaseInquiryUrl(String baseInquiryUrl)
          Setter for the inquiry base url (domain, context, and controller)
 void setDataObjectClassName(String dataObjectClassName)
          Setter for the class name that inquiry should be provided for
 void setDirectInquiryAction(Action directInquiryAction)
          Setter for the direct inquiry Action
 void setEnableDirectInquiry(boolean enableDirectInquiry)
          Setter for the hideDirectInquiry flag
 void setInquiryLink(Link inquiryLink)
          Setter for the inquiry Link
 void setInquiryParameters(Map<String,String> inquiryParameters)
          Setter for the map that determines what property values on the calling view will be sent to properties on the inquiry data object
protected  void setParentReadOnly(boolean parentReadOnly)
          Determines whether a normal or direct inquiry should be enabled
 void setupLink(View view, Object model, DataField field)
          Get parent object and field name and build the inquiry link
 void setViewName(String viewName)
          Setter for the view name configured on the inquiry view that should be invoked by the inquiry widget
 void updateInquiryParameters(BindingInfo bindingInfo)
          Adjusts the path on the inquiry parameter property to match the binding path prefix of the given BindingInfo
 
Methods inherited from class org.kuali.rice.krad.uif.widget.WidgetBase
getComponentTypeName
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addCellCssClass, addDataAttribute, addDataAttributeIfNonEmpty, addStyleClass, appendToStyle, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAlign, getAllDataAttributesJs, getBaseId, getCellCssClasses, getCellStyle, getCellStyleClassesAsString, getCellWidth, getColSpan, getComplexDataAttributesJs, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentSecurityClass, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, isSkipInTabOrder, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setMethodToCallOnRefresh, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setWidth
 
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Component
addCellCssClass, addDataAttribute, addStyleClass, appendToStyle, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAlign, getAllDataAttributesJs, getBaseId, getCellCssClasses, getCellStyle, getCellWidth, getColSpan, getComplexDataAttributesJs, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getTemplate, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, setAdditionalComponentsToRefresh, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, setId, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setStyle, setTemplate, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setWidth
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
getComponentCode, getNamespaceCode
 
Methods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnLoadScript
 

Field Detail

INQUIRY_TITLE_PREFIX

public static final String INQUIRY_TITLE_PREFIX
See Also:
Constant Field Values
Constructor Detail

Inquiry

public Inquiry()
Method Detail

performFinalize

public void performFinalize(View view,
                            Object model,
                            Component parent)
Description copied from class: ComponentBase
The following finalization is done here:

Specified by:
performFinalize in interface Component
Overrides:
performFinalize in class ComponentBase
Parameters:
view - - view instance that should be finalized for rendering
model - - top level object containing the data
parent - - parent component
See Also:
ComponentBase.performFinalize(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component)

setupLink

public void setupLink(View view,
                      Object model,
                      DataField field)
Get parent object and field name and build the inquiry link

This was moved from the performFinalize because overlapping and to be used by DirectInquiry.

Parameters:
view - - Container View
model - - model
field - - The parent Attribute field

updateInquiryParameters

public void updateInquiryParameters(BindingInfo bindingInfo)
Adjusts the path on the inquiry parameter property to match the binding path prefix of the given BindingInfo

Parameters:
bindingInfo - - binding info instance to copy binding path prefix from

buildInquiryLink

public void buildInquiryLink(Object dataObject,
                             String propertyName,
                             Class<?> inquiryObjectClass,
                             Map<String,String> inquiryParams)
Builds the inquiry link based on the given inquiry class and parameters

Parameters:
dataObject - - parent object that contains the data (used to pull inquiry parameters)
propertyName - - name of the property the inquiry is set on
inquiryObjectClass - - class of the object the inquiry should point to
inquiryParams - - map of key field mappings for the inquiry

createTitleText

public String createTitleText(Class<?> dataObjectClass)
Gets text to prepend to the inquiry link title

Parameters:
dataObjectClass - - data object class being inquired into
Returns:
String title prepend text

getComponentsForLifecycle

public List<Component> getComponentsForLifecycle()
Description copied from interface: Component
List of components that are contained within the component and should be sent through the lifecycle

Used by ViewHelperService for the various lifecycle callbacks

Specified by:
getComponentsForLifecycle in interface Component
Overrides:
getComponentsForLifecycle in class ComponentBase
Returns:
List child components
See Also:
ComponentBase.getComponentsForLifecycle()

getBaseInquiryUrl

public String getBaseInquiryUrl()
Returns the URL for the inquiry for which parameters will be added

The base URL includes the domain, context, and controller mapping for the inquiry invocation. Parameters are then added based on configuration to complete the URL. This is generally defaulted to the application URL and internal KRAD servlet mapping, but can be changed to invoke another application such as the Rice standalone server

Returns:
String inquiry base URL

setBaseInquiryUrl

public void setBaseInquiryUrl(String baseInquiryUrl)
Setter for the inquiry base url (domain, context, and controller)

Parameters:
baseInquiryUrl -

getDataObjectClassName

public String getDataObjectClassName()
Full class name the inquiry should be provided for

This is passed on to the inquiry request for the data object the lookup should be rendered for. This is then used by the inquiry framework to select the lookup view (if more than one inquiry view exists for the same data object class name, the getViewName() property should be specified to select the view to render).

Returns:
String inquiry class name

setDataObjectClassName

public void setDataObjectClassName(String dataObjectClassName)
Setter for the class name that inquiry should be provided for

Parameters:
dataObjectClassName -

getViewName

public String getViewName()
When multiple target inquiry views exists for the same data object class, the view name can be set to determine which one to use

When creating multiple inquiry views for the same data object class, the view name can be specified for the different versions (for example 'simple' and 'advanced'). When multiple inquiry views exist the view name must be sent with the data object class for the request. Note the view id can be alternatively used to uniquely identify the inquiry view


setViewName

public void setViewName(String viewName)
Setter for the view name configured on the inquiry view that should be invoked by the inquiry widget

Parameters:
viewName -

getInquiryParameters

public Map<String,String> getInquiryParameters()
Map that determines what properties from a calling view will be sent to properties on the inquiry data object

When invoking an inquiry view, a query is done against the inquiries configured data object and the resulting record is display. The values for the properties configured within the inquiry parameters Map will be pulled and passed along as values for the inquiry data object properties (thus they form the criteria for the inquiry)

Returns:
Map mapping of calling view properties to inquiry data object properties

setInquiryParameters

public void setInquiryParameters(Map<String,String> inquiryParameters)
Setter for the map that determines what property values on the calling view will be sent to properties on the inquiry data object

Parameters:
inquiryParameters -

getInquiryLink

public Link getInquiryLink()
Link that will be rendered for an inquiry

Returns:
the inquiry link

setInquiryLink

public void setInquiryLink(Link inquiryLink)
Setter for the inquiry Link

Parameters:
inquiryLink - - the inquiry Link object

getDirectInquiryAction

public Action getDirectInquiryAction()
Action that will be rendered next to the field for a direct inquiry

Returns:
the directInquiryAction

setDirectInquiryAction

public void setDirectInquiryAction(Action directInquiryAction)
Setter for the direct inquiry Action

Parameters:
directInquiryAction - the direct inquiry Action

isEnableDirectInquiry

public boolean isEnableDirectInquiry()
Indicates that the direct inquiry will not be rendered

Returns:
boolean true if the direct inquiry should be rendered, false if not

setEnableDirectInquiry

public void setEnableDirectInquiry(boolean enableDirectInquiry)
Setter for the hideDirectInquiry flag

Parameters:
enableDirectInquiry -

isParentReadOnly

protected boolean isParentReadOnly()
Determines whether a normal or direct inquiry should be enabled

Returns:
true if parent component is read only, false otherwise

setParentReadOnly

protected void setParentReadOnly(boolean parentReadOnly)
Determines whether a normal or direct inquiry should be enabled

Used by unit tests and internally

Parameters:
parentReadOnly - true if parent component is read only, false otherwise


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