[113] | 1 | package com.ether; |
---|
| 2 | |
---|
[204] | 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; |
---|
[113] | 11 | |
---|
| 12 | import javax.servlet.http.HttpServletRequest; |
---|
| 13 | import javax.servlet.http.HttpServletResponse; |
---|
[204] | 14 | import java.util.HashMap; |
---|
| 15 | import java.util.List; |
---|
| 16 | import java.util.Map; |
---|
[113] | 17 | |
---|
| 18 | /** |
---|
| 19 | * @author vmipsl |
---|
[204] | 20 | * @date 17 feb 2011 |
---|
[113] | 21 | */ |
---|
[204] | 22 | public class Controller |
---|
| 23 | extends ControllerEther |
---|
[113] | 24 | { |
---|
[204] | 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 |
---|
[113] | 38 | { |
---|
[204] | 39 | return new HashMap<String, Object>(); |
---|
[113] | 40 | } |
---|
| 41 | |
---|
[204] | 42 | @ControllerMethod(view = VIEW_DATA_OHP) |
---|
| 43 | public Map<String, Object> viewDataOhp() |
---|
| 44 | throws WebException |
---|
[113] | 45 | { |
---|
[204] | 46 | return new HashMap<String, Object>(); |
---|
| 47 | } |
---|
[183] | 48 | |
---|
[364] | 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 | |
---|
[232] | 176 | @ControllerMethod(view = VIEW_ABOUT) |
---|
| 177 | public Map<String, Object> viewAbout() |
---|
| 178 | throws WebException |
---|
| 179 | { |
---|
| 180 | return new HashMap<String, Object>(); |
---|
| 181 | } |
---|
[183] | 182 | |
---|
[204] | 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 ); |
---|
[183] | 192 | |
---|
[204] | 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 ); |
---|
[183] | 198 | |
---|
[204] | 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 | } |
---|
[183] | 221 | |
---|
[204] | 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 | } |
---|
[183] | 238 | |
---|
[405] | 239 | @ControllerMethod(view = VIEW_ECC_RT) |
---|
| 240 | public Map<String, Object> selectEccRT( @ParamName("dateinf") final String dateinf, |
---|
| 241 | @ParamName("station") String station, |
---|
| 242 | @ParamName("instrument") final String instrument, |
---|
| 243 | @ParamName("type") final String type ) |
---|
| 244 | throws WebException |
---|
| 245 | { |
---|
| 246 | try |
---|
| 247 | { |
---|
| 248 | |
---|
| 249 | final List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStationByType( instrument, dateinf, "yyyyMMdd", station, type ); |
---|
| 250 | |
---|
| 251 | //dateinf="02021980"; |
---|
| 252 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
| 253 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
| 254 | String rep = ""; |
---|
| 255 | String year = dateinf.substring( 0, 4 ); |
---|
| 256 | |
---|
| 257 | if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) |
---|
| 258 | { |
---|
| 259 | rep = "./resources/visu/ohp/ecc"; |
---|
| 260 | station = "OHP"; |
---|
| 261 | if( year.compareTo( "1970" ) == 0 ) year = "2012"; |
---|
| 262 | } |
---|
| 263 | else if( station.compareTo( "LA REUNION" ) == 0 || station.compareTo( "reunion" ) == 0 ) |
---|
| 264 | { |
---|
| 265 | rep = "./resources/visu/reu/ecc"; |
---|
| 266 | //rep="./resources/visu/ohp/lidar/o3_strato"; |
---|
| 267 | station = "LA REUNION"; |
---|
| 268 | if( year.compareTo( "1970" ) == 0 ) year = "2006"; |
---|
| 269 | //year="2006"; |
---|
| 270 | } |
---|
| 271 | else if( station.compareTo( "DDU" ) == 0 || station.compareTo( "ddu" ) == 0 ) |
---|
| 272 | { |
---|
| 273 | rep = "./resources/visu/ddu/ecc"; |
---|
| 274 | //rep="./resources/visu/ohp/lidar/o3_strato"; |
---|
| 275 | station = "DDU"; |
---|
| 276 | if( year.compareTo( "1970" ) == 0 ) year = "1991"; |
---|
| 277 | //year="2006"; |
---|
| 278 | } |
---|
| 279 | |
---|
| 280 | final Map<String, Object> model = new HashMap<String, Object>(); |
---|
| 281 | model.put( "plotsList", plotsList ); |
---|
| 282 | model.put( "listeDates", listeDates ); |
---|
| 283 | model.put( "firstDate", dateinf ); |
---|
| 284 | final String month = dateinf.substring( 4, 6 ); |
---|
| 285 | model.put( "month", month ); |
---|
| 286 | model.put( "year", year ); |
---|
| 287 | model.put( "station", station ); |
---|
| 288 | model.put( "rep", rep ); |
---|
| 289 | return model; |
---|
| 290 | } |
---|
| 291 | catch( ServiceException e ) |
---|
| 292 | { |
---|
| 293 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
| 294 | } |
---|
| 295 | } |
---|
| 296 | |
---|
[204] | 297 | public ModelAndView viewLidarO3s( final HttpServletRequest request, final HttpServletResponse response ) |
---|
| 298 | throws WebException |
---|
| 299 | { |
---|
| 300 | try |
---|
| 301 | { |
---|
| 302 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
| 303 | |
---|
| 304 | final ModelAndView modelAndView = new ModelAndView( VIEW_LIDAR_O3S ); |
---|
| 305 | modelAndView.addObject( "listeDates", listeDates ); |
---|
| 306 | |
---|
| 307 | return modelAndView; |
---|
| 308 | |
---|
| 309 | } |
---|
| 310 | catch( ServiceException e ) |
---|
| 311 | { |
---|
| 312 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
| 313 | } |
---|
[183] | 314 | } |
---|
| 315 | |
---|
[364] | 316 | @ControllerMethod(view = VIEW_LIDAR_O3S) |
---|
| 317 | public Map<String, Object> selectLidarO3s( @ParamName("dateinf") final String dateinf, |
---|
| 318 | @ParamName("station") String station, |
---|
| 319 | @ParamName("instrument") final String instrument ) |
---|
[204] | 320 | throws WebException |
---|
[364] | 321 | |
---|
| 322 | /*public ModelAndView selectLidarO3s( final HttpServletRequest request, final HttpServletResponse response ) |
---|
| 323 | throws WebException*/ |
---|
[204] | 324 | { |
---|
| 325 | try |
---|
| 326 | { |
---|
[364] | 327 | /*String dateinf = request.getParameter( "dateinf" ); |
---|
[204] | 328 | String station = request.getParameter( "station" ); |
---|
[183] | 329 | |
---|
[364] | 330 | final String instrument = request.getParameter( "instrument" );*/ |
---|
[204] | 331 | |
---|
| 332 | List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
| 333 | |
---|
| 334 | //dateinf="02021980"; |
---|
| 335 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
| 336 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
| 337 | String rep = ""; |
---|
| 338 | String year = dateinf.substring( 0, 4 ); |
---|
| 339 | String month = dateinf.substring( 4, 6 ); |
---|
| 340 | |
---|
| 341 | if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) |
---|
| 342 | { |
---|
| 343 | rep = "./resources/visu/ohp/lidar/o3_strato"; |
---|
| 344 | station = "OHP"; |
---|
| 345 | if( year.compareTo( "1970" ) == 0 ) |
---|
| 346 | { |
---|
| 347 | |
---|
| 348 | year = "1991"; |
---|
| 349 | } |
---|
| 350 | } |
---|
| 351 | else if( station.compareTo( "REU" ) == 0 || station.compareTo( "reu" ) == 0 || station.compareTo( "LA REUNION" ) == 0 || station.compareTo( "REUNION" ) == 0 ) |
---|
| 352 | { |
---|
| 353 | rep = "./resources/visu/reu/lidar/o3_strato"; |
---|
| 354 | station = "LA REUNION"; |
---|
| 355 | if( year.compareTo( "1970" ) == 0 ) year = "2006"; |
---|
| 356 | //year="2006"; |
---|
| 357 | } |
---|
| 358 | |
---|
| 359 | else |
---|
| 360 | { |
---|
| 361 | rep = "./resources/visu/ddu/lidar/o3_strato"; |
---|
[364] | 362 | station = "DDUModelAndView"; |
---|
[204] | 363 | if( year.compareTo( "1970" ) == 0 ) |
---|
| 364 | { |
---|
| 365 | year = "1991"; |
---|
| 366 | //month="04"; |
---|
| 367 | } |
---|
| 368 | //year="2006"; |
---|
| 369 | } |
---|
| 370 | |
---|
[364] | 371 | final Map<String, Object> modelAndView = new HashMap<String, Object>(); |
---|
[204] | 372 | //plotsList=null; |
---|
[364] | 373 | modelAndView.put( "plotsList", plotsList ); |
---|
[204] | 374 | |
---|
[364] | 375 | modelAndView.put( "listeDates", listeDates ); |
---|
| 376 | modelAndView.put( "firstDate", dateinf ); |
---|
[204] | 377 | |
---|
| 378 | |
---|
[364] | 379 | modelAndView.put( "month", month ); |
---|
| 380 | modelAndView.put( "year", year ); |
---|
| 381 | modelAndView.put( "station", station ); |
---|
| 382 | modelAndView.put( "rep", rep ); |
---|
[204] | 383 | |
---|
| 384 | return modelAndView; |
---|
| 385 | |
---|
| 386 | } |
---|
| 387 | catch( ServiceException e ) |
---|
| 388 | { |
---|
| 389 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
| 390 | } |
---|
| 391 | } |
---|
| 392 | |
---|
[364] | 393 | @ControllerMethod(view = VIEW_LIDAR_O3T) |
---|
| 394 | public Map<String, Object> selectLidarO3t( @ParamName("dateinf") String dateinf, |
---|
| 395 | @ParamName("station") String station, |
---|
| 396 | @ParamName("instrument") final String instrument ) |
---|
[204] | 397 | throws WebException |
---|
[183] | 398 | { |
---|
[204] | 399 | try |
---|
| 400 | { |
---|
[113] | 401 | |
---|
[204] | 402 | List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
| 403 | |
---|
| 404 | //dateinf="02021980"; |
---|
| 405 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
| 406 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
| 407 | String rep = ""; |
---|
| 408 | String year = dateinf.substring( 0, 4 ); |
---|
| 409 | String month = dateinf.substring( 4, 6 ); |
---|
| 410 | |
---|
| 411 | if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) |
---|
| 412 | { |
---|
| 413 | rep = "./resources/visu/ohp/lidar/o3_tropo"; |
---|
| 414 | station = "OHP"; |
---|
| 415 | if( year.compareTo( "1970" ) == 0 ) |
---|
| 416 | { |
---|
| 417 | year = "2007"; |
---|
| 418 | month = "05"; |
---|
| 419 | dateinf = year + month + "01"; |
---|
| 420 | } |
---|
| 421 | } |
---|
| 422 | //else if (station.compareTo("reunion")==0) { |
---|
| 423 | else |
---|
| 424 | { |
---|
| 425 | rep = "./resources/visu/reu/lidar/o3_tropo"; |
---|
| 426 | //rep="./resources/visu/ohp/lidar/o3_strato"; |
---|
| 427 | station = "LA REUNION"; |
---|
| 428 | if( year.compareTo( "1970" ) == 0 ) |
---|
| 429 | { |
---|
| 430 | year = "2006"; |
---|
| 431 | |
---|
| 432 | } |
---|
| 433 | //year="2006"; |
---|
| 434 | } |
---|
| 435 | |
---|
[364] | 436 | final Map<String, Object> mView = new HashMap<String, Object>(); |
---|
| 437 | //plotsList=null; |
---|
| 438 | mView.put( "plotsList", plotsList ); |
---|
[204] | 439 | |
---|
[364] | 440 | mView.put( "listeDates", listeDates ); |
---|
| 441 | mView.put( "firstDate", dateinf ); |
---|
| 442 | |
---|
| 443 | //String month = dateinf.substring(4,6); |
---|
| 444 | mView.put( "month", month ); |
---|
| 445 | mView.put( "year", year ); |
---|
| 446 | mView.put( "station", station ); |
---|
| 447 | mView.put( "rep", rep ); |
---|
| 448 | |
---|
| 449 | return mView; |
---|
| 450 | |
---|
| 451 | } |
---|
| 452 | catch( ServiceException e ) |
---|
| 453 | { |
---|
| 454 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
| 455 | } |
---|
| 456 | } |
---|
| 457 | |
---|
| 458 | @ControllerMethod(view = VIEW_UMK) |
---|
| 459 | public Map<String, Object> selectUmk( @ParamName("dateinf") String dateinf, |
---|
| 460 | @ParamName("station") String station, |
---|
| 461 | @ParamName("instrument") final String instrument ) |
---|
| 462 | throws WebException |
---|
| 463 | { |
---|
| 464 | try |
---|
| 465 | { |
---|
| 466 | |
---|
| 467 | List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
| 468 | |
---|
| 469 | //dateinf="02021980"; |
---|
| 470 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
| 471 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
| 472 | String rep = ""; |
---|
| 473 | String year = dateinf.substring( 0, 4 ); |
---|
| 474 | String month = dateinf.substring( 4, 6 ); |
---|
| 475 | |
---|
| 476 | rep = "./resources/visu/ohp/umk"; |
---|
| 477 | station = "OHP"; |
---|
| 478 | if( year.compareTo( "1970" ) == 0 ) |
---|
| 479 | { |
---|
| 480 | year = "1983"; |
---|
| 481 | month = "09"; |
---|
| 482 | dateinf = year + month + "03"; |
---|
| 483 | } |
---|
| 484 | |
---|
| 485 | |
---|
| 486 | final Map<String, Object> mView = new HashMap<String, Object>(); |
---|
[204] | 487 | //plotsList=null; |
---|
[364] | 488 | mView.put( "plotsList", plotsList ); |
---|
[204] | 489 | |
---|
[364] | 490 | mView.put( "listeDates", listeDates ); |
---|
| 491 | mView.put( "firstDate", dateinf ); |
---|
[204] | 492 | |
---|
| 493 | //String month = dateinf.substring(4,6); |
---|
[364] | 494 | mView.put( "month", month ); |
---|
| 495 | mView.put( "year", year ); |
---|
| 496 | mView.put( "station", station ); |
---|
| 497 | mView.put( "rep", rep ); |
---|
[204] | 498 | |
---|
[364] | 499 | return mView; |
---|
[204] | 500 | |
---|
| 501 | } |
---|
| 502 | catch( ServiceException e ) |
---|
| 503 | { |
---|
| 504 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
| 505 | } |
---|
[113] | 506 | } |
---|
| 507 | |
---|
[364] | 508 | @ControllerMethod(view = VIEW_LIDAR_TEMP) |
---|
| 509 | public Map<String, Object> selectLidarTemp( @ParamName("dateinf") String dateinf, |
---|
| 510 | @ParamName("station") String station, |
---|
| 511 | @ParamName("instrument") final String instrument ) |
---|
[204] | 512 | throws WebException |
---|
| 513 | { |
---|
| 514 | try |
---|
| 515 | { |
---|
[113] | 516 | |
---|
[204] | 517 | List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
| 518 | |
---|
| 519 | //dateinf="02021980"; |
---|
| 520 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
| 521 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
| 522 | String rep = ""; |
---|
| 523 | String year = dateinf.substring( 0, 4 ); |
---|
| 524 | String month = dateinf.substring( 4, 6 ); |
---|
| 525 | |
---|
| 526 | if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) |
---|
| 527 | { |
---|
| 528 | rep = "./resources/visu/ohp/lidar/temp"; |
---|
| 529 | station = "OHP"; |
---|
| 530 | if( year.compareTo( "1970" ) == 0 ) |
---|
| 531 | { |
---|
| 532 | year = "2009"; |
---|
| 533 | month = "01"; |
---|
| 534 | } |
---|
| 535 | } |
---|
| 536 | |
---|
| 537 | if( station.compareTo( "REU" ) == 0 || station.compareTo( "reu" ) == 0 ) |
---|
| 538 | { |
---|
| 539 | rep = "./resources/visu/reu/lidar/temp"; |
---|
| 540 | station = "REU"; |
---|
| 541 | if( year.compareTo( "1970" ) == 0 ) |
---|
| 542 | { |
---|
| 543 | year = "1994"; |
---|
| 544 | month = "05"; |
---|
| 545 | } |
---|
| 546 | } |
---|
| 547 | |
---|
[364] | 548 | final Map<String, Object> mView = new HashMap<String, Object>(); |
---|
[204] | 549 | |
---|
[364] | 550 | mView.put( "plotsList", plotsList ); |
---|
[204] | 551 | |
---|
[364] | 552 | mView.put( "listeDates", listeDates ); |
---|
| 553 | mView.put( "firstDate", dateinf ); |
---|
[204] | 554 | |
---|
| 555 | |
---|
[364] | 556 | mView.put( "month", month ); |
---|
| 557 | mView.put( "year", year ); |
---|
| 558 | mView.put( "station", station ); |
---|
| 559 | mView.put( "rep", rep ); |
---|
| 560 | |
---|
| 561 | return mView; |
---|
| 562 | |
---|
[204] | 563 | } |
---|
| 564 | catch( ServiceException e ) |
---|
| 565 | { |
---|
| 566 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
| 567 | } |
---|
| 568 | } |
---|
| 569 | |
---|
[364] | 570 | @ControllerMethod(view = VIEW_LIDAR_AEROSOLS) |
---|
| 571 | public Map<String, Object> selectLidarAerosols( @ParamName("dateinf") String dateinf, |
---|
| 572 | @ParamName("station") String station, |
---|
| 573 | @ParamName("instrument") final String instrument ) |
---|
[204] | 574 | throws WebException |
---|
[113] | 575 | { |
---|
[204] | 576 | try |
---|
| 577 | { |
---|
[113] | 578 | |
---|
[204] | 579 | List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); |
---|
| 580 | |
---|
| 581 | //dateinf="02021980"; |
---|
| 582 | //List<String> ListDates = _plotService.getLastDate(instrument); |
---|
| 583 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
| 584 | String rep = ""; |
---|
| 585 | String year = dateinf.substring( 0, 4 ); |
---|
| 586 | String month = dateinf.substring( 4, 6 ); |
---|
| 587 | |
---|
| 588 | if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) |
---|
| 589 | { |
---|
| 590 | rep = "./resources/visu/ohp/lidar/aerosols"; |
---|
| 591 | station = "OHP"; |
---|
| 592 | if( year.compareTo( "1970" ) == 0 ) |
---|
| 593 | { |
---|
| 594 | year = "2009"; |
---|
| 595 | month = "01"; |
---|
| 596 | } |
---|
| 597 | } |
---|
| 598 | |
---|
| 599 | if( station.compareTo( "DDU" ) == 0 || station.compareTo( "ddu" ) == 0 ) |
---|
| 600 | { |
---|
| 601 | rep = "./resources/visu/ddu/lidar/aerosols"; |
---|
| 602 | station = "DDU"; |
---|
| 603 | if( year.compareTo( "1970" ) == 0 ) |
---|
| 604 | { |
---|
| 605 | year = "2010"; |
---|
[405] | 606 | month = "11"; |
---|
[204] | 607 | } |
---|
| 608 | } |
---|
| 609 | |
---|
[364] | 610 | final Map<String, Object> mView = new HashMap<String, Object>(); |
---|
[204] | 611 | //plotsList=null; |
---|
[364] | 612 | mView.put( "plotsList", plotsList ); |
---|
[204] | 613 | |
---|
[364] | 614 | mView.put( "listeDates", listeDates ); |
---|
| 615 | mView.put( "firstDate", dateinf ); |
---|
[204] | 616 | |
---|
| 617 | //String month = dateinf.substring(4,6); |
---|
[364] | 618 | mView.put( "month", month ); |
---|
| 619 | mView.put( "year", year ); |
---|
| 620 | mView.put( "station", station ); |
---|
| 621 | mView.put( "rep", rep ); |
---|
[204] | 622 | |
---|
[364] | 623 | return mView; |
---|
[204] | 624 | |
---|
| 625 | } |
---|
| 626 | catch( ServiceException e ) |
---|
| 627 | { |
---|
| 628 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
| 629 | } |
---|
[113] | 630 | } |
---|
| 631 | |
---|
[364] | 632 | @ControllerMethod(view =VIEW_SPECTRO_UV) |
---|
| 633 | public Map<String, Object> viewSpectroUV( @ParamName("dateinf") String dateinf, |
---|
| 634 | @ParamName("especes") String especes, |
---|
| 635 | @ParamName("instrument") final String instrument |
---|
| 636 | ) |
---|
[204] | 637 | throws WebException |
---|
| 638 | { |
---|
| 639 | try |
---|
| 640 | { |
---|
[113] | 641 | |
---|
[204] | 642 | String m[]; |
---|
| 643 | m = new String[12]; |
---|
| 644 | String fname, iname, year; |
---|
[113] | 645 | |
---|
[204] | 646 | if( especes.equals( "nan" ) ) |
---|
| 647 | { |
---|
| 648 | especes = "uvauvb"; |
---|
| 649 | } |
---|
[113] | 650 | |
---|
[204] | 651 | if( dateinf.equals( "nan" ) ) |
---|
| 652 | { |
---|
| 653 | year = "2008"; |
---|
| 654 | dateinf = "2008"; |
---|
[113] | 655 | |
---|
[204] | 656 | } |
---|
[113] | 657 | |
---|
[204] | 658 | List<String> plotsList = _plotService.getPlotsByDateByInstrument( instrument, dateinf, "yyyy" ); |
---|
| 659 | final List<String> listeDates = _serviceTools.getListeDates(); |
---|
[113] | 660 | |
---|
[364] | 661 | final Map<String, Object> mView = new HashMap<String, Object>(); |
---|
[113] | 662 | |
---|
[364] | 663 | mView.put( "plotsList", plotsList ); |
---|
| 664 | |
---|
| 665 | mView.put( "listeDates", listeDates ); |
---|
| 666 | mView.put( "firstDate", dateinf ); |
---|
| 667 | mView.put( "especes", especes ); |
---|
[204] | 668 | year = dateinf.substring( 0, 4 ); |
---|
[113] | 669 | |
---|
[364] | 670 | mView.put( "year", year ); |
---|
| 671 | mView.put( "m", m ); |
---|
[113] | 672 | |
---|
[204] | 673 | fname = "vasp_"; |
---|
| 674 | fname = fname.concat( especes ); |
---|
| 675 | fname = fname.concat( "_" ); |
---|
| 676 | fname = fname.concat( year ); |
---|
[113] | 677 | |
---|
[204] | 678 | iname = fname.concat( "01_plot1.jpg" ); |
---|
| 679 | if( plotsList.contains( iname ) ) m[0] = iname; |
---|
| 680 | else m[0] = "no"; |
---|
[113] | 681 | |
---|
[204] | 682 | iname = fname.concat( "02_plot1.jpg" ); |
---|
| 683 | if( plotsList.contains( iname ) ) m[1] = iname; |
---|
| 684 | else m[1] = "no"; |
---|
[113] | 685 | |
---|
[204] | 686 | iname = fname.concat( "03_plot1.jpg" ); |
---|
| 687 | if( plotsList.contains( iname ) ) m[2] = iname; |
---|
| 688 | else m[2] = "no"; |
---|
[113] | 689 | |
---|
[204] | 690 | iname = fname.concat( "04_plot1.jpg" ); |
---|
| 691 | if( plotsList.contains( iname ) ) m[3] = iname; |
---|
| 692 | else m[3] = "no"; |
---|
[113] | 693 | |
---|
[204] | 694 | iname = fname.concat( "05_plot1.jpg" ); |
---|
| 695 | if( plotsList.contains( iname ) ) m[4] = iname; |
---|
| 696 | else m[4] = "no"; |
---|
[113] | 697 | |
---|
[204] | 698 | iname = fname.concat( "06_plot1.jpg" ); |
---|
| 699 | if( plotsList.contains( iname ) ) m[5] = iname; |
---|
| 700 | else m[5] = "no"; |
---|
[113] | 701 | |
---|
[204] | 702 | iname = fname.concat( "07_plot1.jpg" ); |
---|
| 703 | if( plotsList.contains( iname ) ) m[6] = iname; |
---|
| 704 | else m[6] = "no"; |
---|
| 705 | |
---|
| 706 | iname = fname.concat( "08_plot1.jpg" ); |
---|
| 707 | if( plotsList.contains( iname ) ) m[7] = iname; |
---|
| 708 | else m[7] = "no"; |
---|
| 709 | |
---|
| 710 | iname = fname.concat( "09_plot1.jpg" ); |
---|
| 711 | if( plotsList.contains( iname ) ) m[8] = iname; |
---|
| 712 | else m[8] = "no"; |
---|
| 713 | |
---|
| 714 | iname = fname.concat( "10_plot1.jpg" ); |
---|
| 715 | if( plotsList.contains( iname ) ) m[9] = iname; |
---|
| 716 | else m[9] = "no"; |
---|
| 717 | |
---|
| 718 | iname = fname.concat( "11_plot1.jpg" ); |
---|
| 719 | if( plotsList.contains( iname ) ) m[10] = iname; |
---|
| 720 | else m[10] = "no"; |
---|
| 721 | |
---|
| 722 | iname = fname.concat( "12_plot1.jpg" ); |
---|
| 723 | if( plotsList.contains( iname ) ) m[11] = iname; |
---|
| 724 | else m[11] = "no"; |
---|
| 725 | |
---|
[364] | 726 | return mView; |
---|
[204] | 727 | |
---|
| 728 | } |
---|
| 729 | catch( ServiceException e ) |
---|
| 730 | { |
---|
| 731 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
| 732 | } |
---|
| 733 | } |
---|
| 734 | |
---|
| 735 | |
---|
| 736 | public ModelAndView viewInstruments( final HttpServletRequest request, final HttpServletResponse response ) |
---|
| 737 | throws WebException |
---|
[113] | 738 | { |
---|
[204] | 739 | try |
---|
| 740 | { |
---|
| 741 | final List<Instrument> instruments = _instrumentService.getAllInstruments(); |
---|
[113] | 742 | |
---|
[204] | 743 | final ModelAndView modelAndView = new ModelAndView( VIEW_INSTRUMENT ); |
---|
| 744 | modelAndView.addObject( "instruments", instruments ); |
---|
| 745 | return modelAndView; |
---|
[113] | 746 | |
---|
[204] | 747 | } |
---|
| 748 | catch( ServiceException e ) |
---|
| 749 | { |
---|
| 750 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
| 751 | } |
---|
[113] | 752 | } |
---|
| 753 | |
---|
[204] | 754 | public ModelAndView viewStation( final HttpServletRequest request, final HttpServletResponse response ) |
---|
| 755 | throws WebException |
---|
[113] | 756 | { |
---|
[204] | 757 | try |
---|
| 758 | { |
---|
| 759 | final Long stationId = Long.valueOf( request.getParameter( "stationId" ) ); |
---|
| 760 | final Station station = _stationService.getStationById( stationId ); |
---|
[113] | 761 | |
---|
[204] | 762 | final ModelAndView modelAndView = new ModelAndView( VIEW_STATION ); |
---|
| 763 | modelAndView.addObject( "station", station ); |
---|
| 764 | return modelAndView; |
---|
[113] | 765 | |
---|
[204] | 766 | } |
---|
| 767 | catch( ServiceException e ) |
---|
| 768 | { |
---|
| 769 | throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); |
---|
| 770 | } |
---|
[113] | 771 | } |
---|
| 772 | |
---|
[204] | 773 | @Required |
---|
| 774 | public void setStationService( final StationService stationService ) |
---|
[113] | 775 | { |
---|
[204] | 776 | _stationService = stationService; |
---|
[113] | 777 | } |
---|
| 778 | |
---|
[204] | 779 | @Required |
---|
| 780 | public void setInstrumentService( final InstrumentService instrumentService ) |
---|
[113] | 781 | { |
---|
[204] | 782 | _instrumentService = instrumentService; |
---|
[113] | 783 | } |
---|
[204] | 784 | |
---|
| 785 | @Required |
---|
| 786 | public void setServiceTools( final ServiceTools serviceTools ) |
---|
[113] | 787 | { |
---|
[204] | 788 | _serviceTools = serviceTools; |
---|
[113] | 789 | } |
---|
[204] | 790 | |
---|
| 791 | @Required |
---|
| 792 | public void setPlotService( final PlotService plotService ) |
---|
[113] | 793 | { |
---|
[204] | 794 | _plotService = plotService; |
---|
[113] | 795 | } |
---|
| 796 | |
---|
[204] | 797 | private static final Log LOGGER = LogFactory.getLog( Controller.class ); |
---|
| 798 | |
---|
| 799 | private static final String VIEW_INIT = "init"; |
---|
| 800 | |
---|
[113] | 801 | private static final String VIEW_INSTRUMENT = "instrument"; |
---|
| 802 | private static final String VIEW_STATION = "station"; |
---|
| 803 | private static final String VIEW_LIDAR_O3S = "visus_lidar_o3s"; |
---|
| 804 | private static final String VIEW_LIDAR_O3T = "visus_lidar_o3t"; |
---|
[364] | 805 | private static final String VIEW_UMK = "visus_umk"; |
---|
[113] | 806 | private static final String VIEW_ECC = "visus_ecc"; |
---|
[405] | 807 | private static final String VIEW_ECC_RT = "visus_ecc_realtime"; |
---|
[113] | 808 | private static final String VIEW_SPECTRO_UV = "visus_spectro"; |
---|
| 809 | private static final String VIEW_LIDAR_TEMP = "visus_lidar_temp"; |
---|
| 810 | private static final String VIEW_LIDAR_AEROSOLS = "visus_lidar_aerosols"; |
---|
[204] | 811 | private static final String VIEW_DATA_OHP = "data_ohp"; |
---|
[232] | 812 | private static final String VIEW_ABOUT = "about"; |
---|
[364] | 813 | private static final String VIEW_DATA_OPAR = "data_opar"; |
---|
| 814 | private static final String VIEW_DATA_DDU = "data_ddu"; |
---|
| 815 | private static final String VIEW_DATA_OMP = "data_lannemezan"; |
---|
| 816 | private static final String VIEW_DATA_VDA = "data_villeneuve"; |
---|
| 817 | private static final String VIEW_DATA_BRI = "data_briancon"; |
---|
| 818 | private static final String VIEW_DATA_SCO = "data_scorebysund"; |
---|
| 819 | private static final String VIEW_DATA_AND = "data_andoya"; |
---|
| 820 | private static final String VIEW_DATA_SOD = "data_sodankyla"; |
---|
| 821 | private static final String VIEW_DATA_ZHI = "data_zhigansk"; |
---|
| 822 | private static final String VIEW_DATA_SAL = "data_salekhard"; |
---|
| 823 | private static final String VIEW_DATA_BOR = "data_bordeaux"; |
---|
| 824 | private static final String VIEW_DATA_TAR = "data_tarawa"; |
---|
| 825 | private static final String VIEW_DATA_BAU = "data_bauru"; |
---|
| 826 | private static final String VIEW_DATA_KER = "data_kerguelen"; |
---|
| 827 | private static final String VIEW_DATA_RIO = "data_riogallegos"; |
---|
| 828 | private static final String VIEW_DATA_CON = "data_concordia"; |
---|
| 829 | private static final String VIEW_BIBLIO = "biblio"; |
---|
| 830 | private static final String VIEW_INTRA = "community"; |
---|
[113] | 831 | |
---|
[364] | 832 | |
---|
[113] | 833 | //services que le controller peut utiliser |
---|
| 834 | private StationService _stationService; |
---|
| 835 | private InstrumentService _instrumentService; |
---|
| 836 | private ServiceTools _serviceTools; |
---|
| 837 | private PlotService _plotService; |
---|
| 838 | } |
---|