1 | |
package org.kuali.student.common.assembly.data; |
2 | |
|
3 | |
import java.util.ArrayList; |
4 | |
import java.util.List; |
5 | |
import java.util.Map; |
6 | |
|
7 | |
import javax.xml.bind.annotation.XmlElement; |
8 | |
import javax.xml.bind.annotation.XmlElementWrapper; |
9 | |
|
10 | |
import org.kuali.student.common.dictionary.dto.CommonLookup; |
11 | |
import org.kuali.student.common.search.dto.SortDirection; |
12 | |
|
13 | 4 | public class UILookupData extends CommonLookup { |
14 | |
|
15 | |
private static final long serialVersionUID = 1L; |
16 | |
|
17 | |
private String id; |
18 | |
private String name; |
19 | |
private String desc; |
20 | |
private String title; |
21 | |
|
22 | |
@XmlElement(name = "result") |
23 | |
@XmlElementWrapper |
24 | |
private List<LookupResultMetadata> results; |
25 | |
|
26 | |
private LookupQosMetadata qosMetadata; |
27 | |
|
28 | |
private String resultDisplayKey; |
29 | |
|
30 | |
private String resultSortKey; |
31 | |
|
32 | |
private Integer minQuerySize; |
33 | |
|
34 | |
|
35 | |
private SortDirection sortDirection; |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | 5 | public enum Usage { |
42 | 1 | DEFAULT, ADVANCED, CUSTOM, ADVANCED_CUSTOM |
43 | |
} |
44 | |
|
45 | |
private Usage usage; |
46 | |
|
47 | |
|
48 | 8 | public enum Widget { |
49 | 1 | NO_WIDGET, SUGGEST_BOX, ADVANCED_LIGHTBOX, DROP_DOWN, BUTTON, CHECKBOX_LIST, RADIO |
50 | |
} |
51 | |
|
52 | |
private Widget widget; |
53 | |
|
54 | 4 | public enum WidgetOption { |
55 | 0 | ADVANCED_LIGHTBOX_PREVIEW_MODE, ADVANCED_LIGHTBOX_ACTION_LABEL |
56 | |
} |
57 | |
|
58 | |
private Map<WidgetOption, String> widgetOptions; |
59 | |
|
60 | |
public Map<WidgetOption, String> getWidgetOptions() { |
61 | 10 | return widgetOptions; |
62 | |
} |
63 | |
|
64 | |
public void setWidgetOptions(Map<WidgetOption, String> widgetOptions) { |
65 | 0 | this.widgetOptions = widgetOptions; |
66 | 0 | } |
67 | |
|
68 | |
public String getWidgetOptionValue(WidgetOption widgetOption) { |
69 | 0 | if (widgetOptions == null) |
70 | 0 | return null; |
71 | 0 | return widgetOptions.get(widgetOption); |
72 | |
} |
73 | |
|
74 | |
public String getName() { |
75 | 10 | return name; |
76 | |
} |
77 | |
|
78 | |
public void setName(String name) { |
79 | 4 | this.name = name; |
80 | 4 | } |
81 | |
|
82 | |
public String getDesc() { |
83 | 10 | return desc; |
84 | |
} |
85 | |
|
86 | |
public void setDesc(String desc) { |
87 | 4 | this.desc = desc; |
88 | 4 | } |
89 | |
|
90 | |
public String getTitle() { |
91 | 10 | return title; |
92 | |
} |
93 | |
|
94 | |
public void setTitle(String title) { |
95 | 0 | this.title = title; |
96 | 0 | } |
97 | |
|
98 | |
public List<LookupResultMetadata> getResults() { |
99 | 10 | if (results == null) { |
100 | 0 | results = new ArrayList<LookupResultMetadata>(); |
101 | |
} |
102 | 10 | return results; |
103 | |
} |
104 | |
|
105 | |
public void setResults(List<LookupResultMetadata> results) { |
106 | 4 | this.results = results; |
107 | 4 | } |
108 | |
|
109 | |
public String getResultDisplayKey() { |
110 | 10 | return resultDisplayKey; |
111 | |
} |
112 | |
|
113 | |
public void setResultDisplayKey(String resultDisplayKey) { |
114 | 4 | this.resultDisplayKey = resultDisplayKey; |
115 | 4 | } |
116 | |
|
117 | |
public String getResultSortKey() { |
118 | 10 | return resultSortKey; |
119 | |
} |
120 | |
|
121 | |
public void setResultSortKey(String resultSortKey) { |
122 | 4 | this.resultSortKey = resultSortKey; |
123 | 4 | } |
124 | |
|
125 | |
public LookupQosMetadata getQosMetadata() { |
126 | 10 | return qosMetadata; |
127 | |
} |
128 | |
|
129 | |
public void setQosMetadata(LookupQosMetadata qosMetadata) { |
130 | 0 | this.qosMetadata = qosMetadata; |
131 | 0 | } |
132 | |
|
133 | |
public String getId() { |
134 | 10 | return id; |
135 | |
} |
136 | |
|
137 | |
public void setId(String id) { |
138 | 4 | this.id = id; |
139 | 4 | } |
140 | |
|
141 | |
public Usage getUsage() { |
142 | 20 | return usage; |
143 | |
} |
144 | |
|
145 | |
public void setUsage(Usage usage) { |
146 | 4 | this.usage = usage; |
147 | 4 | } |
148 | |
|
149 | |
public Widget getWidget() { |
150 | 20 | return widget; |
151 | |
} |
152 | |
|
153 | |
public void setWidget(Widget widget) { |
154 | 4 | this.widget = widget; |
155 | 4 | } |
156 | |
|
157 | |
public Integer getMinQuerySize() { |
158 | 10 | return minQuerySize; |
159 | |
} |
160 | |
|
161 | |
public void setMinQuerySize(Integer minQuerySize) { |
162 | 0 | this.minQuerySize = minQuerySize; |
163 | 0 | } |
164 | |
|
165 | |
public String toString() { |
166 | 0 | StringBuffer sb = new StringBuffer(); |
167 | 0 | sb.append(id); |
168 | 0 | sb.append(","); |
169 | 0 | sb.append(","); |
170 | 0 | sb.append(name); |
171 | 0 | sb.append(","); |
172 | 0 | sb.append(desc); |
173 | 0 | return sb.toString(); |
174 | |
} |
175 | |
|
176 | |
public SortDirection getSortDirection() { |
177 | 10 | return sortDirection; |
178 | |
} |
179 | |
|
180 | |
public void setSortDirection(SortDirection sortDirection) { |
181 | 0 | this.sortDirection = sortDirection; |
182 | 0 | } |
183 | |
|
184 | |
} |