Coverage Report - org.kuali.rice.krad.workflow.attribute.DataDictionaryDocumentSearchCustomizer
 
Classes in this File Line Coverage Branch Coverage Complexity
DataDictionaryDocumentSearchCustomizer
0%
0/42
0%
0/6
1.12
 
 1  
 /*
 2  
  * Copyright 2009 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.krad.workflow.attribute;
 17  
 
 18  
 import java.sql.ResultSet;
 19  
 import java.sql.SQLException;
 20  
 import java.sql.Statement;
 21  
 import java.util.List;
 22  
 import java.util.Map;
 23  
 
 24  
 import org.kuali.rice.kew.docsearch.DocSearchCriteriaDTO;
 25  
 import org.kuali.rice.kew.docsearch.DocSearchDTO;
 26  
 import org.kuali.rice.kew.docsearch.DocumentSearchContext;
 27  
 import org.kuali.rice.kew.docsearch.DocumentSearchGenerator;
 28  
 import org.kuali.rice.kew.docsearch.DocumentSearchResultComponents;
 29  
 import org.kuali.rice.kew.docsearch.DocumentSearchResultProcessor;
 30  
 import org.kuali.rice.kew.docsearch.SearchableAttributeOld;
 31  
 import org.kuali.rice.kew.docsearch.SearchableAttributeValue;
 32  
 import org.kuali.rice.kew.docsearch.StandardDocumentSearchGenerator;
 33  
 import org.kuali.rice.kew.docsearch.StandardDocumentSearchResultProcessor;
 34  
 import org.kuali.rice.kew.exception.WorkflowServiceError;
 35  
 import org.kuali.rice.kew.rule.WorkflowAttributeValidationError;
 36  
 import org.kuali.rice.kns.web.ui.Row;
 37  
 import org.kuali.rice.krad.util.MessageMap;
 38  
 
 39  0
 public class DataDictionaryDocumentSearchCustomizer implements SearchableAttributeOld, DocumentSearchGenerator, DocumentSearchResultProcessor {
 40  
     // SEARCH GENERATOR IMPLEMENTATION
 41  0
     protected StandardDocumentSearchGenerator documentSearchGenerator = null;
 42  
     // SEARCHABLE ATTRIBUTE IMPLEMENTATION
 43  0
     protected SearchableAttributeOld searchableAttribute = null;
 44  
     // SEARCH RESULT PROCESSOR IMPLEMENTATION
 45  0
     protected DocumentSearchResultProcessor searchResultProcessor = null;
 46  
     
 47  
     public DocSearchCriteriaDTO clearSearch(DocSearchCriteriaDTO searchCriteria) {
 48  0
         return getDocumentSearchGenerator().clearSearch(searchCriteria);
 49  
     }
 50  
 
 51  
     public String generateSearchSql(DocSearchCriteriaDTO searchCriteria) {
 52  0
         return getDocumentSearchGenerator().generateSearchSql(searchCriteria);
 53  
     }
 54  
 
 55  
     public int getDocumentSearchResultSetLimit() {
 56  0
         return getDocumentSearchGenerator().getDocumentSearchResultSetLimit();
 57  
     }
 58  
 
 59  
     public List<WorkflowServiceError> performPreSearchConditions(String principalId, DocSearchCriteriaDTO searchCriteria) {
 60  0
         return getDocumentSearchGenerator().performPreSearchConditions(principalId, searchCriteria);
 61  
     }
 62  
 
 63  
     public List<DocSearchDTO> processResultSet(Statement searchAttributeStatement, ResultSet resultSet, DocSearchCriteriaDTO searchCriteria, String principalId) throws SQLException {
 64  0
         return getDocumentSearchGenerator().processResultSet(searchAttributeStatement, resultSet, searchCriteria, principalId);
 65  
     }
 66  
 
 67  
     @Deprecated
 68  
     public List<DocSearchDTO> processResultSet(Statement searchAttributeStatement, ResultSet resultSet, DocSearchCriteriaDTO searchCriteria) throws SQLException {
 69  0
         return getDocumentSearchGenerator().processResultSet(searchAttributeStatement, resultSet, searchCriteria);
 70  
     }    
 71  
 
 72  
     public void setSearchingUser(String principalId) {
 73  0
             getDocumentSearchGenerator().setSearchingUser(principalId);
 74  0
     }
 75  
 
 76  
     public List<WorkflowServiceError> validateSearchableAttributes(DocSearchCriteriaDTO searchCriteria) {
 77  0
         return getDocumentSearchGenerator().validateSearchableAttributes(searchCriteria);
 78  
     }
 79  
 
 80  
     public boolean isProcessResultSet() {
 81  0
         return getDocumentSearchGenerator().isProcessResultSet();
 82  
     }
 83  
     public void setProcessResultSet(boolean isProcessResultSet){
 84  0
             getDocumentSearchGenerator().setProcessResultSet(isProcessResultSet);
 85  0
     }
 86  
     public MessageMap getMessageMap(DocSearchCriteriaDTO searchCriteria) {
 87  0
         return getDocumentSearchGenerator().getMessageMap(searchCriteria);
 88  
     }    
 89  
 
 90  
     public String getSearchContent(DocumentSearchContext documentSearchContext) {
 91  0
         return getSearchableAttribute().getSearchContent(documentSearchContext);
 92  
     }
 93  
 
 94  
     public List<Row> getSearchingRows(DocumentSearchContext documentSearchContext) {
 95  0
         return getSearchableAttribute().getSearchingRows(documentSearchContext);
 96  
     }
 97  
 
 98  
     public List<SearchableAttributeValue> getSearchStorageValues(DocumentSearchContext documentSearchContext) {
 99  0
         return getSearchableAttribute().getSearchStorageValues(documentSearchContext);
 100  
     }
 101  
 
 102  
     public List<WorkflowAttributeValidationError> validateUserSearchInputs(Map<Object, Object> paramMap, DocumentSearchContext searchContext) {
 103  0
         return getSearchableAttribute().validateUserSearchInputs(paramMap, searchContext);
 104  
     }
 105  
 
 106  
         /**
 107  
          * This overridden method calls the currently set searchResultProcessor's processIntoFinalResults
 108  
          * 
 109  
          * @see org.kuali.rice.kew.docsearch.DocumentSearchResultProcessor#processIntoFinalResults(java.util.List, org.kuali.rice.kew.docsearch.DocSearchCriteriaDTO, java.lang.String)
 110  
          */
 111  
         public DocumentSearchResultComponents processIntoFinalResults(
 112  
                         List<DocSearchDTO> docSearchResultRows,
 113  
                         DocSearchCriteriaDTO criteria, String principalId)
 114  
                         throws SQLException {
 115  
                 
 116  0
                 return this.getSearchResultProcessor().processIntoFinalResults(docSearchResultRows, criteria, principalId);
 117  
         }
 118  
 
 119  
         /**
 120  
          * This overridden method returns the searchResultProcessor
 121  
          * 
 122  
          * @see org.kuali.rice.kew.docsearch.DocumentSearchResultProcessor#setProcessFinalResults(boolean)
 123  
          */
 124  
         public void setProcessFinalResults(boolean isProcessFinalResults) {
 125  0
                 this.getSearchResultProcessor().setProcessFinalResults(isProcessFinalResults);
 126  
                 
 127  0
         }
 128  
 
 129  
         /**
 130  
          * This overridden method returns if the searchResultProcessor has processed final results
 131  
          * 
 132  
          * @see org.kuali.rice.kew.docsearch.DocumentSearchResultProcessor#isProcessFinalResults()
 133  
          */
 134  
         public boolean isProcessFinalResults() {
 135  0
                 return this.getSearchResultProcessor().isProcessFinalResults();
 136  
         }
 137  
         
 138  
         /**
 139  
          * @param documentSearchGenerator the documentSearchGenerator to set
 140  
          */
 141  
         public void setDocumentSearchGenerator(
 142  
                         StandardDocumentSearchGenerator documentSearchGenerator) {
 143  0
                 this.documentSearchGenerator = documentSearchGenerator;
 144  0
         }
 145  
         
 146  
         /**
 147  
          * @param searchResultProcessor the searchResultProcessor to set
 148  
          */
 149  
         public void setSearchResultProcessor(
 150  
                         DocumentSearchResultProcessor searchResultProcessor) {
 151  0
                 this.searchResultProcessor = searchResultProcessor;
 152  0
         }
 153  
 
 154  
         /**
 155  
          * 
 156  
          * This method sets a list of searchable attributes on the DocumentSearchGenerator.
 157  
          * Do not confuse this with "setSearchableAttribute"
 158  
          * 
 159  
          * @param searchableAttributes
 160  
          */
 161  
         public void setSearchableAttributes(List<SearchableAttributeOld> searchableAttributes) {
 162  0
                 getDocumentSearchGenerator().setSearchableAttributes(searchableAttributes);
 163  0
     }
 164  
         
 165  
         /**
 166  
          * @param searchableAttribute the searchableAttribute to set
 167  
          */
 168  
         public void setSearchableAttribute(SearchableAttributeOld searchableAttribute) {
 169  0
                 this.searchableAttribute = searchableAttribute;
 170  0
         }
 171  
         
 172  
         /**
 173  
          * @return the searchableAttribute
 174  
          */
 175  
         public SearchableAttributeOld getSearchableAttribute() {
 176  0
                 if(this.searchableAttribute == null){
 177  0
                         this.searchableAttribute = new DataDictionarySearchableAttribute();
 178  
                 }
 179  0
                 return this.searchableAttribute;
 180  
         }
 181  
 
 182  
         /**
 183  
          * @return the documentSearchGenerator
 184  
          */
 185  
         public StandardDocumentSearchGenerator getDocumentSearchGenerator() {
 186  0
                 if(this.documentSearchGenerator == null){
 187  0
                         this.documentSearchGenerator = new StandardDocumentSearchGenerator();
 188  
                 }
 189  0
                 return this.documentSearchGenerator;
 190  
         }
 191  
 
 192  
         /**
 193  
          * @return the searchResultProcessor
 194  
          */
 195  
         public DocumentSearchResultProcessor getSearchResultProcessor() {
 196  0
                 if(this.searchResultProcessor == null){
 197  0
                         this.searchResultProcessor = new StandardDocumentSearchResultProcessor();
 198  
                 }
 199  0
                 return this.searchResultProcessor;
 200  
         }
 201  
 
 202  
         
 203  
         
 204  
 
 205  
 }