Class Inquiry

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, Ordered, ScriptEventSupport, LifecycleElement, 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:
  • Field Details

  • Constructor Details

    • Inquiry

      public Inquiry()
  • Method Details

    • afterEvaluateExpression

      public void afterEvaluateExpression()
      Inherits readOnly from parent if not explicitly populated. No-op implementation. Override for custom behavior in subclasses. Invoked by the view lifecycle after expressions are evaluated at the apply model phase.

      In general, this method is preferred to LifecycleElement.performApplyModel(Object, LifecycleElement) for populating model data via code, since it is called before client-side state is synchronize.

      Specified by:
      afterEvaluateExpression in interface Component
      Overrides:
      afterEvaluateExpression in class ComponentBase
    • performFinalize

      public void performFinalize(Object model, LifecycleElement 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
      The last phase before the view is rendered

      Here final preparations can be made based on the updated view state.

      Specified by:
      performFinalize in interface LifecycleElement
      Overrides:
      performFinalize in class ComponentBase
      Parameters:
      model - - top level object containing the data
      parent - - parent component
    • 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, Map<String,String> inquiryKeyValues)
      Gets text to prepend to the inquiry link title
      Parameters:
      dataObjectClass - data object class being inquired into
      Returns:
      inquiry link title
    • 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:
      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:
      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

      Returns:
      view name
    • 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:
      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:
      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
    • isAdjustInquiryParameters

      public boolean isAdjustInquiryParameters()
      Determines whether inquiry parameters adjusted
      Returns:
      true if adjusted
    • setAdjustInquiryParameters

      protected void setAdjustInquiryParameters(boolean adjustInquiryParameters)
      Determines whether inquiry parameters adjusted

      Used internally

      Parameters:
      adjustInquiryParameters -
    • setFieldBindingInfo

      protected void setFieldBindingInfo(BindingInfo fieldBindingInfo)
      Sets the field binding information

      Sets the field binding information

      Parameters:
      fieldBindingInfo -