View Javadoc

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  public class UILookupData extends CommonLookup {
14  
15  	private static final long serialVersionUID = 1L;
16  
17  	private String id; // unique ID of this lookup
18  	private String name; // name of this search
19  	private String desc;
20  	private String title; // advanced search window 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; // minimum size of query before initiating
33  									// search.
34  
35  	private SortDirection sortDirection;
36  
37  	// how a search criteria will be used. ADVANCED_CUSTOM is shown on both
38  	// advanced
39  	// and custom screens of the advanced search lightbox
40  	// TODO is DEFAULT needed? it has 0 references
41  	public enum Usage {
42  		DEFAULT, ADVANCED, CUSTOM, ADVANCED_CUSTOM
43  	}
44  
45  	private Usage usage;
46  
47  	// TODO BUTTON has 0 references. Is it needed?
48  	public enum Widget {
49  		NO_WIDGET, SUGGEST_BOX, ADVANCED_LIGHTBOX, DROP_DOWN, BUTTON, CHECKBOX_LIST, RADIO
50  	}
51  
52  	private Widget widget;
53  
54  	public enum WidgetOption {
55  		ADVANCED_LIGHTBOX_PREVIEW_MODE, ADVANCED_LIGHTBOX_ACTION_LABEL
56  	}
57  
58  	private Map<WidgetOption, String> widgetOptions;
59  
60  	public Map<WidgetOption, String> getWidgetOptions() {
61  		return widgetOptions;
62  	}
63  
64  	public void setWidgetOptions(Map<WidgetOption, String> widgetOptions) {
65  		this.widgetOptions = widgetOptions;
66  	}
67  
68  	public String getWidgetOptionValue(WidgetOption widgetOption) {
69  		if (widgetOptions == null)
70  			return null;
71  		return widgetOptions.get(widgetOption);
72  	}
73  
74  	public String getName() {
75  		return name;
76  	}
77  
78  	public void setName(String name) {
79  		this.name = name;
80  	}
81  
82  	public String getDesc() {
83  		return desc;
84  	}
85  
86  	public void setDesc(String desc) {
87  		this.desc = desc;
88  	}
89  
90  	public String getTitle() {
91  		return title;
92  	}
93  
94  	public void setTitle(String title) {
95  		this.title = title;
96  	}
97  
98  	public List<LookupResultMetadata> getResults() {
99  		if (results == null) {
100 			results = new ArrayList<LookupResultMetadata>();
101 		}
102 		return results;
103 	}
104 
105 	public void setResults(List<LookupResultMetadata> results) {
106 		this.results = results;
107 	}
108 
109 	public String getResultDisplayKey() {
110 		return resultDisplayKey;
111 	}
112 
113 	public void setResultDisplayKey(String resultDisplayKey) {
114 		this.resultDisplayKey = resultDisplayKey;
115 	}
116 
117 	public String getResultSortKey() {
118 		return resultSortKey;
119 	}
120 
121 	public void setResultSortKey(String resultSortKey) {
122 		this.resultSortKey = resultSortKey;
123 	}
124 
125 	public LookupQosMetadata getQosMetadata() {
126 		return qosMetadata;
127 	}
128 
129 	public void setQosMetadata(LookupQosMetadata qosMetadata) {
130 		this.qosMetadata = qosMetadata;
131 	}
132 
133 	public String getId() {
134 		return id;
135 	}
136 
137 	public void setId(String id) {
138 		this.id = id;
139 	}
140 
141 	public Usage getUsage() {
142 		return usage;
143 	}
144 
145 	public void setUsage(Usage usage) {
146 		this.usage = usage;
147 	}
148 
149 	public Widget getWidget() {
150 		return widget;
151 	}
152 
153 	public void setWidget(Widget widget) {
154 		this.widget = widget;
155 	}
156 
157 	public Integer getMinQuerySize() {
158 		return minQuerySize;
159 	}
160 
161 	public void setMinQuerySize(Integer minQuerySize) {
162 		this.minQuerySize = minQuerySize;
163 	}
164 
165 	public String toString() {
166 		StringBuffer sb = new StringBuffer();
167 		sb.append(id);
168 		sb.append(",");
169 		sb.append(",");
170 		sb.append(name);
171 		sb.append(",");
172 		sb.append(desc);
173 		return sb.toString();
174 	}
175 
176 	public SortDirection getSortDirection() {
177 		return sortDirection;
178 	}
179 
180 	public void setSortDirection(SortDirection sortDirection) {
181 		this.sortDirection = sortDirection;
182 	}
183 
184 }