1 | package com.ether; |
---|
2 | |
---|
3 | import com.ether.annotation.ControllerMethod; |
---|
4 | import com.ether.annotation.ParamName; |
---|
5 | import com.ether.instrument.Instrument; |
---|
6 | import com.ether.station.Station; |
---|
7 | import org.apache.commons.logging.Log; |
---|
8 | import org.apache.commons.logging.LogFactory; |
---|
9 | import org.springframework.beans.factory.annotation.Required; |
---|
10 | import org.springframework.web.servlet.ModelAndView; |
---|
11 | |
---|
12 | import javax.servlet.http.HttpServletRequest; |
---|
13 | import javax.servlet.http.HttpServletResponse; |
---|
14 | import java.util.HashMap; |
---|
15 | import java.util.List; |
---|
16 | import java.util.Map; |
---|
17 | |
---|
18 | /** |
---|
19 | * @author vmipsl |
---|
20 | * @date 17 feb 2011 |
---|
21 | */ |
---|
22 | public class Controller |
---|
23 | extends ControllerEther |
---|
24 | { |
---|
25 | /** *********************************************************** **/ |
---|
26 | /** *********************** VIEWS ***************************** **/ |
---|
27 | /** *********************************************************** **/ |
---|
28 | |
---|
29 | /** |
---|
30 | * Default view if url's methodName is unknown |
---|
31 | * |
---|
32 | * @return |
---|
33 | * @throws WebException |
---|
34 | */ |
---|
35 | @ControllerMethod(view = VIEW_INIT) |
---|
36 | public Map<String, Object> home() |
---|
37 | throws WebException |
---|
38 | { |
---|
39 | return new HashMap<String, Object>(); |
---|
40 | } |
---|
41 | |
---|
42 | @ControllerMethod(view = VIEW_DATA_OHP) |
---|
43 | public Map<String, Object> viewDataOhp() |
---|
44 | throws WebException |
---|
45 | { |
---|
46 | return new HashMap<String, Object>(); |
---|
47 | } |
---|
48 | |
---|
49 | @ControllerMethod(view = VIEW_DATA_OPAR) |
---|
50 | public Map<String, Object> viewDataOpar() |
---|
51 | throws WebException |
---|
52 | { |
---|
53 | return new HashMap<String, Object>(); |
---|
54 | } |
---|
55 | |
---|
56 | @ControllerMethod(view = VIEW_DATA_DDU) |
---|
57 | public Map<String, Object> viewDataDdu() |
---|
58 | throws WebException |
---|
59 | { |
---|
60 | return new HashMap<String, Object>(); |
---|
61 | } |
---|
62 | |
---|
63 | @ControllerMethod(view = VIEW_DATA_OMP) |
---|
64 | public Map<String, Object> viewDataOmp() |
---|
65 | throws WebException |
---|
66 | { |
---|
67 | return new HashMap<String, Object>(); |
---|
68 | } |
---|
69 | |
---|
70 | @ControllerMethod(view = VIEW_DATA_VDA) |
---|
71 | public Map<String, Object> viewDataVda() |
---|
72 | throws WebException |
---|
73 | { |
---|
74 | return new HashMap<String, Object>(); |
---|
75 | } |
---|
76 | |
---|
77 | @ControllerMethod(view = VIEW_DATA_BRI) |
---|
78 | public Map<String, Object> viewDataBri() |
---|
79 | throws WebException |
---|
80 | { |
---|
81 | return new HashMap<String, Object>(); |
---|
82 | } |
---|
83 | |
---|
84 | @ControllerMethod(view = VIEW_DATA_SCO) |
---|
85 | public Map<String, Object> viewDataSco() |
---|
86 | throws WebException |
---|
87 | { |
---|
88 | return new HashMap<String, Object>(); |
---|
89 | } |
---|
90 | |
---|
91 | @ControllerMethod(view = VIEW_DATA_AND) |
---|
92 | public Map<String, Object> viewDataAnd() |
---|
93 | throws WebException |
---|
94 | { |
---|
95 | return new HashMap<String, Object>(); |
---|
96 | } |
---|
97 | |
---|
98 | @ControllerMethod(view = VIEW_DATA_SOD) |
---|
99 | public Map<String, Object> viewDataSod() |
---|
100 | throws WebException |
---|
101 | { |
---|
102 | return new HashMap<String, Object>(); |
---|
103 | } |
---|
104 | |
---|
105 | @ControllerMethod(view = VIEW_DATA_ZHI) |
---|
106 | public Map<String, Object> viewDataZhi() |
---|
107 | throws WebException |
---|
108 | { |
---|
109 | return new HashMap<String, Object>(); |
---|
110 | } |
---|
111 | |
---|
112 | @ControllerMethod(view = VIEW_DATA_SAL) |
---|
113 | public Map<String, Object> viewDataSal() |
---|
114 | throws WebException |
---|
115 | { |
---|
116 | return new HashMap<String, Object>(); |
---|
117 | } |
---|
118 | |
---|
119 | @ControllerMethod(view = VIEW_DATA_BOR) |
---|
120 | public Map<String, Object> viewDataBor() |
---|
121 | throws WebException |
---|
122 | { |
---|
123 | return new HashMap<String, Object>(); |
---|
124 | } |
---|
125 | |
---|
126 | @ControllerMethod(view = VIEW_DATA_TAR) |
---|
127 | public Map<String, Object> viewDataTar() |
---|
128 | throws WebException |
---|
129 | { |
---|
130 | return new HashMap<String, Object>(); |
---|
131 | } |
---|
132 | |
---|
133 | @ControllerMethod(view = VIEW_DATA_BAU) |
---|
134 | public Map<String, Object> viewDataBau() |
---|
135 | throws WebException |
---|
136 | { |
---|
137 | return new HashMap<String, Object>(); |
---|
138 | } |
---|
139 | |
---|
140 | @ControllerMethod(view = VIEW_DATA_KER) |
---|
141 | public Map<String, Object> viewDataKer() |
---|
142 | throws WebException |
---|
143 | { |
---|
144 | return new HashMap<String, Object>(); |
---|
145 | } |
---|
146 | |
---|
147 | @ControllerMethod(view = VIEW_DATA_RIO) |
---|
148 | public Map<String, Object> viewDataRio() |
---|
149 | throws WebException |
---|
150 | { |
---|
151 | return new HashMap<String, Object>(); |
---|
152 | } |
---|
153 | |
---|
154 | @ControllerMethod(view = VIEW_DATA_CON) |
---|
155 | public Map<String, Object> viewDataCon() |
---|
156 | throws WebException |
---|
157 | { |
---|
158 | return new HashMap<String, Object>(); |
---|
159 | } |
---|
160 | |
---|
161 | @ControllerMethod(view = VIEW_BIBLIO) |
---|
162 | public Map<String, Object> viewBiblio() |
---|
163 | throws WebException |
---|
164 | { |
---|
165 | return new HashMap<String, Object>(); |
---|
166 | } |
---|
167 | |
---|
168 | |
---|
169 | @ControllerMethod(view = VIEW_INTRA) |
---|
170 | public Map<String, Object> viewIntra() |
---|
171 | throws WebException |
---|
172 | { |
---|
173 | return new HashMap<String, Object>(); |
---|
174 | } |
---|
175 | |
---|
176 | @ControllerMethod(view = VIEW_ABOUT) |
---|
177 | public Map<String, Object> viewAbout() |
---|
178 | throws WebException |
---|
179 | { |
---|
180 | return new HashMap<String, Object>(); |
---|
181 | } |
---|
182 | |
---|
183 | @ControllerMethod(view = VIEW_ECC) |
---|
184 | public Map<String, Object> selectEcc( @ParamName("dateinf") final String dateinf, |
---|
185 | @ParamName("station") String station, |
---|
186 | @ParamName("instrument") final String instrument ) |
---|
187 | throws WebException |
---|
188 | { |
---|
189 | try |
---|
190 | { |
---|
191 | final List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
192 | |
---|
193 | //dateinf="02021980"; |
---|
194 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
195 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
196 | String rep = ""; |
---|
197 | String year = dateinf.substring( 0, 4 ); |
---|
198 | |
---|
199 | if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) |
---|
200 | { |
---|
201 | rep = "./resources/visu/ohp/ecc"; |
---|
202 | station = "OHP"; |
---|
203 | if( year.compareTo( "1970" ) == 0 ) year = "2007"; |
---|
204 | } |
---|
205 | else if( station.compareTo( "LA REUNION" ) == 0 || station.compareTo( "reunion" ) == 0 ) |
---|
206 | { |
---|
207 | rep = "./resources/visu/reu/ecc"; |
---|
208 | //rep="./resources/visu/ohp/lidar/o3_strato"; |
---|
209 | station = "LA REUNION"; |
---|
210 | if( year.compareTo( "1970" ) == 0 ) year = "2006"; |
---|
211 | //year="2006"; |
---|
212 | } |
---|
213 | else if( station.compareTo( "DDU" ) == 0 || station.compareTo( "ddu" ) == 0 ) |
---|
214 | { |
---|
215 | rep = "./resources/visu/ddu/ecc"; |
---|
216 | //rep="./resources/visu/ohp/lidar/o3_strato"; |
---|
217 | station = "DDU"; |
---|
218 | if( year.compareTo( "1970" ) == 0 ) year = "1991"; |
---|
219 | //year="2006"; |
---|
220 | } |
---|
221 | |
---|
222 | final Map<String, Object> model = new HashMap<String, Object>(); |
---|
223 | model.put( "plotsList", plotsList ); |
---|
224 | model.put( "listeDates", listeDates ); |
---|
225 | model.put( "firstDate", dateinf ); |
---|
226 | final String month = dateinf.substring( 4, 6 ); |
---|
227 | model.put( "month", month ); |
---|
228 | model.put( "year", year ); |
---|
229 | model.put( "station", station ); |
---|
230 | model.put( "rep", rep ); |
---|
231 | return model; |
---|
232 | } |
---|
233 | catch( ServiceException e ) |
---|
234 | { |
---|
235 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
236 | } |
---|
237 | } |
---|
238 | |
---|
239 | public ModelAndView viewLidarO3s( final HttpServletRequest request, final HttpServletResponse response ) |
---|
240 | throws WebException |
---|
241 | { |
---|
242 | try |
---|
243 | { |
---|
244 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
245 | |
---|
246 | final ModelAndView modelAndView = new ModelAndView( VIEW_LIDAR_O3S ); |
---|
247 | modelAndView.addObject( "listeDates", listeDates ); |
---|
248 | |
---|
249 | return modelAndView; |
---|
250 | |
---|
251 | } |
---|
252 | catch( ServiceException e ) |
---|
253 | { |
---|
254 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
255 | } |
---|
256 | } |
---|
257 | |
---|
258 | @ControllerMethod(view = VIEW_LIDAR_O3S) |
---|
259 | public Map<String, Object> selectLidarO3s( @ParamName("dateinf") final String dateinf, |
---|
260 | @ParamName("station") String station, |
---|
261 | @ParamName("instrument") final String instrument ) |
---|
262 | throws WebException |
---|
263 | |
---|
264 | /*public ModelAndView selectLidarO3s( final HttpServletRequest request, final HttpServletResponse response ) |
---|
265 | throws WebException*/ |
---|
266 | { |
---|
267 | try |
---|
268 | { |
---|
269 | /*String dateinf = request.getParameter( "dateinf" ); |
---|
270 | String station = request.getParameter( "station" ); |
---|
271 | |
---|
272 | final String instrument = request.getParameter( "instrument" );*/ |
---|
273 | |
---|
274 | List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
275 | |
---|
276 | //dateinf="02021980"; |
---|
277 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
278 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
279 | String rep = ""; |
---|
280 | String year = dateinf.substring( 0, 4 ); |
---|
281 | String month = dateinf.substring( 4, 6 ); |
---|
282 | |
---|
283 | if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) |
---|
284 | { |
---|
285 | rep = "./resources/visu/ohp/lidar/o3_strato"; |
---|
286 | station = "OHP"; |
---|
287 | if( year.compareTo( "1970" ) == 0 ) |
---|
288 | { |
---|
289 | |
---|
290 | year = "1991"; |
---|
291 | } |
---|
292 | } |
---|
293 | else if( station.compareTo( "REU" ) == 0 || station.compareTo( "reu" ) == 0 || station.compareTo( "LA REUNION" ) == 0 || station.compareTo( "REUNION" ) == 0 ) |
---|
294 | { |
---|
295 | rep = "./resources/visu/reu/lidar/o3_strato"; |
---|
296 | station = "LA REUNION"; |
---|
297 | if( year.compareTo( "1970" ) == 0 ) year = "2006"; |
---|
298 | //year="2006"; |
---|
299 | } |
---|
300 | |
---|
301 | else |
---|
302 | { |
---|
303 | rep = "./resources/visu/ddu/lidar/o3_strato"; |
---|
304 | station = "DDUModelAndView"; |
---|
305 | if( year.compareTo( "1970" ) == 0 ) |
---|
306 | { |
---|
307 | year = "1991"; |
---|
308 | //month="04"; |
---|
309 | } |
---|
310 | //year="2006"; |
---|
311 | } |
---|
312 | |
---|
313 | final Map<String, Object> modelAndView = new HashMap<String, Object>(); |
---|
314 | //plotsList=null; |
---|
315 | modelAndView.put( "plotsList", plotsList ); |
---|
316 | |
---|
317 | modelAndView.put( "listeDates", listeDates ); |
---|
318 | modelAndView.put( "firstDate", dateinf ); |
---|
319 | |
---|
320 | |
---|
321 | modelAndView.put( "month", month ); |
---|
322 | modelAndView.put( "year", year ); |
---|
323 | modelAndView.put( "station", station ); |
---|
324 | modelAndView.put( "rep", rep ); |
---|
325 | |
---|
326 | return modelAndView; |
---|
327 | |
---|
328 | } |
---|
329 | catch( ServiceException e ) |
---|
330 | { |
---|
331 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
332 | } |
---|
333 | } |
---|
334 | |
---|
335 | @ControllerMethod(view = VIEW_LIDAR_O3T) |
---|
336 | public Map<String, Object> selectLidarO3t( @ParamName("dateinf") String dateinf, |
---|
337 | @ParamName("station") String station, |
---|
338 | @ParamName("instrument") final String instrument ) |
---|
339 | throws WebException |
---|
340 | { |
---|
341 | try |
---|
342 | { |
---|
343 | |
---|
344 | List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
345 | |
---|
346 | //dateinf="02021980"; |
---|
347 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
348 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
349 | String rep = ""; |
---|
350 | String year = dateinf.substring( 0, 4 ); |
---|
351 | String month = dateinf.substring( 4, 6 ); |
---|
352 | |
---|
353 | if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) |
---|
354 | { |
---|
355 | rep = "./resources/visu/ohp/lidar/o3_tropo"; |
---|
356 | station = "OHP"; |
---|
357 | if( year.compareTo( "1970" ) == 0 ) |
---|
358 | { |
---|
359 | year = "2007"; |
---|
360 | month = "05"; |
---|
361 | dateinf = year + month + "01"; |
---|
362 | } |
---|
363 | } |
---|
364 | //else if (station.compareTo("reunion")==0) { |
---|
365 | else |
---|
366 | { |
---|
367 | rep = "./resources/visu/reu/lidar/o3_tropo"; |
---|
368 | //rep="./resources/visu/ohp/lidar/o3_strato"; |
---|
369 | station = "LA REUNION"; |
---|
370 | if( year.compareTo( "1970" ) == 0 ) |
---|
371 | { |
---|
372 | year = "2006"; |
---|
373 | |
---|
374 | } |
---|
375 | //year="2006"; |
---|
376 | } |
---|
377 | |
---|
378 | final Map<String, Object> mView = new HashMap<String, Object>(); |
---|
379 | //plotsList=null; |
---|
380 | mView.put( "plotsList", plotsList ); |
---|
381 | |
---|
382 | mView.put( "listeDates", listeDates ); |
---|
383 | mView.put( "firstDate", dateinf ); |
---|
384 | |
---|
385 | //String month = dateinf.substring(4,6); |
---|
386 | mView.put( "month", month ); |
---|
387 | mView.put( "year", year ); |
---|
388 | mView.put( "station", station ); |
---|
389 | mView.put( "rep", rep ); |
---|
390 | |
---|
391 | return mView; |
---|
392 | |
---|
393 | } |
---|
394 | catch( ServiceException e ) |
---|
395 | { |
---|
396 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
397 | } |
---|
398 | } |
---|
399 | |
---|
400 | @ControllerMethod(view = VIEW_UMK) |
---|
401 | public Map<String, Object> selectUmk( @ParamName("dateinf") String dateinf, |
---|
402 | @ParamName("station") String station, |
---|
403 | @ParamName("instrument") final String instrument ) |
---|
404 | throws WebException |
---|
405 | { |
---|
406 | try |
---|
407 | { |
---|
408 | |
---|
409 | List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
410 | |
---|
411 | //dateinf="02021980"; |
---|
412 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
413 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
414 | String rep = ""; |
---|
415 | String year = dateinf.substring( 0, 4 ); |
---|
416 | String month = dateinf.substring( 4, 6 ); |
---|
417 | |
---|
418 | rep = "./resources/visu/ohp/umk"; |
---|
419 | station = "OHP"; |
---|
420 | if( year.compareTo( "1970" ) == 0 ) |
---|
421 | { |
---|
422 | year = "1983"; |
---|
423 | month = "09"; |
---|
424 | dateinf = year + month + "03"; |
---|
425 | } |
---|
426 | |
---|
427 | |
---|
428 | final Map<String, Object> mView = new HashMap<String, Object>(); |
---|
429 | //plotsList=null; |
---|
430 | mView.put( "plotsList", plotsList ); |
---|
431 | |
---|
432 | mView.put( "listeDates", listeDates ); |
---|
433 | mView.put( "firstDate", dateinf ); |
---|
434 | |
---|
435 | //String month = dateinf.substring(4,6); |
---|
436 | mView.put( "month", month ); |
---|
437 | mView.put( "year", year ); |
---|
438 | mView.put( "station", station ); |
---|
439 | mView.put( "rep", rep ); |
---|
440 | |
---|
441 | return mView; |
---|
442 | |
---|
443 | } |
---|
444 | catch( ServiceException e ) |
---|
445 | { |
---|
446 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
447 | } |
---|
448 | } |
---|
449 | |
---|
450 | @ControllerMethod(view = VIEW_LIDAR_TEMP) |
---|
451 | public Map<String, Object> selectLidarTemp( @ParamName("dateinf") String dateinf, |
---|
452 | @ParamName("station") String station, |
---|
453 | @ParamName("instrument") final String instrument ) |
---|
454 | throws WebException |
---|
455 | { |
---|
456 | try |
---|
457 | { |
---|
458 | |
---|
459 | List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
460 | |
---|
461 | //dateinf="02021980"; |
---|
462 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
463 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
464 | String rep = ""; |
---|
465 | String year = dateinf.substring( 0, 4 ); |
---|
466 | String month = dateinf.substring( 4, 6 ); |
---|
467 | |
---|
468 | if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) |
---|
469 | { |
---|
470 | rep = "./resources/visu/ohp/lidar/temp"; |
---|
471 | station = "OHP"; |
---|
472 | if( year.compareTo( "1970" ) == 0 ) |
---|
473 | { |
---|
474 | year = "2009"; |
---|
475 | month = "01"; |
---|
476 | } |
---|
477 | } |
---|
478 | |
---|
479 | if( station.compareTo( "REU" ) == 0 || station.compareTo( "reu" ) == 0 ) |
---|
480 | { |
---|
481 | rep = "./resources/visu/reu/lidar/temp"; |
---|
482 | station = "REU"; |
---|
483 | if( year.compareTo( "1970" ) == 0 ) |
---|
484 | { |
---|
485 | year = "1994"; |
---|
486 | month = "05"; |
---|
487 | } |
---|
488 | } |
---|
489 | |
---|
490 | final Map<String, Object> mView = new HashMap<String, Object>(); |
---|
491 | |
---|
492 | mView.put( "plotsList", plotsList ); |
---|
493 | |
---|
494 | mView.put( "listeDates", listeDates ); |
---|
495 | mView.put( "firstDate", dateinf ); |
---|
496 | |
---|
497 | |
---|
498 | mView.put( "month", month ); |
---|
499 | mView.put( "year", year ); |
---|
500 | mView.put( "station", station ); |
---|
501 | mView.put( "rep", rep ); |
---|
502 | |
---|
503 | return mView; |
---|
504 | |
---|
505 | } |
---|
506 | catch( ServiceException e ) |
---|
507 | { |
---|
508 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
509 | } |
---|
510 | } |
---|
511 | |
---|
512 | @ControllerMethod(view = VIEW_LIDAR_AEROSOLS) |
---|
513 | public Map<String, Object> selectLidarAerosols( @ParamName("dateinf") String dateinf, |
---|
514 | @ParamName("station") String station, |
---|
515 | @ParamName("instrument") final String instrument ) |
---|
516 | throws WebException |
---|
517 | { |
---|
518 | try |
---|
519 | { |
---|
520 | |
---|
521 | List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
522 | |
---|
523 | //dateinf="02021980"; |
---|
524 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
525 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
526 | String rep = ""; |
---|
527 | String year = dateinf.substring( 0, 4 ); |
---|
528 | String month = dateinf.substring( 4, 6 ); |
---|
529 | |
---|
530 | if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) |
---|
531 | { |
---|
532 | rep = "./resources/visu/ohp/lidar/aerosols"; |
---|
533 | station = "OHP"; |
---|
534 | if( year.compareTo( "1970" ) == 0 ) |
---|
535 | { |
---|
536 | year = "2009"; |
---|
537 | month = "01"; |
---|
538 | } |
---|
539 | } |
---|
540 | |
---|
541 | if( station.compareTo( "DDU" ) == 0 || station.compareTo( "ddu" ) == 0 ) |
---|
542 | { |
---|
543 | rep = "./resources/visu/ddu/lidar/aerosols"; |
---|
544 | station = "DDU"; |
---|
545 | if( year.compareTo( "1970" ) == 0 ) |
---|
546 | { |
---|
547 | year = "2010"; |
---|
548 | month = "01"; |
---|
549 | } |
---|
550 | } |
---|
551 | |
---|
552 | final Map<String, Object> mView = new HashMap<String, Object>(); |
---|
553 | //plotsList=null; |
---|
554 | mView.put( "plotsList", plotsList ); |
---|
555 | |
---|
556 | mView.put( "listeDates", listeDates ); |
---|
557 | mView.put( "firstDate", dateinf ); |
---|
558 | |
---|
559 | //String month = dateinf.substring(4,6); |
---|
560 | mView.put( "month", month ); |
---|
561 | mView.put( "year", year ); |
---|
562 | mView.put( "station", station ); |
---|
563 | mView.put( "rep", rep ); |
---|
564 | |
---|
565 | return mView; |
---|
566 | |
---|
567 | } |
---|
568 | catch( ServiceException e ) |
---|
569 | { |
---|
570 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
571 | } |
---|
572 | } |
---|
573 | |
---|
574 | @ControllerMethod(view =VIEW_SPECTRO_UV) |
---|
575 | public Map<String, Object> viewSpectroUV( @ParamName("dateinf") String dateinf, |
---|
576 | @ParamName("especes") String especes, |
---|
577 | @ParamName("instrument") final String instrument |
---|
578 | ) |
---|
579 | throws WebException |
---|
580 | { |
---|
581 | try |
---|
582 | { |
---|
583 | |
---|
584 | String m[]; |
---|
585 | m = new String[12]; |
---|
586 | String fname, iname, year; |
---|
587 | |
---|
588 | if( especes.equals( "nan" ) ) |
---|
589 | { |
---|
590 | especes = "uvauvb"; |
---|
591 | } |
---|
592 | |
---|
593 | if( dateinf.equals( "nan" ) ) |
---|
594 | { |
---|
595 | year = "2008"; |
---|
596 | dateinf = "2008"; |
---|
597 | |
---|
598 | } |
---|
599 | |
---|
600 | List<String> plotsList = _plotService.getPlotsByDateByInstrument( instrument, dateinf, "yyyy" ); |
---|
601 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
602 | |
---|
603 | final Map<String, Object> mView = new HashMap<String, Object>(); |
---|
604 | |
---|
605 | mView.put( "plotsList", plotsList ); |
---|
606 | |
---|
607 | mView.put( "listeDates", listeDates ); |
---|
608 | mView.put( "firstDate", dateinf ); |
---|
609 | mView.put( "especes", especes ); |
---|
610 | year = dateinf.substring( 0, 4 ); |
---|
611 | |
---|
612 | mView.put( "year", year ); |
---|
613 | mView.put( "m", m ); |
---|
614 | |
---|
615 | fname = "vasp_"; |
---|
616 | fname = fname.concat( especes ); |
---|
617 | fname = fname.concat( "_" ); |
---|
618 | fname = fname.concat( year ); |
---|
619 | |
---|
620 | iname = fname.concat( "01_plot1.jpg" ); |
---|
621 | if( plotsList.contains( iname ) ) m[0] = iname; |
---|
622 | else m[0] = "no"; |
---|
623 | |
---|
624 | iname = fname.concat( "02_plot1.jpg" ); |
---|
625 | if( plotsList.contains( iname ) ) m[1] = iname; |
---|
626 | else m[1] = "no"; |
---|
627 | |
---|
628 | iname = fname.concat( "03_plot1.jpg" ); |
---|
629 | if( plotsList.contains( iname ) ) m[2] = iname; |
---|
630 | else m[2] = "no"; |
---|
631 | |
---|
632 | iname = fname.concat( "04_plot1.jpg" ); |
---|
633 | if( plotsList.contains( iname ) ) m[3] = iname; |
---|
634 | else m[3] = "no"; |
---|
635 | |
---|
636 | iname = fname.concat( "05_plot1.jpg" ); |
---|
637 | if( plotsList.contains( iname ) ) m[4] = iname; |
---|
638 | else m[4] = "no"; |
---|
639 | |
---|
640 | iname = fname.concat( "06_plot1.jpg" ); |
---|
641 | if( plotsList.contains( iname ) ) m[5] = iname; |
---|
642 | else m[5] = "no"; |
---|
643 | |
---|
644 | iname = fname.concat( "07_plot1.jpg" ); |
---|
645 | if( plotsList.contains( iname ) ) m[6] = iname; |
---|
646 | else m[6] = "no"; |
---|
647 | |
---|
648 | iname = fname.concat( "08_plot1.jpg" ); |
---|
649 | if( plotsList.contains( iname ) ) m[7] = iname; |
---|
650 | else m[7] = "no"; |
---|
651 | |
---|
652 | iname = fname.concat( "09_plot1.jpg" ); |
---|
653 | if( plotsList.contains( iname ) ) m[8] = iname; |
---|
654 | else m[8] = "no"; |
---|
655 | |
---|
656 | iname = fname.concat( "10_plot1.jpg" ); |
---|
657 | if( plotsList.contains( iname ) ) m[9] = iname; |
---|
658 | else m[9] = "no"; |
---|
659 | |
---|
660 | iname = fname.concat( "11_plot1.jpg" ); |
---|
661 | if( plotsList.contains( iname ) ) m[10] = iname; |
---|
662 | else m[10] = "no"; |
---|
663 | |
---|
664 | iname = fname.concat( "12_plot1.jpg" ); |
---|
665 | if( plotsList.contains( iname ) ) m[11] = iname; |
---|
666 | else m[11] = "no"; |
---|
667 | |
---|
668 | return mView; |
---|
669 | |
---|
670 | } |
---|
671 | catch( ServiceException e ) |
---|
672 | { |
---|
673 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
674 | } |
---|
675 | } |
---|
676 | |
---|
677 | |
---|
678 | public ModelAndView viewInstruments( final HttpServletRequest request, final HttpServletResponse response ) |
---|
679 | throws WebException |
---|
680 | { |
---|
681 | try |
---|
682 | { |
---|
683 | final List<Instrument> instruments = _instrumentService.getAllInstruments(); |
---|
684 | |
---|
685 | final ModelAndView modelAndView = new ModelAndView( VIEW_INSTRUMENT ); |
---|
686 | modelAndView.addObject( "instruments", instruments ); |
---|
687 | return modelAndView; |
---|
688 | |
---|
689 | } |
---|
690 | catch( ServiceException e ) |
---|
691 | { |
---|
692 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
693 | } |
---|
694 | } |
---|
695 | |
---|
696 | public ModelAndView viewStation( final HttpServletRequest request, final HttpServletResponse response ) |
---|
697 | throws WebException |
---|
698 | { |
---|
699 | try |
---|
700 | { |
---|
701 | final Long stationId = Long.valueOf( request.getParameter( "stationId" ) ); |
---|
702 | final Station station = _stationService.getStationById( stationId ); |
---|
703 | |
---|
704 | final ModelAndView modelAndView = new ModelAndView( VIEW_STATION ); |
---|
705 | modelAndView.addObject( "station", station ); |
---|
706 | return modelAndView; |
---|
707 | |
---|
708 | } |
---|
709 | catch( ServiceException e ) |
---|
710 | { |
---|
711 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
712 | } |
---|
713 | } |
---|
714 | |
---|
715 | @Required |
---|
716 | public void setStationService( final StationService stationService ) |
---|
717 | { |
---|
718 | _stationService = stationService; |
---|
719 | } |
---|
720 | |
---|
721 | @Required |
---|
722 | public void setInstrumentService( final InstrumentService instrumentService ) |
---|
723 | { |
---|
724 | _instrumentService = instrumentService; |
---|
725 | } |
---|
726 | |
---|
727 | @Required |
---|
728 | public void setServiceTools( final ServiceTools serviceTools ) |
---|
729 | { |
---|
730 | _serviceTools = serviceTools; |
---|
731 | } |
---|
732 | |
---|
733 | @Required |
---|
734 | public void setPlotService( final PlotService plotService ) |
---|
735 | { |
---|
736 | _plotService = plotService; |
---|
737 | } |
---|
738 | |
---|
739 | private static final Log LOGGER = LogFactory.getLog( Controller.class ); |
---|
740 | |
---|
741 | private static final String VIEW_INIT = "init"; |
---|
742 | |
---|
743 | private static final String VIEW_INSTRUMENT = "instrument"; |
---|
744 | private static final String VIEW_STATION = "station"; |
---|
745 | private static final String VIEW_LIDAR_O3S = "visus_lidar_o3s"; |
---|
746 | private static final String VIEW_LIDAR_O3T = "visus_lidar_o3t"; |
---|
747 | private static final String VIEW_UMK = "visus_umk"; |
---|
748 | private static final String VIEW_ECC = "visus_ecc"; |
---|
749 | private static final String VIEW_SPECTRO_UV = "visus_spectro"; |
---|
750 | private static final String VIEW_LIDAR_TEMP = "visus_lidar_temp"; |
---|
751 | private static final String VIEW_LIDAR_AEROSOLS = "visus_lidar_aerosols"; |
---|
752 | private static final String VIEW_DATA_OHP = "data_ohp"; |
---|
753 | private static final String VIEW_ABOUT = "about"; |
---|
754 | private static final String VIEW_DATA_OPAR = "data_opar"; |
---|
755 | private static final String VIEW_DATA_DDU = "data_ddu"; |
---|
756 | private static final String VIEW_DATA_OMP = "data_lannemezan"; |
---|
757 | private static final String VIEW_DATA_VDA = "data_villeneuve"; |
---|
758 | private static final String VIEW_DATA_BRI = "data_briancon"; |
---|
759 | private static final String VIEW_DATA_SCO = "data_scorebysund"; |
---|
760 | private static final String VIEW_DATA_AND = "data_andoya"; |
---|
761 | private static final String VIEW_DATA_SOD = "data_sodankyla"; |
---|
762 | private static final String VIEW_DATA_ZHI = "data_zhigansk"; |
---|
763 | private static final String VIEW_DATA_SAL = "data_salekhard"; |
---|
764 | private static final String VIEW_DATA_BOR = "data_bordeaux"; |
---|
765 | private static final String VIEW_DATA_TAR = "data_tarawa"; |
---|
766 | private static final String VIEW_DATA_BAU = "data_bauru"; |
---|
767 | private static final String VIEW_DATA_KER = "data_kerguelen"; |
---|
768 | private static final String VIEW_DATA_RIO = "data_riogallegos"; |
---|
769 | private static final String VIEW_DATA_CON = "data_concordia"; |
---|
770 | private static final String VIEW_BIBLIO = "biblio"; |
---|
771 | private static final String VIEW_INTRA = "community"; |
---|
772 | |
---|
773 | |
---|
774 | //services que le controller peut utiliser |
---|
775 | private StationService _stationService; |
---|
776 | private InstrumentService _instrumentService; |
---|
777 | private ServiceTools _serviceTools; |
---|
778 | private PlotService _plotService; |
---|
779 | } |
---|