org.kuali.rice.kew.docsearch
Class DocSearchUtils

java.lang.Object
  extended by org.kuali.rice.kew.docsearch.DocSearchUtils

public class DocSearchUtils
extends Object

Various static utility methods for helping with Searcha.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Nested Class Summary
static class DocSearchUtils.DateComponent
           
 
Field Summary
static List DOCUMENT_SEARCH_DATE_VALIDATION_REGEX_EXPRESSIONS
           
 
Constructor Summary
DocSearchUtils()
           
 
Method Summary
static void addSearchableAttributesToCriteria(DocSearchCriteriaDTO criteria, List propertyFields, boolean setAttributesStrictly)
          This method takes the given propertyFields parameter and populates the DocSearchCriteriaDTO object search attributes based on the document type name set on the criteria object.

This is identical to calling addSearchableAttributesToCriteria(DocSearchCriteriaDTO, List, String, boolean) with a null value for the searchAttributesString parameter.
static void addSearchableAttributesToCriteria(DocSearchCriteriaDTO criteria, List propertyFields, String searchAttributesString)
          This method takes the given propertyFields parameter and populates the DocSearchCriteriaDTO object search attributes based on the document type name set on the criteria object.

This is identical to calling addSearchableAttributesToCriteria(DocSearchCriteriaDTO, List, String, boolean) with a boolean value of false for the setAttributesStrictly parameter.
static void addSearchableAttributesToCriteria(DocSearchCriteriaDTO criteria, List propertyFields, String searchAttributesString, boolean setAttributesStrictly)
          This method takes the given propertyFields parameter and populates the DocSearchCriteriaDTO object search attributes based on the document type name set on the criteria object.
static List<SearchAttributeCriteriaComponent> buildSearchableAttributesFromString(String searchableAttributeString, String documentTypeName)
          Build List of searchable attributes from saved searchable attributes string
static Timestamp convertStringDateToTimestamp(String dateWithoutTime)
           
static String getDisplayValueWithDateOnly(Timestamp value)
           
static String getDisplayValueWithDateTime(Timestamp value)
           
static DocumentSearchContext getDocumentSearchContext(String documentId, String documentTypeName, String documentContent)
           
static String getEntryFormattedDate(String date)
          A method to format any variety of date strings into a common format
static SearchAttributeFormContainer getPropertyField(String key, List propertyFields)
           
static SearchableAttributeValue getSearchableAttributeValueByDataTypeString(String dataType)
           
static List<SearchableAttributeValue> getSearchableAttributeValueObjectTypes()
           
static String getSqlFormattedDate(String date)
          A method to format any variety of date strings into a common format
static void setupPropertyField(SearchAttributeCriteriaComponent searchableAttribute, List propertyFields)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENT_SEARCH_DATE_VALIDATION_REGEX_EXPRESSIONS

public static final List DOCUMENT_SEARCH_DATE_VALIDATION_REGEX_EXPRESSIONS
Constructor Detail

DocSearchUtils

public DocSearchUtils()
Method Detail

getSearchableAttributeValueObjectTypes

public static List<SearchableAttributeValue> getSearchableAttributeValueObjectTypes()

getSearchableAttributeValueByDataTypeString

public static SearchableAttributeValue getSearchableAttributeValueByDataTypeString(String dataType)

getSqlFormattedDate

public static String getSqlFormattedDate(String date)
A method to format any variety of date strings into a common format

Parameters:
date - A string date in one of a few different formats
Returns:
A string representing a date in the format yyyy/MM/dd or null if date is invalid

getEntryFormattedDate

public static String getEntryFormattedDate(String date)
A method to format any variety of date strings into a common format

Parameters:
date - A string date in one of a few different formats
Returns:
A string representing a date in the format MM/dd/yyyy or null if date is invalid

getDisplayValueWithDateOnly

public static String getDisplayValueWithDateOnly(Timestamp value)

getDisplayValueWithDateTime

public static String getDisplayValueWithDateTime(Timestamp value)

convertStringDateToTimestamp

public static Timestamp convertStringDateToTimestamp(String dateWithoutTime)

buildSearchableAttributesFromString

public static List<SearchAttributeCriteriaComponent> buildSearchableAttributesFromString(String searchableAttributeString,
                                                                                         String documentTypeName)
Build List of searchable attributes from saved searchable attributes string

Parameters:
searchableAttributeString - String representation of searchable attributes
documentTypeName - document type name
Returns:
searchable attributes list

addSearchableAttributesToCriteria

public static void addSearchableAttributesToCriteria(DocSearchCriteriaDTO criteria,
                                                     List propertyFields,
                                                     String searchAttributesString)
This method takes the given propertyFields parameter and populates the DocSearchCriteriaDTO object search attributes based on the document type name set on the criteria object.

This is identical to calling addSearchableAttributesToCriteria(DocSearchCriteriaDTO, List, String, boolean) with a boolean value of false for the setAttributesStrictly parameter.

Parameters:
criteria - - The object that needs a list of SearchAttributeCriteriaComponent objects set up based on the document type name and propertyFields parameter
propertyFields - - The list of SearchAttributeFormContainer objects that need to be converted to SearchAttributeCriteriaComponent objects and set on the criteria parameter
searchAttributesString - - A potential string that must be parsed to use to set attributes on the criteria object

addSearchableAttributesToCriteria

public static void addSearchableAttributesToCriteria(DocSearchCriteriaDTO criteria,
                                                     List propertyFields,
                                                     boolean setAttributesStrictly)
This method takes the given propertyFields parameter and populates the DocSearchCriteriaDTO object search attributes based on the document type name set on the criteria object.

This is identical to calling addSearchableAttributesToCriteria(DocSearchCriteriaDTO, List, String, boolean) with a null value for the searchAttributesString parameter.

Parameters:
criteria - - The object that needs a list of SearchAttributeCriteriaComponent objects set up based on the document type name and propertyFields parameter
propertyFields - - The list of SearchAttributeFormContainer objects that need to be converted to SearchAttributeCriteriaComponent objects and set on the criteria parameter
setAttributesStrictly - - A boolean to specify whether to explicitly throw an error when a given value from propertyFields does not match a search attribute on the specified document type. If set to true an error with be thrown. If set to false the mismatch will be ignored.

addSearchableAttributesToCriteria

public static void addSearchableAttributesToCriteria(DocSearchCriteriaDTO criteria,
                                                     List propertyFields,
                                                     String searchAttributesString,
                                                     boolean setAttributesStrictly)
This method takes the given propertyFields parameter and populates the DocSearchCriteriaDTO object search attributes based on the document type name set on the criteria object.

Parameters:
criteria - - The object that needs a list of SearchAttributeCriteriaComponent objects set up based on the document type name and propertyFields parameter
propertyFields - - The list of SearchAttributeFormContainer objects that need to be converted to SearchAttributeCriteriaComponent objects and set on the criteria parameter
searchAttributesString - - A potential string that must be parsed to use to set attributes on the criteria object
setAttributesStrictly - - A boolean to specify whether to explicitly throw an error when a given value from propertyFields does not match a search attribute on the specified document type. If set to true an error with be thrown. If set to false the mismatch will be ignored.

setupPropertyField

public static void setupPropertyField(SearchAttributeCriteriaComponent searchableAttribute,
                                      List propertyFields)

getPropertyField

public static SearchAttributeFormContainer getPropertyField(String key,
                                                            List propertyFields)

getDocumentSearchContext

public static DocumentSearchContext getDocumentSearchContext(String documentId,
                                                             String documentTypeName,
                                                             String documentContent)


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.