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 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: DocumentSearchCriteriaTranslator
      Translates the given map of fields values into a DocumentSearchCriteria. 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:
      translateFieldsToCriteria in interface DocumentSearchCriteriaTranslator
      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:
      translateCriteriaToFields in interface DocumentSearchCriteriaTranslator
      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 key
      attrValues - 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 dsc
      property - the abstract property name
      values - 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 DocumentSearchCriteria
      property - the DocumentSearchCriteria property name and destination field name
      values - 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 DocumentSearchCriteria
      property - the DocumentSearchCriteria property name
      fieldName - the destination field name
      values - 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

      protected String translateRangePropertyToExpression(Map<String,String> fieldValues, String property, String prefix, org.kuali.rice.core.api.uif.AttributeLookupSettings settings)
    • translateDocumentAttributeFieldsToCriteria

      protected void translateDocumentAttributeFieldsToCriteria(Map<String,String> fieldValues, List<String> fields, org.kuali.rice.kew.api.document.search.DocumentSearchCriteria.Builder criteria)
    • applyDocumentAttribute

      protected void applyDocumentAttribute(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria.Builder criteria, String documentAttributeName, String attributeValue)