1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.common.assembly.data; |
17 | |
|
18 | |
import java.io.Serializable; |
19 | |
import java.util.ArrayList; |
20 | |
import java.util.List; |
21 | |
import java.util.Map; |
22 | |
|
23 | |
import org.kuali.student.common.search.dto.SortDirection; |
24 | |
|
25 | 21 | public class LookupMetadata implements Serializable { |
26 | |
|
27 | |
private static final long serialVersionUID = 1L; |
28 | |
|
29 | |
private String id; |
30 | |
private String searchTypeId; |
31 | |
private String name; |
32 | |
private String desc; |
33 | |
private String title; |
34 | |
|
35 | |
private List<LookupParamMetadata> params; |
36 | |
|
37 | |
private List<LookupResultMetadata> results; |
38 | |
|
39 | |
private LookupQosMetadata qosMetadata; |
40 | |
|
41 | |
private String searchParamIdKey; |
42 | |
|
43 | |
private String resultReturnKey; |
44 | |
|
45 | |
private String resultDisplayKey; |
46 | |
|
47 | |
private String resultSortKey; |
48 | |
|
49 | |
private Integer minQuerySize; |
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
private SortDirection sortDirection; |
56 | |
|
57 | 16 | public enum Usage { |
58 | 1 | DEFAULT, ADVANCED, CUSTOM, ADVANCED_CUSTOM |
59 | |
} |
60 | |
|
61 | |
private Usage usage; |
62 | |
|
63 | |
|
64 | 19 | public enum Widget { |
65 | 1 | NO_WIDGET, SUGGEST_BOX, ADVANCED_LIGHTBOX, DROP_DOWN, BUTTON, CHECKBOX_LIST, RADIO |
66 | |
} |
67 | |
private Widget widget; |
68 | |
|
69 | 21 | public enum WidgetOption { |
70 | 0 | ADVANCED_LIGHTBOX_PREVIEW_MODE, ADVANCED_LIGHTBOX_ACTION_LABEL |
71 | |
} |
72 | |
|
73 | |
private Map<WidgetOption, String> widgetOptions; |
74 | |
|
75 | |
public Map<WidgetOption, String> getWidgetOptions() { |
76 | 2 | return widgetOptions; |
77 | |
} |
78 | |
|
79 | |
public void setWidgetOptions(Map<WidgetOption, String> widgetOptions) { |
80 | 0 | this.widgetOptions = widgetOptions; |
81 | 0 | } |
82 | |
|
83 | |
public String getWidgetOptionValue(WidgetOption widgetOption) { |
84 | 0 | if (widgetOptions == null) return null; |
85 | 0 | return widgetOptions.get(widgetOption); |
86 | |
} |
87 | |
|
88 | |
public String getName() { |
89 | 2 | return name; |
90 | |
} |
91 | |
|
92 | |
public void setName(String name) { |
93 | 21 | this.name = name; |
94 | 21 | } |
95 | |
|
96 | |
public String getDesc() { |
97 | 0 | return desc; |
98 | |
} |
99 | |
|
100 | |
public void setDesc(String desc) { |
101 | 21 | this.desc = desc; |
102 | 21 | } |
103 | |
|
104 | |
public String getTitle() { |
105 | 0 | return title; |
106 | |
} |
107 | |
|
108 | |
public void setTitle(String title) { |
109 | 10 | this.title = title; |
110 | 10 | } |
111 | |
|
112 | |
public List<LookupParamMetadata> getParams() { |
113 | 4 | if (params == null) { |
114 | 0 | params = new ArrayList<LookupParamMetadata>(); |
115 | |
} |
116 | 4 | return params; |
117 | |
} |
118 | |
|
119 | |
public void setParams(List<LookupParamMetadata> params) { |
120 | 18 | this.params = params; |
121 | 18 | } |
122 | |
|
123 | |
public List<LookupResultMetadata> getResults() { |
124 | 0 | if (results == null) { |
125 | 0 | results = new ArrayList<LookupResultMetadata>(); |
126 | |
} |
127 | 0 | return results; |
128 | |
} |
129 | |
|
130 | |
public void setResults(List<LookupResultMetadata> results) { |
131 | 21 | this.results = results; |
132 | 21 | } |
133 | |
|
134 | |
public String getSearchTypeId() { |
135 | 6 | return searchTypeId; |
136 | |
} |
137 | |
|
138 | |
public void setSearchTypeId(String searchTypeId) { |
139 | 21 | this.searchTypeId = searchTypeId; |
140 | 21 | } |
141 | |
|
142 | |
public String getResultReturnKey() { |
143 | 0 | return resultReturnKey; |
144 | |
} |
145 | |
|
146 | |
public void setResultReturnKey(String resultReturnKey) { |
147 | 21 | this.resultReturnKey = resultReturnKey; |
148 | 21 | } |
149 | |
|
150 | |
public String getResultDisplayKey() { |
151 | 0 | return resultDisplayKey; |
152 | |
} |
153 | |
|
154 | |
public void setResultDisplayKey(String resultDisplayKey) { |
155 | 21 | this.resultDisplayKey = resultDisplayKey; |
156 | 21 | } |
157 | |
|
158 | |
public String getResultSortKey() { |
159 | 0 | return resultSortKey; |
160 | |
} |
161 | |
|
162 | |
public void setResultSortKey(String resultSortKey) { |
163 | 21 | this.resultSortKey = resultSortKey; |
164 | 21 | } |
165 | |
|
166 | |
public LookupQosMetadata getQosMetadata() { |
167 | 0 | return qosMetadata; |
168 | |
} |
169 | |
|
170 | |
public void setQosMetadata(LookupQosMetadata qosMetadata) { |
171 | 10 | this.qosMetadata = qosMetadata; |
172 | 10 | } |
173 | |
|
174 | |
public String getSearchParamIdKey() { |
175 | 0 | return searchParamIdKey; |
176 | |
} |
177 | |
|
178 | |
public void setSearchParamIdKey(String searchParamIdKey) { |
179 | 10 | this.searchParamIdKey = searchParamIdKey; |
180 | 10 | } |
181 | |
|
182 | |
public String getId() { |
183 | 2 | return id; |
184 | |
} |
185 | |
|
186 | |
public void setId(String id) { |
187 | 21 | this.id = id; |
188 | 21 | } |
189 | |
|
190 | |
|
191 | |
|
192 | |
|
193 | |
public Usage getUsage() { |
194 | 0 | return usage; |
195 | |
} |
196 | |
|
197 | |
|
198 | |
|
199 | |
|
200 | |
public void setUsage(Usage usage) { |
201 | 21 | this.usage = usage; |
202 | 21 | } |
203 | |
|
204 | |
public Widget getWidget() { |
205 | 4 | return widget; |
206 | |
} |
207 | |
|
208 | |
public void setWidget(Widget widget) { |
209 | 10 | this.widget = widget; |
210 | 10 | } |
211 | |
|
212 | |
public Integer getMinQuerySize() { |
213 | 0 | return minQuerySize; |
214 | |
} |
215 | |
|
216 | |
public void setMinQuerySize(Integer minQuerySize) { |
217 | 10 | this.minQuerySize = minQuerySize; |
218 | 10 | } |
219 | |
|
220 | |
public String toString(){ |
221 | 0 | StringBuffer sb = new StringBuffer(); |
222 | 0 | sb.append(id); |
223 | 0 | sb.append(","); |
224 | 0 | sb.append(searchTypeId); |
225 | 0 | sb.append(","); |
226 | 0 | sb.append(name); |
227 | 0 | sb.append(","); |
228 | 0 | sb.append(desc); |
229 | 0 | return sb.toString(); |
230 | |
} |
231 | |
|
232 | |
public SortDirection getSortDirection() { |
233 | 0 | return sortDirection; |
234 | |
} |
235 | |
|
236 | |
public void setSortDirection(SortDirection sortDirection) { |
237 | 10 | this.sortDirection = sortDirection; |
238 | 10 | } |
239 | |
} |