org.kuali.rice.kns.lookup
Class AbstractLookupableHelperServiceImpl

java.lang.Object
  extended by org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
All Implemented Interfaces:
Serializable, LookupableHelperService
Direct Known Subclasses:
KualiLookupableHelperServiceImpl, PessimisticLockLookupableHelperServiceImpl

public abstract class AbstractLookupableHelperServiceImpl
extends Object
implements LookupableHelperService

This class declares many of the common spring injected properties, the get/set-ers for them, and some common util methods that require the injected services

See Also:
Serialized Form

Field Summary
protected static String ACTION_URLS_CHILDREN_END
           
protected static String ACTION_URLS_CHILDREN_SEPARATOR
           
protected static String ACTION_URLS_CHILDREN_STARTER
           
protected static String ACTION_URLS_EMPTY
           
protected static String ACTION_URLS_SEPARATOR
           
protected  String backLocation
           
protected  BusinessObjectAuthorizationService businessObjectAuthorizationService
           
protected  Class businessObjectClass
           
protected  BusinessObjectDictionaryService businessObjectDictionaryService
           
protected  BusinessObjectMetaDataService businessObjectMetaDataService
           
protected  BusinessObjectService businessObjectService
           
protected  ConfigurationService configurationService
           
protected  DataDictionaryService dataDictionaryService
           
protected  String docFormKey
           
protected  String docNum
           
protected  EncryptionService encryptionService
           
protected  Map fieldConversions
           
protected  HashMap<String,Boolean> forceLookupResultFieldInquiryCache
           
protected  HashMap<Class,Class> inquirableClassCache
           
protected  Inquirable kualiInquirable
           
protected static org.apache.log4j.Logger LOG
           
protected  LookupResultsService lookupResultsService
           
protected  LookupService lookupService
           
protected  MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService
           
protected  HashMap<String,Boolean> noLookupResultFieldInquiryCache
           
protected  Map<String,String[]> parameters
           
protected  ParameterService parameterService
           
protected  PersistenceStructureService persistenceStructureService
           
protected  List<String> readOnlyFieldsList
           
protected  String referencesToRefresh
           
protected  CopiedObject<ArrayList<Column>> resultColumns
           
protected static Integer RESULTS_DEFAULT_MAX_COLUMN_LENGTH
           
protected  List<Row> rows
           
protected  SequenceAccessorService sequenceAccessorService
           
protected static String TITLE_ACTION_URL_PREPENDTEXT_PROPERTY
           
protected static String TITLE_RETURN_URL_PREPENDTEXT_PROPERTY
           
 
Constructor Summary
AbstractLookupableHelperServiceImpl()
           
 
Method Summary
protected  String addToReturnHref(String href, LookupForm lookupForm)
           
protected  boolean allowsMaintenanceDeleteAction(BusinessObject businessObject)
          This method ...
protected  boolean allowsMaintenanceEditAction(BusinessObject businessObject)
           
 boolean allowsMaintenanceNewOrCopyAction()
          Determines if underlying lookup bo has associated maintenance document that allows new or copy maintenance actions.
 boolean allowsNewOrCopyAction(String documentTypeName)
          Determines if underlying lookup bo has associated document that allows new or copy maintenance actions.
 void applyConditionalLogicForFieldDisplay()
          Calls methods that can be overridden by child lookupables to implement conditional logic for setting read-only, required, and hidden attributes.
 void applyFieldAuthorizationsFromNestedLookups(Field field)
          Functional requirements state that users are able to perform searches using criteria values that they are not allowed to view.
 boolean checkForAdditionalFields(Map<String,String> fieldValues)
          This implementation always returns false.
protected  String getActionUrlHref(BusinessObject businessObject, String methodToCall, List pkNames)
          This method generates and returns href for the given parameters.
 String getActionUrls(BusinessObject businessObject, List pkNames, BusinessObjectRestrictions businessObjectRestrictions)
          This method is called by performLookup method to generate action urls.
protected  String getActionUrlTitleText(BusinessObject businessObject, String displayText, List pkNames, BusinessObjectRestrictions businessObjectRestrictions)
          This method generates and returns title text for action urls.
 String getBackLocation()
           
 BusinessObjectAuthorizationService getBusinessObjectAuthorizationService()
           
 Class getBusinessObjectClass()
           
 BusinessObjectDictionaryService getBusinessObjectDictionaryService()
          Gets the businessObjectDictionaryService attribute.
 BusinessObjectMetaDataService getBusinessObjectMetaDataService()
          Gets the businessObjectMetaDataService attribute.
 BusinessObjectService getBusinessObjectService()
           
protected  int getColumnMaxLength(String attributeName)
           
 List<Column> getColumns()
          Constructs the list of columns for the search results.
 Set<String> getConditionallyHiddenPropertyNames()
           
 Set<String> getConditionallyReadOnlyPropertyNames()
           
 Set<String> getConditionallyRequiredPropertyNames()
           
protected  String getCurrentSearchFieldValue(String propertyName)
          Helper method to get the value for a property out of the row-field graph.
 List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames)
          Child classes should override this method if they want to return some other action urls.
 DataDictionaryService getDataDictionaryService()
          Gets the dataDictionaryService attribute.
 List<String> getDefaultSortColumns()
          Uses the DD to determine which is the default sort order.
 String getDocFormKey()
          Gets the docFormKey attribute.
 String getDocNum()
           
protected  List<HtmlData> getEmptyActionUrls()
          A utility method that returns an empty list of action urls.
protected  HtmlData getEmptyAnchorHtmlData()
           
protected  EncryptionService getEncryptionService()
          Gets the encryptionService attribute.
 Field getExtraField()
          get an extra field
 HtmlData getInquiryUrl(BusinessObject bo, String propertyName)
          Returns the inquiry url for a field if one exist.
 ConfigurationService getKualiConfigurationService()
           
 Inquirable getKualiInquirable()
           
protected  LookupResultsService getLookupResultsService()
           
protected  LookupService getLookupService()
          Gets the lookupService attribute.
 MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService()
           
protected  String getMaintenanceDocumentTypeName()
          Returns the maintenance document type associated with the business object class or null if one does not exist.
 String getMaintenanceUrl(BusinessObject businessObject, HtmlData htmlData, List pkNames, BusinessObjectRestrictions businessObjectRestrictions)
          Build a maintenance url.
 Map<String,String[]> getParameters()
           
protected  Properties getParameters(BusinessObject bo, Map<String,String> fieldConversions, String lookupImpl, List returnKeys)
           
 ParameterService getParameterService()
           
protected  Properties getParametersFromPrimaryKey(BusinessObject businessObject, List pkNames)
           
protected  PersistenceStructureService getPersistenceStructureService()
          Gets the persistenceStructureService attribute.
 String getPrimaryKeyFieldLabels()
          Returns "N/A"
protected  Class getPropertyClass(BusinessObject element, String propertyName)
          Gets the Class for the property in the given BusinessObject instance, if property is not accessible then runtime exception is thrown
 List<String> getReadOnlyFieldsList()
          Gets the readOnlyFieldsList attribute.
 String getReferencesToRefresh()
           
protected  HtmlData getReturnAnchorHtmlData(BusinessObject businessObject, Properties parameters, LookupForm lookupForm, List returnKeys, BusinessObjectRestrictions businessObjectRestrictions)
           
protected  String getReturnHref(BusinessObject businessObject, Map fieldConversions, String lookupImpl, List returnKeys)
          This method is for lookupable implementations
protected  String getReturnHref(Properties parameters, LookupForm lookupForm, List returnKeys)
           
protected  HtmlData getReturnInputHtmlData(BusinessObject businessObject, Properties parameters, LookupForm lookupForm, List returnKeys, BusinessObjectRestrictions businessObjectRestrictions)
           
 List<String> getReturnKeys()
          This method is public because some unit tests depend on it.
 String getReturnLocation()
           
 HtmlData getReturnUrl(BusinessObject businessObject, LookupForm lookupForm, List returnKeys, BusinessObjectRestrictions businessObjectRestrictions)
          This method builds the return url
 HtmlData getReturnUrl(BusinessObject businessObject, Map fieldConversions, String lookupImpl, List returnKeys, BusinessObjectRestrictions businessObjectRestrictions)
          This method is for lookupable implementations
 List<Row> getRows()
          Returns a list of Row objects to be used to generate the search query screen Generally, setDataObjectClass needs to be called with a non-null value for proper operation
abstract  List<? extends BusinessObject> getSearchResults(Map<String,String> fieldValues)
          Performs a search and returns result list.
 List<? extends BusinessObject> getSearchResultsUnbounded(Map<String,String> fieldValues)
          This implementation of this method throws an UnsupportedOperationException, since not every implementation may actually want to use this operation.
protected  SequenceAccessorService getSequenceAccessorService()
           
 String getSupplementalMenuBar()
          This method gets the supplemental lookup menu if any
 String getTitle()
           
protected  HtmlData.AnchorHtmlData getUrlData(BusinessObject businessObject, String methodToCall, List pkNames)
          This method calls its overloaded method with displayText as methodToCall
protected  HtmlData.AnchorHtmlData getUrlData(BusinessObject businessObject, String methodToCall, String displayText, List pkNames)
          This method constructs an AnchorHtmlData.
 boolean isResultReturnable(BusinessObject object)
          Determines whether a given BusinessObject 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.
 boolean isSearchUsingOnlyPrimaryKeyValues()
          This method returns whether the previously executed getSearchResults used the primary key values to search, ignoring all non key values
protected  String maskValueIfNecessary(Class businessObjectClass, String propertyName, String propertyValue, BusinessObjectRestrictions businessObjectRestrictions)
           
 void performClear(LookupForm lookupForm)
          This method does the logic for the clear action.
 boolean performCustomAction(boolean ignoreErrors)
          performs custom actions.
 Collection<? extends BusinessObject> performLookup(LookupForm lookupForm, Collection<ResultRow> resultTable, boolean bounded)
          Performs the lookup and returns a collection of lookup items
 void setBackLocation(String backLocation)
           
 void setBusinessObjectClass(Class businessObjectClass)
          Initializes the lookup with a business object class.
 void setBusinessObjectDictionaryService(BusinessObjectDictionaryService businessObjectDictionaryService)
          Sets the businessObjectDictionaryService attribute value.
 void setBusinessObjectMetaDataService(BusinessObjectMetaDataService businessObjectMetaDataService)
          Sets the businessObjectMetaDataService attribute value.
 void setBusinessObjectService(BusinessObjectService businessObjectService)
           
 void setDataDictionaryService(DataDictionaryService dataDictionaryService)
          Sets the dataDictionaryService attribute value.
 void setDocFormKey(String docFormKey)
          Sets the docFormKey attribute value.
 void setDocNum(String docNum)
           
 void setEncryptionService(EncryptionService encryptionService)
          Sets the encryptionService attribute value.
 void setFieldConversions(Map fieldConversions)
          Sets the requested fields conversions in the lookupable
 void setKualiInquirable(Inquirable kualiInquirable)
           
 void setLookupResultsService(LookupResultsService lookupResultsService)
           
 void setLookupService(LookupService lookupService)
          Sets the lookupService attribute value.
 void setMaintenanceDocumentDictionaryService(MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService)
           
 void setParameters(Map<String,String[]> parameters)
          Initializes the lookup with the given Map of parameters.
 void setParameterService(ConfigurationService configurationService)
           
 void setParameterService(ParameterService parameterService)
           
 void setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
          Sets the persistenceStructureService attribute value.
 void setReadOnlyFieldsList(List<String> readOnlyFieldsList)
          Sets the readOnlyFieldsList attribute value.
protected  void setReferencesToRefresh(String referencesToRefresh)
           
protected  void setRows()
          Constructs the list of rows for the search fields.
 void setSequenceAccessorService(SequenceAccessorService sequenceAccessorService)
           
 boolean shouldDisplayHeaderNonMaintActions()
           
 boolean shouldDisplayLookupCriteria()
           
 void validateSearchParameters(Map<String,String> fieldValues)
          Checks that any required search fields have value.
protected  void validateSearchParameterWildcardAndOperators(String attributeName, String attributeValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TITLE_RETURN_URL_PREPENDTEXT_PROPERTY

protected static final String TITLE_RETURN_URL_PREPENDTEXT_PROPERTY
See Also:
Constant Field Values

TITLE_ACTION_URL_PREPENDTEXT_PROPERTY

protected static final String TITLE_ACTION_URL_PREPENDTEXT_PROPERTY
See Also:
Constant Field Values

ACTION_URLS_CHILDREN_SEPARATOR

protected static final String ACTION_URLS_CHILDREN_SEPARATOR
See Also:
Constant Field Values

ACTION_URLS_CHILDREN_STARTER

protected static final String ACTION_URLS_CHILDREN_STARTER
See Also:
Constant Field Values

ACTION_URLS_CHILDREN_END

protected static final String ACTION_URLS_CHILDREN_END
See Also:
Constant Field Values

ACTION_URLS_SEPARATOR

protected static final String ACTION_URLS_SEPARATOR
See Also:
Constant Field Values

ACTION_URLS_EMPTY

protected static final String ACTION_URLS_EMPTY
See Also:
Constant Field Values

LOG

protected static final org.apache.log4j.Logger LOG

businessObjectClass

protected Class businessObjectClass

parameters

protected Map<String,String[]> parameters

businessObjectDictionaryService

protected BusinessObjectDictionaryService businessObjectDictionaryService

businessObjectMetaDataService

protected BusinessObjectMetaDataService businessObjectMetaDataService

dataDictionaryService

protected DataDictionaryService dataDictionaryService

persistenceStructureService

protected PersistenceStructureService persistenceStructureService

encryptionService

protected EncryptionService encryptionService

readOnlyFieldsList

protected List<String> readOnlyFieldsList

backLocation

protected String backLocation

docFormKey

protected String docFormKey

fieldConversions

protected Map fieldConversions

lookupService

protected LookupService lookupService

rows

protected List<Row> rows

referencesToRefresh

protected String referencesToRefresh

sequenceAccessorService

protected SequenceAccessorService sequenceAccessorService

businessObjectService

protected BusinessObjectService businessObjectService

lookupResultsService

protected LookupResultsService lookupResultsService

docNum

protected String docNum

configurationService

protected ConfigurationService configurationService

parameterService

protected ParameterService parameterService

businessObjectAuthorizationService

protected BusinessObjectAuthorizationService businessObjectAuthorizationService

maintenanceDocumentDictionaryService

protected MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService

kualiInquirable

protected Inquirable kualiInquirable

noLookupResultFieldInquiryCache

protected HashMap<String,Boolean> noLookupResultFieldInquiryCache

inquirableClassCache

protected HashMap<Class,Class> inquirableClassCache

forceLookupResultFieldInquiryCache

protected HashMap<String,Boolean> forceLookupResultFieldInquiryCache

resultColumns

protected CopiedObject<ArrayList<Column>> resultColumns

RESULTS_DEFAULT_MAX_COLUMN_LENGTH

protected static Integer RESULTS_DEFAULT_MAX_COLUMN_LENGTH
Constructor Detail

AbstractLookupableHelperServiceImpl

public AbstractLookupableHelperServiceImpl()
Method Detail

getDocNum

public String getDocNum()
Specified by:
getDocNum in interface LookupableHelperService
Returns:
the docNum

setDocNum

public void setDocNum(String docNum)
Specified by:
setDocNum in interface LookupableHelperService
Parameters:
docNum - the docNum to set

checkForAdditionalFields

public boolean checkForAdditionalFields(Map<String,String> fieldValues)
This implementation always returns false.

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

getBusinessObjectClass

public Class getBusinessObjectClass()
Specified by:
getBusinessObjectClass in interface LookupableHelperService
Returns:
Returns the dataObjectClass this lookupable is representing
See Also:
LookupableHelperService.getBusinessObjectClass()

setBusinessObjectClass

public void setBusinessObjectClass(Class businessObjectClass)
Description copied from interface: LookupableHelperService
Initializes the lookup with a business object class. This is set via the LookupableHelperService's consumer, namely the Lookupable implementation (or in cases of nesting a wrapping LookupableHelperService). The Lookupable in turn receives this value from the UI via LookupForm population.

Specified by:
setBusinessObjectClass in interface LookupableHelperService
See Also:
LookupableHelperService.setBusinessObjectClass(java.lang.Class)

getParameters

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

setParameters

public void setParameters(Map<String,String[]> parameters)
Description copied from interface: LookupableHelperService
Initializes the lookup with the given Map of parameters.

Specified by:
setParameters in interface LookupableHelperService
See Also:
LookupableHelperService.setParameters(java.util.Map)

getDataDictionaryService

public DataDictionaryService getDataDictionaryService()
Gets the dataDictionaryService attribute.

Specified by:
getDataDictionaryService in interface LookupableHelperService
Returns:
Returns the dataDictionaryService.

setDataDictionaryService

public void setDataDictionaryService(DataDictionaryService dataDictionaryService)
Sets the dataDictionaryService attribute value.

Parameters:
dataDictionaryService - The dataDictionaryService to set.

getBusinessObjectDictionaryService

public BusinessObjectDictionaryService getBusinessObjectDictionaryService()
Gets the businessObjectDictionaryService attribute.

Specified by:
getBusinessObjectDictionaryService in interface LookupableHelperService
Returns:
Returns the businessObjectDictionaryService.

setBusinessObjectDictionaryService

public void setBusinessObjectDictionaryService(BusinessObjectDictionaryService businessObjectDictionaryService)
Sets the businessObjectDictionaryService attribute value.

Parameters:
businessObjectDictionaryService - The businessObjectDictionaryService to set.

getBusinessObjectMetaDataService

public BusinessObjectMetaDataService getBusinessObjectMetaDataService()
Gets the businessObjectMetaDataService attribute.

Returns:
Returns the businessObjectMetaDataService.

setBusinessObjectMetaDataService

public void setBusinessObjectMetaDataService(BusinessObjectMetaDataService businessObjectMetaDataService)
Sets the businessObjectMetaDataService attribute value.

Parameters:
businessObjectMetaDataService - The businessObjectMetaDataService to set.

getPersistenceStructureService

protected PersistenceStructureService getPersistenceStructureService()
Gets the persistenceStructureService attribute.

Returns:
Returns the persistenceStructureService.

setPersistenceStructureService

public void setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
Sets the persistenceStructureService attribute value.

Parameters:
persistenceStructureService - The persistenceStructureService to set.

getEncryptionService

protected EncryptionService getEncryptionService()
Gets the encryptionService attribute.

Returns:
Returns the encryptionService.

setEncryptionService

public void setEncryptionService(EncryptionService encryptionService)
Sets the encryptionService attribute value.

Parameters:
encryptionService - The encryptionService to set.

getMaintenanceDocumentDictionaryService

public MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService()

getBusinessObjectAuthorizationService

public BusinessObjectAuthorizationService getBusinessObjectAuthorizationService()

getKualiInquirable

public Inquirable getKualiInquirable()

setMaintenanceDocumentDictionaryService

public void setMaintenanceDocumentDictionaryService(MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService)

setKualiInquirable

public void setKualiInquirable(Inquirable kualiInquirable)

getKualiConfigurationService

public ConfigurationService getKualiConfigurationService()

setParameterService

public void setParameterService(ConfigurationService configurationService)

getParameterService

public ParameterService getParameterService()

setParameterService

public void setParameterService(ParameterService parameterService)

allowsMaintenanceNewOrCopyAction

public boolean allowsMaintenanceNewOrCopyAction()
Determines if underlying lookup bo has associated maintenance document that allows new or copy maintenance actions.

Specified by:
allowsMaintenanceNewOrCopyAction in interface LookupableHelperService
Returns:
true if bo has maint doc that allows new or copy actions

allowsMaintenanceEditAction

protected boolean allowsMaintenanceEditAction(BusinessObject businessObject)

getMaintenanceUrl

public final String getMaintenanceUrl(BusinessObject businessObject,
                                      HtmlData htmlData,
                                      List pkNames,
                                      BusinessObjectRestrictions businessObjectRestrictions)
Build a maintenance url.

Specified by:
getMaintenanceUrl in interface LookupableHelperService
Parameters:
bo - - business object representing the record for maint.
methodToCall - - maintenance action
Returns:

getActionUrls

public final String getActionUrls(BusinessObject businessObject,
                                  List pkNames,
                                  BusinessObjectRestrictions businessObjectRestrictions)
This method is called by performLookup method to generate action urls. It calls the method getCustomActionUrls to get html data, calls getMaintenanceUrl to get the actual html tag, and returns a formatted/concatenated string of action urls.

Specified by:
getActionUrls in interface LookupableHelperService
Parameters:
businessObject - - Instance of a business object containing the return values
pkNames - - List of primary key names
Returns:
String rendered in actions column of result set
See Also:
LookupableHelperService#getActionUrls(org.kuali.rice.krad.bo.BusinessObject)

getCustomActionUrls

public List<HtmlData> getCustomActionUrls(BusinessObject businessObject,
                                          List pkNames)
Child classes should override this method if they want to return some other action urls.

Specified by:
getCustomActionUrls in interface LookupableHelperService
Returns:
See Also:
LookupableHelperService#getCustomActionUrls(org.kuali.rice.krad.bo.BusinessObject, java.util.List, java.util.List pkNames)

allowsMaintenanceDeleteAction

protected boolean allowsMaintenanceDeleteAction(BusinessObject businessObject)
This method ... for KULRice 3070

Returns:

getUrlData

protected HtmlData.AnchorHtmlData getUrlData(BusinessObject businessObject,
                                             String methodToCall,
                                             String displayText,
                                             List pkNames)
This method constructs an AnchorHtmlData. This method can be overriden by child classes if they want to construct the html data in a different way. Foe example, if they want different type of html tag, like input/image.

Parameters:
businessObject -
methodToCall -
displayText -
pkNames -
Returns:

getUrlData

protected HtmlData.AnchorHtmlData getUrlData(BusinessObject businessObject,
                                             String methodToCall,
                                             List pkNames)
This method calls its overloaded method with displayText as methodToCall

Parameters:
businessObject -
methodToCall -
pkNames -
Returns:

getEmptyActionUrls

protected List<HtmlData> getEmptyActionUrls()
A utility method that returns an empty list of action urls.

Returns:

getEmptyAnchorHtmlData

protected HtmlData getEmptyAnchorHtmlData()

getActionUrlHref

protected String getActionUrlHref(BusinessObject businessObject,
                                  String methodToCall,
                                  List pkNames)
This method generates and returns href for the given parameters. This method can be overridden by child classes if they have to generate href differently. For example, refer to IntendedIncumbentLookupableHelperServiceImpl

Parameters:
businessObject -
methodToCall -
pkNames -
Returns:

getParametersFromPrimaryKey

protected Properties getParametersFromPrimaryKey(BusinessObject businessObject,
                                                 List pkNames)

getActionUrlTitleText

protected String getActionUrlTitleText(BusinessObject businessObject,
                                       String displayText,
                                       List pkNames,
                                       BusinessObjectRestrictions businessObjectRestrictions)
This method generates and returns title text for action urls. Child classes can override this if they want to generate the title text differently. For example, refer to BatchJobStatusLookupableHelperServiceImpl

Parameters:
businessObject -
displayText -
pkNames -
Returns:

getMaintenanceDocumentTypeName

protected String getMaintenanceDocumentTypeName()
Returns the maintenance document type associated with the business object class or null if one does not exist.

Returns:
String representing the maintenance document type name

getReadOnlyFieldsList

public List<String> getReadOnlyFieldsList()
Gets the readOnlyFieldsList attribute.

Specified by:
getReadOnlyFieldsList in interface LookupableHelperService
Returns:
Returns the readOnlyFieldsList.

setReadOnlyFieldsList

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

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

getInquiryUrl

public HtmlData getInquiryUrl(BusinessObject bo,
                              String propertyName)
Returns the inquiry url for a field if one exist.

Specified by:
getInquiryUrl in interface LookupableHelperService
Parameters:
bo - the business object instance to build the urls for
propertyName - the property which links to an inquirable
Returns:
String url to inquiry

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 LookupableHelperService
Returns:
List of Column objects used to render the result table

getColumnMaxLength

protected int getColumnMaxLength(String attributeName)

getBackLocation

public String getBackLocation()
Specified by:
getBackLocation in interface LookupableHelperService
Returns:
Returns the backLocation.

setBackLocation

public void setBackLocation(String backLocation)
Specified by:
setBackLocation in interface LookupableHelperService
Parameters:
backLocation - The backLocation to set.

getReturnLocation

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

getReturnUrl

public final HtmlData getReturnUrl(BusinessObject businessObject,
                                   Map fieldConversions,
                                   String lookupImpl,
                                   List returnKeys,
                                   BusinessObjectRestrictions businessObjectRestrictions)
This method is for lookupable implementations

Specified by:
getReturnUrl in interface LookupableHelperService
Parameters:
businessObject - - 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
returnKeys - - Keys to return
Returns:
String url called when selecting a row from the result set
See Also:
LookupableHelperService#getReturnUrl(org.kuali.rice.krad.bo.BusinessObject, java.util.Map, java.lang.String, java.util.List)

getReturnHref

protected final String getReturnHref(BusinessObject businessObject,
                                     Map fieldConversions,
                                     String lookupImpl,
                                     List returnKeys)
This method is for lookupable implementations

Parameters:
businessObject -
fieldConversions -
lookupImpl -
returnKeys -
Returns:

getReturnUrl

public HtmlData getReturnUrl(BusinessObject businessObject,
                             LookupForm lookupForm,
                             List returnKeys,
                             BusinessObjectRestrictions businessObjectRestrictions)
Description copied from interface: LookupableHelperService
This method builds the return url

Specified by:
getReturnUrl in interface LookupableHelperService
Returns:
See Also:
LookupableHelperService#getReturnUrl(org.kuali.core.bo.BusinessObject, java.util.Map, java.lang.String)

getReturnInputHtmlData

protected HtmlData getReturnInputHtmlData(BusinessObject businessObject,
                                          Properties parameters,
                                          LookupForm lookupForm,
                                          List returnKeys,
                                          BusinessObjectRestrictions businessObjectRestrictions)

getReturnAnchorHtmlData

protected HtmlData getReturnAnchorHtmlData(BusinessObject businessObject,
                                           Properties parameters,
                                           LookupForm lookupForm,
                                           List returnKeys,
                                           BusinessObjectRestrictions businessObjectRestrictions)

getReturnHref

protected String getReturnHref(Properties parameters,
                               LookupForm lookupForm,
                               List returnKeys)

addToReturnHref

protected String addToReturnHref(String href,
                                 LookupForm lookupForm)

getParameters

protected Properties getParameters(BusinessObject bo,
                                   Map<String,String> fieldConversions,
                                   String lookupImpl,
                                   List returnKeys)

getReturnKeys

public List<String> getReturnKeys()
Description copied from interface: LookupableHelperService
This method is public because some unit tests depend on it.

Specified by:
getReturnKeys in interface LookupableHelperService
Returns:
a List of the names of fields which are marked in data dictionary as return fields.

getDocFormKey

public String getDocFormKey()
Gets the docFormKey attribute.

Specified by:
getDocFormKey in interface LookupableHelperService
Returns:
Returns the docFormKey.

setDocFormKey

public void setDocFormKey(String docFormKey)
Sets the docFormKey attribute value.

Specified by:
setDocFormKey in interface LookupableHelperService
Parameters:
docFormKey - The docFormKey to set.

setFieldConversions

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

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

getLookupService

protected LookupService getLookupService()
Gets the lookupService attribute.

Returns:
Returns the lookupService.

setLookupService

public void setLookupService(LookupService lookupService)
Sets the lookupService attribute value.

Parameters:
lookupService - The lookupService to set.

getDefaultSortColumns

public List<String> getDefaultSortColumns()
Uses the DD to determine which is the default sort order.

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

validateSearchParameters

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

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

validateSearchParameterWildcardAndOperators

protected void validateSearchParameterWildcardAndOperators(String attributeName,
                                                           String attributeValue)

setRows

protected void setRows()
Constructs the list of rows for the search fields. All properties for the field objects come from the DataDictionary. To be called by setBusinessObject


getRows

public List<Row> getRows()
Description copied from interface: LookupableHelperService
Returns a list of Row objects to be used to generate the search query screen Generally, setDataObjectClass needs to be called with a non-null value for proper operation

Specified by:
getRows in interface LookupableHelperService
Returns:

getSearchResults

public abstract List<? extends BusinessObject> getSearchResults(Map<String,String> fieldValues)
Description copied from interface: LookupableHelperService
Performs a search and returns result list.

Specified by:
getSearchResults in interface LookupableHelperService
Parameters:
fieldValues - - Map of property/value pairs
Returns:
List of business objects found by the search

getSearchResultsUnbounded

public List<? extends BusinessObject> getSearchResultsUnbounded(Map<String,String> fieldValues)
This implementation of this method throws an UnsupportedOperationException, since not every implementation may actually want to use this operation. Subclasses desiring other behaviors will need to override this.

Specified by:
getSearchResultsUnbounded in interface LookupableHelperService
Returns:
See Also:
LookupableHelperService.getSearchResultsUnbounded(java.util.Map)

performLookup

public Collection<? extends BusinessObject> performLookup(LookupForm lookupForm,
                                                          Collection<ResultRow> resultTable,
                                                          boolean bounded)
Performs the lookup and returns a collection of lookup items

Specified by:
performLookup in interface LookupableHelperService
Parameters:
lookupForm -
resultTable -
bounded -
Returns:

getPropertyClass

protected Class getPropertyClass(BusinessObject element,
                                 String propertyName)
Gets the Class for the property in the given BusinessObject instance, if property is not accessible then runtime exception is thrown

Parameters:
element - BusinessObject instance that contains property
propertyName - Name of property in BusinessObject to get class for
Returns:
Type for property as Class

maskValueIfNecessary

protected String maskValueIfNecessary(Class businessObjectClass,
                                      String propertyName,
                                      String propertyValue,
                                      BusinessObjectRestrictions businessObjectRestrictions)

setReferencesToRefresh

protected void setReferencesToRefresh(String referencesToRefresh)

getReferencesToRefresh

public String getReferencesToRefresh()

getSequenceAccessorService

protected SequenceAccessorService getSequenceAccessorService()

setSequenceAccessorService

public void setSequenceAccessorService(SequenceAccessorService sequenceAccessorService)

getBusinessObjectService

public BusinessObjectService getBusinessObjectService()

setBusinessObjectService

public void setBusinessObjectService(BusinessObjectService businessObjectService)

getLookupResultsService

protected LookupResultsService getLookupResultsService()

setLookupResultsService

public void setLookupResultsService(LookupResultsService lookupResultsService)

isSearchUsingOnlyPrimaryKeyValues

public boolean isSearchUsingOnlyPrimaryKeyValues()
Description copied from interface: LookupableHelperService
This method returns whether the previously executed getSearchResults used the primary key values to search, ignoring all non key values

Specified by:
isSearchUsingOnlyPrimaryKeyValues in interface LookupableHelperService
Returns:
false always, subclasses should override to do something smarter
See Also:
LookupableHelperService.isSearchUsingOnlyPrimaryKeyValues()

getPrimaryKeyFieldLabels

public String getPrimaryKeyFieldLabels()
Returns "N/A"

Specified by:
getPrimaryKeyFieldLabels in interface LookupableHelperService
Returns:
"N/A"
See Also:
LookupableHelperService.getPrimaryKeyFieldLabels()

isResultReturnable

public boolean isResultReturnable(BusinessObject object)
Description copied from interface: LookupableHelperService
Determines whether a given BusinessObject 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. Note that this can be part of an authorization mechanism, but not the complete authorization mechanism. The component that invoked the lookup/ lookup caller (e.g. document, nesting lookup, etc.) needs to check that the object that was passed to it was returnable as well because there are ways around this method (e.g. crafting a custom return URL).

Specified by:
isResultReturnable in interface LookupableHelperService
Parameters:
object - an object from the search result set
Returns:
See Also:
LookupableHelperService#isResultReturnable(org.kuali.core.bo.BusinessObject)

performClear

public void performClear(LookupForm lookupForm)
This method does the logic for the clear action.

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

shouldDisplayHeaderNonMaintActions

public boolean shouldDisplayHeaderNonMaintActions()
Specified by:
shouldDisplayHeaderNonMaintActions in interface LookupableHelperService
See Also:
LookupableHelperService.shouldDisplayHeaderNonMaintActions()

shouldDisplayLookupCriteria

public boolean shouldDisplayLookupCriteria()
Specified by:
shouldDisplayLookupCriteria in interface LookupableHelperService
See Also:
LookupableHelperService.shouldDisplayLookupCriteria()

getSupplementalMenuBar

public String getSupplementalMenuBar()
Description copied from interface: LookupableHelperService
This method gets the supplemental lookup menu if any

Specified by:
getSupplementalMenuBar in interface LookupableHelperService
Returns:
supplemental menu bar
See Also:
LookupableHelperService.getSupplementalMenuBar()

getTitle

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

performCustomAction

public boolean performCustomAction(boolean ignoreErrors)
Description copied from interface: LookupableHelperService
performs custom actions. return true to reperform search

Specified by:
performCustomAction in interface LookupableHelperService
Returns:
boolean to reperform search
See Also:
LookupableHelperService.performCustomAction(boolean)

getExtraField

public Field getExtraField()
Description copied from interface: LookupableHelperService
get an extra field

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

allowsNewOrCopyAction

public boolean allowsNewOrCopyAction(String documentTypeName)
Description copied from interface: LookupableHelperService
Determines if underlying lookup bo has associated document that allows new or copy maintenance actions.

Specified by:
allowsNewOrCopyAction in interface LookupableHelperService
Returns:
true if bo has doc that allows new or copy actions

applyFieldAuthorizationsFromNestedLookups

public void applyFieldAuthorizationsFromNestedLookups(Field field)
Functional requirements state that users are able to perform searches using criteria values that they are not allowed to view.

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

applyConditionalLogicForFieldDisplay

public void applyConditionalLogicForFieldDisplay()
Calls methods that can be overridden by child lookupables to implement conditional logic for setting read-only, required, and hidden attributes. Called in the last part of the lookup lifecycle so the fields values that will be sent will be correctly reflected in the rows (like after a clear).

Specified by:
applyConditionalLogicForFieldDisplay in interface LookupableHelperService
See Also:
getConditionallyReadOnlyPropertyNames(), getConditionallyRequiredPropertyNames(), getConditionallyHiddenPropertyNames(), LookupableHelperService.applyConditionalLogicForFieldDisplay()

getConditionallyReadOnlyPropertyNames

public Set<String> getConditionallyReadOnlyPropertyNames()
Returns:
Set of property names that should be set as read only based on the current search contents, note request parms containing search field values can be retrieved with getParameters()

getConditionallyRequiredPropertyNames

public Set<String> getConditionallyRequiredPropertyNames()
Returns:
Set of property names that should be set as required based on the current search contents, note request parms containing search field values can be retrieved with getParameters()

getConditionallyHiddenPropertyNames

public Set<String> getConditionallyHiddenPropertyNames()
Returns:
Set of property names that should be set as hidden based on the current search contents, note request parms containing search field values can be retrieved with getParameters()

getCurrentSearchFieldValue

protected String getCurrentSearchFieldValue(String propertyName)
Helper method to get the value for a property out of the row-field graph. If property is multi-value then the values will be joined by a semi-colon.

Parameters:
propertyName - - name of property to retrieve value for
Returns:
current property value as a String


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