|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.kns.lookup.LookupUtils
public class LookupUtils
This is a static utility class for Lookup related utilities and helper methods.
Field Summary | |
---|---|
private static String |
BASE_INQUIRY_ACTION_URL
|
private static String |
BASE_LOOKUP_ACTION_URL
|
private static String |
BASE_MULTIPLE_VALUE_LOOKUP_ACTION_URL
|
private static BusinessObjectDictionaryService |
businessObjectDictionaryService
|
private static BusinessObjectMetaDataService |
businessObjectMetaDataService
|
private static DataDictionaryService |
dataDictionaryService
|
private static DateTimeService |
dateTimeService
|
private static KualiConfigurationService |
kualiConfigurationService
|
private static org.apache.log4j.Logger |
LOG
|
private static PersistenceStructureService |
persistenceStructureService
|
private static Map<Class,Map<String,Map>> |
referencesForForeignKey
|
Constructor Summary | |
---|---|
LookupUtils()
|
Method Summary | |
---|---|
static void |
applySearchResultsLimit(Class businessObjectClass,
Criteria criteria)
This method 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 void |
applySearchResultsLimit(org.apache.ojb.broker.query.Criteria criteria,
DatabasePlatform platform)
Deprecated. use applySearchResultsLimit(Class, Criteria, DatabasePlatform) instead |
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> |
forceUppercase(Class boClass,
Map<String,String> fieldValues)
This method uses the DataDictionary to determine whether to force uppercase the values, and if it should, then it does the uppercase, and returns the upper-cased Map of fieldname/fieldValue pairs. |
static String |
forceUppercase(Class boClass,
String fieldName,
String fieldValue)
This method uses the DataDictionary to determine whether to force uppercase the value, and if it should, then it does the uppercase, and returns the upper-cased value. |
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. |
private static String |
generateFieldConversions(BusinessObject businessObject,
String collectionName,
BusinessObjectRelationship relationship,
String propertyPrefix,
List displayedFieldNames,
String nestedObjectPrefix)
|
private static String |
generateLookupParameters(BusinessObject businessObject,
String collectionName,
BusinessObjectRelationship relationship,
String propertyPrefix,
List displayedFieldNames,
String nestedObjectPrefix)
|
static Timestamp |
getActiveDateTimestampForCriteria(Map searchValues)
Determines what Timestamp should be used for active queries on effective dated records. |
static Integer |
getApplicationMaximumSearchResulsPerPageForMultipleValueLookups()
This method the maximum rows per page in a multiple value lookup |
private static Integer |
getApplicationSearchResultsLimit()
|
static String |
getBaseInquiryUrl()
|
static String |
getBaseLookupUrl(boolean isMultipleValue)
|
private static Integer |
getBusinessObjectSearchResultsLimit(Class businessObjectClass)
This method parses and returns the lookup result set limit for the passed in BO (if one exists) |
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 Map |
getPrimitiveReference(BusinessObject businessObject,
String attributeName)
|
static Integer |
getSearchResultsLimit(Class businessObjectClass)
This method 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 void |
removeHiddenCriteriaFields(Class businessObjectClass,
Map fieldValues)
Removes fields identified in the data dictionary as hidden from the lookup field values. |
void |
setBusinessObjectDictionaryService(BusinessObjectDictionaryService businessObjectDictionaryService)
|
void |
setBusinessObjectMetaDataService(BusinessObjectMetaDataService businessObjectMetaDataService)
Sets the businessObjectMetaDataService attribute value. |
void |
setDataDictionaryService(DataDictionaryService ddService)
|
void |
setDateTimeService(DateTimeService dateTimeService)
|
static Field |
setFieldDirectInquiry(BusinessObject businessObject,
String attributeName,
Field field)
|
private static void |
setFieldDirectInquiry(Field field)
Sets whether a field should have direct inquiries enabled. |
static Field |
setFieldQuickfinder(BusinessObject businessObject,
String collectionName,
boolean addLine,
int index,
String attributeName,
Field field,
List displayedFieldNames)
Sets a fields quickfinder class and field conversions for an attribute. |
static Field |
setFieldQuickfinder(BusinessObject businessObject,
String collectionName,
boolean addLine,
int index,
String attributeName,
Field field,
List displayedFieldNames,
boolean noLookupField)
|
static Field |
setFieldQuickfinder(BusinessObject businessObject,
String collectionName,
boolean addLine,
int index,
String attributeName,
Field field,
List displayedFieldNames,
SelectiveReferenceRefresher srr)
Sets a fields quickfinder class and field conversions for an attribute. |
static Field |
setFieldQuickfinder(BusinessObject businessObject,
String attributeName,
Field field,
List displayedFieldNames)
|
static Field |
setFieldQuickfinder(BusinessObject businessObject,
String attributeName,
Field field,
List displayedFieldNames,
SelectiveReferenceRefresher srr)
|
void |
setKualiConfigurationService(KualiConfigurationService kualiConfigurationService)
|
void |
setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
|
static String |
transformLookupUrlToMultiple(String lookupUrl)
|
static Map |
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. |
private static String |
translateToDisplayedField(Class businessObjectClass,
String fieldName,
List displayedFieldNames)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger LOG
private static DataDictionaryService dataDictionaryService
private static PersistenceStructureService persistenceStructureService
private static BusinessObjectDictionaryService businessObjectDictionaryService
private static BusinessObjectMetaDataService businessObjectMetaDataService
private static KualiConfigurationService kualiConfigurationService
private static DateTimeService dateTimeService
private static String BASE_LOOKUP_ACTION_URL
private static String BASE_MULTIPLE_VALUE_LOOKUP_ACTION_URL
private static String BASE_INQUIRY_ACTION_URL
private static Map<Class,Map<String,Map>> referencesForForeignKey
Constructor Detail |
---|
public LookupUtils()
Method Detail |
---|
public void setBusinessObjectDictionaryService(BusinessObjectDictionaryService businessObjectDictionaryService)
public void setDataDictionaryService(DataDictionaryService ddService)
public void setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
public void setKualiConfigurationService(KualiConfigurationService kualiConfigurationService)
public void setDateTimeService(DateTimeService dateTimeService)
public void setBusinessObjectMetaDataService(BusinessObjectMetaDataService businessObjectMetaDataService)
businessObjectMetaDataService
- The businessObjectMetaDataService to set.public static String forceUppercase(Class boClass, String fieldName, String fieldValue)
boClass
- Parent BO class that the fieldName is a member of.fieldName
- Name of the field to be forced to uppercase.fieldValue
- Value of the field that may be uppercased.
public static Map<String,String> forceUppercase(Class boClass, Map<String,String> fieldValues)
boClass
- Parent BO class that the fieldName is a member of.fieldValues
- A Mappublic static void applySearchResultsLimit(org.apache.ojb.broker.query.Criteria criteria, DatabasePlatform platform)
applySearchResultsLimit(Class, Criteria, DatabasePlatform)
instead
public static void applySearchResultsLimit(Class businessObjectClass, org.apache.ojb.broker.query.Criteria criteria, DatabasePlatform platform)
businessObjectClass
- BO class to search on / get limit forcriteria
- search criteriaplatform
- database platformpublic static void applySearchResultsLimit(Class businessObjectClass, Criteria criteria)
businessObjectClass
- BO class to search on / get limit forcriteria
- search criteriapublic static Integer getSearchResultsLimit(Class businessObjectClass)
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.
private static Integer getApplicationSearchResultsLimit()
private static Integer getBusinessObjectSearchResultsLimit(Class businessObjectClass)
businessObjectClass
-
public static Integer getApplicationMaximumSearchResulsPerPageForMultipleValueLookups()
org.kuali.KNSConstants.SystemGroupParameterNames#MULTIPLE_VALUE_LOOKUP_RESULTS_PER_PAGE
public static List<String> translateReadOnlyFieldsToList(String readOnlyFieldsString)
readOnlyFields
-
public static Map translateFieldConversions(String fieldConversionsString)
conversionFields
-
public static Field setFieldQuickfinder(BusinessObject businessObject, String attributeName, Field field, List displayedFieldNames)
public static Field setFieldQuickfinder(BusinessObject businessObject, String attributeName, Field field, List displayedFieldNames, SelectiveReferenceRefresher srr)
public static Field setFieldQuickfinder(BusinessObject businessObject, String collectionName, boolean addLine, int index, String attributeName, Field field, List displayedFieldNames, SelectiveReferenceRefresher srr)
public static Field setFieldQuickfinder(BusinessObject businessObject, String collectionName, boolean addLine, int index, String attributeName, Field field, List displayedFieldNames)
public static Field setFieldQuickfinder(BusinessObject businessObject, String collectionName, boolean addLine, int index, String attributeName, Field field, List displayedFieldNames, boolean noLookupField)
public static String getBaseLookupUrl(boolean isMultipleValue)
public static String getBaseInquiryUrl()
public static String transformLookupUrlToMultiple(String lookupUrl)
private static void setFieldDirectInquiry(Field field)
field
- public static Field setFieldDirectInquiry(BusinessObject businessObject, String attributeName, Field field)
field
-
public static Map getPrimitiveReference(BusinessObject businessObject, String attributeName)
public static BusinessObject getNestedBusinessObject(BusinessObject bo, String attributeName)
attributeName
-
public static Class getNestedReferenceClass(BusinessObject businessObject, String attributeName)
private static String generateFieldConversions(BusinessObject businessObject, String collectionName, BusinessObjectRelationship relationship, String propertyPrefix, List displayedFieldNames, String nestedObjectPrefix)
private static String generateLookupParameters(BusinessObject businessObject, String collectionName, BusinessObjectRelationship relationship, String propertyPrefix, List displayedFieldNames, String nestedObjectPrefix)
private static String translateToDisplayedField(Class businessObjectClass, String fieldName, List displayedFieldNames)
public static String convertReferencesToSelectCollectionToString(Collection<String> referencesToRefresh)
public static String convertSetOfObjectIdsToString(Set<String> objectIds)
public static Set<String> convertStringOfObjectIdsToSet(String objectIdsString)
public static Comparator findBestValueComparatorForColumn(List<ResultRow> resultTable, int column)
resultsTable
- column
-
public static Map<String,String> generateCompositeSelectedObjectIds(Set<String> previouslySelectedObjectIds, Set<String> displayedObjectIds, Set<String> selectedObjectIds)
previouslySelectedObjectIds
- displayedObjectIds
- selectedObjectIds
-
public static void removeHiddenCriteriaFields(Class businessObjectClass, Map fieldValues)
fieldValues
- public static Timestamp getActiveDateTimestampForCriteria(Map searchValues)
searchValues
- - Map containing search key/value pairs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |