Class DocumentSearchCriteriaTranslatorImpl
java.lang.Object
org.kuali.rice.kew.impl.document.search.DocumentSearchCriteriaTranslatorImpl
- All Implemented Interfaces:
DocumentSearchCriteriaTranslator
public class DocumentSearchCriteriaTranslatorImpl
extends Object
implements DocumentSearchCriteriaTranslator
Reference implementation of
DocumentSearchCriteriaTranslator.- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyDateRangeField(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria.Builder criteria, String fieldName, String fieldValue) protected voidapplyDocumentAttribute(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria.Builder criteria, String documentAttributeName, String attributeValue) protected static voidConvert a ranged document search attribute field into a form field.protected static voidconvertCriteriaPropertyToField(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, String property, String fieldName, Map<String, String[]> values) Looks up a property on the criteria object and sets it as a key/value pair in the values Mapprotected static voidconvertCriteriaPropertyToField(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, String property, Map<String, String[]> values) Looks up a property on the criteria object and sets it as a key/value pair in the values Mapprotected static voidconvertCriteriaRangeField(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, String property, Map<String, String[]> values) Convenience method for converting a set of doc search criteria range fields into form fieldsgetAttributeLookupSettings(org.kuali.rice.kew.api.document.search.DocumentSearchCriteriaContract criteria) Returns a map of attributelookupsettings for the custom search attributes of the document if specified in the criteriatranslateCriteriaToFields(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria) Converts the DocumentSearchCriteria to a Map of values that can be applied to the Lookup form fields.protected voidtranslateDocumentAttributeFieldsToCriteria(Map<String, String> fieldValues, List<String> fields, org.kuali.rice.kew.api.document.search.DocumentSearchCriteria.Builder criteria) org.kuali.rice.kew.api.document.search.DocumentSearchCriteriatranslateFieldsToCriteria(Map<String, String> fieldValues) Translates the given map of fields values into aDocumentSearchCriteria.protected StringtranslateRangePropertyToExpression(Map<String, String> fieldValues, String property, String prefix, org.kuali.rice.core.api.uif.AttributeLookupSettings settings)
-
Constructor Details
-
DocumentSearchCriteriaTranslatorImpl
public DocumentSearchCriteriaTranslatorImpl()
-
-
Method Details
-
translateFieldsToCriteria
public org.kuali.rice.kew.api.document.search.DocumentSearchCriteria translateFieldsToCriteria(Map<String, String> fieldValues) Description copied from interface:DocumentSearchCriteriaTranslatorTranslates the given map of fields values into aDocumentSearchCriteria. The given map of field values is keyed based on the name of the field being submitted and the value represents that field value, which may contain wildcards and other logical operators supported by the KNS lookup framework.- Specified by:
translateFieldsToCriteriain interfaceDocumentSearchCriteriaTranslator- Parameters:
fieldValues- the map of field names and values from which to populate the criteria- Returns:
- populated document search criteria which contains the various criteria components populated based on the interpretation of the given field values
-
translateCriteriaToFields
public Map<String,String[]> translateCriteriaToFields(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria) Converts the DocumentSearchCriteria to a Map of values that can be applied to the Lookup form fields.- Specified by:
translateCriteriaToFieldsin interfaceDocumentSearchCriteriaTranslator- Parameters:
criteria- the criteria to translate- Returns:
- a Map of values that can be applied to the Lookup form fields.
-
convertAttributeRangeField
protected static void convertAttributeRangeField(String attrKey, List<String> attrValues, Map<String, String[]> values) Convert a ranged document search attribute field into a form field. This means: 0) the attribute field has been identified as a ranged attribute 1) we need to parse the attribute search expression to find upper and lower bounds 2) set upper and lower bounds in distinct form fields- Parameters:
attrKey- the attribute keyattrValues- the attribute value
-
convertCriteriaRangeField
protected static void convertCriteriaRangeField(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, String property, Map<String, String[]> values) Convenience method for converting a set of doc search criteria range fields into form fields- Parameters:
criteria- the dscproperty- the abstract property namevalues- the form field values
-
convertCriteriaPropertyToField
protected static void convertCriteriaPropertyToField(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, String property, Map<String, String[]> values) Looks up a property on the criteria object and sets it as a key/value pair in the values Map- Parameters:
criteria- the DocumentSearchCriteriaproperty- the DocumentSearchCriteria property name and destination field namevalues- the map of values to update
-
convertCriteriaPropertyToField
protected static void convertCriteriaPropertyToField(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, String property, String fieldName, Map<String, String[]> values) Looks up a property on the criteria object and sets it as a key/value pair in the values Map- Parameters:
criteria- the DocumentSearchCriteriaproperty- the DocumentSearchCriteria property namefieldName- the destination field namevalues- the map of values to update
-
applyDateRangeField
protected void applyDateRangeField(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria.Builder criteria, String fieldName, String fieldValue) throws Exception - Throws:
Exception
-
getAttributeLookupSettings
protected Map<String,org.kuali.rice.core.api.uif.AttributeLookupSettings> getAttributeLookupSettings(org.kuali.rice.kew.api.document.search.DocumentSearchCriteriaContract criteria) Returns a map of attributelookupsettings for the custom search attributes of the document if specified in the criteria- Parameters:
criteria- the doc search criteria- Returns:
- a map of attributelookupsettings for the custom search attributes of the document if specified in the criteria, empty otherwise
-
translateRangePropertyToExpression
-
translateDocumentAttributeFieldsToCriteria
-
applyDocumentAttribute
-