org.kuali.rice.kns.lookup
Class LookupUtils

java.lang.Object
  extended by org.kuali.rice.kns.lookup.LookupUtils

public class LookupUtils
extends Object

Utility class for Lookup related utilities and helper methods.


Constructor Summary
LookupUtils()
           
 
Method Summary
static void applySearchResultsLimit(Class businessObjectClass, Criteria criteria)
          Applies the search results limit to the search criteria for this BO (JPA)
static void applySearchResultsLimit(Class businessObjectClass, org.apache.ojb.broker.query.Criteria criteria, DatabasePlatform platform)
          This method applies the search results limit to the search criteria for this BO
static String convertReferencesToSelectCollectionToString(Collection<String> referencesToRefresh)
           
static String convertSetOfObjectIdsToString(Set<String> objectIds)
           
static Set<String> convertStringOfObjectIdsToSet(String objectIdsString)
           
static Comparator findBestValueComparatorForColumn(List<ResultRow> resultTable, int column)
          Given a list of results from a lookup, determines the best comparator to use on the String values of each of these columns This method exists because each cell (represented by the Column object) lists the comparator that should be used within it based on the property value class, so we gotta go thru the whole list and determine the best comparator to use
static Map<String,String> generateCompositeSelectedObjectIds(Set<String> previouslySelectedObjectIds, Set<String> displayedObjectIds, Set<String> selectedObjectIds)
          Given 3 sets of object IDs: the set of selected object IDs before rendering the current page, the set of object IDs rendered on the page, and the set of object IDs selected on the page, computes the total set of selected object IDs.
static Integer getApplicationMaximumSearchResulsPerPageForMultipleValueLookups()
          This method the maximum rows per page in a multiple value lookup
static Integer getApplicationSearchResultsLimit()
           
static String getBaseInquiryUrl()
          Deprecated. 
static String getBaseLookupUrl(boolean isMultipleValue)
          Deprecated. 
static BusinessObjectDictionaryService getBusinessObjectDictionaryService()
           
static BusinessObjectMetaDataService getBusinessObjectMetaDataService()
           
static Integer getBusinessObjectSearchResultsLimit(Class businessObjectClass)
          Parses and returns the lookup result set limit for the passed in BO (if one exists)
static DataDictionaryService getDataDictionaryService()
           
static DateTimeService getDateTimeService()
           
static BusinessObject getNestedBusinessObject(BusinessObject bo, String attributeName)
          This method walks through the nested attribute and finds the last business object in the chain and returns it (excluding the last parameter which is the actual attribute)
static Class getNestedReferenceClass(BusinessObject businessObject, String attributeName)
           
static PersistenceStructureService getPersistenceStructureService()
           
static Map getPrimitiveReference(BusinessObject businessObject, String attributeName)
          Deprecated. 
static Integer getSearchResultsLimit(Class businessObjectClass)
          Parses and returns the lookup result set limit, checking first for the limit for the BO being looked up, and then the global application limit if there isn't a limit specific to this BO.
static Map<String,String> preProcessRangeFields(Map<String,String> lookupFormFields)
          Changes ranged search fields like from/to dates into the range operators the lookupable dao expects ("..",">" etc) this method modifies the passed in map and returns a list containing only the modified fields This method does not handle document searchable attributes.
static void removeHiddenCriteriaFields(Class businessObjectClass, Map fieldValues)
          Removes fields identified in the data dictionary as hidden from the lookup field values.
static Field setFieldDirectInquiry(BusinessObject businessObject, String attributeName, Field field)
           
static Field setFieldQuickfinder(BusinessObject businessObject, String collectionName, boolean addLine, int index, String attributeName, Field field, List displayedFieldNames)
          Deprecated. 
static Field setFieldQuickfinder(BusinessObject businessObject, String collectionName, boolean addLine, int index, String attributeName, Field field, List displayedFieldNames, boolean noLookupField)
          Deprecated. 
static Field setFieldQuickfinder(BusinessObject businessObject, String collectionName, boolean addLine, int index, String attributeName, Field field, List displayedFieldNames, SelectiveReferenceRefresher srr)
          Deprecated. 
static Field setFieldQuickfinder(BusinessObject businessObject, String attributeName, Field field, List displayedFieldNames)
          Deprecated. 
static Field setFieldQuickfinder(BusinessObject businessObject, String attributeName, Field field, List displayedFieldNames, SelectiveReferenceRefresher srr)
          Deprecated. 
static String transformLookupUrlToMultiple(String lookupUrl)
           
static Map<String,String> translateFieldConversions(String fieldConversionsString)
          This translates a , delimited list of pairs separated by a : into a Map of target --> lookup field conversions.
static List<String> translateReadOnlyFieldsToList(String readOnlyFieldsString)
          This makes a , delimited String list of fields separated by a , into a List of target --> lookup readOnlyFieldsList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LookupUtils

public LookupUtils()
Method Detail

removeHiddenCriteriaFields

public static void removeHiddenCriteriaFields(Class businessObjectClass,
                                              Map fieldValues)
Removes fields identified in the data dictionary as hidden from the lookup field values. (This will remove Universal User ID and Person name from search requests when a user ID is entered.)

Parameters:
fieldValues -

getSearchResultsLimit

public static Integer getSearchResultsLimit(Class businessObjectClass)
Parses and returns the lookup result set limit, checking first for the limit for the BO being looked up, and then the global application limit if there isn't a limit specific to this BO.

Parameters:
businessObjectClass - BO class to search on / get limit for. If the passed in type is not of type BusinessObject, then the application-wide default limit is used.
Returns:
result set limit (or null if there isn't one)

getApplicationSearchResultsLimit

public static Integer getApplicationSearchResultsLimit()

getBusinessObjectSearchResultsLimit

public static Integer getBusinessObjectSearchResultsLimit(Class businessObjectClass)
Parses and returns the lookup result set limit for the passed in BO (if one exists)

Parameters:
businessObjectClass -
Returns:
result set limit for this BO (or null if the BO doesn't have a limit)

applySearchResultsLimit

public static void applySearchResultsLimit(Class businessObjectClass,
                                           org.apache.ojb.broker.query.Criteria criteria,
                                           DatabasePlatform platform)
This method applies the search results limit to the search criteria for this BO

Parameters:
businessObjectClass - BO class to search on / get limit for
criteria - search criteria
platform - database platform

applySearchResultsLimit

public static void applySearchResultsLimit(Class businessObjectClass,
                                           Criteria criteria)
Applies the search results limit to the search criteria for this BO (JPA)

Parameters:
businessObjectClass - BO class to search on / get limit for
criteria - search criteria

getApplicationMaximumSearchResulsPerPageForMultipleValueLookups

public static Integer getApplicationMaximumSearchResulsPerPageForMultipleValueLookups()
This method the maximum rows per page in a multiple value lookup

Returns:
See Also:
org.kuali.KRADConstants.SystemGroupParameterNames#MULTIPLE_VALUE_LOOKUP_RESULTS_PER_PAGE

translateReadOnlyFieldsToList

public static List<String> translateReadOnlyFieldsToList(String readOnlyFieldsString)
This makes a , delimited String list of fields separated by a , into a List of target --> lookup readOnlyFieldsList.

Parameters:
readOnlyFields -
Returns:
the List representation of the readOnlyFields String provided.

translateFieldConversions

public static Map<String,String> translateFieldConversions(String fieldConversionsString)
This translates a , delimited list of pairs separated by a : into a Map of target --> lookup field conversions.

Parameters:
conversionFields -
Returns:
the Map representation of the fieldConversions String provided.

setFieldQuickfinder

@Deprecated
public static Field setFieldQuickfinder(BusinessObject businessObject,
                                                   String attributeName,
                                                   Field field,
                                                   List displayedFieldNames)
Deprecated. 


setFieldQuickfinder

@Deprecated
public static Field setFieldQuickfinder(BusinessObject businessObject,
                                                   String attributeName,
                                                   Field field,
                                                   List displayedFieldNames,
                                                   SelectiveReferenceRefresher srr)
Deprecated. 


setFieldQuickfinder

@Deprecated
public static Field setFieldQuickfinder(BusinessObject businessObject,
                                                   String collectionName,
                                                   boolean addLine,
                                                   int index,
                                                   String attributeName,
                                                   Field field,
                                                   List displayedFieldNames,
                                                   SelectiveReferenceRefresher srr)
Deprecated. 

Sets a fields quickfinder class and field conversions for an attribute.


setFieldQuickfinder

@Deprecated
public static Field setFieldQuickfinder(BusinessObject businessObject,
                                                   String collectionName,
                                                   boolean addLine,
                                                   int index,
                                                   String attributeName,
                                                   Field field,
                                                   List displayedFieldNames)
Deprecated. 

Sets a fields quickfinder class and field conversions for an attribute.


setFieldQuickfinder

@Deprecated
public static Field setFieldQuickfinder(BusinessObject businessObject,
                                                   String collectionName,
                                                   boolean addLine,
                                                   int index,
                                                   String attributeName,
                                                   Field field,
                                                   List displayedFieldNames,
                                                   boolean noLookupField)
Deprecated. 


getBaseLookupUrl

@Deprecated
public static String getBaseLookupUrl(boolean isMultipleValue)
Deprecated. 

See Also:
LookupInquiryUtils.getBaseLookupUrl()

getBaseInquiryUrl

@Deprecated
public static String getBaseInquiryUrl()
Deprecated. 


transformLookupUrlToMultiple

public static String transformLookupUrlToMultiple(String lookupUrl)

setFieldDirectInquiry

public static Field setFieldDirectInquiry(BusinessObject businessObject,
                                          String attributeName,
                                          Field field)
Parameters:
field -
Returns:
the altered Field object

getPrimitiveReference

@Deprecated
public static Map getPrimitiveReference(BusinessObject businessObject,
                                                   String attributeName)
Deprecated. 


getNestedBusinessObject

public static BusinessObject getNestedBusinessObject(BusinessObject bo,
                                                     String attributeName)
This method walks through the nested attribute and finds the last business object in the chain and returns it (excluding the last parameter which is the actual attribute)

Parameters:
attributeName -
Returns:

getNestedReferenceClass

public static Class getNestedReferenceClass(BusinessObject businessObject,
                                            String attributeName)

convertReferencesToSelectCollectionToString

public static String convertReferencesToSelectCollectionToString(Collection<String> referencesToRefresh)

convertSetOfObjectIdsToString

public static String convertSetOfObjectIdsToString(Set<String> objectIds)

convertStringOfObjectIdsToSet

public static Set<String> convertStringOfObjectIdsToSet(String objectIdsString)

findBestValueComparatorForColumn

public static Comparator findBestValueComparatorForColumn(List<ResultRow> resultTable,
                                                          int column)
Given a list of results from a lookup, determines the best comparator to use on the String values of each of these columns This method exists because each cell (represented by the Column object) lists the comparator that should be used within it based on the property value class, so we gotta go thru the whole list and determine the best comparator to use

Parameters:
resultsTable -
column -
Returns:

preProcessRangeFields

public static Map<String,String> preProcessRangeFields(Map<String,String> lookupFormFields)
Changes ranged search fields like from/to dates into the range operators the lookupable dao expects ("..",">" etc) this method modifies the passed in map and returns a list containing only the modified fields This method does not handle document searchable attributes. This is handled in a second pass by the docsearch-specific DocumentSearchCriteriaTranslator


generateCompositeSelectedObjectIds

public static Map<String,String> generateCompositeSelectedObjectIds(Set<String> previouslySelectedObjectIds,
                                                                    Set<String> displayedObjectIds,
                                                                    Set<String> selectedObjectIds)
Given 3 sets of object IDs: the set of selected object IDs before rendering the current page, the set of object IDs rendered on the page, and the set of object IDs selected on the page, computes the total set of selected object IDs. Instead of storing it in a set, returns it in a map with the selected object ID as both the key and value

Parameters:
previouslySelectedObjectIds -
displayedObjectIds -
selectedObjectIds -
Returns:

getDataDictionaryService

public static DataDictionaryService getDataDictionaryService()

getPersistenceStructureService

public static PersistenceStructureService getPersistenceStructureService()

getBusinessObjectDictionaryService

public static BusinessObjectDictionaryService getBusinessObjectDictionaryService()

getBusinessObjectMetaDataService

public static BusinessObjectMetaDataService getBusinessObjectMetaDataService()

getDateTimeService

public static DateTimeService getDateTimeService()


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