Class InquirableImpl

All Implemented Interfaces:
Serializable, Inquirable, ViewHelperService

public class InquirableImpl extends ViewHelperServiceImpl implements Inquirable
Implementation of the Inquirable interface that uses metadata from the data dictionary and performs a query against the database to retrieve the data object for inquiry

More advanced lookup operations or alternate ways of retrieving metadata can be implemented by extending this base implementation and configuring

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Field Details

    • dataObjectClass

      protected Class<?> dataObjectClass
    • SUPER_CLASS_TRANSLATOR_LIST

      public static List<Class<?>> SUPER_CLASS_TRANSLATOR_LIST
      A list that can be used to define classes that are superclasses or superinterfaces of kuali objects where those objects' inquiry URLs need to use the name of the superclass or superinterface as the business object class attribute
  • Constructor Details

    • InquirableImpl

      public InquirableImpl()
  • Method Details

    • retrieveDataObject

      public Object retrieveDataObject(Map<String,String> parameters)
      Finds primary and alternate key sets configured for the configured data object class and then attempts to find a set with matching key/value pairs from the request, if a set is found then calls the module service (for EBOs) or business object service to retrieve the data object

      Note at this point on business objects are supported by the default implementation

      Responsible for retrieving the data object from its data source (database, service call, etc) based on the given map of field name/value pairs

      Given map can contain more than fields (primary key or other) necessary for retrieving the data object. Method will use the fields necessary based on the metadata for the data object class configured on the inquirable

      Specified by:
      retrieveDataObject in interface Inquirable
      Parameters:
      parameters - - a map of string field names and values
      Returns:
      the data object or null if not found
    • retrieveKeySetFromMap

      protected List<String> retrieveKeySetFromMap(List<List<String>> potentialKeySets, Map<String,String> parameters)
      Iterates through the list of key sets looking for a set where the given map of parameters has all the key names and values are non-blank, first matched set is returned
      Parameters:
      potentialKeySets - - List of key sets to check for match
      parameters - - map of parameter name/value pairs for matching key set
      Returns:
      List<String> key set that was matched, or null if none were matched
    • getAlternateKeysForClass

      protected List<List<String>> getAlternateKeysForClass(Class<?> clazz)
      Invokes the module service to retrieve any alternate keys that have been defined for the given class
      Parameters:
      clazz - - class to find alternate keys for
      Returns:
      List<List<String>> list of alternate key sets, or empty list if none are found
    • buildInquirableLink

      public void buildInquirableLink(Object dataObject, String propertyName, Inquiry inquiry)
      Description copied from interface: Inquirable
      Invoked by the ViewHelperService to build a link to the inquiry

      Note this is used primarily for custom Inquirable implementations to customize the inquiry class or parameters for an inquiry. Instead of building the full inquiry link, implementations can make a callback to org.kuali.rice.krad.uif.widget.Inquiry.buildInquiryLink(Object, String, Classinvalid input: '<'?>, Mapinvalid input: '<'String, String>) given an inquiry class and parameters to build the link field.

      Specified by:
      buildInquirableLink in interface Inquirable
      Parameters:
      dataObject - - parent object for the inquiry property
      propertyName - - name of the property the inquiry is being built for
      inquiry - - instance of the inquiry widget being built for the property
      See Also:
    • getDataObjectClass

      public Class<?> getDataObjectClass()
      Class for the data object the inquirable should retrieve

      Must be set before invoking any other operations on the Inquirable, including the retrieveDataObject method

      Specified by:
      getDataObjectClass in interface Inquirable
      Returns:
      inquiry data object class
    • setDataObjectClass

      public void setDataObjectClass(Class<?> dataObjectClass)
      Specified by:
      setDataObjectClass in interface Inquirable
      See Also:
    • canViewInquiryNoteAttachment

      public boolean canViewInquiryNoteAttachment(Person user)
      Description copied from interface: Inquirable
      Checks appropriate permissions to determine whether the given user is authorized to download note attachments associated with this inquiry data object. Should probably be in an authorizer class, but since inquiries don't always have document or view associations this is the next best place.
      Specified by:
      canViewInquiryNoteAttachment in interface Inquirable
      Parameters:
      user - - the user for whom to check authorization
      Returns:
      whether or not the user is authorized to download note attachments
    • getLegacyDataAdapter

      protected LegacyDataAdapter getLegacyDataAdapter()
      Description copied from class: ViewHelperServiceImpl
      Get the legacy data adapter.
      Overrides:
      getLegacyDataAdapter in class ViewHelperServiceImpl
      Returns:
      The legacy data adapter.
    • getKualiModuleService

      protected KualiModuleService getKualiModuleService()
    • getDataDictionaryService

      public DataDictionaryService getDataDictionaryService()
      Description copied from class: ViewHelperServiceImpl
      Gets the data dictionary service
      Overrides:
      getDataDictionaryService in class ViewHelperServiceImpl
      Returns:
      data dictionary service
    • getDataObjectAuthorizationService

      protected DataObjectAuthorizationService getDataObjectAuthorizationService()
    • getEncryptionService

      protected EncryptionService getEncryptionService()
    • getPermissionService

      public PermissionService getPermissionService()