Changeset 204 for ether_ndacc


Ignore:
Timestamp:
09/21/11 16:12:07 (13 years ago)
Author:
vmipsl
Message:

[Internationalisation]

Location:
ether_ndacc/trunk
Files:
8 added
7 edited

Legend:

Unmodified
Added
Removed
  • ether_ndacc/trunk/web/WEB-INF/servlet-context.xml

    r183 r204  
    1 <?xml version="1.0" encoding="UTF-8"?> 
     1<?com.medias.xml version="1.0" encoding="UTF-8"?> 
    22<beans xmlns="http://www.springframework.org/schema/beans" 
    3         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" 
    4         xsi:schemaLocation=" 
     3       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" 
     4       xsi:schemaLocation=" 
    55       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
    66       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> 
    77 
    8         <!-- i18n --> 
     8    <!-- i18n --> 
    99    <!--<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/>--> 
    1010    <bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver"> 
    11         <property name="defaultLocale" value="fr"/> 
     11        <property name="defaultLocale" value="en"/> 
    1212    </bean> 
    1313 
     
    2929 
    3030    <!-- Mappings --> 
    31         <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 
    32                 <property name="mappings"> 
    33                         <props> 
    34                                 <prop key="/station">etherController</prop> 
    35                                 <prop key="/instrument">etherController</prop> 
    36                         </props> 
    37                 </property> 
    38         </bean> 
     31    <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 
     32        <property name="interceptors"> 
     33            <list> 
     34                <ref bean="localeChangeInterceptor"/> 
     35            </list> 
     36        </property> 
    3937 
    40         <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
    41                 <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> 
    42                 <property name="prefix" value="/" /> 
    43                 <property name="suffix" value=".jsp" /> 
    44         </bean> 
     38        <property name="mappings"> 
     39            <props> 
     40                <prop key="/station">controller</prop> 
     41                <prop key="/instrument">controller</prop> 
     42            </props> 
     43        </property> 
     44    </bean> 
    4545 
    46         <bean id="myMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver"> 
    47                 <property name="defaultMethodName" value="home"/> 
    48                 <property name="paramName" value="methodName"/> 
    49         </bean> 
     46    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
     47        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> 
     48        <property name="prefix" value="/"/> 
     49        <property name="suffix" value=".jsp"/> 
     50    </bean> 
    5051 
    51         <bean id="etherController" class="com.ether.Controller"> 
    52                 <property name="methodNameResolver" ref="myMethodNameResolver" /> 
    53                 <property name="stationService" ref="stationService" /> 
    54                 <property name="instrumentService" ref="instrumentService" /> 
    55                 <property name="serviceTools" ref="serviceTools" /> 
    56                 <property name="plotService" ref="plotService" /> 
    57         </bean> 
     52    <bean id="myMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver"> 
     53        <property name="defaultMethodName" value="home"/> 
     54        <property name="paramName" value="methodName"/> 
     55    </bean> 
     56 
     57    <bean id="controllerEther" class="com.ether.ControllerEther"> 
     58        <property name="methodNameResolver" ref="myMethodNameResolver"/> 
     59    </bean> 
     60 
     61    <bean id="controller" class="com.ether.Controller" parent="controllerEther"> 
     62        <property name="stationService" ref="stationService"/> 
     63        <property name="instrumentService" ref="instrumentService"/> 
     64        <property name="serviceTools" ref="serviceTools"/> 
     65        <property name="plotService" ref="plotService"/> 
     66    </bean> 
    5867 
    5968</beans> 
  • ether_ndacc/trunk/web/WEB-INF/web.xml

    r183 r204  
    1 <?xml version="1.0" encoding="UTF-8"?> 
    2 <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> 
     1<?com.medias.xml version="1.0" encoding="UTF-8"?> 
     2<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
     3        "http://java.sun.com/dtd/web-app_2_3.dtd"> 
    34<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" 
    4         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    5         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 
     5         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     6         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 
     7 
     8    <display-name>NDACC</display-name> 
     9 
     10    <welcome-file-list>   
     11        <welcome-file>index.jsp</welcome-file>   
     12    </welcome-file-list> 
     13       
     14    <context-param> 
     15        <param-name>contextConfigLocation</param-name> 
     16        <param-value> 
     17            /WEB-INF/classes/dao-context.xml, 
     18            /WEB-INF/classes/service-context.xml, 
     19            /WEB-INF/classes/hibernate.cfg.xml 
     20        </param-value> 
     21    </context-param> 
     22 
     23    <listener> 
     24        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
     25    </listener> 
     26 
     27    <!-- TAGLIBS --> 
     28    <!--<taglib>--> 
     29    <!--<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>--> 
     30    <!--<taglib-location>/WEB-INF/tags/htmlJsp.tag</taglib-location>--> 
     31    <!--</taglib>--> 
     32 
     33    <!--<taglib>--> 
     34    <!--<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>--> 
     35    <!--<taglib-location>/WEB-INF/tags/htmlResourceJsp.tag</taglib-location>--> 
     36    <!--</taglib>--> 
     37 
     38    <!--<taglib>--> 
     39    <!--<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>--> 
     40    <!--<taglib-location>/WEB-INF/tags/htmlCss.tag</taglib-location>--> 
     41    <!--</taglib>--> 
     42 
     43    <!--<taglib>--> 
     44    <!--<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>--> 
     45    <!--<taglib-location>/WEB-INF/tags/htmlJs.tag</taglib-location>--> 
     46    <!--</taglib>--> 
     47 
     48    <!--SERVLETS --> 
     49    <servlet> 
     50        <servlet-name>instrument</servlet-name> 
     51        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
     52        <init-param> 
     53            <param-name>contextConfigLocation</param-name> 
     54            <param-value> 
     55                /WEB-INF/servlet-context.xml 
     56            </param-value> 
     57        </init-param> 
     58    </servlet> 
     59 
     60    <servlet-mapping> 
     61        <servlet-name>instrument</servlet-name> 
     62        <url-pattern>/instrument</url-pattern> 
     63    </servlet-mapping> 
    664 
    765 
     66    <servlet> 
     67        <servlet-name>station</servlet-name> 
     68        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
     69        <init-param> 
     70            <param-name>contextConfigLocation</param-name> 
     71            <param-value> 
     72                /WEB-INF/servlet-context.xml 
     73            </param-value> 
     74        </init-param> 
     75    </servlet> 
    876 
    9         <display-name>NDACC</display-name> 
     77    <servlet-mapping> 
     78        <servlet-name>station</servlet-name> 
     79        <url-pattern>/station</url-pattern> 
     80    </servlet-mapping> 
    1081 
    11         <context-param> 
    12                 <param-name>contextConfigLocation</param-name> 
    13                 <param-value> 
    14                         classpath:dao-context.xml, 
    15                         classpath:service-context.xml, 
    16                         classpath:hibernate.cfg.xml 
    17                 </param-value> 
    18         </context-param> 
    19  
    20         <listener> 
    21                 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
    22         </listener> 
    23  
    24  
    25     <!--SERVLETS --> 
    26         <servlet> 
    27             <servlet-name>instrument</servlet-name> 
    28             <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    29             <init-param> 
    30                 <param-name>contextConfigLocation</param-name> 
    31                 <param-value> 
    32                     /WEB-INF/servlet-context.xml 
    33                 </param-value> 
    34             </init-param> 
    35         </servlet> 
    36  
    37  
    38         <servlet-mapping> 
    39                 <servlet-name>instrument</servlet-name> 
    40                 <url-pattern>/instrument</url-pattern> 
    41         </servlet-mapping> 
    42  
    43         <servlet> 
    44                 <servlet-name>station</servlet-name> 
    45                 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    46                 <init-param> 
    47                         <param-name>contextConfigLocation</param-name> 
    48                         <param-value> 
    49                                 /WEB-INF/servlet-context.xml 
    50             </param-value> 
    51                 </init-param> 
    52         </servlet> 
    53  
    54         <servlet-mapping> 
    55                 <servlet-name>station</servlet-name> 
    56                 <url-pattern>/station</url-pattern> 
    57         </servlet-mapping> 
     82    <session-config> 
     83        <session-timeout>60</session-timeout> 
     84        <!-- minute --> 
     85    </session-config> 
    5886 
    5987</web-app> 
  • ether_ndacc/trunk/web/data_ohp.jsp

    r202 r204  
    101101<tr> 
    102102<td class="blanc1" rowspan=2 width="15%">INSTRUMENT</td> 
    103 <td class="blanc1" rowspan=2 width="15%"><spring:message code="mesure" htmlEscape="true"></td> 
     103<td class="blanc1" rowspan=2 width="15%"><spring:message code="mesure" htmlEscape="true"/></td> 
    104104 
    105105<td class="blanc1" rowspan=2 width="15%">PI</td> 
     
    226226<br><i>pattern files : oh[yy][mm][dd].b*</i></td> 
    227227 
    228 <td class="orange" nowrap align=center> 
     228<td class="orange" nowrap align=center> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
    229229<a href="" title="Results" onclick="OuvrirFeuilleDynW ('instrument?methodName=selectEcc&instrument=ECC&dateinf=19700101&station=OHP#','700','650')"> 
    230230<img border=1 src="resources/images/results.jpg" width="60px"></img> 
  • ether_ndacc/trunk/web/index.jsp

    r202 r204  
    1 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 
    2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
    3 <html><head> 
    4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    5 <link rel="stylesheet" type="text/css" href="resources/css/ndacc.css"> 
    6 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
    7 <META NAME="keywords" CONTENT="NDACC, NDACC FRANCE"> 
    8  
    9  
    10 <link rel="stylesheet" type="text/css" href="resources/css/etherTypo.css" /> 
    11 <title>NDACC-France / Home</title> 
    12 <meta name="generator" content="TYPO3 4.1 CMS" /> 
    13  
    14 </head> 
    15 <body onload="preload_im();majMenu('0');"> 
    16  
    17 <SCRIPT LANGUAGE="JavaScript"> 
    18  
    19 var isIE = document.all; 
    20 var mouseX = 0; 
    21 var mouseY = 0; 
    22  
    23 function preload_im() { 
    24         if (navigator.appVersion.substring(0,1) >= 3) { 
    25                 i1=new Image; 
    26                 i1.src='resources/images/pl_st_ndacc_f_symp.png'; 
    27                 i2=new Image; 
    28                 i2.src='resources/images/pl_st_ndacc_f_lidar_symp.png'; 
    29                 i3=new Image; 
    30                 i3.src='resources/images/pl_st_ndacc_f_saoz_symp.png'; 
    31                 i4=new Image; 
    32                 i4.src='resources/images/pl_st_ndacc_f_dobson_symp.png'; 
    33                 i5=new Image; 
    34                 i5.src='resources/images/pl_st_ndacc_f_spectro_symp.png'; 
    35                 i6=new Image; 
    36                 i6.src='resources/images/pl_st_ndacc_f_o3sonde_symp.png'; 
    37                 i7=new Image; 
    38                 i7.src='resources/images/pl_st_ndacc_f_ftir_symp.png'; 
    39         } 
    40  
    41     return tooltipInit(); 
    42 } 
    43  
    44  
    45 function getMouseXY(e) { 
    46  
    47 if (!e) e = window.event; 
    48  
    49 if (e) { 
    50         mouseX = isIE ? (e.clientX + document.body.scrollLeft) : e.pageX; 
    51         mouseY = isIE ? (e.clientY + document.body.scrollTop) : e.pageY; 
    52 } 
    53  
    54 } 
    55  
    56 document.onmousemove = getMouseXY; 
    57  
    58 function tooltipShow(msg,im) { 
    59         // 
    60         document.getElementById("tooltip").style.visibility ="visible"; 
    61         document.getElementById("tooltip").style.left = mouseX-70 +"px"; 
    62         document.getElementById("tooltip").style.top = mouseY-110 +"px"; 
    63         document.getElementById("texts").style.visibility ="visible"; 
    64         document.getElementById("texts").style.left = mouseX-60 +"px"; 
    65  
    66         if (im == '' || im == null) { 
    67                 document.getElementById("texts").style.top = mouseY-30+"px"; 
    68                 document.getElementById("tooltip").style.visibility ="hidden"; 
    69                 document.getElementById("ims").src = ""; 
    70         document.getElementById("ims").style.width="110px"; 
    71         //document.getElementById("ims").height="70px"; 
    72  
    73         } 
    74         else { 
    75                 document.getElementById("texts").style.top = mouseY -30 +"px"; 
    76                 document.getElementById("ims").src = "resources/images/"+im; 
    77         document.getElementById("ims").style.width="110px"; 
    78         //document.getElementById("ims").height="70px"; 
    79         } 
    80  
    81         document.getElementById("texts").innerHTML=msg; 
    82  
    83  
    84 } 
    85  
    86  
    87 function tooltipHide() { 
    88         document.getElementById("tooltip").style.visibility ="hidden"; 
    89         document.getElementById("texts").style.visibility ="hidden"; 
    90     //document.getElementById("ims").style.visibility ="hidden"; 
    91 } 
    92  
    93 function tooltipInit() { 
    94     //document.getElementById("tooltip").style.visibility ="hidden"; 
    95     //document.getElementById("tooltip").style.left = -70 +"px"; 
    96         //document.getElementById("tooltip").style.top = -110 +"px"; 
    97     //mouseX=200; 
    98     tooltipShow('',''); 
    99     //document.getElementById("tooltip").getElementById("ims").style.width="300px"; 
    100 } 
    101  
    102 function showMap(page) { 
    103         document.getElementById("immap").src="resources/images/"+page; 
    104         //alert(page); 
    105  
    106 } 
    107  
    108 </SCRIPT> 
    109  
    110 <div align=center> 
    111 <div style="margin-top: -10px; width: 1230px ;" class="menu1"><!-- début de la boite contenant les onglets --> 
    112  
    113 <jsp:include page="template_haut.jsp" /> 
    114 </div> 
    115     <div id="tooltip" style="position:absolute;visibility: hidden;"> 
    116         <img id="ims" border=0 alt="" src=""> 
    117     </div> 
    118     <div id="texts" style="position:absolute;color:#62f545;"></div> 
    119  
    120  
    121 <div style="width: 1230px ; text-align: left;"> 
    122  
    123 <img id="immap" border=1 class="cielb" alt="" src="resources/images/pl_st_ndacc_f_symp.png" usemap="#Map"> 
    124  
    125 <MAP NAME="Map" > 
    126  
    127         <AREA SHAPE="rect" 
    128                    HREF="#" 
    129                    COORDS="20,60,490,140" 
    130                    onmouseover="" onmouseout="" onclick="window.open ('http://ndacc2011.univ-reunion.fr/', 'Symposium 2011', 'resizable=yes,scrollbars=yes,toolbar=yes,left=100,top=100,width=1000,height=600');"> 
    131  
    132         <AREA SHAPE="rect" 
    133                    HREF="#" 
    134                    COORDS="80,460,120,470" 
    135                    onmouseover="showMap('pl_st_ndacc_f_saoz_symp.png');" onmouseout="showMap('pl_st_ndacc_f_symp.png');" onclick="showMap('pl_st_ndacc_f_saoz_symp.png');"> 
    136  
    137     <AREA SHAPE="rect" 
    138                    HREF="#" 
    139                    COORDS="80,446,120,456" 
    140                    onmouseover="showMap('pl_st_ndacc_f_lidar_symp.png');" onmouseout="showMap('pl_st_ndacc_f_symp.png');" onclick="showMap('pl_st_ndacc_f_lidar_symp.png');"> 
    141  
    142     <AREA SHAPE="rect" 
    143                    HREF="#" 
    144                    COORDS="80,480,145,490" 
    145                    onmouseover="showMap('pl_st_ndacc_f_o3sonde_symp.png');" onmouseout="showMap('pl_st_ndacc_f_symp.png');" onclick="showMap('pl_st_ndacc_f_o3sonde_symp.png');"> 
    146  
    147         <AREA SHAPE="rect" 
    148                    HREF="#" 
    149                    COORDS="80,498,140,508" 
    150                    onmouseover="showMap('pl_st_ndacc_f_dobson_symp.png');" onmouseout="showMap('pl_st_ndacc_f_symp.png');" onclick="showMap('pl_st_ndacc_f_dobson_symp.png');"> 
    151  
    152         <AREA SHAPE="rect" 
    153                    HREF="#" 
    154                    COORDS="80,511,220,521" 
    155                    onmouseover="showMap('pl_st_ndacc_f_spectro_symp.png');" onmouseout="showMap('pl_st_ndacc_f_symp.png');" onclick="showMap('pl_st_ndacc_f_spectro_symp.png');"> 
    156  
    157         <AREA SHAPE="rect" 
    158                    HREF="#" 
    159                    COORDS="80,530,110,540" 
    160                    onmouseover="showMap('pl_st_ndacc_f_ftir_symp.png');" onmouseout="showMap('pl_st_ndacc_f_symp.png');" onclick="showMap('pl_st_ndacc_f_ftir_symp.png');"> 
    161  
    162         <AREA SHAPE="rect" 
    163                    HREF="data_opar.jsp" 
    164                    COORDS="790,370,810,390" 
    165                    onmouseover="tooltipShow('&nbsp;La R&eacute;union','reu.jpg');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    166  
    167         <AREA SHAPE="rect" 
    168                    HREF="data_kerguelen.jsp" 
    169                    COORDS="845,464,865,484" 
    170                    onmouseover="tooltipShow('&nbsp;Kerguelen','');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    171  
    172         <AREA SHAPE="rect" 
    173                    HREF="instrument?methodName=thisCall&language=en&target=data_ohp.jsp" 
    174                    COORDS="160,360,180,380" 
    175                    onmouseover="tooltipShow('&nbsp;OHP','ohp.jpg');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    176  
    177         <AREA SHAPE="rect" 
    178                    HREF="data_villeneuve.jsp" 
    179                    COORDS="132,258,152,278" 
    180                    onmouseover="tooltipShow('&nbsp;Villeneuve d\'Ascq','');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    181  
    182         <AREA SHAPE="rect" 
    183                    HREF="data_concordia.jsp" 
    184                    COORDS="1019,567,1039,587" 
    185                    onmouseover="tooltipShow('&nbsp;Concordia','');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    186  
    187         <AREA SHAPE="rect" 
    188                    HREF="data_ddu.jsp" 
    189                    COORDS="1082,540,1102,560" 
    190                    onmouseover="tooltipShow('&nbsp;Dumont d\'Urville','ddu.jpg');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    191  
    192         <AREA SHAPE="rect" 
    193                    HREF="data_tarawa.jsp" 
    194                    COORDS="1204,282,1224,302" 
    195                    onmouseover="tooltipShow('&nbsp;Tarawa','');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    196  
    197         <AREA SHAPE="rect" 
    198                    HREF="data_salekhard.jsp" 
    199                    COORDS="842,70,862,90" 
    200                    onmouseover="tooltipShow('&nbsp;Salekhard','');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    201  
    202         <AREA SHAPE="rect" 
    203                    HREF="data_zhigansk.jsp" 
    204                    COORDS="1002,80,1022,100" 
    205                    onmouseover="tooltipShow('&nbsp;Zhigansk','');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    206  
    207  
    208         <AREA SHAPE="rect" 
    209                    HREF="data_sodankyla.jsp" 
    210                    COORDS="695,75,715,95" 
    211                    onmouseover="tooltipShow('&nbsp;Sodankyla','');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    212  
    213         <AREA SHAPE="rect" 
    214                    HREF="data_scorebysund.jsp" 
    215                    COORDS="525,60,545,80" 
    216                    onmouseover="tooltipShow('&nbsp;Scorebysund','');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    217  
    218         <AREA SHAPE="rect" 
    219                    HREF="data_bauru.jsp" 
    220                    COORDS="440,390,460,410" 
    221                    onmouseover="tooltipShow('&nbsp;Bauru','');" onmouseout="tooltipHide();" onclick="tooltipHide();"> 
    222  
    223         <AREA SHAPE="rect" 
    224                    HREF="data_andoya.jsp" 
    225                    COORDS="660,70,680,90" 
    226                    onmouseover="tooltipShow('&nbsp;Andoya','alomar.jpg');" onmouseout="tooltipHide();"> 
    227  
    228         <AREA SHAPE="rect" 
    229                    HREF="data_riogallegos.jsp" 
    230                    COORDS="370,470,390,490" 
    231                    onmouseover="tooltipShow('&nbsp;Rio Gallegos','');" onmouseout="tooltipHide();"> 
    232  
    233         <AREA SHAPE="rect" 
    234                    HREF="data_bordeaux.jsp" 
    235                    COORDS="90,355,110,375" 
    236                    onmouseover="tooltipShow('&nbsp;Bordeaux','');" onmouseout="tooltipHide();"> 
    237  
    238         <AREA SHAPE="rect" 
    239                    HREF="data_lannemezan.jsp" 
    240                    COORDS="102,372,122,392" 
    241                    onmouseover="tooltipShow('&nbsp;OMP','omp.jpg');" onmouseout="tooltipHide();"> 
    242  
    243 </MAP> 
    244  
    245  
    246  
    247  
    248 </div> 
    249  
    250  
    251 </div> 
    252  
    253 <jsp:include page="template_bas.jsp" /> 
    254 </body> 
    255 </html> 
     1<%--This redirect is used to allow messages sources in the index page--%> 
     2<jsp:forward page="station?methodName=home"/> 
  • ether_ndacc/trunk/web/src/com/ether/Controller.java

    r201 r204  
    11package com.ether; 
    22 
    3 import java.util.List; 
     3import com.ether.annotation.ControllerMethod; 
     4import com.ether.annotation.ParamName; 
     5import com.ether.instrument.Instrument; 
     6import com.ether.station.Station; 
     7import org.apache.commons.logging.Log; 
     8import org.apache.commons.logging.LogFactory; 
     9import org.springframework.beans.factory.annotation.Required; 
     10import org.springframework.web.servlet.ModelAndView; 
    411 
    512import javax.servlet.http.HttpServletRequest; 
    613import javax.servlet.http.HttpServletResponse; 
    7  
    8 import org.springframework.web.servlet.ModelAndView; 
    9 import org.springframework.web.servlet.mvc.multiaction.MultiActionController; 
    10  
    11 import com.ether.instrument.Instrument; 
    12 import com.ether.station.Station; 
     14import java.util.HashMap; 
     15import java.util.List; 
     16import java.util.Map; 
    1317 
    1418/** 
    1519 * @author vmipsl 
    16  * @date 02 feb 2011 
     20 * @date 17 feb 2011 
    1721 */ 
    18 public class Controller extends MultiActionController 
     22public class Controller 
     23        extends ControllerEther 
    1924{ 
    20     // Default view if methodName is unknown 
    21     public ModelAndView home(final HttpServletRequest request, final HttpServletResponse response) throws WebException 
    22     { 
    23         //okok 
    24         return new ModelAndView("index"); 
    25     } 
    26  
    27      
    28     public ModelAndView thisCall(final HttpServletRequest request, final HttpServletResponse response) 
    29         throws WebException 
    30     { 
    31  
    32         String pageCourante = request.getParameter("target"); 
    33  
    34         String pagePref = pageCourante.substring( 1, pageCourante.lastIndexOf('.')); 
    35  
    36  
    37         final ModelAndView modelAndView = new ModelAndView(pagePref); 
    38  
    39                 return modelAndView; 
    40  
    41     } 
    42  
    43  
    44     public ModelAndView viewLidarO3s(final HttpServletRequest request, final HttpServletResponse response) 
    45         throws WebException 
    46     { 
    47                 try { 
    48                         final List<String> listeDates = _serviceTools.getListeDates(); 
    49  
    50                         final ModelAndView modelAndView = new ModelAndView(VIEW_LIDAR_O3S); 
    51                         modelAndView.addObject("listeDates", listeDates); 
    52                          
    53                         return modelAndView; 
    54  
    55                 } catch (ServiceException e) { 
    56                         throw new WebException(WebException.WebCode.SERVICE_PROBLEM, e); 
    57                 } 
    58     } 
    59      
    60      
    61     public ModelAndView selectEcc(final HttpServletRequest request, final HttpServletResponse response)  
    62         throws WebException 
    63         { 
    64         try { 
    65                 String dateinf = request.getParameter("dateinf"); 
    66                 String station = request.getParameter("station"); 
    67                  
    68                 final String instrument = request.getParameter("instrument"); 
    69  
    70                 List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation(instrument, dateinf,"yyyyMMdd",station); 
    71                   
    72                 //dateinf="02021980"; 
    73                 //List<String> ListDates = _plotService.getLastDate(instrument); 
    74                 final List<String> listeDates = _serviceTools.getListeDates(); 
    75                 String rep=""; 
    76                 String year = dateinf.substring(0, 4); 
    77                  
    78                 if (station.compareTo("OHP")==0 || station.compareTo("ohp")==0 ) { 
    79                         rep="./resources/visu/ohp/ecc"; 
    80                         station="OHP"; 
    81                         if (year.compareTo("1970") == 0) year="2007"; 
    82                 } 
    83                 else if (station.compareTo("LA REUNION")==0 || station.compareTo("reunion")==0 ) { 
    84                         rep="./resources/visu/reu/ecc"; 
    85                         //rep="./resources/visu/ohp/lidar/o3_strato"; 
    86                         station="LA REUNION"; 
    87                         if (year.compareTo("1970") == 0) year="2006"; 
    88                         //year="2006"; 
    89                 } 
    90                 else if (station.compareTo("DDU")==0 || station.compareTo("ddu")==0 ) { 
    91                         rep="./resources/visu/ddu/ecc"; 
    92                         //rep="./resources/visu/ohp/lidar/o3_strato"; 
    93                         station="DDU"; 
    94                         if (year.compareTo("1970") == 0) year="1991"; 
    95                         //year="2006"; 
    96                 } 
    97                  
    98                  
    99                 final ModelAndView modelAndView = new ModelAndView(VIEW_ECC); 
    100                 //plotsList=null; 
    101                 modelAndView.addObject("plotsList", plotsList); 
    102                  
    103                 modelAndView.addObject("listeDates", listeDates); 
    104                 modelAndView.addObject("firstDate", dateinf);                    
    105                  
    106                 String month = dateinf.substring(4,6); 
    107                 modelAndView.addObject("month", month); 
    108                 modelAndView.addObject("year", year); 
    109                 modelAndView.addObject("station", station); 
    110                 modelAndView.addObject("rep", rep); 
    111                  
    112                 return modelAndView; 
    113  
    114         } catch (ServiceException e) { 
    115                 throw new WebException(WebException.WebCode.SERVICE_PROBLEM, e); 
    116         } 
    117 } 
    118  
    119      
    120     public ModelAndView selectLidarO3s(final HttpServletRequest request, final HttpServletResponse response)  
    121         throws WebException 
    122     { 
    123                 try { 
    124                         String dateinf = request.getParameter("dateinf"); 
    125                         String station = request.getParameter("station"); 
    126                          
    127                         final String instrument = request.getParameter("instrument"); 
    128  
    129                         List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation(instrument, dateinf,"yyyyMMdd",station); 
    130                           
    131                         //dateinf="02021980"; 
    132                         //List<String> ListDates = _plotService.getLastDate(instrument); 
    133                         final List<String> listeDates = _serviceTools.getListeDates(); 
    134                         String rep=""; 
    135                         String year = dateinf.substring(0, 4); 
    136                         String month = dateinf.substring(4,6); 
    137                          
    138                         if (station.compareTo("OHP")==0 || station.compareTo("ohp")==0 ) { 
    139                                 rep="./resources/visu/ohp/lidar/o3_strato"; 
    140                                 station="OHP"; 
    141                                 if (year.compareTo("1970") == 0) { 
    142                                          
    143                                         year="1991"; 
    144                                 } 
    145                         } 
    146                         else if (station.compareTo("REU")==0 || station.compareTo("reu")==0 || station.compareTo("LA REUNION")==0 || station.compareTo("REUNION")==0) { 
    147                                 rep="./resources/visu/reu/lidar/o3_strato"; 
    148                                 station="LA REUNION"; 
    149                                 if (year.compareTo("1970") == 0) year="2006"; 
    150                                 //year="2006"; 
    151                         } 
    152                          
    153                         else { 
    154                                 rep="./resources/visu/ddu/lidar/o3_strato"; 
    155                                 station="DDU"; 
    156                                 if (year.compareTo("1970") == 0) { 
    157                                                 year="1991"; 
    158                                                 //month="04";                            
    159                                 } 
    160                                 //year="2006"; 
    161                         } 
    162                          
    163                         final ModelAndView modelAndView = new ModelAndView(VIEW_LIDAR_O3S); 
    164                         //plotsList=null; 
    165                         modelAndView.addObject("plotsList", plotsList); 
    166                          
    167                         modelAndView.addObject("listeDates", listeDates); 
    168                         modelAndView.addObject("firstDate", dateinf);                    
    169                          
    170                          
    171                         modelAndView.addObject("month", month); 
    172                         modelAndView.addObject("year", year); 
    173                         modelAndView.addObject("station", station); 
    174                         modelAndView.addObject("rep", rep); 
    175                          
    176                         return modelAndView; 
    177  
    178                 } catch (ServiceException e) { 
    179                         throw new WebException(WebException.WebCode.SERVICE_PROBLEM, e); 
    180                 } 
    181     } 
    182      
    183     public ModelAndView selectLidarO3t(final HttpServletRequest request, final HttpServletResponse response)  
    184         throws WebException 
    185 { 
    186         try { 
    187                 String dateinf = request.getParameter("dateinf"); 
    188                 String station = request.getParameter("station"); 
    189                  
    190                 final String instrument = request.getParameter("instrument"); 
    191  
    192                 List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation(instrument, dateinf,"yyyyMMdd",station); 
    193                   
    194                 //dateinf="02021980"; 
    195                 //List<String> ListDates = _plotService.getLastDate(instrument); 
    196                 final List<String> listeDates = _serviceTools.getListeDates(); 
    197                 String rep=""; 
    198                 String year = dateinf.substring(0, 4); 
    199                 String month = dateinf.substring(4, 6); 
    200                  
    201                 if (station.compareTo("OHP")==0 || station.compareTo("ohp")==0 ) { 
    202                         rep="./resources/visu/ohp/lidar/o3_tropo"; 
    203                         station="OHP"; 
    204                         if (year.compareTo("1970") == 0) { 
    205                                         year="2007"; 
    206                                         month="05"; 
    207                                         dateinf=year+month+"01"; 
    208                         } 
    209                 } 
    210                 //else if (station.compareTo("reunion")==0) { 
    211                 else { 
    212                         rep="./resources/visu/reu/lidar/o3_tropo"; 
    213                         //rep="./resources/visu/ohp/lidar/o3_strato"; 
    214                         station="LA REUNION"; 
    215                         if (year.compareTo("1970") == 0) { 
    216                                         year="2006"; 
    217                                          
    218                         } 
    219                         //year="2006"; 
    220                 } 
    221                  
    222                  
    223                 final ModelAndView modelAndView = new ModelAndView(VIEW_LIDAR_O3T); 
    224                 //plotsList=null; 
    225                 modelAndView.addObject("plotsList", plotsList); 
    226                  
    227                 modelAndView.addObject("listeDates", listeDates); 
    228                 modelAndView.addObject("firstDate", dateinf);                    
    229                  
    230                 //String month = dateinf.substring(4,6); 
    231                 modelAndView.addObject("month", month); 
    232                 modelAndView.addObject("year", year); 
    233                 modelAndView.addObject("station", station); 
    234                 modelAndView.addObject("rep", rep); 
    235                  
    236                 return modelAndView; 
    237  
    238         } catch (ServiceException e) { 
    239                 throw new WebException(WebException.WebCode.SERVICE_PROBLEM, e); 
    240         } 
    241 } 
    242  
    243     public ModelAndView selectLidarTemp(final HttpServletRequest request, final HttpServletResponse response)  
    244         throws WebException 
    245 { 
    246         try { 
    247                 String dateinf = request.getParameter("dateinf"); 
    248                 String station = request.getParameter("station"); 
    249                  
    250                 final String instrument = request.getParameter("instrument"); 
    251  
    252                 List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation(instrument, dateinf,"yyyyMMdd",station); 
    253                   
    254                 //dateinf="02021980"; 
    255                 //List<String> ListDates = _plotService.getLastDate(instrument); 
    256                 final List<String> listeDates = _serviceTools.getListeDates(); 
    257                 String rep=""; 
    258                 String year = dateinf.substring(0, 4); 
    259                 String month = dateinf.substring(4, 6); 
    260                  
    261                 if (station.compareTo("OHP")==0 || station.compareTo("ohp")==0 ) { 
    262                         rep="./resources/visu/ohp/lidar/temp"; 
    263                         station="OHP"; 
    264                         if (year.compareTo("1970") == 0) { 
    265                                         year="2009"; 
    266                                         month="01"; 
    267                         } 
    268                 } 
    269                  
    270                 if (station.compareTo("REU")==0 || station.compareTo("reu")==0 ) { 
    271                         rep="./resources/visu/reu/lidar/temp"; 
    272                         station="REU"; 
    273                         if (year.compareTo("1970") == 0) { 
    274                                         year="1994"; 
    275                                         month="05"; 
    276                         } 
    277                 } 
    278                  
    279                 final ModelAndView modelAndView = new ModelAndView(VIEW_LIDAR_TEMP); 
    280                 //plotsList=null; 
    281                 modelAndView.addObject("plotsList", plotsList); 
    282                  
    283                 modelAndView.addObject("listeDates", listeDates); 
    284                 modelAndView.addObject("firstDate", dateinf);                    
    285                  
    286                 //String month = dateinf.substring(4,6); 
    287                 modelAndView.addObject("month", month); 
    288                 modelAndView.addObject("year", year); 
    289                 modelAndView.addObject("station", station); 
    290                 modelAndView.addObject("rep", rep); 
    291                  
    292                 return modelAndView; 
    293  
    294         } catch (ServiceException e) { 
    295                 throw new WebException(WebException.WebCode.SERVICE_PROBLEM, e); 
    296         } 
    297 } 
    298  
    299      
    300     public ModelAndView selectLidarAerosols(final HttpServletRequest request, final HttpServletResponse response)  
    301         throws WebException 
    302 { 
    303         try { 
    304                 String dateinf = request.getParameter("dateinf"); 
    305                 String station = request.getParameter("station"); 
    306                  
    307                 final String instrument = request.getParameter("instrument"); 
    308  
    309                 List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation(instrument, dateinf,"yyyyMMdd",station); 
    310                   
    311                 //dateinf="02021980"; 
    312                 //List<String> ListDates = _plotService.getLastDate(instrument); 
    313                 final List<String> listeDates = _serviceTools.getListeDates(); 
    314                 String rep=""; 
    315                 String year = dateinf.substring(0, 4); 
    316                 String month = dateinf.substring(4, 6); 
    317                  
    318                 if (station.compareTo("OHP")==0 || station.compareTo("ohp")==0 ) { 
    319                         rep="./resources/visu/ohp/lidar/aerosols"; 
    320                         station="OHP"; 
    321                         if (year.compareTo("1970") == 0) { 
    322                                         year="2009"; 
    323                                         month="01"; 
    324                         } 
    325                 } 
    326                  
    327                 if (station.compareTo("DDU")==0 || station.compareTo("ddu")==0 ) { 
    328                         rep="./resources/visu/ddu/lidar/aerosols"; 
    329                         station="DDU"; 
    330                         if (year.compareTo("1970") == 0) { 
    331                                         year="2010"; 
    332                                         month="01"; 
    333                         } 
    334                 } 
    335                  
    336                 final ModelAndView modelAndView = new ModelAndView(VIEW_LIDAR_AEROSOLS); 
    337                 //plotsList=null; 
    338                 modelAndView.addObject("plotsList", plotsList); 
    339                  
    340                 modelAndView.addObject("listeDates", listeDates); 
    341                 modelAndView.addObject("firstDate", dateinf);                    
    342                  
    343                 //String month = dateinf.substring(4,6); 
    344                 modelAndView.addObject("month", month); 
    345                 modelAndView.addObject("year", year); 
    346                 modelAndView.addObject("station", station); 
    347                 modelAndView.addObject("rep", rep); 
    348                  
    349                 return modelAndView; 
    350  
    351         } catch (ServiceException e) { 
    352                 throw new WebException(WebException.WebCode.SERVICE_PROBLEM, e); 
    353         } 
    354 } 
    355  
    356     public ModelAndView viewSpectroUV(final HttpServletRequest request, final HttpServletResponse response) throws WebException  
    357         { 
    358         try { 
    359                 String dateinf = request.getParameter("dateinf"); 
    360                 //List<String> m = new ArrayList<String>(12); 
    361                  
    362                 String m[]; 
    363                 m = new String[12]; 
    364                 String fname, iname, year;               
    365                                  
    366                 final String instrument = request.getParameter("instrument"); 
    367                 String especes = request.getParameter("especes"); 
    368                  
    369                 if (especes.equals("nan")) { 
    370                         especes="uvauvb"; 
    371                 } 
    372                  
    373                 if (dateinf.equals("nan")) { 
    374                         year = "2008"; 
    375                         dateinf="2008"; 
    376                          
    377                 } 
    378  
    379                 List<String> plotsList = _plotService.getPlotsByDateByInstrument(instrument, dateinf,"yyyy");             
    380                 final List<String> listeDates = _serviceTools.getListeDates(); 
    381                  
    382                 final ModelAndView modelAndView = new ModelAndView(VIEW_SPECTRO_UV); 
    383                 modelAndView.addObject("plotsList", plotsList); 
    384                  
    385                 modelAndView.addObject("listeDates", listeDates); 
    386                 modelAndView.addObject("firstDate", dateinf); 
    387                 modelAndView.addObject("especes", especes); 
    388                 year = dateinf.substring(0, 4); 
    389                  
    390                 modelAndView.addObject("year", year); 
    391                 modelAndView.addObject("m", m); 
    392                  
    393                 fname="vasp_"; 
    394                 fname=fname.concat(especes); 
    395                 fname=fname.concat("_"); 
    396                 fname=fname.concat(year); 
    397                  
    398                 iname=fname.concat("01_plot1.jpg"); 
    399                 if (plotsList.contains(iname)) m[0]=iname; 
    400                 else m[0]="no"; 
    401  
    402                 iname=fname.concat("02_plot1.jpg"); 
    403                 if (plotsList.contains(iname)) m[1]=iname; 
    404                 else m[1]="no"; 
    405                  
    406                 iname=fname.concat("03_plot1.jpg"); 
    407                 if (plotsList.contains(iname)) m[2]=iname; 
    408                 else m[2]="no"; 
    409  
    410                 iname=fname.concat("04_plot1.jpg"); 
    411                 if (plotsList.contains(iname)) m[3]=iname; 
    412                 else m[3]="no"; 
    413  
    414                 iname=fname.concat("05_plot1.jpg"); 
    415                 if (plotsList.contains(iname)) m[4]=iname; 
    416                 else m[4]="no"; 
    417                  
    418                 iname=fname.concat("06_plot1.jpg"); 
    419                 if (plotsList.contains(iname)) m[5]=iname; 
    420                 else m[5]="no"; 
    421                  
    422                 iname=fname.concat("07_plot1.jpg"); 
    423                 if (plotsList.contains(iname)) m[6]=iname; 
    424                 else m[6]="no"; 
    425  
    426                 iname=fname.concat("08_plot1.jpg"); 
    427                 if (plotsList.contains(iname)) m[7]=iname; 
    428                 else m[7]="no"; 
    429                  
    430                 iname=fname.concat("09_plot1.jpg"); 
    431                 if (plotsList.contains(iname)) m[8]=iname; 
    432                 else m[8]="no"; 
    433                                  
    434                 iname=fname.concat("10_plot1.jpg"); 
    435                 if (plotsList.contains(iname)) m[9]=iname; 
    436                 else m[9]="no"; 
    437  
    438                 iname=fname.concat("11_plot1.jpg"); 
    439                 if (plotsList.contains(iname)) m[10]=iname; 
    440                 else m[10]="no"; 
    441                  
    442                 iname=fname.concat("12_plot1.jpg"); 
    443                 if (plotsList.contains(iname)) m[11]=iname; 
    444                 else m[11]="no"; 
    445  
    446                 return modelAndView; 
    447  
    448         } catch (ServiceException e) { 
    449                 throw new WebException(WebException.WebCode.SERVICE_PROBLEM, e); 
    450         } 
    451         } 
    452  
    453   
    454      
    455     public ModelAndView viewInstruments(final HttpServletRequest request, final HttpServletResponse response)  
    456         throws WebException 
    457     { 
    458                 try { 
    459                         final List<Instrument> instruments = _instrumentService.getAllInstruments(); 
    460  
    461                         final ModelAndView modelAndView = new ModelAndView(VIEW_INSTRUMENT); 
    462                         modelAndView.addObject("instruments", instruments); 
    463                         return modelAndView; 
    464  
    465                 } catch (ServiceException e) { 
    466                         throw new WebException(WebException.WebCode.SERVICE_PROBLEM, e); 
    467                 } 
    468     } 
    469  
    470     public ModelAndView viewStation(final HttpServletRequest request, final HttpServletResponse response) throws WebException 
    471     { 
    472                 try { 
    473                         final Long stationId = Long.valueOf(request.getParameter("stationId")); 
    474                         final Station station = _stationService.getStationById(stationId); 
    475  
    476                         final ModelAndView modelAndView = new ModelAndView(VIEW_STATION); 
    477                         modelAndView.addObject("station", station); 
    478                         return modelAndView; 
    479  
    480                 } catch (ServiceException e) { 
    481                         throw new WebException(WebException.WebCode.SERVICE_PROBLEM, e); 
    482                 } 
    483     } 
    484  
    485     public void setStationService(final StationService stationService) 
    486     { 
    487         _stationService = stationService; 
    488     } 
    489  
    490     public void setInstrumentService(final InstrumentService instrumentService) 
    491     { 
    492         _instrumentService = instrumentService; 
    493     } 
    494      
    495     public void setServiceTools(final ServiceTools serviceTools) 
    496     { 
    497         _serviceTools=serviceTools; 
    498     } 
    499      
    500     public void setPlotService(final PlotService plotService) 
    501     { 
    502         _plotService=plotService; 
    503     } 
     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 
     50    @ControllerMethod(view = VIEW_ECC) 
     51    public Map<String, Object> selectEcc( @ParamName("dateinf") final String dateinf, 
     52                                          @ParamName("station") String station, 
     53                                          @ParamName("instrument") final String instrument ) 
     54            throws WebException 
     55    { 
     56        try 
     57        { 
     58            final List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); 
     59 
     60            //dateinf="02021980"; 
     61            //List<String> ListDates = _plotService.getLastDate(instrument); 
     62            final List<String> listeDates = _serviceTools.getListeDates(); 
     63            String rep = ""; 
     64            String year = dateinf.substring( 0, 4 ); 
     65 
     66            if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) 
     67            { 
     68                rep = "./resources/visu/ohp/ecc"; 
     69                station = "OHP"; 
     70                if( year.compareTo( "1970" ) == 0 ) year = "2007"; 
     71            } 
     72            else if( station.compareTo( "LA REUNION" ) == 0 || station.compareTo( "reunion" ) == 0 ) 
     73            { 
     74                rep = "./resources/visu/reu/ecc"; 
     75                //rep="./resources/visu/ohp/lidar/o3_strato"; 
     76                station = "LA REUNION"; 
     77                if( year.compareTo( "1970" ) == 0 ) year = "2006"; 
     78                //year="2006"; 
     79            } 
     80            else if( station.compareTo( "DDU" ) == 0 || station.compareTo( "ddu" ) == 0 ) 
     81            { 
     82                rep = "./resources/visu/ddu/ecc"; 
     83                //rep="./resources/visu/ohp/lidar/o3_strato"; 
     84                station = "DDU"; 
     85                if( year.compareTo( "1970" ) == 0 ) year = "1991"; 
     86                //year="2006"; 
     87            } 
     88 
     89            final Map<String, Object> model = new HashMap<String, Object>(); 
     90            model.put( "plotsList", plotsList ); 
     91            model.put( "listeDates", listeDates ); 
     92            model.put( "firstDate", dateinf ); 
     93            final String month = dateinf.substring( 4, 6 ); 
     94            model.put( "month", month ); 
     95            model.put( "year", year ); 
     96            model.put( "station", station ); 
     97            model.put( "rep", rep ); 
     98            return model; 
     99        } 
     100        catch( ServiceException e ) 
     101        { 
     102            throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); 
     103        } 
     104    } 
     105 
     106    public ModelAndView viewLidarO3s( final HttpServletRequest request, final HttpServletResponse response ) 
     107            throws WebException 
     108    { 
     109        try 
     110        { 
     111            final List<String> listeDates = _serviceTools.getListeDates(); 
     112 
     113            final ModelAndView modelAndView = new ModelAndView( VIEW_LIDAR_O3S ); 
     114            modelAndView.addObject( "listeDates", listeDates ); 
     115 
     116            return modelAndView; 
     117 
     118        } 
     119        catch( ServiceException e ) 
     120        { 
     121            throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); 
     122        } 
     123    } 
     124 
     125    public ModelAndView selectLidarO3s( final HttpServletRequest request, final HttpServletResponse response ) 
     126            throws WebException 
     127    { 
     128        try 
     129        { 
     130            String dateinf = request.getParameter( "dateinf" ); 
     131            String station = request.getParameter( "station" ); 
     132 
     133            final String instrument = request.getParameter( "instrument" ); 
     134 
     135            List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); 
     136 
     137            //dateinf="02021980"; 
     138            //List<String> ListDates = _plotService.getLastDate(instrument); 
     139            final List<String> listeDates = _serviceTools.getListeDates(); 
     140            String rep = ""; 
     141            String year = dateinf.substring( 0, 4 ); 
     142            String month = dateinf.substring( 4, 6 ); 
     143 
     144            if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) 
     145            { 
     146                rep = "./resources/visu/ohp/lidar/o3_strato"; 
     147                station = "OHP"; 
     148                if( year.compareTo( "1970" ) == 0 ) 
     149                { 
     150 
     151                    year = "1991"; 
     152                } 
     153            } 
     154            else if( station.compareTo( "REU" ) == 0 || station.compareTo( "reu" ) == 0 || station.compareTo( "LA REUNION" ) == 0 || station.compareTo( "REUNION" ) == 0 ) 
     155            { 
     156                rep = "./resources/visu/reu/lidar/o3_strato"; 
     157                station = "LA REUNION"; 
     158                if( year.compareTo( "1970" ) == 0 ) year = "2006"; 
     159                //year="2006"; 
     160            } 
     161 
     162            else 
     163            { 
     164                rep = "./resources/visu/ddu/lidar/o3_strato"; 
     165                station = "DDU"; 
     166                if( year.compareTo( "1970" ) == 0 ) 
     167                { 
     168                    year = "1991"; 
     169                    //month="04"; 
     170                } 
     171                //year="2006"; 
     172            } 
     173 
     174            final ModelAndView modelAndView = new ModelAndView( VIEW_LIDAR_O3S ); 
     175            //plotsList=null; 
     176            modelAndView.addObject( "plotsList", plotsList ); 
     177 
     178            modelAndView.addObject( "listeDates", listeDates ); 
     179            modelAndView.addObject( "firstDate", dateinf ); 
     180 
     181 
     182            modelAndView.addObject( "month", month ); 
     183            modelAndView.addObject( "year", year ); 
     184            modelAndView.addObject( "station", station ); 
     185            modelAndView.addObject( "rep", rep ); 
     186 
     187            return modelAndView; 
     188 
     189        } 
     190        catch( ServiceException e ) 
     191        { 
     192            throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); 
     193        } 
     194    } 
     195 
     196    public ModelAndView selectLidarO3t( final HttpServletRequest request, final HttpServletResponse response ) 
     197            throws WebException 
     198    { 
     199        try 
     200        { 
     201            String dateinf = request.getParameter( "dateinf" ); 
     202            String station = request.getParameter( "station" ); 
     203 
     204            final String instrument = request.getParameter( "instrument" ); 
     205 
     206            List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); 
     207 
     208            //dateinf="02021980"; 
     209            //List<String> ListDates = _plotService.getLastDate(instrument); 
     210            final List<String> listeDates = _serviceTools.getListeDates(); 
     211            String rep = ""; 
     212            String year = dateinf.substring( 0, 4 ); 
     213            String month = dateinf.substring( 4, 6 ); 
     214 
     215            if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) 
     216            { 
     217                rep = "./resources/visu/ohp/lidar/o3_tropo"; 
     218                station = "OHP"; 
     219                if( year.compareTo( "1970" ) == 0 ) 
     220                { 
     221                    year = "2007"; 
     222                    month = "05"; 
     223                    dateinf = year + month + "01"; 
     224                } 
     225            } 
     226            //else if (station.compareTo("reunion")==0) { 
     227            else 
     228            { 
     229                rep = "./resources/visu/reu/lidar/o3_tropo"; 
     230                //rep="./resources/visu/ohp/lidar/o3_strato"; 
     231                station = "LA REUNION"; 
     232                if( year.compareTo( "1970" ) == 0 ) 
     233                { 
     234                    year = "2006"; 
     235 
     236                } 
     237                //year="2006"; 
     238            } 
     239 
     240 
     241            final ModelAndView modelAndView = new ModelAndView( VIEW_LIDAR_O3T ); 
     242            //plotsList=null; 
     243            modelAndView.addObject( "plotsList", plotsList ); 
     244 
     245            modelAndView.addObject( "listeDates", listeDates ); 
     246            modelAndView.addObject( "firstDate", dateinf ); 
     247 
     248            //String month = dateinf.substring(4,6); 
     249            modelAndView.addObject( "month", month ); 
     250            modelAndView.addObject( "year", year ); 
     251            modelAndView.addObject( "station", station ); 
     252            modelAndView.addObject( "rep", rep ); 
     253 
     254            return modelAndView; 
     255 
     256        } 
     257        catch( ServiceException e ) 
     258        { 
     259            throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); 
     260        } 
     261    } 
     262 
     263    public ModelAndView selectLidarTemp( final HttpServletRequest request, final HttpServletResponse response ) 
     264            throws WebException 
     265    { 
     266        try 
     267        { 
     268            String dateinf = request.getParameter( "dateinf" ); 
     269            String station = request.getParameter( "station" ); 
     270 
     271            final String instrument = request.getParameter( "instrument" ); 
     272 
     273            List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); 
     274 
     275            //dateinf="02021980"; 
     276            //List<String> ListDates = _plotService.getLastDate(instrument); 
     277            final List<String> listeDates = _serviceTools.getListeDates(); 
     278            String rep = ""; 
     279            String year = dateinf.substring( 0, 4 ); 
     280            String month = dateinf.substring( 4, 6 ); 
     281 
     282            if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) 
     283            { 
     284                rep = "./resources/visu/ohp/lidar/temp"; 
     285                station = "OHP"; 
     286                if( year.compareTo( "1970" ) == 0 ) 
     287                { 
     288                    year = "2009"; 
     289                    month = "01"; 
     290                } 
     291            } 
     292 
     293            if( station.compareTo( "REU" ) == 0 || station.compareTo( "reu" ) == 0 ) 
     294            { 
     295                rep = "./resources/visu/reu/lidar/temp"; 
     296                station = "REU"; 
     297                if( year.compareTo( "1970" ) == 0 ) 
     298                { 
     299                    year = "1994"; 
     300                    month = "05"; 
     301                } 
     302            } 
     303 
     304            final ModelAndView modelAndView = new ModelAndView( VIEW_LIDAR_TEMP ); 
     305            //plotsList=null; 
     306            modelAndView.addObject( "plotsList", plotsList ); 
     307 
     308            modelAndView.addObject( "listeDates", listeDates ); 
     309            modelAndView.addObject( "firstDate", dateinf ); 
     310 
     311            //String month = dateinf.substring(4,6); 
     312            modelAndView.addObject( "month", month ); 
     313            modelAndView.addObject( "year", year ); 
     314            modelAndView.addObject( "station", station ); 
     315            modelAndView.addObject( "rep", rep ); 
     316 
     317            return modelAndView; 
     318 
     319        } 
     320        catch( ServiceException e ) 
     321        { 
     322            throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); 
     323        } 
     324    } 
     325 
     326 
     327    public ModelAndView selectLidarAerosols( final HttpServletRequest request, final HttpServletResponse response ) 
     328            throws WebException 
     329    { 
     330        try 
     331        { 
     332            String dateinf = request.getParameter( "dateinf" ); 
     333            String station = request.getParameter( "station" ); 
     334 
     335            final String instrument = request.getParameter( "instrument" ); 
     336 
     337            List<String> plotsList = _plotService.getPlotsByDateByInstrumentByStation( instrument, dateinf, "yyyyMMdd", station ); 
     338 
     339            //dateinf="02021980"; 
     340            //List<String> ListDates = _plotService.getLastDate(instrument); 
     341            final List<String> listeDates = _serviceTools.getListeDates(); 
     342            String rep = ""; 
     343            String year = dateinf.substring( 0, 4 ); 
     344            String month = dateinf.substring( 4, 6 ); 
     345 
     346            if( station.compareTo( "OHP" ) == 0 || station.compareTo( "ohp" ) == 0 ) 
     347            { 
     348                rep = "./resources/visu/ohp/lidar/aerosols"; 
     349                station = "OHP"; 
     350                if( year.compareTo( "1970" ) == 0 ) 
     351                { 
     352                    year = "2009"; 
     353                    month = "01"; 
     354                } 
     355            } 
     356 
     357            if( station.compareTo( "DDU" ) == 0 || station.compareTo( "ddu" ) == 0 ) 
     358            { 
     359                rep = "./resources/visu/ddu/lidar/aerosols"; 
     360                station = "DDU"; 
     361                if( year.compareTo( "1970" ) == 0 ) 
     362                { 
     363                    year = "2010"; 
     364                    month = "01"; 
     365                } 
     366            } 
     367 
     368            final ModelAndView modelAndView = new ModelAndView( VIEW_LIDAR_AEROSOLS ); 
     369            //plotsList=null; 
     370            modelAndView.addObject( "plotsList", plotsList ); 
     371 
     372            modelAndView.addObject( "listeDates", listeDates ); 
     373            modelAndView.addObject( "firstDate", dateinf ); 
     374 
     375            //String month = dateinf.substring(4,6); 
     376            modelAndView.addObject( "month", month ); 
     377            modelAndView.addObject( "year", year ); 
     378            modelAndView.addObject( "station", station ); 
     379            modelAndView.addObject( "rep", rep ); 
     380 
     381            return modelAndView; 
     382 
     383        } 
     384        catch( ServiceException e ) 
     385        { 
     386            throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); 
     387        } 
     388    } 
     389 
     390    public ModelAndView viewSpectroUV( final HttpServletRequest request, final HttpServletResponse response ) 
     391            throws WebException 
     392    { 
     393        try 
     394        { 
     395            String dateinf = request.getParameter( "dateinf" ); 
     396            //List<String> m = new ArrayList<String>(12); 
     397 
     398            String m[]; 
     399            m = new String[12]; 
     400            String fname, iname, year; 
     401 
     402            final String instrument = request.getParameter( "instrument" ); 
     403            String especes = request.getParameter( "especes" ); 
     404 
     405            if( especes.equals( "nan" ) ) 
     406            { 
     407                especes = "uvauvb"; 
     408            } 
     409 
     410            if( dateinf.equals( "nan" ) ) 
     411            { 
     412                year = "2008"; 
     413                dateinf = "2008"; 
     414 
     415            } 
     416 
     417            List<String> plotsList = _plotService.getPlotsByDateByInstrument( instrument, dateinf, "yyyy" ); 
     418            final List<String> listeDates = _serviceTools.getListeDates(); 
     419 
     420            final ModelAndView modelAndView = new ModelAndView( VIEW_SPECTRO_UV ); 
     421            modelAndView.addObject( "plotsList", plotsList ); 
     422 
     423            modelAndView.addObject( "listeDates", listeDates ); 
     424            modelAndView.addObject( "firstDate", dateinf ); 
     425            modelAndView.addObject( "especes", especes ); 
     426            year = dateinf.substring( 0, 4 ); 
     427 
     428            modelAndView.addObject( "year", year ); 
     429            modelAndView.addObject( "m", m ); 
     430 
     431            fname = "vasp_"; 
     432            fname = fname.concat( especes ); 
     433            fname = fname.concat( "_" ); 
     434            fname = fname.concat( year ); 
     435 
     436            iname = fname.concat( "01_plot1.jpg" ); 
     437            if( plotsList.contains( iname ) ) m[0] = iname; 
     438            else m[0] = "no"; 
     439 
     440            iname = fname.concat( "02_plot1.jpg" ); 
     441            if( plotsList.contains( iname ) ) m[1] = iname; 
     442            else m[1] = "no"; 
     443 
     444            iname = fname.concat( "03_plot1.jpg" ); 
     445            if( plotsList.contains( iname ) ) m[2] = iname; 
     446            else m[2] = "no"; 
     447 
     448            iname = fname.concat( "04_plot1.jpg" ); 
     449            if( plotsList.contains( iname ) ) m[3] = iname; 
     450            else m[3] = "no"; 
     451 
     452            iname = fname.concat( "05_plot1.jpg" ); 
     453            if( plotsList.contains( iname ) ) m[4] = iname; 
     454            else m[4] = "no"; 
     455 
     456            iname = fname.concat( "06_plot1.jpg" ); 
     457            if( plotsList.contains( iname ) ) m[5] = iname; 
     458            else m[5] = "no"; 
     459 
     460            iname = fname.concat( "07_plot1.jpg" ); 
     461            if( plotsList.contains( iname ) ) m[6] = iname; 
     462            else m[6] = "no"; 
     463 
     464            iname = fname.concat( "08_plot1.jpg" ); 
     465            if( plotsList.contains( iname ) ) m[7] = iname; 
     466            else m[7] = "no"; 
     467 
     468            iname = fname.concat( "09_plot1.jpg" ); 
     469            if( plotsList.contains( iname ) ) m[8] = iname; 
     470            else m[8] = "no"; 
     471 
     472            iname = fname.concat( "10_plot1.jpg" ); 
     473            if( plotsList.contains( iname ) ) m[9] = iname; 
     474            else m[9] = "no"; 
     475 
     476            iname = fname.concat( "11_plot1.jpg" ); 
     477            if( plotsList.contains( iname ) ) m[10] = iname; 
     478            else m[10] = "no"; 
     479 
     480            iname = fname.concat( "12_plot1.jpg" ); 
     481            if( plotsList.contains( iname ) ) m[11] = iname; 
     482            else m[11] = "no"; 
     483 
     484            return modelAndView; 
     485 
     486        } 
     487        catch( ServiceException e ) 
     488        { 
     489            throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); 
     490        } 
     491    } 
     492 
     493 
     494    public ModelAndView viewInstruments( final HttpServletRequest request, final HttpServletResponse response ) 
     495            throws WebException 
     496    { 
     497        try 
     498        { 
     499            final List<Instrument> instruments = _instrumentService.getAllInstruments(); 
     500 
     501            final ModelAndView modelAndView = new ModelAndView( VIEW_INSTRUMENT ); 
     502            modelAndView.addObject( "instruments", instruments ); 
     503            return modelAndView; 
     504 
     505        } 
     506        catch( ServiceException e ) 
     507        { 
     508            throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); 
     509        } 
     510    } 
     511 
     512    public ModelAndView viewStation( final HttpServletRequest request, final HttpServletResponse response ) 
     513            throws WebException 
     514    { 
     515        try 
     516        { 
     517            final Long stationId = Long.valueOf( request.getParameter( "stationId" ) ); 
     518            final Station station = _stationService.getStationById( stationId ); 
     519 
     520            final ModelAndView modelAndView = new ModelAndView( VIEW_STATION ); 
     521            modelAndView.addObject( "station", station ); 
     522            return modelAndView; 
     523 
     524        } 
     525        catch( ServiceException e ) 
     526        { 
     527            throw new WebException( WebException.WebCode.SERVICE_PROBLEM, e ); 
     528        } 
     529    } 
     530 
     531    @Required 
     532    public void setStationService( final StationService stationService ) 
     533    { 
     534        _stationService = stationService; 
     535    } 
     536 
     537    @Required 
     538    public void setInstrumentService( final InstrumentService instrumentService ) 
     539    { 
     540        _instrumentService = instrumentService; 
     541    } 
     542 
     543    @Required 
     544    public void setServiceTools( final ServiceTools serviceTools ) 
     545    { 
     546        _serviceTools = serviceTools; 
     547    } 
     548 
     549    @Required 
     550    public void setPlotService( final PlotService plotService ) 
     551    { 
     552        _plotService = plotService; 
     553    } 
     554 
     555    private static final Log LOGGER = LogFactory.getLog( Controller.class ); 
     556 
     557    private static final String VIEW_INIT = "init"; 
    504558 
    505559    private static final String VIEW_INSTRUMENT = "instrument"; 
     
    511565    private static final String VIEW_LIDAR_TEMP = "visus_lidar_temp"; 
    512566    private static final String VIEW_LIDAR_AEROSOLS = "visus_lidar_aerosols"; 
     567    private static final String VIEW_DATA_OHP = "data_ohp"; 
    513568 
    514569    //services que le controller peut utiliser 
  • ether_ndacc/trunk/web/src/com/ether/WebException.java

    r113 r204  
    33/** 
    44 * @author vmipsl 
    5  * @date 02 feb 2011  
     5 * @date 02 feb 2011 
    66 */ 
    77@SuppressWarnings("serial") 
    8 public class WebException  
    9         extends FormattedException 
     8public class WebException 
     9        extends FormattedException 
    1010{ 
    11     public WebException(final Enum<? extends Code> code, final Throwable cause, final Object... parameters) { 
    12         this(code, cause.getMessage(), cause, parameters); 
     11    public WebException(final Enum<? extends Code> code) { 
     12        super(code); 
     13        } 
     14 
     15        public WebException(final Throwable cause) { 
     16                super(cause); 
     17        } 
     18 
     19        public WebException( final Enum<? extends Code> code, final String string) { 
     20                super(code, string); 
     21        } 
     22 
     23    public WebException( final Enum<? extends Code> code, final Throwable cause, final Object... parameters ) 
     24    { 
     25        this( code, cause.getMessage(), cause, parameters ); 
    1326    } 
    1427 
    15     protected WebException(final Enum<? extends Code> code, final String message, final Throwable cause, final Object... parameters) { 
    16         super(prefix(code, message), cause, parameters); 
     28    protected WebException( final Enum<? extends Code> code, final String message, final Throwable cause, final Object... parameters ) 
     29    { 
     30        super( prefix( code, message ), cause, parameters ); 
    1731    } 
    1832 
    19     public static enum WebCode implements Code  
     33    public static enum WebCode 
     34            implements Code 
    2035    { 
    21         UNKNOWN,  
    22         PERSISTENCE,  
    23         SERVICE_PROBLEM,  
     36        UNKNOWN, 
     37        PERSISTENCE, 
     38        SERVICE_PROBLEM, 
     39        IO_EXCEPTION_ERROR_TO_GET_OUTPUTSTREAM, 
     40        ERROR_UNSUPPORTED_UTF8_ENCODING, 
     41        ERROR_NO_REQUEST_HANDLING_METHOD, 
     42        ERROR_NUMBER_OF_PARAM_TYPES_NOT_EQUAL_TO_PARAM_ANNOTATIONS, 
    2443    } 
    2544} 
  • ether_ndacc/trunk/web/template_haut.jsp

    r201 r204  
     1<%@ page import="com.ether.WebHelper" %> 
    12<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
     3<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 
     4 
    25<!--Bandeau du haut--> 
    36<script type="text/javascript" src="<c:url value="./resources/css/etherTypo.js"/>"></script> 
     
    2326<tr><td height=30></td> </tr> 
    2427      <tr> 
    25       <td><img src="resources/images/fr.jpg" alt="French version" border=0></td> 
     28      <td><a href="?<%=WebHelper.getUrlToRecall( request )%>&language=fr"><img src="resources/images/fr.jpg" alt="French version" border=0></a></td> 
    2629      <td>&nbsp;&nbsp;</td> 
    27       <td><img src="resources/images/en.jpg" alt="English version" border=0></td> 
    28       <td align="center" width="20%"><a id="menu0" class="menuon" onmouseout="changeMenu('menu0','out');" onmouseover="changeMenu('menu0','over');" href="index.jsp">Home</a></td> 
     30      <td><a href="?<%=WebHelper.getUrlToRecall( request )%>&language=en"><img src="resources/images/en.jpg" alt="English version" border=0></a></td> 
     31      <td align="center" width="20%"><a id="menu0" class="menuon" onmouseout="changeMenu('menu0','out');" onmouseover="changeMenu('menu0','over');" href="index.jsp"><spring:message code="home"/></a></td> 
    2932      <td align="center">&nbsp;</td> 
    3033 
    3134      <td align="center" width="20%" height="40%"> 
    32       <a id="menu1" class="menuon" onmouseout="changeMenu('menu1','out');" onmouseover="changeMenu('menu1','over');" href="about.jsp">About us</a> 
     35      <a id="menu1" class="menuon" onmouseout="changeMenu('menu1','out');" onmouseover="changeMenu('menu1','over');" href="about.jsp"><spring:message code="about"/></a> 
    3336      </td> 
    3437      <td align="center"><font color="#CDECFF;">&nbsp;</font></td> 
    3538 
    36       <td  align="center"  width="20%"><a href="data_ohp.jsp" id="menu2" class="menuon" onmouseout="changeMenu('menu2','on');" onmouseover="changeMenu('menu2','over');">Stations</a></td> 
     39      <td  align="center"  width="20%"><a href="data_ohp.jsp" id="menu2" class="menuon" onmouseout="changeMenu('menu2','on');" onmouseover="changeMenu('menu2','over');"><spring:message code="stations"/></a></td> 
    3740      <td align="center"><font color="#CDECFF;" >&nbsp;</font></td> 
    3841 
Note: See TracChangeset for help on using the changeset viewer.