|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.lookup.LookupUtils
public class LookupUtils
Provides static utility methods for use within the lookup framework.
Method Summary | |
---|---|
static Map<String,String> |
adjustCriteriaForNestedEBOs(Class<?> dataObjectClass,
Map<String,String> searchCriteria,
boolean unbounded)
Looks for criteria against nested EBOs and performs a search against that EBO and updates the criteria. |
static Map<String,String> |
forceUppercase(Class<?> dataObjectClass,
Map<String,String> fieldValues)
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<?> dataObjectClass,
String fieldName,
String fieldValue)
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 String |
generateMultiValueKey(Object lineDataObject,
List<String> fieldConversionKeys)
Generates a key string in case of multivalue return. |
static Timestamp |
getActiveDateTimestampForCriteria(Map searchValues)
Determines what Timestamp should be used for active queries on effective dated records. |
static Integer |
getApplicationMultipleValueSearchResultsLimit()
Retrieves the default application multiple value search limit configured through a system parameter. |
static Integer |
getApplicationSearchResultsLimit()
Retrieves the default application search limit configured through a system parameter. |
static String |
getBaseLookupUrl()
Retrieves the default KRAD base lookup URL, used to build lookup URLs in code |
static Class<? extends ExternalizableBusinessObject> |
getExternalizableBusinessObjectClass(Class<?> boClass,
String propertyName)
Given an property on the main BO class, return the defined type of the ExternalizableBusinessObject. |
static Map<String,String> |
getExternalizableBusinessObjectFieldValues(String eboPropertyName,
Map<String,String> fieldValues)
Return the EBO fieldValue entries explicitly for the given eboPropertyName. |
static List<String> |
getExternalizableBusinessObjectProperties(Class<?> boClass,
Map<String,String> fieldValues)
Get the complete list of all properties referenced in the fieldValues that are ExternalizableBusinessObjects. |
static Integer |
getSearchResultsLimit(Class dataObjectClass,
LookupForm lookupForm)
Parses and returns the lookup result set limit, checking first for the limit for the specific view, then the class being looked up, and then the global application limit if there isn't a limit specific to this data object class. |
static boolean |
hasExternalBusinessObjectProperty(Class<?> boClass,
Map<String,String> fieldValues)
Checks whether any of the fieldValues being passed refer to a property within an ExternalizableBusinessObject. |
static boolean |
isExternalBusinessObjectProperty(Object sampleBo,
String propertyName)
Check whether the given property represents a property within an EBO starting with the sampleBo object given. |
static Map<String,String> |
preprocessDateFields(Map<String,String> searchCriteria)
Changes from/to dates into the range operators the lookupable dao expects ("..",">" etc) this method modifies the passed in map and returns an updated search criteria map. |
static void |
refreshLookupResultSelections(LookupForm form)
Merges the lookup result selections that are part of the request with the selectedLookupResultsCache maintained in the session. |
static Map<String,String> |
removeExternalizableBusinessObjectFieldValues(Class<?> boClass,
Map<String,String> fieldValues)
Returns a map stripped of any properties which refer to ExternalizableBusinessObjects. |
static String |
retrieveLookupParameterValue(UifFormBase form,
javax.servlet.http.HttpServletRequest request,
Class<?> lookupObjectClass,
String propertyName,
String parameterName)
Retrieves the value for the given parameter name to send as a lookup parameter. |
static String |
scrubQueryCharacters(String criteriaValue)
Removes query characters (such as wildcards) from the given string value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String retrieveLookupParameterValue(UifFormBase form, javax.servlet.http.HttpServletRequest request, Class<?> lookupObjectClass, String propertyName, String parameterName)
form
- form instance to retrieve values fromrequest
- request object to retrieve parameters fromlookupObjectClass
- data object class associated with the lookup, used to check whether the
value needs to be encyrptedpropertyName
- name of the property associated with the parameter, used to check whether the
value needs to be encryptedparameterName
- name of the parameter to retrieve the value for
public static String getBaseLookupUrl()
public static String forceUppercase(Class<?> dataObjectClass, String fieldName, String fieldValue)
dataObjectClass
- parent DO class that the fieldName is a member offieldName
- name of the field to be forced to uppercasefieldValue
- value of the field that may be uppercased
public static Map<String,String> forceUppercase(Class<?> dataObjectClass, Map<String,String> fieldValues)
dataObjectClass
- parent DO class that the fieldName is a member offieldValues
- a Mappublic static Integer getSearchResultsLimit(Class dataObjectClass, LookupForm lookupForm)
dataObjectClass
- class to get limit forlookupForm
- lookupForm to use. May be null if the form is unknown. If lookupForm is null, only the
dataObjectClass will be used to find the search results set limit
public static Integer getApplicationSearchResultsLimit()
public static Integer getApplicationMultipleValueSearchResultsLimit()
public static Timestamp getActiveDateTimestampForCriteria(Map searchValues)
searchValues
- map containing search key/value pairs
public static Map<String,String> preprocessDateFields(Map<String,String> searchCriteria)
searchCriteria
- map of criteria currently set for which the date criteria will be adjusted
public static boolean hasExternalBusinessObjectProperty(Class<?> boClass, Map<String,String> fieldValues) throws IllegalAccessException, InstantiationException
boClass
- business object class of the lookupfieldValues
- map of the lookup criteria values
IllegalAccessException
InstantiationException
public static boolean isExternalBusinessObjectProperty(Object sampleBo, String propertyName)
sampleBo
- business object of the property to be testedpropertyName
- property name to be tested
public static Map<String,String> removeExternalizableBusinessObjectFieldValues(Class<?> boClass, Map<String,String> fieldValues) throws IllegalAccessException, InstantiationException
boClass
- business object class of the lookupfieldValues
- map of lookup criteria from which to remove the externalizable business objects
IllegalAccessException
InstantiationException
public static Map<String,String> getExternalizableBusinessObjectFieldValues(String eboPropertyName, Map<String,String> fieldValues)
eboPropertyName
- the externalizable business object property name to retrievefieldValues
- map of lookup criteria
return map of lookup criteria for the given eboPropertyNamepublic static List<String> getExternalizableBusinessObjectProperties(Class<?> boClass, Map<String,String> fieldValues) throws IllegalAccessException, InstantiationException
This is a list of the EBO object references themselves, not of the properties within them.
boClass
- business object class of the lookupfieldValues
- map of lookup criteria from which to return the externalizable business objects
IllegalAccessException
InstantiationException
public static Class<? extends ExternalizableBusinessObject> getExternalizableBusinessObjectClass(Class<?> boClass, String propertyName) throws IllegalAccessException, InstantiationException
boClass
- business object class of the lookuppropertyName
- property of which the externalizable business object type is to be determined
IllegalAccessException
InstantiationException
public static Map<String,String> adjustCriteriaForNestedEBOs(Class<?> dataObjectClass, Map<String,String> searchCriteria, boolean unbounded) throws InstantiationException, IllegalAccessException
searchCriteria
- map of criteria currently setunbounded
- indicates whether the complete result should be returned. When set to false the result is
limited (if necessary) to the max search result limit configured.
InstantiationException
IllegalAccessException
public static String scrubQueryCharacters(String criteriaValue)
criteriaValue
- string to clean
public static String generateMultiValueKey(Object lineDataObject, List<String> fieldConversionKeys)
lineDataObject
- Object from which to extract valuesfieldConversionKeys
- List of keys whose values have to be concatenated
public static void refreshLookupResultSelections(LookupForm form)
form
- lookup form instance containing the selected results and lookup configuration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |