1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.krad.workflow.attribute; |
17 | |
|
18 | |
import org.kuali.rice.core.api.uif.RemotableAttributeError; |
19 | |
import org.kuali.rice.core.api.uif.RemotableAttributeField; |
20 | |
import org.kuali.rice.kew.api.document.DocumentWithContent; |
21 | |
import org.kuali.rice.kew.api.document.attribute.DocumentAttribute; |
22 | |
import org.kuali.rice.kew.api.document.attribute.WorkflowAttributeDefinition; |
23 | |
import org.kuali.rice.kew.api.document.search.DocumentSearchCriteria; |
24 | |
import org.kuali.rice.kew.api.document.search.DocumentSearchResult; |
25 | |
import org.kuali.rice.kew.api.extension.ExtensionDefinition; |
26 | |
import org.kuali.rice.kew.framework.document.attribute.SearchableAttribute; |
27 | |
import org.kuali.rice.kew.framework.document.search.DocumentSearchCustomizer; |
28 | |
import org.kuali.rice.kew.framework.document.search.DocumentSearchResultSetConfiguration; |
29 | |
import org.kuali.rice.kew.framework.document.search.DocumentSearchResultValues; |
30 | |
import org.kuali.rice.kew.framework.document.search.NullDocumentSearchCustomizer; |
31 | |
|
32 | |
import java.util.List; |
33 | |
|
34 | |
public class DataDictionaryDocumentSearchCustomizer implements SearchableAttribute, DocumentSearchCustomizer { |
35 | |
|
36 | |
private SearchableAttribute searchableAttribute; |
37 | |
private DocumentSearchCustomizer documentSearchCustomizer; |
38 | |
|
39 | |
public DataDictionaryDocumentSearchCustomizer() { |
40 | 0 | this(new DataDictionarySearchableAttribute(), new NullDocumentSearchCustomizer()); |
41 | 0 | } |
42 | |
|
43 | |
public DataDictionaryDocumentSearchCustomizer(SearchableAttribute searchableAttribute, |
44 | 0 | DocumentSearchCustomizer documentSearchCustomizer) { |
45 | 0 | this.searchableAttribute = searchableAttribute; |
46 | 0 | this.documentSearchCustomizer = documentSearchCustomizer; |
47 | 0 | } |
48 | |
|
49 | |
@Override |
50 | |
public final String generateSearchContent(ExtensionDefinition extensionDefinition, |
51 | |
String documentTypeName, |
52 | |
WorkflowAttributeDefinition attributeDefinition) { |
53 | 0 | return getSearchableAttribute().generateSearchContent(extensionDefinition, documentTypeName, |
54 | |
attributeDefinition); |
55 | |
} |
56 | |
|
57 | |
@Override |
58 | |
public final List<DocumentAttribute> extractDocumentAttributes(ExtensionDefinition extensionDefinition, |
59 | |
DocumentWithContent documentWithContent) { |
60 | 0 | return getSearchableAttribute().extractDocumentAttributes(extensionDefinition, documentWithContent); |
61 | |
} |
62 | |
|
63 | |
@Override |
64 | |
public final List<RemotableAttributeField> getSearchFields(ExtensionDefinition extensionDefinition, |
65 | |
String documentTypeName) { |
66 | 0 | return getSearchableAttribute().getSearchFields(extensionDefinition, documentTypeName); |
67 | |
} |
68 | |
|
69 | |
@Override |
70 | |
public final List<RemotableAttributeError> validateDocumentAttributeCriteria(ExtensionDefinition extensionDefinition, |
71 | |
DocumentSearchCriteria documentSearchCriteria) { |
72 | 0 | return getSearchableAttribute().validateDocumentAttributeCriteria(extensionDefinition, documentSearchCriteria); |
73 | |
} |
74 | |
|
75 | |
@Override |
76 | |
public final DocumentSearchCriteria customizeCriteria(DocumentSearchCriteria documentSearchCriteria) { |
77 | 0 | return getDocumentSearchCustomizer().customizeCriteria(documentSearchCriteria); |
78 | |
} |
79 | |
|
80 | |
@Override |
81 | |
public final DocumentSearchCriteria customizeClearCriteria(DocumentSearchCriteria documentSearchCriteria) { |
82 | 0 | return getDocumentSearchCustomizer().customizeClearCriteria(documentSearchCriteria); |
83 | |
} |
84 | |
|
85 | |
@Override |
86 | |
public final DocumentSearchResultValues customizeResults(DocumentSearchCriteria documentSearchCriteria, |
87 | |
List<DocumentSearchResult> defaultResults) { |
88 | 0 | return getDocumentSearchCustomizer().customizeResults(documentSearchCriteria, defaultResults); |
89 | |
} |
90 | |
|
91 | |
@Override |
92 | |
public DocumentSearchResultSetConfiguration customizeResultSetConfiguration( |
93 | |
DocumentSearchCriteria documentSearchCriteria) { |
94 | 0 | return getDocumentSearchCustomizer().customizeResultSetConfiguration(documentSearchCriteria); |
95 | |
} |
96 | |
|
97 | |
@Override |
98 | |
public final boolean isCustomizeCriteriaEnabled(String documentTypeName) { |
99 | 0 | return getDocumentSearchCustomizer().isCustomizeCriteriaEnabled(documentTypeName); |
100 | |
} |
101 | |
|
102 | |
@Override |
103 | |
public final boolean isCustomizeClearCriteriaEnabled(String documentTypeName) { |
104 | 0 | return getDocumentSearchCustomizer().isCustomizeClearCriteriaEnabled(documentTypeName); |
105 | |
} |
106 | |
|
107 | |
@Override |
108 | |
public final boolean isCustomizeResultsEnabled(String documentTypeName) { |
109 | 0 | return getDocumentSearchCustomizer().isCustomizeResultsEnabled(documentTypeName); |
110 | |
} |
111 | |
|
112 | |
@Override |
113 | |
public final boolean isCustomizeResultSetFieldsEnabled(String documentTypeName) { |
114 | 0 | return getDocumentSearchCustomizer().isCustomizeResultSetFieldsEnabled(documentTypeName); |
115 | |
} |
116 | |
|
117 | |
protected SearchableAttribute getSearchableAttribute() { |
118 | 0 | return this.searchableAttribute; |
119 | |
} |
120 | |
|
121 | |
public void setSearchableAttribute(SearchableAttribute searchableAttribute) { |
122 | 0 | this.searchableAttribute = searchableAttribute; |
123 | 0 | } |
124 | |
|
125 | |
protected DocumentSearchCustomizer getDocumentSearchCustomizer() { |
126 | 0 | return this.documentSearchCustomizer; |
127 | |
} |
128 | |
|
129 | |
public void setDocumentSearchCustomizer(DocumentSearchCustomizer documentSearchCustomizer) { |
130 | 0 | this.documentSearchCustomizer = documentSearchCustomizer; |
131 | 0 | } |
132 | |
|
133 | |
|
134 | |
} |