org.kuali.rice.krad.inquiry
Class InquirableImpl

java.lang.Object
  extended by org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl
      extended by org.kuali.rice.krad.inquiry.InquirableImpl
All Implemented Interfaces:
Serializable, Inquirable, ViewHelperService
Direct Known Subclasses:
KualiInquirableImpl, PeopleFlowInquirableImpl

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:
Serialized Form

Field Summary
protected  Class<?> dataObjectClass
           
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 Summary
InquirableImpl()
           
 
Method Summary
 void buildInquirableLink(Object dataObject, String propertyName, Inquiry inquiry)
          Invoked by the ViewHelperService to build a link to the inquiry
protected  List<List<String>> getAlternateKeysForClass(Class<?> clazz)
          Invokes the module service to retrieve any alternate keys that have been defined for the given class
protected  BusinessObjectService getBusinessObjectService()
           
protected  ConfigurationService getConfigurationService()
           
protected  DataDictionaryService getDataDictionaryService()
           
protected  DataObjectAuthorizationService getDataObjectAuthorizationService()
           
protected  Class<?> getDataObjectClass()
          Retrieves the data object class configured for this inquirable
protected  DataObjectMetaDataService getDataObjectMetaDataService()
           
protected  EncryptionService getEncryptionService()
           
protected  KualiModuleService getKualiModuleService()
           
 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
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
 void setDataObjectClass(Class<?> dataObjectClass)
          Sets the class for the data object the inquirable should retrieve
 
Methods inherited from class org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl
addClientSideStateForComponent, addCustomContainerComponents, addLine, applyAuthorizationAndPresentationLogic, applyDefaultValues, applyDefaultValuesForCollectionLine, buildClientSideStateScript, buildInquiryLink, cleanViewAfterRender, findNestedDictionaryAttribute, getCommonContext, getExpressionEvaluatorService, getPreModelContext, getViewDictionaryService, initializeDataFieldFromDataDictionary, invokeMethodFinalizer, logAndThrowRuntime, performAddLineValidation, performApplyModel, performComponentApplyModel, performComponentFinalize, performComponentInitialization, performComponentLifecycle, performCustomApplyModel, performCustomFinalize, performCustomInitialization, performDeleteLineValidation, performFinalize, performInitialization, populateDefaultValueForField, populateViewFromRequestParameters, processAfterAddLine, processAfterDeleteLine, processAnyRemoteFieldsHolder, processBeforeAddLine, processCollectionAddLine, processCollectionDeleteLine, processMultipleValueLookupResults, retrieveEditModesAndActionFlags, runComponentModifiers, setDataDictionaryService, setExpressionEvaluatorService, setViewContext, setViewDictionaryService, syncClientSideStateForComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 Detail

InquirableImpl

public InquirableImpl()
Method Detail

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

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
See Also:
Inquirable#retrieveDataObject(java.util.Map)

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 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 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, Class, Map) 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:
Inquirable.buildInquirableLink(java.lang.Object, java.lang.String, org.kuali.rice.krad.uif.widget.Inquiry)

setDataObjectClass

public void setDataObjectClass(Class<?> dataObjectClass)
Description copied from interface: Inquirable
Sets the 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:
setDataObjectClass in interface Inquirable
Parameters:
dataObjectClass - the class of the dataObject that this inquirable should retrieve
See Also:
Inquirable.setDataObjectClass(java.lang.Class)

getDataObjectClass

protected Class<?> getDataObjectClass()
Retrieves the data object class configured for this inquirable

Returns:
Class of configured data object, or null if data object class not configured

getConfigurationService

protected ConfigurationService getConfigurationService()

getDataObjectMetaDataService

protected DataObjectMetaDataService getDataObjectMetaDataService()

getKualiModuleService

protected KualiModuleService getKualiModuleService()

getDataDictionaryService

protected DataDictionaryService getDataDictionaryService()
Overrides:
getDataDictionaryService in class ViewHelperServiceImpl

getDataObjectAuthorizationService

protected DataObjectAuthorizationService getDataObjectAuthorizationService()

getEncryptionService

protected EncryptionService getEncryptionService()

getBusinessObjectService

protected BusinessObjectService getBusinessObjectService()


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