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