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 public class DataDictionaryDocumentSearchCustomizer implements SearchableAttribute, DocumentSearchGenerator, DocumentSearchResultProcessor {
40
41 protected StandardDocumentSearchGenerator documentSearchGenerator = null;
42
43 protected SearchableAttribute searchableAttribute = null;
44
45 protected DocumentSearchResultProcessor searchResultProcessor = null;
46
47 public DocSearchCriteriaDTO clearSearch(DocSearchCriteriaDTO searchCriteria) {
48 return getDocumentSearchGenerator().clearSearch(searchCriteria);
49 }
50
51 public String generateSearchSql(DocSearchCriteriaDTO searchCriteria) {
52 return getDocumentSearchGenerator().generateSearchSql(searchCriteria);
53 }
54
55 public int getDocumentSearchResultSetLimit() {
56 return getDocumentSearchGenerator().getDocumentSearchResultSetLimit();
57 }
58
59 public List<WorkflowServiceError> performPreSearchConditions(String principalId, DocSearchCriteriaDTO searchCriteria) {
60 return getDocumentSearchGenerator().performPreSearchConditions(principalId, searchCriteria);
61 }
62
63 public List<DocSearchDTO> processResultSet(Statement searchAttributeStatement, ResultSet resultSet, DocSearchCriteriaDTO searchCriteria, String principalId) throws SQLException {
64 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 return getDocumentSearchGenerator().processResultSet(searchAttributeStatement, resultSet, searchCriteria);
70 }
71
72 public void setSearchingUser(String principalId) {
73 getDocumentSearchGenerator().setSearchingUser(principalId);
74 }
75
76 public List<WorkflowServiceError> validateSearchableAttributes(DocSearchCriteriaDTO searchCriteria) {
77 return getDocumentSearchGenerator().validateSearchableAttributes(searchCriteria);
78 }
79
80 public boolean isProcessResultSet() {
81 return getDocumentSearchGenerator().isProcessResultSet();
82 }
83 public void setProcessResultSet(boolean isProcessResultSet){
84 getDocumentSearchGenerator().setProcessResultSet(isProcessResultSet);
85 }
86 public MessageMap getMessageMap(DocSearchCriteriaDTO searchCriteria) {
87 return getDocumentSearchGenerator().getMessageMap(searchCriteria);
88 }
89
90 public String getSearchContent(DocumentSearchContext documentSearchContext) {
91 return getSearchableAttribute().getSearchContent(documentSearchContext);
92 }
93
94 public List<Row> getSearchingRows(DocumentSearchContext documentSearchContext) {
95 return getSearchableAttribute().getSearchingRows(documentSearchContext);
96 }
97
98 public List<SearchableAttributeValue> getSearchStorageValues(DocumentSearchContext documentSearchContext) {
99 return getSearchableAttribute().getSearchStorageValues(documentSearchContext);
100 }
101
102 public List<WorkflowAttributeValidationError> validateUserSearchInputs(Map<Object, Object> paramMap, DocumentSearchContext searchContext) {
103 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 return this.getSearchResultProcessor().processIntoFinalResults(docSearchResultRows, criteria, principalId);
117 }
118
119
120
121
122
123
124 public void setProcessFinalResults(boolean isProcessFinalResults) {
125 this.getSearchResultProcessor().setProcessFinalResults(isProcessFinalResults);
126
127 }
128
129
130
131
132
133
134 public boolean isProcessFinalResults() {
135 return this.getSearchResultProcessor().isProcessFinalResults();
136 }
137
138
139
140
141 public void setDocumentSearchGenerator(
142 StandardDocumentSearchGenerator documentSearchGenerator) {
143 this.documentSearchGenerator = documentSearchGenerator;
144 }
145
146
147
148
149 public void setSearchResultProcessor(
150 DocumentSearchResultProcessor searchResultProcessor) {
151 this.searchResultProcessor = searchResultProcessor;
152 }
153
154
155
156
157
158
159
160
161 public void setSearchableAttributes(List<SearchableAttribute> searchableAttributes) {
162 getDocumentSearchGenerator().setSearchableAttributes(searchableAttributes);
163 }
164
165
166
167
168 public void setSearchableAttribute(SearchableAttribute searchableAttribute) {
169 this.searchableAttribute = searchableAttribute;
170 }
171
172
173
174
175 public SearchableAttribute getSearchableAttribute() {
176 if(this.searchableAttribute == null){
177 this.searchableAttribute = new DataDictionarySearchableAttribute();
178 }
179 return this.searchableAttribute;
180 }
181
182
183
184
185 public StandardDocumentSearchGenerator getDocumentSearchGenerator() {
186 if(this.documentSearchGenerator == null){
187 this.documentSearchGenerator = new StandardDocumentSearchGenerator();
188 }
189 return this.documentSearchGenerator;
190 }
191
192
193
194
195 public DocumentSearchResultProcessor getSearchResultProcessor() {
196 if(this.searchResultProcessor == null){
197 this.searchResultProcessor = new StandardDocumentSearchResultProcessor();
198 }
199 return this.searchResultProcessor;
200 }
201
202
203
204
205 }