1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.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.SearchableAttribute; |
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.util.MessageMap; |
37 | |
import org.kuali.rice.kns.web.ui.Row; |
38 | |
|
39 | 0 | public class DataDictionaryDocumentSearchCustomizer implements SearchableAttribute, DocumentSearchGenerator, DocumentSearchResultProcessor { |
40 | |
|
41 | 0 | protected StandardDocumentSearchGenerator documentSearchGenerator = null; |
42 | |
|
43 | 0 | protected SearchableAttribute searchableAttribute = null; |
44 | |
|
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 | |
|
108 | |
|
109 | |
|
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 | |
|
121 | |
|
122 | |
|
123 | |
|
124 | |
public void setProcessFinalResults(boolean isProcessFinalResults) { |
125 | 0 | this.getSearchResultProcessor().setProcessFinalResults(isProcessFinalResults); |
126 | |
|
127 | 0 | } |
128 | |
|
129 | |
|
130 | |
|
131 | |
|
132 | |
|
133 | |
|
134 | |
public boolean isProcessFinalResults() { |
135 | 0 | return this.getSearchResultProcessor().isProcessFinalResults(); |
136 | |
} |
137 | |
|
138 | |
|
139 | |
|
140 | |
|
141 | |
public void setDocumentSearchGenerator( |
142 | |
StandardDocumentSearchGenerator documentSearchGenerator) { |
143 | 0 | this.documentSearchGenerator = documentSearchGenerator; |
144 | 0 | } |
145 | |
|
146 | |
|
147 | |
|
148 | |
|
149 | |
public void setSearchResultProcessor( |
150 | |
DocumentSearchResultProcessor searchResultProcessor) { |
151 | 0 | this.searchResultProcessor = searchResultProcessor; |
152 | 0 | } |
153 | |
|
154 | |
|
155 | |
|
156 | |
|
157 | |
|
158 | |
|
159 | |
|
160 | |
|
161 | |
public void setSearchableAttributes(List<SearchableAttribute> searchableAttributes) { |
162 | 0 | getDocumentSearchGenerator().setSearchableAttributes(searchableAttributes); |
163 | 0 | } |
164 | |
|
165 | |
|
166 | |
|
167 | |
|
168 | |
public void setSearchableAttribute(SearchableAttribute searchableAttribute) { |
169 | 0 | this.searchableAttribute = searchableAttribute; |
170 | 0 | } |
171 | |
|
172 | |
|
173 | |
|
174 | |
|
175 | |
public SearchableAttribute getSearchableAttribute() { |
176 | 0 | if(this.searchableAttribute == null){ |
177 | 0 | this.searchableAttribute = new DataDictionarySearchableAttribute(); |
178 | |
} |
179 | 0 | return this.searchableAttribute; |
180 | |
} |
181 | |
|
182 | |
|
183 | |
|
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 | |
|
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 | |
} |