Class DocumentSearchInternalUtils

java.lang.Object
org.kuali.rice.kew.docsearch.DocumentSearchInternalUtils

public class DocumentSearchInternalUtils extends Object
Defines various utilities for internal use in the reference implementation of the document search functionality.
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Field Details

  • Constructor Details

    • DocumentSearchInternalUtils

      public DocumentSearchInternalUtils()
  • Method Details

    • isLookupCaseSensitive

      public static boolean isLookupCaseSensitive(org.kuali.rice.core.api.uif.RemotableAttributeField remotableAttributeField)
    • getAttributeTableName

      public static String getAttributeTableName(org.kuali.rice.core.api.uif.RemotableAttributeField attributeField)
    • getDataTypeClass

      public static Class<?> getDataTypeClass(org.kuali.rice.core.api.uif.RemotableAttributeField attributeField)
    • getSearchableAttributeValueObjectTypes

      public static List<SearchableAttributeValue> getSearchableAttributeValueObjectTypes()
    • getSearchableAttributeValueByDataTypeString

      public static SearchableAttributeValue getSearchableAttributeValueByDataTypeString(String dataType)
    • getDisplayValueWithDateOnly

      public static String getDisplayValueWithDateOnly(org.joda.time.DateTime value)
    • getDisplayValueWithDateOnly

      public static String getDisplayValueWithDateOnly(Timestamp value)
    • getLowerDateTimeBound

      public static org.joda.time.DateTime getLowerDateTimeBound(String dateRange) throws ParseException
      Throws:
      ParseException
    • getUpperDateTimeBound

      public static org.joda.time.DateTime getUpperDateTimeBound(String dateRange) throws ParseException
      Throws:
      ParseException
    • unmarshalDocumentSearchCriteria

      public static org.kuali.rice.kew.api.document.search.DocumentSearchCriteria unmarshalDocumentSearchCriteria(String string) throws IOException
      Unmarshals a DocumentSearchCriteria from JSON string
      Parameters:
      string - the JSON
      Returns:
      unmarshalled DocumentSearchCriteria
      Throws:
      IOException
    • marshalDocumentSearchCriteria

      public static String marshalDocumentSearchCriteria(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria) throws IOException
      Marshals a DocumentSearchCriteria to JSON string
      Parameters:
      criteria - the criteria
      Returns:
      a JSON string
      Throws:
      IOException
    • validateSearchFieldValues

      public static List<org.kuali.rice.core.api.uif.RemotableAttributeError> validateSearchFieldValues(String fieldName, SearchableAttributeValue attributeValue, List<String> searchValues, String errorMessagePrefix, List<String> resultingValues, com.google.common.base.Function<String,Collection<org.kuali.rice.core.api.uif.RemotableAttributeError>> customValidator)
    • validateSearchFieldValue

      public static List<org.kuali.rice.core.api.uif.RemotableAttributeError> validateSearchFieldValue(String fieldName, SearchableAttributeValue attributeValue, String enteredValue, String errorMessagePrefix, List<String> resultingValues, com.google.common.base.Function<String,Collection<org.kuali.rice.core.api.uif.RemotableAttributeError>> customValidator)
      Validates a single DocumentSearchCriteria searchable attribute field value (of the list of possibly multiple values)
      Parameters:
      fieldName - the name of the searchable attribute field/key
      attributeValue - the searchable attribute value type
      enteredValue - the incoming DSC field value
      errorMessagePrefix - error message prefix
      resultingValues - optional list of accumulated parsed values
      customValidator - custom value validator to invoke on default validation success
      Returns:
      (possibly empty) list of validation error
    • validateParsedSearchFieldValue

      public static Collection<org.kuali.rice.core.api.uif.RemotableAttributeError> validateParsedSearchFieldValue(String fieldName, SearchableAttributeValue attributeValue, String parsedValue, String errorMessagePrefix, List<String> resultingValues, com.google.common.base.Function<String,Collection<org.kuali.rice.core.api.uif.RemotableAttributeError>> customValidator)
      Validates a single terminal value from a single search field (list of values); calls a custom validator if default validation passes and custom validator is given
      Parameters:
      fieldName - the field name for error message
      attributeValue - the searchable value type
      parsedValue - the parsed value to validate
      errorMessagePrefix - the prefix for error message
      resultingValues - parsed value is appended to this list if present (non-null)
      Returns:
      immutable collection of errors (possibly empty)
    • convertValueToDataType

      public static org.kuali.rice.core.api.data.DataType convertValueToDataType(String dataTypeValue)
      Converts a searchable attribute field data type into a UI data type
      Parameters:
      dataTypeValue - the SearchableAttributeValue data type
      Returns:
      the corresponding DataType