org.kuali.rice.kns.lookup
Class KualiLookupableImpl

java.lang.Object
  extended by org.kuali.rice.kns.lookup.KualiLookupableImpl
All Implemented Interfaces:
Serializable, Lookupable
Direct Known Subclasses:
GroupLookupableImpl, PermissionLookupableImpl, PersonLookupableImpl, ResponsibilityLookupableImpl, RoleLookupableImpl, RuleBaseValuesLookupableImpl, RuleDelegationLookupableImpl

@Transactional
public class KualiLookupableImpl
extends Object
implements Lookupable

Kuali lookup implementation. Implements methods necessary to render the lookup and provides search and return methods.

See Also:
Serialized Form

Field Summary
protected  Class businessObjectClass
           
protected  String extraOnLoad
           
protected static String[] IGNORE_LIST
           
protected  LookupableHelperService lookupableHelperService
           
 
Constructor Summary
KualiLookupableImpl()
          Default constructor initializes services from spring
 
Method Summary
 void applyConditionalLogicForFieldDisplay()
          Performs conditional logic (based on current search values or other parameters) to override field hidden, read-only, and required attributes previously set.
 void applyFieldAuthorizationsFromNestedLookups(Field field)
          This overridden method ...
 boolean checkForAdditionalFields(Map<String,String> fieldValues)
          Determines if there should be more search fields rendered based on already entered search criteria.
 String getBackLocation()
           
 Class getBusinessObjectClass()
           
protected  BusinessObjectDictionaryService getBusinessObjectDictionaryService()
           
 List<Column> getColumns()
          Constructs the list of columns for the search results.
 String getCreateNewUrl()
          Builds the Url for a maintenance new document for the lookup business object class
protected  String getCreateNewUrl(String url)
           
protected  DataDictionaryService getDataDictionaryService()
           
 List<String> getDefaultSortColumns()
          This method returns a list of the default columns used to sort the result set.
 String getDocFormKey()
           
 String getExtraButtonParams()
           
 String getExtraButtonSource()
           
 Field getExtraField()
          This overridden method ...
 String getExtraOnLoad()
          This overridden method returns the extraOnLoad variable.
 String getHtmlMenuBar()
           
 LookupableHelperService getLookupableHelperService()
          Returns the LookupableHelperService designated to help this lookup
 Map<String,String[]> getParameters()
           
 String getPrimaryKeyFieldLabels()
          Returns a comma delimited list of primary key field labels, as defined in the DD
 List<String> getReturnKeys()
           
 String getReturnLocation()
           
 HtmlData getReturnUrl(BusinessObject bo, Map fieldConversions, String lookupImpl, BusinessObjectRestrictions businessObjectRestrictions)
          Builds the return value url.
 List<Row> getRows()
           
 List<? extends BusinessObject> getSearchResults(Map<String,String> fieldValues)
          Uses Lookup Service to provide a basic search.
 List<? extends BusinessObject> getSearchResultsUnbounded(Map<String,String> fieldValues)
          Uses Lookup Service to provide a basic unbounded search.
 String getSupplementalMenuBar()
           
 String getTitle()
           
 boolean isSearchUsingOnlyPrimaryKeyValues()
          Returns whether this search was performed using the values of the primary keys only
 void performClear(LookupForm lookupForm)
          calls the lookup helper service to do "clear" behaviors
 boolean performCustomAction(boolean ignoreErrors)
          This method is called from a custom action button or script
 Collection<? extends BusinessObject> performLookup(LookupForm lookupForm, List<ResultRow> resultTable, boolean bounded)
          Performs a lookup that can only return one row.
 void setBackLocation(String backLocation)
           
 void setBusinessObjectClass(Class boClass)
          Sets the business object class for the lookup instance, then rows can be set for search render.
 void setDocFormKey(String docFormKey)
          // this method is public because unit tests depend upon it
 void setExtraOnLoad(String extraOnLoad)
           
 void setFieldConversions(Map fieldConversions)
          Sets the requested fields conversions in the lookupable
 void setLookupableHelperService(LookupableHelperService lookupableHelperService)
          Sets the lookupableHelperService attribute value.
 void setParameters(Map<String,String[]> parameters)
          Initializes the lookup with the given Map of parameters.
 void setReadOnlyFieldsList(List<String> readOnlyFieldsList)
          Sets the readOnlyFieldsList attribute value.
 boolean shouldDisplayHeaderNonMaintActions()
          calls the lookup helper service to check if non maintenance actions should be displayed
 boolean shouldDisplayLookupCriteria()
          calls the lookup helper service to check if criteria should be displayed
 void validateSearchParameters(Map<String,String> fieldValues)
          Checks that any required search fields have value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IGNORE_LIST

protected static final String[] IGNORE_LIST

businessObjectClass

protected Class businessObjectClass

lookupableHelperService

protected LookupableHelperService lookupableHelperService

extraOnLoad

protected String extraOnLoad
Constructor Detail

KualiLookupableImpl

public KualiLookupableImpl()
Default constructor initializes services from spring

Method Detail

setBusinessObjectClass

public void setBusinessObjectClass(Class boClass)
Sets the business object class for the lookup instance, then rows can be set for search render.

Specified by:
setBusinessObjectClass in interface Lookupable
Parameters:
boClass - Class for the lookup business object

setParameters

public void setParameters(Map<String,String[]> parameters)
Initializes the lookup with the given Map of parameters.

Specified by:
setParameters in interface Lookupable
Parameters:
parameters -

getParameters

public Map<String,String[]> getParameters()
Specified by:
getParameters in interface Lookupable
Returns:
Returns the parameters passed to this lookup

getColumns

public List<Column> getColumns()
Constructs the list of columns for the search results. All properties for the column objects come from the DataDictionary.

Specified by:
getColumns in interface Lookupable
Returns:
List of Column objects used to render the result table

validateSearchParameters

public void validateSearchParameters(Map<String,String> fieldValues)
Checks that any required search fields have value.

Specified by:
validateSearchParameters in interface Lookupable
Parameters:
fieldValues - - Map of property/value pairs
See Also:
Lookupable.validateSearchParameters(java.util.Map)

getSearchResultsUnbounded

public List<? extends BusinessObject> getSearchResultsUnbounded(Map<String,String> fieldValues)
Uses Lookup Service to provide a basic unbounded search.

Specified by:
getSearchResultsUnbounded in interface Lookupable
Parameters:
fieldValues - - Map containing prop name keys and search values
Returns:
List found business objects

getSearchResults

public List<? extends BusinessObject> getSearchResults(Map<String,String> fieldValues)
Uses Lookup Service to provide a basic search.

Specified by:
getSearchResults in interface Lookupable
Parameters:
fieldValues - - Map containing prop name keys and search values
Returns:
List found business objects

getReturnUrl

public HtmlData getReturnUrl(BusinessObject bo,
                             Map fieldConversions,
                             String lookupImpl,
                             BusinessObjectRestrictions businessObjectRestrictions)
Description copied from interface: Lookupable
Builds the return value url.

Specified by:
getReturnUrl in interface Lookupable
Parameters:
bo - - Instance of a business object containing the return values
fieldConversions - - Map of conversions mapping bo names to caller field names.
lookupImpl - - Current lookup impl name
Returns:
the return url for each result row.

getCreateNewUrl

public String getCreateNewUrl()
Description copied from interface: Lookupable
Builds the Url for a maintenance new document for the lookup business object class

Specified by:
getCreateNewUrl in interface Lookupable
Returns:
String rendered on Lookup screen for maintenance new document
See Also:
Lookupable.getCreateNewUrl()

getHtmlMenuBar

public String getHtmlMenuBar()
Specified by:
getHtmlMenuBar in interface Lookupable
Returns:
the html to be displayed as a menu bar
See Also:
Lookupable.getHtmlMenuBar()

getSupplementalMenuBar

public String getSupplementalMenuBar()
Specified by:
getSupplementalMenuBar in interface Lookupable
Returns:
the html to be displayed as a supplemental menu bar
See Also:
Lookupable.getSupplementalMenuBar()

getRows

public List<Row> getRows()
Specified by:
getRows in interface Lookupable
Returns:
List of Row objects used to render the search area
See Also:
Lookupable.getRows()

getTitle

public String getTitle()
Specified by:
getTitle in interface Lookupable
Returns:
String displayed as title for the lookup
See Also:
Lookupable.getTitle()

getReturnLocation

public String getReturnLocation()
Specified by:
getReturnLocation in interface Lookupable
Returns:
String url for the location to return to after the lookup
See Also:
Lookupable.getReturnLocation()

getBusinessObjectClass

public Class getBusinessObjectClass()
Specified by:
getBusinessObjectClass in interface Lookupable
Returns:
Returns the dataObjectClass.

getReturnKeys

public List<String> getReturnKeys()
Returns:
a List of the names of fields which are marked in data dictionary as return fields.

getExtraButtonSource

public String getExtraButtonSource()
Specified by:
getExtraButtonSource in interface Lookupable
Returns:
String providing source for optional extra button
See Also:
Lookupable.getExtraButtonSource()

getExtraButtonParams

public String getExtraButtonParams()
Specified by:
getExtraButtonParams in interface Lookupable
Returns:
String providing return parameters for optional extra button
See Also:
Lookupable.getExtraButtonParams()

getDefaultSortColumns

public List<String> getDefaultSortColumns()
Description copied from interface: Lookupable
This method returns a list of the default columns used to sort the result set. For multiple value lookups, this method does not change when different columns are sorted.

Specified by:
getDefaultSortColumns in interface Lookupable
Returns:
property names that will be used to sort on by default

checkForAdditionalFields

public boolean checkForAdditionalFields(Map<String,String> fieldValues)
Description copied from interface: Lookupable
Determines if there should be more search fields rendered based on already entered search criteria.

Specified by:
checkForAdditionalFields in interface Lookupable
Parameters:
fieldValues - - Map of property/value pairs
Returns:
boolean
See Also:
Lookupable.checkForAdditionalFields(java.util.Map)

getBackLocation

public String getBackLocation()
Returns:
Returns the backLocation.

setBackLocation

public void setBackLocation(String backLocation)
Parameters:
backLocation - The backLocation to set.

getDocFormKey

public String getDocFormKey()
Returns:
Returns the docFormKey.

setDocFormKey

public void setDocFormKey(String docFormKey)
// this method is public because unit tests depend upon it

Parameters:
docFormKey - The docFormKey to set.

getBusinessObjectDictionaryService

protected BusinessObjectDictionaryService getBusinessObjectDictionaryService()
Returns:
Returns the businessObjectDictionaryService.

setFieldConversions

public void setFieldConversions(Map fieldConversions)
Description copied from interface: Lookupable
Sets the requested fields conversions in the lookupable

Specified by:
setFieldConversions in interface Lookupable
See Also:
Lookupable.setFieldConversions(java.util.Map)

getDataDictionaryService

protected DataDictionaryService getDataDictionaryService()
Returns:
Returns the dataDictionaryService.

setReadOnlyFieldsList

public void setReadOnlyFieldsList(List<String> readOnlyFieldsList)
Sets the readOnlyFieldsList attribute value.

Specified by:
setReadOnlyFieldsList in interface Lookupable
Parameters:
readOnlyFieldsList - The readOnlyFieldsList to set.

getLookupableHelperService

public LookupableHelperService getLookupableHelperService()
Description copied from interface: Lookupable
Returns the LookupableHelperService designated to help this lookup

Specified by:
getLookupableHelperService in interface Lookupable
Returns:

setLookupableHelperService

public void setLookupableHelperService(LookupableHelperService lookupableHelperService)
Sets the lookupableHelperService attribute value.

Specified by:
setLookupableHelperService in interface Lookupable
Parameters:
lookupableHelperService - The lookupableHelperService to set.

performLookup

public Collection<? extends BusinessObject> performLookup(LookupForm lookupForm,
                                                          List<ResultRow> resultTable,
                                                          boolean bounded)
Performs a lookup that can only return one row.

Specified by:
performLookup in interface Lookupable
Returns:
results of lookup
See Also:
Lookupable#performLookup(org.kuali.rice.krad.web.struts.form.LookupForm, java.util.List, boolean)

isSearchUsingOnlyPrimaryKeyValues

public boolean isSearchUsingOnlyPrimaryKeyValues()
Description copied from interface: Lookupable
Returns whether this search was performed using the values of the primary keys only

Specified by:
isSearchUsingOnlyPrimaryKeyValues in interface Lookupable
Returns:

getPrimaryKeyFieldLabels

public String getPrimaryKeyFieldLabels()
Description copied from interface: Lookupable
Returns a comma delimited list of primary key field labels, as defined in the DD

Specified by:
getPrimaryKeyFieldLabels in interface Lookupable
Returns:

performClear

public void performClear(LookupForm lookupForm)
calls the lookup helper service to do "clear" behaviors

Specified by:
performClear in interface Lookupable
See Also:
Lookupable#performClear()

shouldDisplayHeaderNonMaintActions

public boolean shouldDisplayHeaderNonMaintActions()
calls the lookup helper service to check if non maintenance actions should be displayed

Specified by:
shouldDisplayHeaderNonMaintActions in interface Lookupable
See Also:
Lookupable.shouldDisplayHeaderNonMaintActions()

shouldDisplayLookupCriteria

public boolean shouldDisplayLookupCriteria()
calls the lookup helper service to check if criteria should be displayed

Specified by:
shouldDisplayLookupCriteria in interface Lookupable
See Also:
Lookupable.shouldDisplayLookupCriteria()

getCreateNewUrl

protected String getCreateNewUrl(String url)

performCustomAction

public boolean performCustomAction(boolean ignoreErrors)
Description copied from interface: Lookupable
This method is called from a custom action button or script

Specified by:
performCustomAction in interface Lookupable
See Also:
Lookupable.performCustomAction(boolean)

getExtraField

public Field getExtraField()
This overridden method ...

Specified by:
getExtraField in interface Lookupable
Returns:
See Also:
Lookupable.getExtraField()

applyFieldAuthorizationsFromNestedLookups

public void applyFieldAuthorizationsFromNestedLookups(Field field)
This overridden method ...

Specified by:
applyFieldAuthorizationsFromNestedLookups in interface Lookupable
See Also:
Lookupable#applyFieldAuthorizationsFromNestedLookups(org.kuali.rice.krad.web.ui.Field)

getExtraOnLoad

public String getExtraOnLoad()
This overridden method returns the extraOnLoad variable. The varible is currently accessed in page.tag and is called in the onLoad. it allows us to inject javascript onload.

Specified by:
getExtraOnLoad in interface Lookupable
See Also:
Lookupable.getExtraOnLoad()

setExtraOnLoad

public void setExtraOnLoad(String extraOnLoad)
Specified by:
setExtraOnLoad in interface Lookupable
Parameters:
extraOnLoad - the extraOnLoad to set

applyConditionalLogicForFieldDisplay

public void applyConditionalLogicForFieldDisplay()
Description copied from interface: Lookupable
Performs conditional logic (based on current search values or other parameters) to override field hidden, read-only, and required attributes previously set.

Specified by:
applyConditionalLogicForFieldDisplay in interface Lookupable
See Also:
Lookupable.applyConditionalLogicForFieldDisplay()


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.