org.kuali.rice.kns.lookup
Class KualiLookupableImpl

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

@Transactional
public class KualiLookupableImpl
extends java.lang.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  java.lang.Class businessObjectClass
           
protected  java.lang.String extraOnLoad
           
protected static java.lang.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(java.util.Map fieldValues)
          Determines if there should be more search fields rendered based on already entered search criteria.
 java.lang.String getBackLocation()
           
 java.lang.Class getBusinessObjectClass()
           
protected  BusinessObjectDictionaryService getBusinessObjectDictionaryService()
           
 java.util.List getColumns()
          Constructs the list of columns for the search results.
 java.lang.String getCreateNewUrl()
          Builds the Url for a maintenance new document for the lookup business object class
protected  java.lang.String getCreateNewUrl(java.lang.String url)
           
protected  DataDictionaryService getDataDictionaryService()
           
 java.util.List getDefaultSortColumns()
          This method returns a list of the default columns used to sort the result set.
 java.lang.String getDocFormKey()
           
 java.lang.String getExtraButtonParams()
           
 java.lang.String getExtraButtonSource()
           
 Field getExtraField()
          This overridden method ...
 java.lang.String getExtraOnLoad()
          This overridden method returns the extraOnLoad variable.
 java.lang.String getHtmlMenuBar()
           
 LookupableHelperService getLookupableHelperService()
          Returns the LookupableHelperService designated to help this lookup
 java.util.Map getParameters()
           
 java.lang.String getPrimaryKeyFieldLabels()
          Returns a comma delimited list of primary key field labels, as defined in the DD
 java.util.List getReturnKeys()
           
 java.lang.String getReturnLocation()
           
 HtmlData getReturnUrl(org.kuali.rice.kns.bo.BusinessObject bo, java.util.Map fieldConversions, java.lang.String lookupImpl, BusinessObjectRestrictions businessObjectRestrictions)
          Builds the return value url.
 java.util.List getRows()
           
 java.util.List<org.kuali.rice.kns.bo.BusinessObject> getSearchResults(java.util.Map<java.lang.String,java.lang.String> fieldValues)
          Uses Lookup Service to provide a basic search.
 java.util.List<org.kuali.rice.kns.bo.BusinessObject> getSearchResultsUnbounded(java.util.Map<java.lang.String,java.lang.String> fieldValues)
          Uses Lookup Service to provide a basic unbounded search.
 java.lang.String getSupplementalMenuBar()
           
 java.lang.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
 java.util.Collection performLookup(LookupForm lookupForm, java.util.List<ResultRow> resultTable, boolean bounded)
          Performs a lookup that can only return one row.
 void setBackLocation(java.lang.String backLocation)
           
 void setBusinessObjectClass(java.lang.Class boClass)
          Sets the business object class for the lookup instance, then rows can be set for search render.
 void setDocFormKey(java.lang.String docFormKey)
          // this method is public because unit tests depend upon it
 void setExtraOnLoad(java.lang.String extraOnLoad)
           
 void setFieldConversions(java.util.Map fieldConversions)
          Sets the requested fields conversions in the lookupable
 void setLookupableHelperService(LookupableHelperService lookupableHelperService)
          Sets the lookupableHelperService attribute value.
 void setParameters(java.util.Map parameters)
          Initializes the lookup with the given Map of parameters.
 void setReadOnlyFieldsList(java.util.List<java.lang.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(java.util.Map 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 java.lang.String[] IGNORE_LIST

businessObjectClass

protected java.lang.Class businessObjectClass

lookupableHelperService

protected LookupableHelperService lookupableHelperService

extraOnLoad

protected java.lang.String extraOnLoad
Constructor Detail

KualiLookupableImpl

public KualiLookupableImpl()
Default constructor initializes services from spring

Method Detail

setBusinessObjectClass

public void setBusinessObjectClass(java.lang.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(java.util.Map parameters)
Initializes the lookup with the given Map of parameters.

Specified by:
setParameters in interface Lookupable
Parameters:
parameters -

getParameters

public java.util.Map getParameters()
Specified by:
getParameters in interface Lookupable
Returns:
Returns the parameters passed to this lookup

getColumns

public java.util.List 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(java.util.Map 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 java.util.List<org.kuali.rice.kns.bo.BusinessObject> getSearchResultsUnbounded(java.util.Map<java.lang.String,java.lang.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 java.util.List<org.kuali.rice.kns.bo.BusinessObject> getSearchResults(java.util.Map<java.lang.String,java.lang.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(org.kuali.rice.kns.bo.BusinessObject bo,
                             java.util.Map fieldConversions,
                             java.lang.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 java.lang.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 java.lang.String getHtmlMenuBar()
Specified by:
getHtmlMenuBar in interface Lookupable
Returns:
the html to be displayed as a menu bar
See Also:
Lookupable.getHtmlMenuBar()

getSupplementalMenuBar

public java.lang.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 java.util.List getRows()
Specified by:
getRows in interface Lookupable
Returns:
List of Row objects used to render the search area
See Also:
Lookupable.getRows()

getTitle

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

getReturnLocation

public java.lang.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 java.lang.Class getBusinessObjectClass()
Specified by:
getBusinessObjectClass in interface Lookupable
Returns:
Returns the businessObjectClass.

getReturnKeys

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

getExtraButtonSource

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

getExtraButtonParams

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

getDefaultSortColumns

public java.util.List 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(java.util.Map 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 java.lang.String getBackLocation()
Returns:
Returns the backLocation.

setBackLocation

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

getDocFormKey

public java.lang.String getDocFormKey()
Returns:
Returns the docFormKey.

setDocFormKey

public void setDocFormKey(java.lang.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(java.util.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(java.util.List<java.lang.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 java.util.Collection performLookup(LookupForm lookupForm,
                                          java.util.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.kns.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 java.lang.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:
org.kuali.rice.kns.lookup.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 java.lang.String getCreateNewUrl(java.lang.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.kns.web.ui.Field)

getExtraOnLoad

public java.lang.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(java.lang.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 © 2004-2011 The Kuali Foundation. All Rights Reserved.