org.kuali.student.common.search.service.impl
Class CrossSearchManager

java.lang.Object
  extended by org.kuali.student.common.search.service.impl.CrossSearchManager

public class CrossSearchManager
extends Object

Author:
Daniel Epstein

Nested Class Summary
private static class CrossSearchManager.DataType
           
 
Field Summary
private  SearchDispatcher searchDispatcher
           
 
Constructor Summary
CrossSearchManager()
           
 
Method Summary
private  boolean compare(CrossSearchManager.DataType dataType, String left, String right, JoinComparisonInfo.ComparisonType type)
           
private  boolean compareBoolean(Boolean left, Boolean right, JoinComparisonInfo.ComparisonType type)
           
private  boolean compareDate(Date left, Date right, JoinComparisonInfo.ComparisonType type)
           
private  boolean compareInt(Integer left, Integer right, JoinComparisonInfo.ComparisonType type)
           
private  boolean compareString(String left, String right, JoinComparisonInfo.ComparisonType type)
           
 SearchResult doCrossSearch(SearchRequest searchRequest, CrossSearchTypeInfo crossSearchType)
           
 SearchDispatcher getSearchDispatcher()
           
private  SearchResultRow mapResultRow(Map<String,SearchResultRow> permutation, CrossSearchTypeInfo crossSearchType)
          Maps results from multiple searches into a single result row
private  SearchResultRow mapResultRow(String subSearchKey, SearchResultRow row, CrossSearchTypeInfo crossSearchType)
           
private  boolean meetsCriteria(Map<String,SearchResultRow> permutation, CrossSearchTypeInfo crossSearchType, JoinCriteriaInfo joinCriteria)
          Checks each comparison of the join criteria and recursively checks through nested criteria.
private  SearchResult metaFilter(SearchResult searchResult, SearchRequest searchRequest)
           
 void setSearchDispatcher(SearchDispatcher searchDispatcher)
           
private  List<Map<String,SearchResultRow>> unionOfAllRows(Map<String,SearchResult> searchResults)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

searchDispatcher

private SearchDispatcher searchDispatcher
Constructor Detail

CrossSearchManager

public CrossSearchManager()
Method Detail

doCrossSearch

public SearchResult doCrossSearch(SearchRequest searchRequest,
                                  CrossSearchTypeInfo crossSearchType)

metaFilter

private SearchResult metaFilter(SearchResult searchResult,
                                SearchRequest searchRequest)
Parameters:
searchResult -
searchRequest -
Returns:
a sorted and paginated result

mapResultRow

private SearchResultRow mapResultRow(Map<String,SearchResultRow> permutation,
                                     CrossSearchTypeInfo crossSearchType)
Maps results from multiple searches into a single result row

Parameters:
permutation -
crossSearchType -
Returns:
a mapped SearchResultRow

mapResultRow

private SearchResultRow mapResultRow(String subSearchKey,
                                     SearchResultRow row,
                                     CrossSearchTypeInfo crossSearchType)

meetsCriteria

private boolean meetsCriteria(Map<String,SearchResultRow> permutation,
                              CrossSearchTypeInfo crossSearchType,
                              JoinCriteriaInfo joinCriteria)
Checks each comparison of the join criteria and recursively checks through nested criteria. Short circuits for false 'AND' joins and true 'OR' joins

Parameters:
permutation -
crossSearchType -
joinCriteria -
Returns:
whether the criteria is met

unionOfAllRows

private List<Map<String,SearchResultRow>> unionOfAllRows(Map<String,SearchResult> searchResults)
Parameters:
searchResults -
Returns:
a list of all possible combinations of rows

compare

private boolean compare(CrossSearchManager.DataType dataType,
                        String left,
                        String right,
                        JoinComparisonInfo.ComparisonType type)

compareString

private boolean compareString(String left,
                              String right,
                              JoinComparisonInfo.ComparisonType type)

compareInt

private boolean compareInt(Integer left,
                           Integer right,
                           JoinComparisonInfo.ComparisonType type)

compareDate

private boolean compareDate(Date left,
                            Date right,
                            JoinComparisonInfo.ComparisonType type)

compareBoolean

private boolean compareBoolean(Boolean left,
                               Boolean right,
                               JoinComparisonInfo.ComparisonType type)

setSearchDispatcher

public void setSearchDispatcher(SearchDispatcher searchDispatcher)

getSearchDispatcher

public SearchDispatcher getSearchDispatcher()


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