1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs;
17
18 import org.kuali.rice.krad.web.controller.UifControllerBase;
19 import org.kuali.rice.krad.web.form.UifFormBase;
20 import org.springframework.stereotype.Controller;
21 import org.springframework.validation.BindingResult;
22 import org.springframework.web.bind.annotation.ModelAttribute;
23 import org.springframework.web.bind.annotation.RequestMapping;
24 import org.springframework.web.servlet.ModelAndView;
25
26 import java.io.*;
27 import java.net.*;
28
29 import javax.json.*;
30
31 import javax.servlet.http.HttpServletRequest;
32 import javax.servlet.http.HttpServletResponse;
33 import java.util.ArrayList;
34 import java.util.Iterator;
35 import java.util.List;
36
37
38
39
40
41
42 @Controller
43 @RequestMapping(value = "/kitchensinkperformance")
44 public class KitchenSinkPerformanceController extends UifControllerBase {
45
46 public static final String KUALI_ATP_2012_FALL = "kuali.atp.2012Fall";
47
48
49
50
51
52 @Override
53 protected KitchenSinkPerformanceForm createInitialForm(HttpServletRequest request) {
54 return new KitchenSinkPerformanceForm();
55 }
56
57 @Override
58 @RequestMapping(params = "methodToCall=start")
59 public ModelAndView start(@ModelAttribute("KualiForm") UifFormBase form,
60 HttpServletRequest request, HttpServletResponse response) {
61 KitchenSinkPerformanceForm perfForm = (KitchenSinkPerformanceForm) form;
62
63 return getUIFModelAndView(perfForm);
64 }
65
66
67
68
69
70
71
72
73
74
75 @RequestMapping(params = "methodToCall=buildcollection")
76 public ModelAndView buildCollection(@ModelAttribute("KualiForm") KitchenSinkPerformanceForm form, BindingResult result,
77 HttpServletRequest request, HttpServletResponse response) {
78
79 String courseCode = form.getInputOne();
80 String termId = KUALI_ATP_2012_FALL;
81 String termCode = "201208";
82 String temp = "[\n"
83 + " {\n"
84 + " \"courseOfferingId\":\"9e89ed85-66ba-4a9c-9765-c36e78929051\",\n"
85 + " \"courseOfferingCode\":\"CHEM105\",\n"
86 + " \"courseOfferingDesc\":\"Fundamental of Organic and Biochemistry\",\n"
87 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
88 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
89 + " \"studentSelectablePassFail\":true,\n"
90 + " \"auditCourse\":true,\n"
91 + " \"honorsCourse\":false\n"
92 + " },\n"
93 + " {\n"
94 + " \"courseOfferingId\":\"25a7e006-e71a-4d5d-806c-04675f365222\",\n"
95 + " \"courseOfferingCode\":\"CHEM131\",\n"
96 + " \"courseOfferingDesc\":\"Chemistry I - Fundamentals of General Chemistry\",\n"
97 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
98 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
99 + " \"studentSelectablePassFail\":true,\n"
100 + " \"auditCourse\":true,\n"
101 + " \"honorsCourse\":false\n"
102 + " },\n"
103 + " {\n"
104 + " \"courseOfferingId\":\"ea618cb3-8583-4833-bbe3-43c7961f70fb\",\n"
105 + " \"courseOfferingCode\":\"CHEM131S\",\n"
106 + " \"courseOfferingDesc\":\"Chemistry I - Fundamentals of General Chemistry\",\n"
107 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
108 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
109 + " \"studentSelectablePassFail\":true,\n"
110 + " \"auditCourse\":true,\n"
111 + " \"honorsCourse\":false\n"
112 + " },\n"
113 + " {\n"
114 + " \"courseOfferingId\":\"ee786c4b-57c9-4237-9519-4bdb961ca5d4\",\n"
115 + " \"courseOfferingCode\":\"CHEM132\",\n"
116 + " \"courseOfferingDesc\":\"General Chemistry I Laboratory\",\n"
117 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
118 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
119 + " \"studentSelectablePassFail\":true,\n"
120 + " \"auditCourse\":false,\n"
121 + " \"honorsCourse\":false\n"
122 + " },\n"
123 + " {\n"
124 + " \"courseOfferingId\":\"56802cf2-5577-4163-9fa7-a356396e8d45\",\n"
125 + " \"courseOfferingCode\":\"CHEM132C\",\n"
126 + " \"courseOfferingDesc\":\"General Chemistry I Laboratory\",\n"
127 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
128 + " \"courseOfferingGradingOptionDisplay\":\"Pass/Fail Grading\",\n"
129 + " \"studentSelectablePassFail\":true,\n"
130 + " \"auditCourse\":false,\n"
131 + " \"honorsCourse\":false\n"
132 + " },\n"
133 + " {\n"
134 + " \"courseOfferingId\":\"5fc5ff07-eb70-4c0a-b549-124eb879c8cb\",\n"
135 + " \"courseOfferingCode\":\"CHEM132S\",\n"
136 + " \"courseOfferingDesc\":\"General Chemistry I Laboratory\",\n"
137 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
138 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
139 + " \"studentSelectablePassFail\":true,\n"
140 + " \"auditCourse\":false,\n"
141 + " \"honorsCourse\":false\n"
142 + " },\n"
143 + " {\n"
144 + " \"courseOfferingId\":\"ced6bd11-bcd2-445f-be16-3a46d8231323\",\n"
145 + " \"courseOfferingCode\":\"CHEM135\",\n"
146 + " \"courseOfferingDesc\":\"General Chemistry for Engineers\",\n"
147 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
148 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
149 + " \"studentSelectablePassFail\":false,\n"
150 + " \"auditCourse\":false,\n"
151 + " \"honorsCourse\":false\n"
152 + " },\n"
153 + " {\n"
154 + " \"courseOfferingId\":\"27f703ed-d24c-4580-a401-105b3b1e5825\",\n"
155 + " \"courseOfferingCode\":\"CHEM135U\",\n"
156 + " \"courseOfferingDesc\":\"General Chemistry for Engineers\",\n"
157 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
158 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
159 + " \"studentSelectablePassFail\":false,\n"
160 + " \"auditCourse\":false,\n"
161 + " \"honorsCourse\":false\n"
162 + " },\n"
163 + " {\n"
164 + " \"courseOfferingId\":\"e960defa-3c0c-4bf6-bb2f-0ec13d80096d\",\n"
165 + " \"courseOfferingCode\":\"CHEM136\",\n"
166 + " \"courseOfferingDesc\":\"General Chemistry Laboratory for Engineers\",\n"
167 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
168 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
169 + " \"studentSelectablePassFail\":false,\n"
170 + " \"auditCourse\":false,\n"
171 + " \"honorsCourse\":false\n"
172 + " },\n"
173 + " {\n"
174 + " \"courseOfferingId\":\"2403ccea-0951-4730-b481-445631cc14a9\",\n"
175 + " \"courseOfferingCode\":\"CHEM146\",\n"
176 + " \"courseOfferingDesc\":\"Principles of General Chemistry\",\n"
177 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
178 + " \"courseOfferingGradingOptionDisplay\":\"Pass/Fail Grading\",\n"
179 + " \"studentSelectablePassFail\":true,\n"
180 + " \"auditCourse\":true,\n"
181 + " \"honorsCourse\":false\n"
182 + " },\n"
183 + " {\n"
184 + " \"courseOfferingId\":\"bc3cafeb-5c1a-452c-9ab3-dabb992d1178\",\n"
185 + " \"courseOfferingCode\":\"CHEM147\",\n"
186 + " \"courseOfferingDesc\":\"Principles of Chemistry Laboratory\",\n"
187 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
188 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
189 + " \"studentSelectablePassFail\":true,\n"
190 + " \"auditCourse\":false,\n"
191 + " \"honorsCourse\":false\n"
192 + " },\n"
193 + " {\n"
194 + " \"courseOfferingId\":\"2d847317-1c21-4c8c-990c-ab56f0897c75\",\n"
195 + " \"courseOfferingCode\":\"CHEM231\",\n"
196 + " \"courseOfferingDesc\":\"Organic Chemistry I\",\n"
197 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
198 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
199 + " \"studentSelectablePassFail\":true,\n"
200 + " \"auditCourse\":true,\n"
201 + " \"honorsCourse\":false\n"
202 + " },\n"
203 + " {\n"
204 + " \"courseOfferingId\":\"9c5f138c-951b-4d3a-8cd5-369a23f89caa\",\n"
205 + " \"courseOfferingCode\":\"CHEM232\",\n"
206 + " \"courseOfferingDesc\":\"Organic Chemistry Laboratory I\",\n"
207 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
208 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
209 + " \"studentSelectablePassFail\":false,\n"
210 + " \"auditCourse\":false,\n"
211 + " \"honorsCourse\":false\n"
212 + " },\n"
213 + " {\n"
214 + " \"courseOfferingId\":\"ebe93736-4f75-45fc-a313-e375575cdf4a\",\n"
215 + " \"courseOfferingCode\":\"CHEM241\",\n"
216 + " \"courseOfferingDesc\":\"Organic Chemistry II\",\n"
217 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
218 + " \"courseOfferingGradingOptionDisplay\":\"Pass/Fail Grading\",\n"
219 + " \"studentSelectablePassFail\":true,\n"
220 + " \"auditCourse\":true,\n"
221 + " \"honorsCourse\":false\n"
222 + " },\n"
223 + " {\n"
224 + " \"courseOfferingId\":\"9133914d-53a1-49d6-ab4d-cf83a3848262\",\n"
225 + " \"courseOfferingCode\":\"CHEM242\",\n"
226 + " \"courseOfferingDesc\":\"Organic Chemistry Laboratory II\",\n"
227 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
228 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
229 + " \"studentSelectablePassFail\":false,\n"
230 + " \"auditCourse\":false,\n"
231 + " \"honorsCourse\":false\n"
232 + " },\n"
233 + " {\n"
234 + " \"courseOfferingId\":\"759bba9a-0ccf-4ddd-bdb9-8abe46f2b784\",\n"
235 + " \"courseOfferingCode\":\"CHEM247\",\n"
236 + " \"courseOfferingDesc\":\"Principles of Organic Chemistry II\",\n"
237 + " \"courseOfferingCreditOptionDisplay\":\"4.0\",\n"
238 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
239 + " \"studentSelectablePassFail\":true,\n"
240 + " \"auditCourse\":true,\n"
241 + " \"honorsCourse\":false\n"
242 + " },\n"
243 + " {\n"
244 + " \"courseOfferingId\":\"d4208ae9-7a2a-4ad7-b570-7c060aa74d90\",\n"
245 + " \"courseOfferingCode\":\"CHEM271\",\n"
246 + " \"courseOfferingDesc\":\"General Chemistry and Energetics\",\n"
247 + " \"courseOfferingCreditOptionDisplay\":\"2.0\",\n"
248 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
249 + " \"studentSelectablePassFail\":true,\n"
250 + " \"auditCourse\":true,\n"
251 + " \"honorsCourse\":false\n"
252 + " },\n"
253 + " {\n"
254 + " \"courseOfferingId\":\"fdfd8711-e66e-4618-8321-f4bc74062792\",\n"
255 + " \"courseOfferingCode\":\"CHEM272\",\n"
256 + " \"courseOfferingDesc\":\"General Bioanalytical Chemistry Laboratory\",\n"
257 + " \"courseOfferingCreditOptionDisplay\":\"2.0\",\n"
258 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
259 + " \"studentSelectablePassFail\":true,\n"
260 + " \"auditCourse\":false,\n"
261 + " \"honorsCourse\":false\n"
262 + " },\n"
263 + " {\n"
264 + " \"courseOfferingId\":\"8e7fa3b9-9560-4f2e-88c5-59c29dc9f126\",\n"
265 + " \"courseOfferingCode\":\"CHEM277\",\n"
266 + " \"courseOfferingDesc\":\"Fundamentals of Analytical and Bioanalytical Chemistry Laboratory\",\n"
267 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
268 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
269 + " \"studentSelectablePassFail\":false,\n"
270 + " \"auditCourse\":false,\n"
271 + " \"honorsCourse\":false\n"
272 + " },\n"
273 + " {\n"
274 + " \"courseOfferingId\":\"3b84eca8-8664-4de1-8703-b1aebeddc1fb\",\n"
275 + " \"courseOfferingCode\":\"CHEM398\",\n"
276 + " \"courseOfferingDesc\":\"Special Projects\",\n"
277 + " \"courseOfferingCreditOptionDisplay\":\"2.0\",\n"
278 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
279 + " \"studentSelectablePassFail\":true,\n"
280 + " \"auditCourse\":true,\n"
281 + " \"honorsCourse\":false\n"
282 + " },\n"
283 + " {\n"
284 + " \"courseOfferingId\":\"075b54a0-133a-4e58-9b89-99cb1498e0f0\",\n"
285 + " \"courseOfferingCode\":\"CHEM399A\",\n"
286 + " \"courseOfferingDesc\":\"Introduction to Chemical Research\",\n"
287 + " \"courseOfferingCreditOptionDisplay\":\"1.0,1.5,2.0,2.5,3.0\",\n"
288 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
289 + " \"studentSelectablePassFail\":true,\n"
290 + " \"auditCourse\":true,\n"
291 + " \"honorsCourse\":false\n"
292 + " },\n"
293 + " {\n"
294 + " \"courseOfferingId\":\"9a3126b4-bcad-403a-87ba-ddc438141039\",\n"
295 + " \"courseOfferingCode\":\"CHEM399B\",\n"
296 + " \"courseOfferingDesc\":\"Introduction to Chemical Research\",\n"
297 + " \"courseOfferingCreditOptionDisplay\":\"1.0,1.5,2.0,2.5,3.0\",\n"
298 + " \"courseOfferingGradingOptionDisplay\":\"Pass/Fail Grading\",\n"
299 + " \"studentSelectablePassFail\":true,\n"
300 + " \"auditCourse\":true,\n"
301 + " \"honorsCourse\":false\n"
302 + " },\n"
303 + " {\n"
304 + " \"courseOfferingId\":\"26a79829-b42c-441b-b9cf-0d8f7a35629f\",\n"
305 + " \"courseOfferingCode\":\"CHEM399C\",\n"
306 + " \"courseOfferingDesc\":\"Introduction to Chemical Research\",\n"
307 + " \"courseOfferingCreditOptionDisplay\":\"1.0,1.5,2.0,2.5,3.0\",\n"
308 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
309 + " \"studentSelectablePassFail\":true,\n"
310 + " \"auditCourse\":true,\n"
311 + " \"honorsCourse\":false\n"
312 + " },\n"
313 + " {\n"
314 + " \"courseOfferingId\":\"84d4cc82-a24f-4775-8374-a5a4ebcab530\",\n"
315 + " \"courseOfferingCode\":\"CHEM399X\",\n"
316 + " \"courseOfferingDesc\":\"Introduction to Chemical Research; Chemistry Instruction\",\n"
317 + " \"courseOfferingCreditOptionDisplay\":\"1.0,1.5,2.0,2.5,3.0\",\n"
318 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
319 + " \"studentSelectablePassFail\":true,\n"
320 + " \"auditCourse\":true,\n"
321 + " \"honorsCourse\":false\n"
322 + " },\n"
323 + " {\n"
324 + " \"courseOfferingId\":\"0c5fcfef-11dd-4e89-b9ab-a28b4b2d7fb0\",\n"
325 + " \"courseOfferingCode\":\"CHEM403\",\n"
326 + " \"courseOfferingDesc\":\"Radiochemistry\",\n"
327 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
328 + " \"courseOfferingGradingOptionDisplay\":\"Pass/Fail Grading\",\n"
329 + " \"studentSelectablePassFail\":true,\n"
330 + " \"auditCourse\":true,\n"
331 + " \"honorsCourse\":false\n"
332 + " },\n"
333 + " {\n"
334 + " \"courseOfferingId\":\"195107f1-0afb-4af3-a78a-d287a57f8a3c\",\n"
335 + " \"courseOfferingCode\":\"CHEM425\",\n"
336 + " \"courseOfferingDesc\":\"Instrumental Methods of Analysis\",\n"
337 + " \"courseOfferingCreditOptionDisplay\":\"4.0\",\n"
338 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
339 + " \"studentSelectablePassFail\":true,\n"
340 + " \"auditCourse\":true,\n"
341 + " \"honorsCourse\":false\n"
342 + " },\n"
343 + " {\n"
344 + " \"courseOfferingId\":\"e67d87d6-8d89-401a-86ac-08ca8bd5195b\",\n"
345 + " \"courseOfferingCode\":\"CHEM441\",\n"
346 + " \"courseOfferingDesc\":\"Advanced Organic Chemistry\",\n"
347 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
348 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
349 + " \"studentSelectablePassFail\":true,\n"
350 + " \"auditCourse\":true,\n"
351 + " \"honorsCourse\":false\n"
352 + " },\n"
353 + " {\n"
354 + " \"courseOfferingId\":\"6f2cb68a-b09d-4b2b-8459-7fe17de11055\",\n"
355 + " \"courseOfferingCode\":\"CHEM460\",\n"
356 + " \"courseOfferingDesc\":\"Structure Determination Using Spectroscopic Methods\",\n"
357 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
358 + " \"courseOfferingGradingOptionDisplay\":\"Pass/Fail Grading\",\n"
359 + " \"studentSelectablePassFail\":true,\n"
360 + " \"auditCourse\":true,\n"
361 + " \"honorsCourse\":false\n"
362 + " },\n"
363 + " {\n"
364 + " \"courseOfferingId\":\"abf9196f-a0d2-4558-b47b-308bf0257c35\",\n"
365 + " \"courseOfferingCode\":\"CHEM474\",\n"
366 + " \"courseOfferingDesc\":\"Environmental Chemistry\",\n"
367 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
368 + " \"courseOfferingGradingOptionDisplay\":\"Pass/Fail Grading\",\n"
369 + " \"studentSelectablePassFail\":true,\n"
370 + " \"auditCourse\":true,\n"
371 + " \"honorsCourse\":false\n"
372 + " },\n"
373 + " {\n"
374 + " \"courseOfferingId\":\"87521128-54b5-4c97-a756-b1ecd7dcc5f5\",\n"
375 + " \"courseOfferingCode\":\"CHEM481\",\n"
376 + " \"courseOfferingDesc\":\"Physical Chemistry I\",\n"
377 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
378 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
379 + " \"studentSelectablePassFail\":true,\n"
380 + " \"auditCourse\":true,\n"
381 + " \"honorsCourse\":false\n"
382 + " },\n"
383 + " {\n"
384 + " \"courseOfferingId\":\"99f82ba5-ad01-4489-b446-99ea8f62d292\",\n"
385 + " \"courseOfferingCode\":\"CHEM482\",\n"
386 + " \"courseOfferingDesc\":\"Physical Chemistry II\",\n"
387 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
388 + " \"courseOfferingGradingOptionDisplay\":\"Pass/Fail Grading\",\n"
389 + " \"studentSelectablePassFail\":true,\n"
390 + " \"auditCourse\":true,\n"
391 + " \"honorsCourse\":false\n"
392 + " },\n"
393 + " {\n"
394 + " \"courseOfferingId\":\"7a84cb1d-51ad-44a5-a315-69451dea6154\",\n"
395 + " \"courseOfferingCode\":\"CHEM483\",\n"
396 + " \"courseOfferingDesc\":\"Physical Chemistry Laboratory I\",\n"
397 + " \"courseOfferingCreditOptionDisplay\":\"2.0\",\n"
398 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
399 + " \"studentSelectablePassFail\":true,\n"
400 + " \"auditCourse\":true,\n"
401 + " \"honorsCourse\":false\n"
402 + " },\n"
403 + " {\n"
404 + " \"courseOfferingId\":\"9118cf6c-a573-4443-9208-89079ff89d8b\",\n"
405 + " \"courseOfferingCode\":\"CHEM484\",\n"
406 + " \"courseOfferingDesc\":\"Physical Chemistry Laboratory II\",\n"
407 + " \"courseOfferingCreditOptionDisplay\":\"2.0\",\n"
408 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
409 + " \"studentSelectablePassFail\":true,\n"
410 + " \"auditCourse\":true,\n"
411 + " \"honorsCourse\":false\n"
412 + " },\n"
413 + " {\n"
414 + " \"courseOfferingId\":\"d5604c9f-664c-4dc1-94b1-695a821b7c8f\",\n"
415 + " \"courseOfferingCode\":\"CHEM491\",\n"
416 + " \"courseOfferingDesc\":\"Advanced Organic Chemistry Laboratory\",\n"
417 + " \"courseOfferingCreditOptionDisplay\":\"4.0\",\n"
418 + " \"courseOfferingGradingOptionDisplay\":\"Pass/Fail Grading\",\n"
419 + " \"studentSelectablePassFail\":true,\n"
420 + " \"auditCourse\":true,\n"
421 + " \"honorsCourse\":false\n"
422 + " },\n"
423 + " {\n"
424 + " \"courseOfferingId\":\"9218e1e8-8279-4ea2-9975-9decdf337eca\",\n"
425 + " \"courseOfferingCode\":\"CHEM601\",\n"
426 + " \"courseOfferingDesc\":\"Structure and Bonding of Molecules and Materials\",\n"
427 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
428 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
429 + " \"studentSelectablePassFail\":false,\n"
430 + " \"auditCourse\":true,\n"
431 + " \"honorsCourse\":false\n"
432 + " },\n"
433 + " {\n"
434 + " \"courseOfferingId\":\"eb942c03-0e7e-4bd7-a774-d26cb1c64f25\",\n"
435 + " \"courseOfferingCode\":\"CHEM608K\",\n"
436 + " \"courseOfferingDesc\":\"Selected Topics in Inorganic Chemistry; Chemistry Teaching and Learning in Higher Education\",\n"
437 + " \"courseOfferingCreditOptionDisplay\":\"1.0,1.5,2.0,2.5,3.0\",\n"
438 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
439 + " \"studentSelectablePassFail\":false,\n"
440 + " \"auditCourse\":true,\n"
441 + " \"honorsCourse\":false\n"
442 + " },\n"
443 + " {\n"
444 + " \"courseOfferingId\":\"19bb06aa-a076-4937-8fc4-acccf85b9828\",\n"
445 + " \"courseOfferingCode\":\"CHEM611\",\n"
446 + " \"courseOfferingDesc\":\"Professional Skills for New Graduate Students\",\n"
447 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
448 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
449 + " \"studentSelectablePassFail\":false,\n"
450 + " \"auditCourse\":true,\n"
451 + " \"honorsCourse\":false\n"
452 + " },\n"
453 + " {\n"
454 + " \"courseOfferingId\":\"9dd9724e-efd6-4d31-9624-b46450b57027\",\n"
455 + " \"courseOfferingCode\":\"CHEM625\",\n"
456 + " \"courseOfferingDesc\":\"Separation Methods in Quantitative Analysis\",\n"
457 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
458 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
459 + " \"studentSelectablePassFail\":false,\n"
460 + " \"auditCourse\":true,\n"
461 + " \"honorsCourse\":false\n"
462 + " },\n"
463 + " {\n"
464 + " \"courseOfferingId\":\"8938913c-cbd0-4405-97ad-f7e179114b83\",\n"
465 + " \"courseOfferingCode\":\"CHEM626\",\n"
466 + " \"courseOfferingDesc\":\"Metrology for Chemistry and Biochemistry\",\n"
467 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
468 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
469 + " \"studentSelectablePassFail\":false,\n"
470 + " \"auditCourse\":true,\n"
471 + " \"honorsCourse\":false\n"
472 + " },\n"
473 + " {\n"
474 + " \"courseOfferingId\":\"39c50ead-18ef-4909-89dc-3341cf8f6fd5\",\n"
475 + " \"courseOfferingCode\":\"CHEM640\",\n"
476 + " \"courseOfferingDesc\":\"Problems in Organic Reaction Mechanisms\",\n"
477 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
478 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
479 + " \"studentSelectablePassFail\":false,\n"
480 + " \"auditCourse\":true,\n"
481 + " \"honorsCourse\":false\n"
482 + " },\n"
483 + " {\n"
484 + " \"courseOfferingId\":\"bc7d6a5e-b77c-400b-a79b-1e02164b2de8\",\n"
485 + " \"courseOfferingCode\":\"CHEM641\",\n"
486 + " \"courseOfferingDesc\":\"Organic Reaction Mechanisms\",\n"
487 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
488 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
489 + " \"studentSelectablePassFail\":false,\n"
490 + " \"auditCourse\":true,\n"
491 + " \"honorsCourse\":false\n"
492 + " },\n"
493 + " {\n"
494 + " \"courseOfferingId\":\"22f75db7-d9ac-4da7-ba0c-6def7b544718\",\n"
495 + " \"courseOfferingCode\":\"CHEM682\",\n"
496 + " \"courseOfferingDesc\":\"Chemical Kinetics and Dynamics\",\n"
497 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
498 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
499 + " \"studentSelectablePassFail\":false,\n"
500 + " \"auditCourse\":true,\n"
501 + " \"honorsCourse\":false\n"
502 + " },\n"
503 + " {\n"
504 + " \"courseOfferingId\":\"4a6f4368-2a17-4bef-b62c-872fa66f8211\",\n"
505 + " \"courseOfferingCode\":\"CHEM684\",\n"
506 + " \"courseOfferingDesc\":\"Chemical Thermodynamics\",\n"
507 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
508 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
509 + " \"studentSelectablePassFail\":false,\n"
510 + " \"auditCourse\":true,\n"
511 + " \"honorsCourse\":false\n"
512 + " },\n"
513 + " {\n"
514 + " \"courseOfferingId\":\"8ba3008b-cf09-4df3-99fe-403f44be4eed\",\n"
515 + " \"courseOfferingCode\":\"CHEM689\",\n"
516 + " \"courseOfferingDesc\":\"Special Topics in Physical Chemistry\",\n"
517 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
518 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
519 + " \"studentSelectablePassFail\":false,\n"
520 + " \"auditCourse\":true,\n"
521 + " \"honorsCourse\":false\n"
522 + " },\n"
523 + " {\n"
524 + " \"courseOfferingId\":\"73e0e856-d344-4946-a759-65209dfd6e3b\",\n"
525 + " \"courseOfferingCode\":\"CHEM690\",\n"
526 + " \"courseOfferingDesc\":\"Quantum Chemistry I\",\n"
527 + " \"courseOfferingCreditOptionDisplay\":\"3.0\",\n"
528 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
529 + " \"studentSelectablePassFail\":false,\n"
530 + " \"auditCourse\":true,\n"
531 + " \"honorsCourse\":false\n"
532 + " },\n"
533 + " {\n"
534 + " \"courseOfferingId\":\"ce30b18d-5003-430c-9b8d-07d320785f4d\",\n"
535 + " \"courseOfferingCode\":\"CHEM699\",\n"
536 + " \"courseOfferingDesc\":\"Special Problems in Chemistry\",\n"
537 + " \"courseOfferingCreditOptionDisplay\":\"1 - 6\",\n"
538 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
539 + " \"studentSelectablePassFail\":false,\n"
540 + " \"auditCourse\":true,\n"
541 + " \"honorsCourse\":false\n"
542 + " },\n"
543 + " {\n"
544 + " \"courseOfferingId\":\"af7586c2-92aa-4da7-81d0-82e757efae99\",\n"
545 + " \"courseOfferingCode\":\"CHEM799\",\n"
546 + " \"courseOfferingDesc\":\"Master's Thesis Research\",\n"
547 + " \"courseOfferingCreditOptionDisplay\":\"1 - 6\",\n"
548 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
549 + " \"studentSelectablePassFail\":false,\n"
550 + " \"auditCourse\":false,\n"
551 + " \"honorsCourse\":false\n"
552 + " },\n"
553 + " {\n"
554 + " \"courseOfferingId\":\"47b27aeb-3506-4cef-9cab-ce82eb16b98a\",\n"
555 + " \"courseOfferingCode\":\"CHEM889A\",\n"
556 + " \"courseOfferingDesc\":\"Seminar; Analytical, Nuclear and Environmental Chemistry\",\n"
557 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
558 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
559 + " \"studentSelectablePassFail\":false,\n"
560 + " \"auditCourse\":true,\n"
561 + " \"honorsCourse\":false\n"
562 + " },\n"
563 + " {\n"
564 + " \"courseOfferingId\":\"81590cdf-e8bb-42b2-8192-9782ad9ca0e7\",\n"
565 + " \"courseOfferingCode\":\"CHEM889C\",\n"
566 + " \"courseOfferingDesc\":\"Seminar; Inorganic\",\n"
567 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
568 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
569 + " \"studentSelectablePassFail\":false,\n"
570 + " \"auditCourse\":true,\n"
571 + " \"honorsCourse\":false\n"
572 + " },\n"
573 + " {\n"
574 + " \"courseOfferingId\":\"2972d4f5-2670-4d69-8bc5-c3d0afb28a4a\",\n"
575 + " \"courseOfferingCode\":\"CHEM889D\",\n"
576 + " \"courseOfferingDesc\":\"Seminar; Organic\",\n"
577 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
578 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
579 + " \"studentSelectablePassFail\":false,\n"
580 + " \"auditCourse\":true,\n"
581 + " \"honorsCourse\":false\n"
582 + " },\n"
583 + " {\n"
584 + " \"courseOfferingId\":\"672d59b9-c2ae-4462-82f3-b0ebfc181c59\",\n"
585 + " \"courseOfferingCode\":\"CHEM889E\",\n"
586 + " \"courseOfferingDesc\":\"Seminar; Physical Chemistry\",\n"
587 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
588 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
589 + " \"studentSelectablePassFail\":false,\n"
590 + " \"auditCourse\":true,\n"
591 + " \"honorsCourse\":false\n"
592 + " },\n"
593 + " {\n"
594 + " \"courseOfferingId\":\"ee6838b4-40d8-419e-8838-a5286e269dc9\",\n"
595 + " \"courseOfferingCode\":\"CHEM889F\",\n"
596 + " \"courseOfferingDesc\":\"Seminar; Chemical Physics\",\n"
597 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
598 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
599 + " \"studentSelectablePassFail\":false,\n"
600 + " \"auditCourse\":true,\n"
601 + " \"honorsCourse\":false\n"
602 + " },\n"
603 + " {\n"
604 + " \"courseOfferingId\":\"fe0b4cbd-0796-4810-88ec-0dc22f570cc6\",\n"
605 + " \"courseOfferingCode\":\"CHEM889G\",\n"
606 + " \"courseOfferingDesc\":\"Seminar; Physical Organic\",\n"
607 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
608 + " \"courseOfferingGradingOptionDisplay\":\"Allow students to audit\",\n"
609 + " \"studentSelectablePassFail\":false,\n"
610 + " \"auditCourse\":true,\n"
611 + " \"honorsCourse\":false\n"
612 + " },\n"
613 + " {\n"
614 + " \"courseOfferingId\":\"ac1a7153-1ceb-483e-bf3c-417494ac4522\",\n"
615 + " \"courseOfferingCode\":\"CHEM889M\",\n"
616 + " \"courseOfferingDesc\":\"Seminar; Materials Chemistry\",\n"
617 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
618 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
619 + " \"studentSelectablePassFail\":false,\n"
620 + " \"auditCourse\":true,\n"
621 + " \"honorsCourse\":false\n"
622 + " },\n"
623 + " {\n"
624 + " \"courseOfferingId\":\"019e01b1-695a-4513-92b6-4303af879b61\",\n"
625 + " \"courseOfferingCode\":\"CHEM889P\",\n"
626 + " \"courseOfferingDesc\":\"Seminar; Structure and Reactivity of Biopolymers\",\n"
627 + " \"courseOfferingCreditOptionDisplay\":\"1.0\",\n"
628 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
629 + " \"studentSelectablePassFail\":false,\n"
630 + " \"auditCourse\":true,\n"
631 + " \"honorsCourse\":false\n"
632 + " },\n"
633 + " {\n"
634 + " \"courseOfferingId\":\"d0b9cf2f-879d-4bf4-8afd-05531b842219\",\n"
635 + " \"courseOfferingCode\":\"CHEM898\",\n"
636 + " \"courseOfferingDesc\":\"Pre-Candidacy Research\",\n"
637 + " \"courseOfferingCreditOptionDisplay\":\"1 - 8\",\n"
638 + " \"courseOfferingGradingOptionDisplay\":\"Administrative Grade of Satisfactory\",\n"
639 + " \"studentSelectablePassFail\":false,\n"
640 + " \"auditCourse\":false,\n"
641 + " \"honorsCourse\":false\n"
642 + " },\n"
643 + " {\n"
644 + " \"courseOfferingId\":\"a3c5e362-6343-4177-ae39-c2f55b32f56b\",\n"
645 + " \"courseOfferingCode\":\"CHEM899\",\n"
646 + " \"courseOfferingDesc\":\"Doctoral Dissertation Research\",\n"
647 + " \"courseOfferingCreditOptionDisplay\":\"1 - 8\",\n"
648 + " \"courseOfferingGradingOptionDisplay\":\"Letter\",\n"
649 + " \"studentSelectablePassFail\":false,\n"
650 + " \"auditCourse\":false,\n"
651 + " \"honorsCourse\":false\n"
652 + " }\n"
653 + "]";
654
655 JsonReader jsonReader = Json.createReader(new StringReader(temp));
656 JsonArray jsonArray = jsonReader.readArray();
657 List<CourseSearchResult> collectionList = new ArrayList<CourseSearchResult>();
658
659 populateCourseSearchResults(jsonArray, collectionList);
660 form.setPerfCollection(collectionList);
661
662 return getUIFModelAndView(form);
663 }
664
665 public void populateCourseSearchResults(JsonArray jsonArray, List<CourseSearchResult> collectionList)throws JsonException {
666 int j = jsonArray.size();
667 int i;
668 for(i=0; i<j; i++) {
669 CourseSearchResult courseSearchResult = new CourseSearchResult();
670 JsonObject jsonObject = (JsonObject)jsonArray.get(i);
671 courseSearchResult.setCourseOfferingId(jsonObject.getString("courseOfferingId"));
672 courseSearchResult.setCourseOfferingCode(jsonObject.getString("courseOfferingCode"));
673 courseSearchResult.setHonorsCourse(jsonObject.getBoolean("honorsCourse"));
674 courseSearchResult.setAuditCourse(jsonObject.getBoolean("auditCourse"));
675 courseSearchResult.setStudentSelectablePassFail(jsonObject.getBoolean("studentSelectablePassFail"));
676 courseSearchResult.setCourseOfferingDesc(jsonObject.getString("courseOfferingDesc"));
677 courseSearchResult.setCourseOfferingCreditOptionDisplay(jsonObject.getString(
678 "courseOfferingCreditOptionDisplay"));
679 courseSearchResult.setCourseOfferingGradingOptionDisplay(jsonObject.getString(
680 "courseOfferingGradingOptionDisplay"));
681 collectionList.add(courseSearchResult);
682 }
683
684
685 }
686
687
688 public String getHTML(String urlToRead) {
689 URL url;
690 HttpURLConnection conn;
691 BufferedReader rd;
692 String line;
693 String result = "";
694 try {
695 url = new URL(urlToRead);
696 conn = (HttpURLConnection) url.openConnection();
697 conn.setRequestMethod("GET");
698 rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
699 while ((line = rd.readLine()) != null) {
700 result += line;
701 }
702 rd.close();
703 } catch (IOException e) {
704 e.printStackTrace();
705 } catch (Exception e) {
706 e.printStackTrace();
707 }
708 return result;
709 }
710
711 }