|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl org.kuali.rice.krad.lookup.LookupableImpl
public class LookupableImpl
Default implementation of Lookupable
Constructor Summary | |
---|---|
LookupableImpl()
|
Method Summary | |
---|---|
protected Map<String,String> |
adjustCriteriaForNestedEBOs(Map<String,String> searchCriteria,
boolean unbounded)
|
boolean |
allowsMaintenanceDeleteAction(Object dataObject)
Determines if given data object has associated maintenance document that allows delete maintenance actions. |
boolean |
allowsMaintenanceEditAction(Object dataObject)
Determines if given data object has associated maintenance document that allows edit maintenance actions |
boolean |
allowsMaintenanceNewOrCopyAction()
Determines if given data object has associated maintenance document that allows new or copy maintenance actions |
protected String |
getActionUrlHref(LookupForm lookupForm,
Object dataObject,
String methodToCall,
List<String> pkNames)
Generates a URL to perform a maintenance action on the given result data object |
protected Map<String,InputField> |
getCriteriaFieldsForValidation(LookupView lookupView,
LookupForm form)
Returns the criteria fields in a map keyed by the field property name. |
protected DataObjectAuthorizationService |
getDataObjectAuthorizationService()
|
Class<?> |
getDataObjectClass()
Returns the class for the data object the lookup is configured with |
protected DataObjectMetaDataService |
getDataObjectMetaDataService()
|
DocumentDictionaryService |
getDocumentDictionaryService()
|
protected EncryptionService |
getEncryptionService()
|
protected LookupService |
getLookupService()
|
void |
getMaintenanceActionLink(Link actionLink,
Object model,
String maintenanceMethodToCall)
Invoked to build a maintenance URL for a result row |
protected String |
getMaintenanceDocumentTypeName()
Returns the maintenance document type associated with the business object class or null if one does not exist. |
protected List<String> |
getReturnKeys(LookupView lookupView,
LookupForm lookupForm,
Object dataObject)
Returns the configured return key property names or if not configured defaults to the primary keys for the data object class |
protected String |
getReturnUrl(LookupView lookupView,
LookupForm lookupForm,
Object dataObject)
Builds the URL for returning the given data object result row |
void |
getReturnUrlForResults(LinkField returnLinkField,
Object model)
Invoked to build the return URL for a result row |
protected Properties |
getReturnUrlParameters(LookupView lookupView,
LookupForm lookupForm,
Object dataObject)
Builds up a Properties object that will be used to provide the request parameters for the
return URL link |
protected List<?> |
getSearchResults(LookupForm form,
Map<String,String> searchCriteria,
boolean unbounded)
Get the search results of the lookup |
protected List<?> |
getSearchResultsForEBO(Map<String,String> searchCriteria,
boolean unbounded)
Get the search results of an |
void |
initSuppressAction(LookupForm lookupForm)
Initialize the suppressAction indicator on the LookupForm. |
protected boolean |
isResultReturnable(Object dataObject)
Determines whether a given data object that's returned as one of the lookup's results is considered returnable, which means that for single-value lookups, a "return value" link may be rendered, and for multiple value lookups, a checkbox is rendered. |
Map<String,String> |
performClear(LookupForm form,
Map<String,String> searchCriteria)
Invoked when the clear action is requested to result the search fields to their initial default values |
void |
performInitialization(View view,
Object model)
Initialization of Lookupable requires that the business object class be set for the ViewHelperServiceImpl.initializeDataFieldFromDataDictionary(org.kuali.rice.krad.uif.view.View,
org.kuali.rice.krad.uif.field.DataField) method |
Collection<?> |
performSearch(LookupForm form,
Map<String,String> searchCriteria,
boolean bounded)
Invoked to carry out the lookup search based on the given map of key/value search values |
protected Map<String,String> |
processSearchCriteria(LookupForm lookupForm,
Map<String,String> searchCriteria)
Process the search criteria to be used with the lookup |
void |
setConfigurationService(ConfigurationService configurationService)
Sets the configuration service |
void |
setDataObjectAuthorizationService(DataObjectAuthorizationService dataObjectAuthorizationService)
|
void |
setDataObjectClass(Class<?> dataObjectClass)
Sets the class for the data object the lookup will be provided on |
void |
setDataObjectMetaDataService(DataObjectMetaDataService dataObjectMetaDataService)
|
void |
setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService)
|
void |
setEncryptionService(EncryptionService encryptionService)
|
void |
setLookupService(LookupService lookupService)
|
void |
setMultiValueLookupSelect(InputField selectField,
Object model)
Sets the value for the attribute field control to contain the field conversion values for the line |
protected void |
sortSearchResults(LookupForm form,
List<?> searchResults)
Sorts the given list of search results based on the lookup view's configured sort attributes |
boolean |
validateSearchParameters(LookupForm form,
Map<String,String> searchCriteria)
Invoked to perform validation on the search criteria before the search is performed |
protected void |
validateSearchParameterWildcardAndOperators(InputField inputField,
String searchPropertyValue)
Validates that any wildcards contained within the search value are valid wilcards and allowed for the property type for which the field is searching |
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.service.ViewHelperService |
---|
applyDefaultValuesForCollectionLine, buildInquiryLink, cleanViewAfterRender, getCommonContext, performApplyModel, performComponentInitialization, performComponentLifecycle, performFinalize, populateViewFromRequestParameters, processCollectionAddBlankLine, processCollectionAddLine, processCollectionDeleteLine, processCollectionSaveLine, processMultipleValueLookupResults |
Constructor Detail |
---|
public LookupableImpl()
Method Detail |
---|
public void performInitialization(View view, Object model)
ViewHelperServiceImpl.initializeDataFieldFromDataDictionary(org.kuali.rice.krad.uif.view.View,
org.kuali.rice.krad.uif.field.DataField)
method
performInitialization
in interface ViewHelperService
performInitialization
in class ViewHelperServiceImpl
view
- - View instance that should be initializedmodel
- - object instance containing the view dataViewHelperServiceImpl.performInitialization(org.kuali.rice.krad.uif.view.View,
java.lang.Object)
public void initSuppressAction(LookupForm lookupForm)
Lookupable
The suppress action is set to true if the user is not authorized to initiate these documents. The indicator is then used to hide irrelevant actions such as creating a new document or editing existing ones.
initSuppressAction
in interface Lookupable
lookupForm
- on which to initialize the suppressAction indicatorLookupable.initSuppressAction(org.kuali.rice.krad.web.form.LookupForm)
public Collection<?> performSearch(LookupForm form, Map<String,String> searchCriteria, boolean bounded)
Lookupable
performSearch
in interface Lookupable
form
- - lookup form instance containing the lookup datasearchCriteria
- - map of criteria currently setbounded
- - indicates whether the results should be limited (if necessary) to the max search
result limit configured
Lookupable.performSearch(org.kuali.rice.krad.web.form.LookupForm, java.util.Map, boolean)
protected List<?> getSearchResults(LookupForm form, Map<String,String> searchCriteria, boolean unbounded)
form
- lookup form instance containing the lookup datasearchCriteria
- map of criteria currently setunbounded
- indicates whether the complete result should be returned. When set to false the result is
limited (if necessary) to the max search result limit configured.
protected void sortSearchResults(LookupForm form, List<?> searchResults)
First if the posted view exists we grab the sort attributes from it. This will take into account expressions that might have been configured on the sort attributes. If the posted view does not exist (because we did a search from a get request or form session storage is off), we get the sort attributes from the view that we will be rendered (and was initialized before controller call). However, expressions will not be evaluated yet, thus if expressions were configured we don't know the results and can not sort the list
form
- - lookup form instance containing view informationsearchResults
- - list of search results to sortprotected Map<String,String> processSearchCriteria(LookupForm lookupForm, Map<String,String> searchCriteria)
Processing entails primarily of the removal of unused/blank search criteria. Encrypted field values are decrypted in this process as well.
lookupForm
- lookup form instance containing the lookup datasearchCriteria
- map of criteria currently set
protected List<?> getSearchResultsForEBO(Map<String,String> searchCriteria, boolean unbounded)
searchCriteria
- map of criteria currently setunbounded
- indicates whether the complete result should be returned. When set to false the result is
limited (if necessary) to the max search result limit configured.
protected Map<String,String> adjustCriteriaForNestedEBOs(Map<String,String> searchCriteria, boolean unbounded) throws InstantiationException, IllegalAccessException
searchCriteria
- map of criteria currently setunbounded
- indicates whether the complete result should be returned. When set to false the result is
limited (if necessary) to the max search result limit configured.
InstantiationException
IllegalAccessException
public Map<String,String> performClear(LookupForm form, Map<String,String> searchCriteria)
Lookupable
performClear
in interface Lookupable
form
- - lookup form instance containing the lookup datasearchCriteria
- - map of criteria currently set
Lookupable.performClear(org.kuali.rice.krad.web.form.LookupForm, java.util.Map)
public boolean validateSearchParameters(LookupForm form, Map<String,String> searchCriteria)
Lookupable
validateSearchParameters
in interface Lookupable
form
- - lookup form instance containing the lookup datasearchCriteria
- - map of criteria where key is search property name and value is
search value (which can include wildcards)
Lookupable.validateSearchParameters(org.kuali.rice.krad.web.form.LookupForm, java.util.Map)
protected Map<String,InputField> getCriteriaFieldsForValidation(LookupView lookupView, LookupForm form)
lookupView
- form
- lookup form instance containing the lookup data
protected void validateSearchParameterWildcardAndOperators(InputField inputField, String searchPropertyValue)
inputField
- - attribute field instance for the field that is being searchedsearchPropertyValue
- - value given for field to search forpublic void getReturnUrlForResults(LinkField returnLinkField, Object model)
Lookupable
Based on the line contained in the field context, the URL for returning the role is constructed and set as the href for the link field. If a return link cannot be constructed the field should be set to not render
getReturnUrlForResults
in interface Lookupable
returnLinkField
- - link field that will be used to render the return URLmodel
- - lookup form containing the dataLookupable.getReturnUrlForResults(org.kuali.rice.krad.uif.field.LinkField, java.lang.Object)
protected String getReturnUrl(LookupView lookupView, LookupForm lookupForm, Object dataObject)
Note return URL will only be built if a return location is specified on the LookupForm
lookupView
- - lookup view instance containing lookup configurationlookupForm
- - lookup form instance containing the datadataObject
- - data object instance for the current line and for which the return URL is being built
protected Properties getReturnUrlParameters(LookupView lookupView, LookupForm lookupForm, Object dataObject)
Properties
object that will be used to provide the request parameters for the
return URL link
lookupView
- - lookup view instance containing lookup configurationlookupForm
- - lookup form instance containing the datadataObject
- - data object instance for the current line and for which the return URL is being built
protected List<String> getReturnKeys(LookupView lookupView, LookupForm lookupForm, Object dataObject)
Returns the configured return key property names or if not configured defaults to the primary keys for the data object class
lookupView
- - lookup view instance containing lookup configurationlookupForm
- - lookup form instance containing the datadataObject
- - data object instance
public void getMaintenanceActionLink(Link actionLink, Object model, String maintenanceMethodToCall)
Lookupable
Based on the line contained in the field context and the given maintenance method that should be called a URL is constructed and set as the href on the link field. If a maintenance link cannot be constructed the field should be set to not render
getMaintenanceActionLink
in interface Lookupable
actionLink
- - link that will be used to return the maintenance URLmodel
- - lookup form containing the datamaintenanceMethodToCall
- - name of the method that should be invoked in the maintenance controllerLookupable.getMaintenanceActionLink(org.kuali.rice.krad.uif.element.Link, java.lang.Object, java.lang.String)
protected String getActionUrlHref(LookupForm lookupForm, Object dataObject, String methodToCall, List<String> pkNames)
Will build a URL containing keys of the data object to invoke the given maintenance action method within the maintenance controller
dataObject
- - data object instance for the line to build the maintenance action link formethodToCall
- - method name on the maintenance controller that should be invokedpkNames
- - list of primary key field names for the data object whose key/value pairs will be added to
the maintenance link
public void setMultiValueLookupSelect(InputField selectField, Object model)
setMultiValueLookupSelect
in interface Lookupable
selectField
- - the InputField used to mark the lookup row as selectedmodel
- - lookup form containing the datasetMultiValueLookupSelect(org.kuali.rice.krad.uif.field.InputField, java.lang.Object)
public boolean allowsMaintenanceNewOrCopyAction()
public boolean allowsMaintenanceEditAction(Object dataObject)
public boolean allowsMaintenanceDeleteAction(Object dataObject)
protected String getMaintenanceDocumentTypeName()
protected boolean isResultReturnable(Object dataObject)
dataObject
- - an object from the search result set
public void setDataObjectClass(Class<?> dataObjectClass)
Lookupable
setDataObjectClass
in interface Lookupable
dataObjectClass
- - data object class for lookupLookupable.setDataObjectClass(java.lang.Class>)
public Class<?> getDataObjectClass()
Lookupable
getDataObjectClass
in interface Lookupable
Lookupable.getDataObjectClass()
public void setConfigurationService(ConfigurationService configurationService)
ViewHelperServiceImpl
setConfigurationService
in class ViewHelperServiceImpl
protected DataObjectAuthorizationService getDataObjectAuthorizationService()
public void setDataObjectAuthorizationService(DataObjectAuthorizationService dataObjectAuthorizationService)
protected DataObjectMetaDataService getDataObjectMetaDataService()
public void setDataObjectMetaDataService(DataObjectMetaDataService dataObjectMetaDataService)
public DocumentDictionaryService getDocumentDictionaryService()
public void setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService)
protected LookupService getLookupService()
public void setLookupService(LookupService lookupService)
protected EncryptionService getEncryptionService()
public void setEncryptionService(EncryptionService encryptionService)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |