source: ether_visual/trunk/save_form/formulaire.jsp.2 @ 396

Last change on this file since 396 was 17, checked in by cbipsl, 18 years ago

ajout V3

File size: 118.7 KB
Line 
1<%@ page import="fr.acri.norm.*" %>
2
3<%@ page import="java.io.*" %>
4<%@ page import="java.util.*" %>
5<%@ page import="java.lang.*" %>
6<%@ include file="declarations.jsp" %>
7<%@ include file="affectations.jsp" %>
8<%
9VISU_conf conf_visu=new VISU_conf();
10String rep_data=conf_visu.REP_DATA;
11String rep_xml=conf_visu.REP_XML;
12/********************************  LISTE DES EXPERIENCES  ***********************************************************/
13
14sql="SELECT distinct exp_name";
15sql+=" FROM ether.dcp_file_class, ether.ether_experiment, ether.dcp_descripteur, ether.dcp_parameter ";
16sql+="WHERE ether_experiment.exp_id=dcp_file_class.exp_id and dcp_descripteur.tpl_id=dcp_file_class.tpl_id ";
17sql+="and dcp_parameter.par_acronym = ether.dcp_descripteur.par_acronym and (isord=0 or isord=2) and associate=-1 ";
18
19if (sel_temp_name!=null && !sel_temp_name.equals("")) sql+="and exp_name like '%"+sel_temp_name+"%' ";
20;sql+=" and dcp_file_class.tpl_id NOT IN (1332,1333,1331) ";
21
22sql+="and exp_name not like '%AMON%' and exp_name not like '%SMR_OF%' and exp_name not like '%ELHYSA%' and exp_name not like '%LIDAR.AND%' and exp_name not like '%LIDAR.REU%'";
23
24sql+="ORDER BY exp_name";
25exp_list=req.get_list(sql,exp_columns0);
26
27if (exp_list==null || exp_list.size()==0) {
28        error_msg="No file class found in the database";
29}
30else {
31        nexp=exp_list.size()/exp_columns0.length;
32        exp_options0="";
33        if (nexp>0) {
34                k=0;
35                for(i=0;i<nexp;i++){
36                        selected="";
37                        if( isExp && exp_list.get(k).toString().equals(sel_tpl_name) ){
38                                selected="selected";
39                                sel_tpl_name=exp_list.get(k).toString();
40                        }
41                        exp_options0+="<OPTION class=grass VALUE=\""+exp_list.get(k)+"\" "+selected+">"+exp_list.get(k);
42                        exp_options0+="</OPTION>";
43                        k+=exp_columns0.length;
44                }
45
46        }
47        nexp=0;
48        exp_list=null; 
49}
50
51
52//LISTE DES DIFFERENTES VERSION ET NIVEAUX DE L'EXPERIENCE CHOISIE
53
54sql="SELECT distinct ether_experiment.exp_id,exp_name,exp_mission,set_dataset_version,set_ceos_level,set_ceos_sublevel,set_format";
55sql+=",dcp_file_class.tpl_id,exp_public,exp_alt_min,exp_alt_max FROM ether.dcp_file_class, ether.ether_experiment, ether.dcp_descripteur, ether.dcp_parameter ";
56sql+="WHERE ether_experiment.exp_id=dcp_file_class.exp_id and dcp_descripteur.tpl_id=dcp_file_class.tpl_id ";
57sql+="and dcp_parameter.par_acronym = ether.dcp_descripteur.par_acronym and (isord=0 or isord=2) and associate=-1 ";
58sql+="and dcp_file_class.tpl_id NOT IN (1332,1333,1331) ";
59sql+="and dcp_file_class.tpl_id in (select dcp_file_class.tpl_id from ether.ether_experiment, ether.dcp_file_class ";
60sql+="where ether_experiment.exp_id=dcp_file_class.exp_id and exp_name='"+sel_tpl_name+"') ";
61sql+="ORDER BY exp_name, set_dataset_version";
62
63
64nreq=-1;
65exp_list=req.get_list(sql,exp_columns);
66
67if (exp_list==null || exp_list.size()==0) {
68        error_msg="No file class found in the database";
69}
70else{
71        nreq=exp_list.size()/exp_columns.length;
72        exp_options="";
73        if (nreq>0) {
74                k=0;
75                sel_tpl="";
76                for (i=0 ; i < nreq ; i++) {
77
78                        if(exp_list.get(k+7).toString().equals(sel_tpl_id) ){
79                                selected="selected";
80                                sel_tpl=exp_list.get(k+7).toString();
81                                sel_exp_id=exp_list.get(k).toString();
82                                sel_version=exp_list.get(k+3).toString();
83                                sel_level=exp_list.get(k+4).toString();
84                                sel_sublevel=exp_list.get(k+5).toString();
85                                sel_format=exp_list.get(k+6).toString();
86                                sel_exp_public=exp_list.get(k+8).toString();
87                                exp_alt_min=exp_list.get(k+9).toString();
88                                exp_alt_max=exp_list.get(k+10).toString();
89                               
90                                //heightTexte="<b>(Between "+exp_alt_min+" km and "+exp_alt_max+" km in altitude)</b>";
91                                lib_mission=exp_list.get(k+2).toString();
92                                lib_version=exp_list.get(k+3).toString();
93                                lib_level=exp_list.get(k+4).toString();
94                               
95                                lib_sublevel=exp_list.get(k+5).toString();
96                                if (lib_sublevel.equals(".")) lib_sublevel="None";
97
98
99                                lib_fileformat=exp_list.get(k+6).toString();
100                                lib_tpl_id=exp_list.get(k+2).toString()+" - "+exp_list.get(k+3).toString()+" - "+exp_list.get(k+4).toString()+" - "+lib_sublevel+" - "+exp_list.get(k+6).toString();
101                        }
102                        else selected="";
103
104                        exp_options+="<OPTION class=selection VALUE=\""+exp_list.get(k+7)+"\" "+selected+">"+exp_list.get(k+2);
105                        exp_options+=" - "+exp_list.get(k+3)+" - "+exp_list.get(k+4)+" - ";
106                        if (!exp_list.get(k+5).toString().equals(".")) exp_options+=exp_list.get(k+5).toString()+" - ";
107                        exp_options+=exp_list.get(k+6)+"</OPTION>";
108                        k+=exp_columns.length;
109                }
110
111        }
112        exp_list=null;
113}
114exp_list=null; 
115
116if (!sel_tpl_id.equals("") && !sel_tpl_id.equals("null")) {
117
118listAbscisses absExp = new listAbscisses(sel_tpl_id, sel_exp_id, sel_par_abs);
119absExp.recupList();
120
121
122error_msg=absExp.error_msg;
123isParAbs=absExp.isParAbs;
124
125file_par_abs=absExp.file_par_abs;
126file_unit_abs=absExp.file_unit_abs;
127file_nature_abs=absExp.file_nature_abs;
128file_type_abs=absExp.file_type_abs;
129form_par_abs=absExp.form_par_abs;
130form_legend=absExp.form_legend;
131form_par_id=absExp.form_par_id;
132lib_param=absExp.lib_param;
133par_options_abs=absExp.par_options_abs;
134
135
136
137/* LISTE DES SOUS-PARAMETRES ABSCISSE */
138
139if(isParAbs) {// && !sel_par_abs.equals("") && !sel_par_abs.equals("null")) {
140        nreq=-1;
141
142        sel_par="";
143        if (sel_par_abs!=null) sel_par=(new stringSplit()).split(sel_par_abs,"%")[0];
144
145        // BORNES DE DATES
146        sql="SELECT DISTINCT set_first_date,set_last_date,set_lon_min,set_lon_max,set_lat_min,set_lat_max ";
147        sql+="FROM ether.ether_dataset,ether.dcp_file_class,set_parameter=par_acronym and set_id_experiment=exp_id and ";
148        sql+="(exp_id="+sel_exp_id+" or exp_id= ( select exp_id from ether.dcp_file_class where associate= "+sel_tpl_id+")) and set_parameter='";
149        sql+=sel_par+"' and ether_dataset.set_dataset_version='"+sel_version+"' "+ " and ether_dataset.set_ceos_level='"+sel_level+"' ";
150        sql+=" and ether_dataset.set_ceos_sublevel='"+sel_sublevel+"' "+" and ether_dataset.set_format='"+sel_format+"' ";
151        sspar_list=req.get_list(sql,sspar_columns1);
152        if (sspar_list!=null && sspar_list.size()>0) {
153                mindate_ms=Long.parseLong(sspar_list.get(0).toString());
154                maxdate_ms=Long.parseLong(sspar_list.get(1).toString());
155                DSMinDate=(new calDate(mindate_ms)).date_cal;
156                DSMaxDate=(new calDate(maxdate_ms)).date_cal;
157                date_time=DSMinDate.substring(0,10);
158                lonmin=sspar_list.get(2).toString();
159                lonmax=sspar_list.get(3).toString();
160                latmin=sspar_list.get(4).toString();
161                latmax=sspar_list.get(5).toString();
162        }
163
164        // LISTE DES SOUS-PARAMETRES PROPREMENT DIT
165        sql="select distinct subvariable from ether.dcp_descripteur, ether.dcp_file_class where par_acronym='"+sel_par+"'";
166        sql+=" and dcp_descripteur.tpl_id="+sel_tpl_id+" and dcp_descripteur.tpl_id=dcp_file_class.tpl_id and (exp_id="+sel_exp_id;
167        sql+=" or exp_id=( select exp_id from ether.dcp_file_class where associate= "+sel_tpl_id+"))";
168
169
170        sspar_list=req.get_list(sql,sspar_columns);
171        if (sspar_list==null || sspar_list.size()==0) isSspar=false;
172        else {
173                isSspar=true;
174                nreq=sspar_list.size()/sspar_columns.length;
175                sspar_options="";
176                if (nreq>0) {
177                     k=0;
178                     if (sel_sspar_abs=="" || sel_sspar_abs==null || sel_sspar_abs.equals("") || sel_sspar_abs.equals("null")) sel_sspar_abs=sspar_list.get(0).toString();
179                                for (i=0;i<nreq;i++) {
180                                        selected="";
181                                        if (isSspar && sspar_list.get(k).toString().equals(sel_sspar_abs)) selected="selected";
182                                        sspar_options+="<OPTION class=selection VALUE=\""+sspar_list.get(k).toString()+"\" "+selected+">";
183
184                                        if (sspar_list.get(k).toString().equals(".")) sspar_options+="None";
185                                        else sspar_options+=sspar_list.get(k);
186                                        sspar_options+="</OPTION>";
187                                        form_sspar_abs=sspar_list.get(k).toString();
188
189                                        k+=sspar_columns.length;
190                                }
191                }
192        }
193}
194
195
196/*LISTE DES PARAMETRES EN ORDONNEES*/
197
198if( isFile && isParAbs && sel_par_abs!=null && !sel_par_abs.equals("null") && !sel_par_abs.equals(""))  {
199if (graph_sel.equals("2")) {
200        listAbscisses ordExp = new listAbscisses(sel_tpl_id, sel_exp_id, sel_par_ord);
201        ordExp.recupList();
202
203        error_msg=ordExp.error_msg;
204        isParOrd=ordExp.isParAbs;
205
206        file_par_ord=ordExp.file_par_abs;
207        file_unit_ord=ordExp.file_unit_abs;
208        file_nature_ord=ordExp.file_nature_abs;
209        form_par_abs=ordExp.form_par_abs;
210        form_legend=ordExp.form_legend;
211
212        par_options_ord=ordExp.par_options_abs;
213
214
215        if (isParOrd && sel_par_ord!=null && sel_par_ord!="" && !sel_par_ord.equals("null") ) {
216        nreq=-1;
217
218        sel_par="";
219        if (sel_par_ord!=null) sel_par=(new stringSplit()).split(sel_par_ord,"%")[0];
220
221        // BORNES DE DATES
222        /*sql="SELECT DISTINCT set_first_date,set_last_date,set_lon_min,set_lon_max,set_lat_min,set_lat_max ";
223        sql+="FROM ether.ether_dataset,ether.dcp_file_class,set_parameter=par_acronym and set_id_experiment=exp_id and ";
224        sql+="(exp_id="+sel_exp_id+" or exp_id= ( select exp_id from ether.dcp_file_class WHERE associate= "+sel_tpl_id+")) and set_parameter='";
225        sql+=sel_par+"' and ether_dataset.set_dataset_version='"+sel_version+"' "+ " and ether_dataset.set_ceos_level='"+sel_level+"' ";
226        sql+=" and ether_dataset.set_ceos_sublevel='"+sel_sublevel+"' "+" and ether_dataset.set_format='"+sel_format+"' ";
227        sspar_list=req.get_list(sql,sspar_columns1);
228        if (sspar_list!=null && sspar_list.size()>0) {
229                mindate_ms=Long.parseLong(sspar_list.get(0).toString());
230                maxdate_ms=Long.parseLong(sspar_list.get(1).toString());
231                DSMinDate=(new calDate(mindate_ms)).date_cal;
232                DSMaxDate=(new calDate(maxdate_ms)).date_cal;
233                date_time=DSMinDate.substring(0,10);
234                lonmin=sspar_list.get(2).toString();
235                lonmax=sspar_list.get(3).toString();
236                latmin=sspar_list.get(4).toString();
237                latmax=sspar_list.get(5).toString();
238        }*/
239
240        // LISTE DES SOUS-PARAMETRES PROPREMENT DIT
241        sql="select distinct subvariable from ether.dcp_descripteur, ether.dcp_file_class where par_acronym='"+sel_par+"'";
242        sql+=" and dcp_descripteur.tpl_id="+sel_tpl_id+" and dcp_descripteur.tpl_id=dcp_file_class.tpl_id and (exp_id="+sel_exp_id;
243        sql+=" or exp_id=( select exp_id from ether.dcp_file_class where associate= "+sel_tpl_id+"))";
244
245
246        sspar_list=req.get_list(sql,sspar_columns);
247        if (sspar_list==null || sspar_list.size()==0) isSspar=false;
248        else {
249                isSspar=true;
250                nreq=sspar_list.size()/sspar_columns.length;
251                ssparord_options="";
252                if (nreq>0) {
253                     k=0;
254                     if (sel_sspar_ord=="" || sel_sspar_ord==null || sel_sspar_ord.equals("") || sel_sspar_ord.equals("null")) sel_sspar_ord=sspar_list.get(0).toString();
255                                for (i=0;i<nreq;i++) {
256                                        selected="";
257                                        if (isSspar && sspar_list.get(k).toString().equals(sel_sspar_ord)) selected="selected";
258                                        ssparord_options+="<OPTION class=selection VALUE=\""+sspar_list.get(k).toString()+"\" "+selected+">";
259
260                                        if (sspar_list.get(k).toString().equals(".")) ssparord_options+="None";
261                                        else ssparord_options+=sspar_list.get(k);
262                                        ssparord_options+="</OPTION>";
263
264                                        k+=sspar_columns.length;
265                                }
266                }
267        }
268       
269               
270
271        }       
272       
273}
274else {
275
276        from=" from ";
277        TRF=new Transform(sel_tpl_id, sel_exp_id,lang, file_type_abs);
278        isParOrd=TRF.isPar;
279        par_options_ord="";
280
281        if( !isParOrd ) error_msg="";
282        else{
283        _parameters=new ArrayList();
284        for(i=0;i<TRF.parameter.length;i++) if (!TRF.parameter[i].equals("Time") && !TRF.parameter[i].equals("Latitude") && !TRF.parameter[i].equals("Longitude")) {
285                if (!TRF.parameter[i].equals("Longitude") && !TRF.parameter[i].equals("Latitude") && !TRF.parameter[i].equals("Time")) {
286                if (!(graph_sel.equals("0") && !TRF.par_acr[i].equals("h"))) {
287                selected="";
288                svalue=TRF.par_acr[i]+"%"+TRF.nature[i]+"%"+TRF.ssparameter[i];
289                if ((selected.equals("") || selected.equals("null")) && (sel_par_ord.equals("") || sel_par_ord.equals("null"))) {
290                        if (file_type_abs.equals("densite")) sel_par_ord=svalue;
291                }
292
293                if( sel_par_ord!=null && sel_par_ord!="" && !sel_par_ord.equals("null") && TRF.par_acr[i]!=null && svalue.equals(sel_par_ord) ){
294                        selected="selected";
295                        file_par_ord=TRF.par_acr[i];
296                        file_sspar_ord=TRF.ssparameter[i];
297                        file_unit_ord=TRF.unit[i];
298                        if( sel_unit_ord==null || sel_unit_ord.equals("") || sel_unit_ord.equals("null") ){
299                                sel_unit_ord=file_unit_ord;
300                                isUnitOrd=true;
301                        }
302
303                        file_nature_ord=TRF.nature[i];
304                        display_type="available";
305                        form_par_ord=TRF.parameter[i];
306                }
307               
308
309                par_options_ord+="<OPTION class=selection VALUE=\""+svalue+"\" "+selected+">"+TRF.parameter[i];
310
311                if (TRF.nature[i].equals("Mes")) par_options_ord+=" (Measured)";
312                else par_options_ord+=" ("+TRF.nature[i]+")";
313
314                if (!TRF.ssparameter[i].equals(".")) par_options_ord+=" (subparameter : "+TRF.ssparameter[i]+")</OPTION>";
315                //else par_options_ord+=" - "+TRF.ssparameter[i]+"</OPTION>";
316                //if (selected.equals("selected")) par_observation_height=TRF.parameter[i]+" - "+TRF.nature[i]+" - "+TRF.ssparameter[i];
317                if (selected.equals("selected")) {
318                        par_observation_height=TRF.parameter[i]+" - ";
319                        if (TRF.nature[i].equals("Mes")) par_observation_height+=" (Measured)";
320                        else par_observation_height+=" ("+TRF.nature[i]+")";
321                        if (!TRF.ssparameter[i].equals(".")) par_options_ord+="- (subparameter : "+TRF.ssparameter[i]+")";
322                }
323
324                _parameters.add(TRF.par_acr[i]);
325                }
326                }
327        }
328
329         // PARAMETRES OBTENUS PAR TRANSFORMATIONS SIMPLES
330         if( file_type_abs.equals("profil") && TRF.cal_parameter!=null ) {
331        //      if (!TRF.cal_parameter[i].equals("Longitude") && !TRF.cal_parameter[i].equals("Latitude") && !TRF.cal_parameter[i].equals("Time")) {
332                for(i=0;i<TRF.cal_parameter.length;i++) {
333                        selected="";
334                        svalue=TRF.cal_par_acr[i]+"%"+TRF.cal_nature[i]+"%"+TRF.cal_par_acr_orig[i]+"%";
335                        svalue+=TRF.cal_ssparameter[i];
336                        if( sel_par_ord!=null && sel_par_ord!="" && !sel_par_ord.equals("null") && TRF.cal_par_acr[i]!=null && svalue.equals(sel_par_ord) ){
337                                selected="selected";
338                                file_par_ord=TRF.cal_par_acr[i];
339                                file_sspar_ord=TRF.cal_ssparameter[i];
340                                file_unit_ord=TRF.cal_unit[i];
341
342                                if( sel_unit_ord==null || sel_unit_ord.equals("") || sel_unit_ord.equals("null") ){
343                                        sel_unit_ord=file_unit_ord;
344                                        isUnitOrd=true;
345                                }
346
347                                file_nature_ord=TRF.cal_nature[i];
348                                display_type="transformed";
349
350                                file_par_aux=TRF.cal_par_acr_aux[i];
351                                file_unit_aux=TRF.cal_unit_aux[i];
352                                file_nature_aux=TRF.cal_nature_aux[i];
353                                file_par_aux1=TRF.cal_par_acr_aux1[i];
354                                file_unit_aux1=TRF.cal_unit_aux1[i];
355                                file_nature_aux1=TRF.cal_nature_aux1[i];
356
357                                file_trf_id=TRF.cal_trf_id[i];
358                                file_par_orig=TRF.cal_par_acr_orig[i];
359                                file_unit_orig=TRF.cal_unit_orig[i];
360                                file_nature_orig=TRF.cal_nature_orig[i];
361                        }
362
363                        if( !TRF.isRedundant[i] && !TRF.cal_trf_id[i].equals("999")) {// && !svalue.equals("Geopotential%Cal%Press%."))
364                                par_options_ord+="<OPTION class=selection VALUE=\""+svalue+"\" "+selected+">";
365                                par_options_ord+=TRF.cal_parameter[i]+from+TRF.cal_parameter_orig[i]+" (Calculated)</OPTION>";
366                                if (selected.equals("selected")) par_observation_height=TRF.cal_parameter[i]+from+TRF.cal_parameter_orig[i]+" (Calculated)";
367                        }
368
369                        _parameters.add(TRF.cal_par_acr[i]);
370                }
371        //}
372        }
373
374
375        // PARAMETRES OBTENUS PAR TRANSFORMATIONS COMBINEES
376/*        if( file_type_abs.equals("profil") && TRF.cbn_parameter!=null ){
377                for(i=0;i<TRF.cbn_parameter.length;i++){
378                        selected="";
379
380                        svalue=TRF.cbn_par_acr[i][TRF.cbn_parameter[i].length-1];
381                        svalue+="%"+TRF.cbn_nature[i][TRF.cbn_parameter[i].length-1]+"%";
382                        svalue+=TRF.cbn_par_acr_orig[i][0]+"%"+TRF.cbn_nature[i][TRF.cbn_ssparameter[i].length-1];
383
384                        if( sel_par_ord!=null && sel_par_ord!="" && !sel_par_ord.equals("null") && svalue.equals(sel_par_ord) ) {
385                                selected="selected";
386                                file_par_ord=TRF.cbn_par_acr[i][TRF.cbn_parameter[i].length-1];
387                                file_sspar_ord=TRF.cbn_ssparameter[i][TRF.cbn_parameter[i].length-1];
388                                file_unit_ord=TRF.cbn_unit[i][TRF.cbn_parameter[i].length-1];
389
390                                if( sel_unit_ord==null || sel_unit_ord.equals("") || sel_unit_ord.equals("null") ){
391                                        sel_unit_ord=file_unit_ord;
392                                        isUnitOrd=true;
393                                }
394                                file_nature_ord=TRF.cbn_nature[i][TRF.cbn_parameter[i].length-1];
395                                display_type="combined";
396                                file_trf_id=TRF.cbn_trf_id[i];
397                                file_par_orig=TRF.cbn_par_acr_orig[i][0];
398                                file_unit_orig=TRF.cbn_unit_orig[i][0];
399                                file_nature_orig=TRF.cbn_nature_orig[i][0];
400                         }
401
402                         // ON ECARTE LES TRANSFORMATIONS DONT LE PARAMETRE ORIGINE N'APPARTIENT PAS AU FICHIER
403                         // ON ECARTE EGALEMENT LES TRANSFORMATIONS REDONDANTES
404                         if( TRF.cbn_nature_orig[i][0]!=null && !TRF.cbn_nature_orig[i][0].equals("Cal") && !TRF.isRedundantCbn[i]) {
405                                par_options_ord+="<OPTION class=selection VALUE=\""+svalue+"\" "+selected+">";
406                                par_options_ord+=TRF.cbn_parameter[i][TRF.cbn_parameter[i].length-1]+from;
407                                par_options_ord+=TRF.cbn_parameter_orig[i][0];
408                                par_options_ord+=" (Calculated)</OPTION>";
409                                if (selected.equals("selected"))
410                                        par_observation_height=TRF.cbn_parameter[i][TRF.cbn_parameter[i].length-1]+from+TRF.cbn_parameter_orig[i][0]+" (Calculated)";
411
412
413                                _parameters.add(TRF.cbn_par_acr[i][TRF.cbn_parameter[i].length-1]);
414                         }
415
416       
417                }
418        }*/
419
420}
421}
422}
423
424
425
426
427//UNITES
428nunit_abs=-1;
429nunit_ord=-1;
430if (isFile) {
431        sql="select unit2.unit_acronym from ether.dcp_unit,ether.dcp_parameter,ether.dcp_unit unit2,ether.dcp_conversion ";
432        sql+="where par_acronym = '"+file_par_abs+"' and dcp_unit.unit_acronym = '"+file_unit_abs+"'";
433        sql+="and dcp_parameter.cls_acronym = dcp_unit.cls_acronym ";
434        sql+="and dcp_unit.unit_id = dcp_conversion.unit_orig and dcp_conversion.unit_final = unit2.unit_id";
435
436
437        unit_list_abs=req.get_list(sql,unit_columns);
438        isUnitAbs=true;
439        Object obs1=new Object();
440        obs1=file_unit_abs;
441        unit_list_abs.add(0,obs1);
442        nunit_abs=unit_list_abs.size()/unit_columns.length;
443        unit_options_abs="";
444
445        if( nunit_abs>0 ){
446                k=0;
447                if (!(sel_unit_abs!=null && !sel_unit_abs.equals("")) && sel_par_abs!=null
448                                && !sel_par_abs.equals("")) sel_unit_abs=unit_list_abs.get(0).toString();
449
450                for(i=0;i<nunit_abs;i++){
451                        selected="";
452                        if( isUnitAbs && unit_list_abs.get(k).toString().equals(sel_unit_abs)) selected="selected";
453
454                        unit_options_abs+="<OPTION class=selection VALUE=\"";
455                        unit_options_abs+=unit_list_abs.get(k)+"\" "+selected+">"+unit_list_abs.get(k)+"</OPTION>";
456                        k+=unit_columns.length;
457                }
458         }
459         if( isParOrd && file_par_ord!=null && !file_par_ord.equals("null") &&
460                                file_unit_ord!=null && !file_unit_ord.equals("null") && !file_unit_ord.equals("") ) {
461
462                sql="select unit2.unit_acronym from ether.dcp_unit, ether.dcp_parameter, ether.dcp_unit unit2,";
463                sql+="ether.dcp_conversion where par_acronym = '"+file_par_ord+"' and dcp_unit.unit_acronym = '"+file_unit_ord+"' ";
464                sql+="and dcp_parameter.cls_acronym = dcp_unit.cls_acronym and dcp_unit.unit_id = dcp_conversion.unit_orig ";
465                sql+="and dcp_conversion.unit_final = unit2.unit_id";
466                unit_list_ord=req.get_list(sql,unit_columns);
467
468                // RAJOUT DE L'UNITE DU FICHIER
469                Object obs=new Object();
470                obs=file_unit_ord;
471                unit_list_ord.add(0,obs);
472                isUnitOrd=true;
473                nunit_ord=unit_list_ord.size()/unit_columns.length;
474                unit_options_ord="";
475                if( nunit_ord>0 ){
476                        k=0;
477                        // ON FORCE LA SELECTION DE L'UNITE EN ORDONNEE A CELLE DU FICHIER PAR DEFAUT
478                        issel=false;
479                        for(i=0;i<nunit_ord;i++){
480                                if( isUnitOrd && unit_list_ord.get(k).toString().equals(sel_unit_ord) ){
481                                        issel=true;
482                                        break;
483                                }
484                                k+=unit_columns.length;
485                        }
486
487                        if( !issel ) sel_unit_ord=file_unit_ord;
488
489                        k=0;
490                        for(i=0;i<nunit_ord;i++){
491                                selected="";
492                                if( isUnitOrd && unit_list_ord.get(k).toString().equals(sel_unit_ord) )selected="selected";
493                                unit_options_ord+="<OPTION class=selection VALUE=\""+unit_list_ord.get(k)+"\" "+selected+">";
494                                unit_options_ord+=unit_list_ord.get(k)+"</OPTION>";
495                                k+=unit_columns.length;
496                        }
497                }
498        }
499
500}
501
502if (!afficheTrace.equals("null") && afficheTrace.equals("1")) {
503count=1;
504//UNITE DIFFERENTE
505//POUR L'ABSCISSE
506if( sel_unit_abs!=null && !sel_unit_abs.equals("") && !file_unit_abs.equals(sel_unit_abs) ){
507        ids=get_conv("acr", file_unit_abs, sel_unit_abs,req);
508        cnv_id=(new stringSplit()).split(ids,"%")[0];
509        trf_id=(new stringSplit()).split(ids,"%")[1];
510        // EST-CE UNE CONVERSION OU/ET UNE TRANSFORMATION (EN ABSCISSE SEULE UNE TRANFO NON COMBINEE PEUT AVOIR LIEU
511
512        if( !trf_id.equals("999") ){
513                // LA CONVERSION POINTE VERS UNE TRANSFORMATION: ATTENTION DANS CE CAS LA VARIABLE N'EST PAS TRANSFORMEE
514                // CELA RESTE UN CHANGEMENT D'UNITE
515                // DONC LA VARIABLE A LIRE RESTE LA MEME (CONTRAIREMENT A L'ORDONNEE OU CELLE A LIRE EST
516                // LA VARIABLE ORIGINE DE LA TRANSFORMATION ET NON PAS LA VARIABLE CHOISIE PAR L'UTILISATEUR
517                // QUI N'EXISTE PAS DANS LE FICHIER DE MESURE PUISQUE CALCULEE)
518                result=treat_trf(trf_id, sel_tpl_id, count,"",sel_unit_abs,false,true,req);
519                spl=(new stringSplit()).split(result,"%");
520                Xtransfo=spl[1];
521                AUX0transfo=spl[2];
522                AUX1transfo=spl[3];
523                count=Integer.parseInt(spl[4]);
524                more_varid+=spl[5];
525         }
526         else if( !cnv_id.equals("-1") ){
527                // C'EST UNE CONVERSION SIMPLE
528                Xtransfo="conv"+cnv_id+",999,999";
529         }
530        else{
531                sel_unit_abs=file_unit_abs;
532                Xtransfo="t999,999,999";
533        }
534 }
535 else{
536        Xtransfo="t999,999,999";
537 }
538
539//POUR ORDONNEE
540
541if(sel_unit_ord!=null && !sel_unit_ord.equals("")) {
542
543        if (graph_sel.equals("2")) {
544                if(!file_unit_ord.equals(sel_unit_ord) ){
545                ids=get_conv("acr", file_unit_ord, sel_unit_ord,req);
546                cnv_id=(new stringSplit()).split(ids,"%")[0];
547                trf_id=(new stringSplit()).split(ids,"%")[1];
548                // EST-CE UNE CONVERSION OU/ET UNE TRANSFORMATION (EN ABSCISSE SEULE UNE TRANFO NON COMBINEE PEUT AVOIR LIEU
549   
550                if( !trf_id.equals("999") ){
551                        // LA CONVERSION POINTE VERS UNE TRANSFORMATION: ATTENTION DANS CE CAS LA VARIABLE N'EST PAS TRANSFORMEE
552                        // CELA RESTE UN CHANGEMENT D'UNITE
553                        // DONC LA VARIABLE A LIRE RESTE LA MEME (CONTRAIREMENT A L'ORDONNEE OU CELLE A LIRE EST
554                        // LA VARIABLE ORIGINE DE LA TRANSFORMATION ET NON PAS LA VARIABLE CHOISIE PAR L'UTILISATEUR
555                        // QUI N'EXISTE PAS DANS LE FICHIER DE MESURE PUISQUE CALCULEE)
556                        result=treat_trf(trf_id, sel_tpl_id, count,"",sel_unit_ord,false,true,req);
557                        spl=(new stringSplit()).split(result,"%");
558                        Ytransfo=spl[1];
559                        AUY0transfo=spl[2];
560                        AUY1transfo=spl[3];
561                        count=Integer.parseInt(spl[4]);
562                        more_varid+=spl[5];
563                 }
564                 else if( !cnv_id.equals("-1") ){
565                        // C'EST UNE CONVERSION SIMPLE
566                        Ytransfo="conv"+cnv_id+",999,999";
567                }
568                else{
569                     sel_unit_ord=file_unit_ord;
570                     Ytransfo="t999,999,999";
571               }
572        }
573        else{
574               Ytransfo="t999,999,999";
575        }
576
577        }
578        else {
579 
580        ordonnee=file_par_ord;
581        sspar_ordonnee=file_sspar_ord;
582        numY_aux0=999;
583        numY_aux1=999;
584        isTransform=false;
585
586        // LA VARIABLE DEMANDEE EN ORDONNEE N'EST PAS DISPONIBLE DANS LE FICHIER
587        // ON CREE DE LA DONNEE VIA UNE TRANSFORMATION DE VARIABLE
588        if( !display_type.equals("available") ){
589
590                isTransform=true;
591                auxiliary=file_par_aux;
592                auxiliary_nature=file_nature_aux;
593                auxiliary1=file_par_aux1;
594                auxiliary_nature1="file_nature_aux1";
595                origin="file_par_orig";
596                origin_unit=file_unit_orig;
597                origin_nature=file_nature_orig;
598
599                // 2 POSSIBILITES :
600                // 1/ ON TRANSFORME LA VARIABLE INITIALE PAR UNE TRANSFORMATION SIMPLE
601                if( display_type.equals("transformed") ){
602                        if( !file_trf_id.equals("999") ){
603                                //LA CONVERSION POINTE VERS UNE TRANSFORMATION
604                                result=treat_trf(file_trf_id, sel_tpl_id, count,origin_unit,sel_unit_ord,true,true,req);
605                                spl=(new stringSplit()).split(result,"%");
606                                varY=spl[0];
607                                Ytransfo=spl[1];
608                                AUY0transfo=spl[2];
609                                //AUY0transfo=spl[2];
610                                AUY1transfo=spl[3];
611                                count=Integer.parseInt(spl[4]);
612
613                                more_varid+=spl[5];
614
615                         }else{
616                                sel_unit_ord=file_unit_ord;
617                                Ytransfo="t999,999,999";
618
619                         }
620                 // 2/ ON TRANSFORME LA VARIABLE INITIALE PAR UNE TRANSFORMATION COMBINEE
621                 }
622                else if( display_type.equals("combined") ){
623                        if( !file_trf_id.equals("999") ){
624                                //La conversion pointe vers une transformation
625                                result=treat_cbn(file_trf_id, sel_tpl_id, count,origin_unit,sel_unit_ord,req);
626                                spl=(new stringSplit()).split(result,"%");
627                                varY=spl[0];
628                               
629                                Ytransfo=spl[1];
630                                AUY0transfo=spl[2];
631                                AUY1transfo=spl[3];
632                                count=Integer.parseInt(spl[4]);
633                                more_varid+=spl[5];
634                        }else {
635                                sel_unit_ord=file_unit_ord;
636                                Ytransfo="t999,999,999";
637                        }
638                 }
639                 }else{
640                        // PAS DE TRANSFORMATION MAIS PEUT-ETRE UNE CONVERSION
641                      nature_ord=file_nature_ord;
642                      //varY=",{variable:'"+ordonnee+"', nature:'"+nature_ord+"', subvariable:'"+sspar_ordonnee+"', unite:'"+sel_unit_ord+"'}";
643                        varY=ordonnee+","+nature_ord+","+sspar_ordonnee+","+sel_unit_ord;
644                      if( !file_unit_ord.equals(sel_unit_ord) ){
645                                ids=get_conv("acr", file_unit_ord, sel_unit_ord,req);
646                                cnv_id=(new stringSplit()).split(ids,"%")[0];
647                                trf_id=(new stringSplit()).split(ids,"%")[1];
648
649                                //EST-CE UNE CONVERSION OU/ET UNE TRANSFORMATION (EN ORDONNEE TRANFO OU COMBINEE PEUVENT
650                                //AVOIR LIEU
651                                if( !trf_id.equals("999") ){
652                                        //LA CONVERSION POINTE VERS UNE TRANSFORMATION
653                                        result=treat_trf(trf_id, sel_tpl_id, count, "", sel_unit_ord,false,true,req);
654                                        spl=(new stringSplit()).split(result,"%");
655                                        varY=spl[0];
656                                        Ytransfo=spl[1];
657                                        AUY0transfo=spl[2];
658                                        AUY1transfo=spl[3];
659                                        count=Integer.parseInt(spl[4]);
660                                        more_varid+=spl[5];
661                                }
662                                else if( !cnv_id.equals("-1") ){
663                                        //C'EST UNE CONVERSION SIMPLE
664                                        Ytransfo="conv"+cnv_id+",999,999";
665
666                                }else{
667                                        sel_unit_ord=file_unit_ord;
668                                        Ytransfo="t999,999,999";
669                                }
670                        }else{
671                                        Ytransfo="t999,999,999";
672                        }
673                 }
674        }
675
676}
677TRANSFO="";
678TRANSFO+=Xtransfo+"&"+Ytransfo;
679if( !AUX0transfo.equals("") )TRANSFO+="&"+AUX0transfo;
680if( !AUX1transfo.equals("") )TRANSFO+="&"+AUX1transfo;
681if( !AUY0transfo.equals("") )TRANSFO+="&"+AUY0transfo;
682if( !AUY1transfo.equals("") )TRANSFO+="&"+AUY1transfo;
683}
684
685//if (!afficheTrace.equals("null") && afficheTrace.equals("1")) {
686nfile=-1;
687if (isParAbs && sel_par_abs!=null && isParOrd ) {
688        if (sel_par_ord!=null && sel_par_ord!="") {
689        sel_par="";
690        if (sel_par_abs!=null) sel_par=(new stringSplit()).split(sel_par_abs,"%")[0];
691        //DETERMINATION DES BORNES SPATIO-TEMPROELLES
692                if ((sel_mindate==null || sel_mindate.equals("") || sel_mindate.equals("null")
693                        || sel_maxdate==null || sel_maxdate.equals("") || sel_maxdate.equals("null")
694                        || lonmin==null || lonmin.equals("") || lonmin.equals("null")
695                        || lonmax==null || lonmax.equals("") || lonmax.equals("null")
696                        || latmin==null || latmin.equals("") || latmin.equals("null")
697                        || latmax==null || latmax.equals("") || latmax.equals("null"))
698                        && sel_exp_id!=null && sel_sspar_abs!=null) {
699
700                        sql="SELECT min(eth_first_date) as mindate, max(eth_last_date) as maxdate,min(eth_lon_min) as lonmin";
701                        sql+=",max(eth_lon_max) as lonmax,min(eth_lat_min) as latmin, max(eth_lat_max) as latmax,min(eth_alt_min) as altmin";
702                        sql+=",max(eth_alt_max) as altmax ";
703                        sql+="FROM ether.ether_file where (eth_id_experiment="+sel_exp_id;
704                        sql+=" or eth_id_experiment=(select exp_id from ether.dcp_file_class where associate="+sel_tpl_id+")) ";
705                        sql+=" and (eth_subparameter='"+sel_sspar_abs+"' or eth_subparameter='.') and eth_parameter='"+sel_par+"'";
706                        sql+=" and eth_dataset_version='"+sel_version+"' ";
707                        sql+=" and eth_ceos_level='"+sel_level+"' ";
708                        sql+=" and eth_ceos_sublevel='"+sel_sublevel+"' ";
709                        sql+=" and eth_format='"+sel_format+"'";
710       
711                        al1=req.get_list(sql,cols);
712                        exp_alt_min=al1.get(6).toString();
713                        exp_alt_max=al1.get(7).toString();
714                        if(al1!=null && al1.size()>0) {
715                                if (exp_alt_min!=null && !exp_alt_min.equals("") && exp_alt_max!=null && !exp_alt_min.equals("")) {
716                                        heightTexte="<b>(Between "+exp_alt_min+" km and "+exp_alt_max+" km in altitude)</b>";
717                                }
718
719                                if (sel_mindate==null || sel_mindate.equals("") || sel_mindate.equals("null")) {
720                                        mindate_ms=Long.parseLong(al1.get(0).toString());
721                                        DSMinDate=(new calDate(mindate_ms)).date_cal;
722                                }
723                                else {
724                                        DSMinDate=sel_mindate;
725                                        mindate_ms=(new calDate()).invers(sel_mindate);
726
727                                }
728
729                                if (sel_maxdate==null || sel_maxdate.equals("") || sel_maxdate.equals("null")) {
730                                        maxdate_ms=Long.parseLong(al1.get(1).toString());
731                                        DSMaxDate=(new calDate(maxdate_ms)).date_cal;
732
733                                }
734                                else {
735                                        DSMaxDate=sel_maxdate;
736                                        maxdate_ms=(new calDate()).invers(sel_maxdate);
737
738                                }
739                                if (lonmin==null || lonmin.equals("") || lonmin.equals("null")) lonmin=al1.get(2).toString();
740                                if (lonmax==null || lonmax.equals("") || lonmax.equals("null")) lonmax=al1.get(3).toString();
741
742                                if (latmin==null || latmin.equals("") || latmin.equals("null")) latmin=al1.get(4).toString();
743                                if (latmax==null || latmax.equals("") || latmax.equals("null")) latmax=al1.get(5).toString();
744
745                                DSMinDate_file=DSMinDate;
746                                DSMaxDate_file=DSMaxDate;
747                                if (file_type_abs.equals("densite")) {
748                                        sel_date_time=DSMinDate.substring(0,10);
749                                }
750                                lonmin_file=lonmin;
751                                lonmax_file=lonmax;
752                                latmin_file=latmin;
753                                latmax_file=latmax;
754
755                        }
756
757                        if (!exp_nrecouv.equals("-1") && exp_nrecouv!=null) {
758                                calNRecouv pnrecouv = new calNRecouv((new calDate()).invers(DSMinDate),Integer.parseInt(exp_nrecouv),"jour");
759                                DSMaxDate=pnrecouv.date_cal;
760                                if ((new calDate()).invers(DSMaxDate) > (new calDate()).invers(DSMaxDate_file)) DSMaxDate=DSMaxDate_file;
761                        }
762
763
764        }
765        else if ((sel_mindate!=null && sel_maxdate!=null)) {//|| (sel_date_time!="" && sel_date_time!=null)) {
766                DSMinDate=sel_mindate;
767                DSMaxDate=sel_maxdate;
768
769                if (!file_type_abs.equals("densite")) {
770                        mindate_ms=(new calDate()).invers(sel_mindate);
771                        maxdate_ms=(new calDate()).invers(sel_maxdate);
772                }
773                else {
774                        mindate_ms=(new calDate()).invers(sel_date_time+"-00:00:00:000");
775                        maxdate_ms=(new calDate()).invers(sel_date_time+"-23:59:59:000");
776                }
777        }
778
779}
780
781}
782// LISTE DES FICHIERS diSponibles
783sel_file="";
784file_list=null;
785nfile=0;
786
787
788sql="select is_batch, exp_nrecouv from sil_experiment_attribut where exp_id='"+sel_exp_id+"'";
789exp_attribut_list=req.get_list(sql,exp_attribut_columns);
790
791if (exp_attribut_list==null || exp_attribut_list.size()==0) {
792        is_batch="0";
793        exp_nrecouv="-1";
794}
795else{
796        nreq=exp_attribut_list.size()/exp_attribut_columns.length;
797        if( nreq>0 ){
798            k=0;
799            is_batch=exp_attribut_list.get(k).toString();
800            if (!exp_attribut_list.get(k+1).toString().equals("") && exp_attribut_list.get(k+1).toString()!=null) exp_nrecouv=exp_attribut_list.get(k+1).toString();
801            else exp_nrecouv="-1";     
802               
803        }
804}
805
806if (sel_exp_public.equals("1")) {
807        is_private="1";
808        private_data_flag="1";
809}
810else {
811        is_private="0";
812        private_data_flag="0";
813}
814
815
816if (is_private.equals("1")) {
817        if (is_batch.equals("0")) {
818                droit="1";
819                modei="none";
820        }
821        else {
822                modei="email";
823                if (cemail.equals("") || cemail.equals("null")) {
824                        droit="0";
825                }
826                else {
827                        droit="1";
828                }
829        }
830        download_auth="0";
831}
832if (is_private.equals("0")) {
833//      email="";
834        modei="loginu";
835
836        if (onlydata.equals("1")) {
837                download_auth="1";
838                droit="1";
839                rightTexte="Only data";
840        }
841        else {
842        if (is_batch.equals("1")) {
843                if (!cemail.equals("") && !cemail.equals("null")) {
844                        download_auth="1";
845                        email=cemail;
846                        droit="1";
847                        continuer="0";
848                }
849                else continuer="1";
850        }
851        else continuer="1";
852
853        if (continuer.equals("1")) {
854
855        if (!login.equals("") && !passu.equals("")) {
856
857        //recherche donnees utilisateur
858        sql="select id,email,name,first_name from ether_user where login='"+login+"' and password='"+passu+"'";
859        user_list=req.get_list(sql,user_columns);
860
861        if (user_list==null || user_list.size()==0) {
862                droit="0";
863                login="";
864                passu="";
865                lance="0";
866                name="Login non-existent in Ether base";
867                modei="err";
868
869        }
870        else{
871                nreq=user_list.size()/user_columns.length;
872                if( nreq>0 ){
873                        k=0;
874                        userid=user_list.get(k).toString();
875                        email=user_list.get(k+1).toString();
876                        name=user_list.get(k+2).toString();
877                        first_name=user_list.get(k+3).toString();
878
879                }
880
881        }
882
883
884        //recherche group_id de l'experience
885        sql="select eri_group_id from ether_experiment_right where eri_experiment_id='"+sel_exp_id+"'";
886        group_list=req.get_list(sql,group_columns);
887
888        if (group_list==null || group_list.size()==0) {
889        }
890        else{
891               nreq=group_list.size()/group_columns.length;
892               if( nreq>0 ){
893                        k=0;
894                        group=group_list.get(k).toString();
895                }
896
897        }
898
899        //recherche droit utilisateur
900        sql="select id from ether_group_user where user_id='"+userid+"' and group_id='"+group+"'";
901        priv_list=req.get_list(sql,priv_columns);
902
903        if (priv_list==null || priv_list.size()==0) {
904                download_auth="1";
905                login="";
906                passu="";
907        }
908        else{
909                nreq=priv_list.size()/priv_columns.length;
910                if( nreq>0 ){
911                        droit="1";
912                        download_auth="0";
913                }
914                else {
915                        download_auth="1";
916                }
917
918        }
919
920        }
921        droit="1";
922        }
923        if (download_auth.equals("0")) rightTexte="Data and download";
924        else rightTexte="Only data";
925
926        }
927
928}
929
930if (download_auth.equals("0")) rightTexte="Data and download";
931else rightTexte="Only data";
932
933
934if (is_batch.equals("1")) modeTexte="BATCH";
935else modeTexte="DIRECT";
936
937ftitle=request.getParameter("ftitle");
938if (ftitle==null || ftitle.equals("") || ftitle.equals("null")) {
939                ftitle="";
940}
941
942if (colour_bar_title==null || colour_bar_title.equals("") || colour_bar_title.equals("null")) {
943        colour_bar_title=form_legend;
944
945}
946
947if (droit.equals("1") && !afficheTrace.equals("null") && afficheTrace.equals("1")) {
948
949/*        sql="select * from ether.ether_file,ether.dcp_file_class file_class ";
950        sql+="where eth_id_experiment=exp_id ";
951        sql+="and eth_dataset_version=set_dataset_version ";
952        sql+="and eth_ceos_level=set_ceos_level ";
953        sql+="and eth_ceos_sublevel=set_ceos_sublevel ";
954        sql+="and eth_format=set_format and ";
955        sql+="eth_id_experiment=exp_id and eth_id_experiment="+sel_exp_id;
956        sql+=" and (eth_subparameter='"+sel_sspar_abs+"' ";
957        sql+=" or eth_subparameter='.') ";
958        sql+=" and eth_parameter='"+file_par_abs+"' and associate=-1 ";
959        sql+=" and eth_dataset_version='"+sel_version+"' ";
960        sql+=" and eth_ceos_level='"+sel_level+"' ";
961        sql+=" and eth_ceos_sublevel='"+sel_sublevel+"' ";
962        sql+=" and eth_format='"+sel_format+"' and ";
963        sql+=" (eth_last_date>="+mindate_ms+" and eth_first_date<="+maxdate_ms+") ";
964        sql+="and (eth_lon_max>="+lonmin+" and eth_lon_min<="+lonmax+") and (eth_lat_max>="+latmin+" and eth_lat_min<="+latmax+") ";
965
966*/
967
968        sql="SELECT * ";
969        sql+="FROM ether.ether_file where (eth_id_experiment="+sel_exp_id;
970        sql+=" or eth_id_experiment=(select exp_id from ether.dcp_file_class where associate="+sel_tpl_id+")) ";
971        sql+=" and (eth_subparameter='"+sel_sspar_abs+"' or eth_subparameter='.') and eth_parameter='"+file_par_abs+"'";
972        sql+=" and eth_dataset_version='"+sel_version+"' ";
973        sql+=" and eth_ceos_level='"+sel_level+"' ";
974        sql+=" and eth_ceos_sublevel='"+sel_sublevel+"' ";
975        sql+=" and eth_format='"+sel_format+"'";
976
977        file_list=req.get_list(sql,file_columns2);
978
979        if (file_list==null || file_list.size()==0) {
980                out.write("<script>alert('No experiment files found for this selection');</script>");
981                isFile=false;
982        }else{
983                isFile=true;
984                nfile=file_list.size()/file_columns2.length;
985                if( nfile>0 ){
986                        if (is_batch.equals("1")) mode="BATCH";
987                        else mode="DIRECT";
988                        k=0;
989                        for(i=0;i<nfile;i++){
990                                sel_file+=file_list.get(k+2)+","+file_list.get(k+5)+","+file_list.get(k+6)+","+file_list.get(k+7);
991                                sel_file+=","+file_list.get(k+8)+"&";
992                                k+=file_columns2.length;
993                        }
994                }
995
996        }
997
998
999
1000pageMode="";
1001
1002if (sel_tpl_id!=null && !sel_tpl_id.equals("") && isFile==true) {
1003        pageMode="";
1004        reader=file_reader(sel_tpl_id,req);
1005        if (sel_file!=null && !sel_file.equals("")) {
1006
1007                files=sel_file;
1008                varid="[{variable:'"+file_par_abs+"', nature:'"+file_nature_abs+"', subvariable:'"+sel_sspar_abs+"', unite:'"+sel_unit_abs+"'}"+varY;
1009                varid+=more_varid;
1010                varid+="]";
1011
1012                typeOrdonnee=file_par_ord;
1013
1014                reader_param_varid=file_par_abs+","+file_nature_abs+","+sel_sspar_abs+","+sel_unit_abs;
1015                reader_param_varid+="&";
1016                reader_param_varid+=varY+more_varid;
1017
1018                tt=(new stringSplit()).split(files,"&");
1019                len=tt.length;
1020                if( tt[len-1].equals("")) len=len-1;
1021                filename=new String[len];
1022                auxfile=new String[len];
1023                infofile="";
1024
1025                for(i=0; i<len;i++){
1026                        filename[i]=(new stringSplit()).split(tt[i],",")[0];
1027                        tab_file_name+=rep_data+filename[i];
1028                        if( i<len-1 )tab_file_name+=",";
1029
1030
1031                        assoc=scanAssociates("info",sel_tpl_id,filename[i],rep_data,req);
1032                        if( assoc!=null && assoc.length>0 ){
1033                                infofile+=assoc[0];
1034                        }else{
1035                                infofile+="none";
1036                        }
1037
1038                        if (i<len-1) infofile+=",";
1039
1040                        ///////////////////////////////////////////////
1041                        assoc=scanAssociates("paramaux",sel_tpl_id,filename[i],rep_data,req);
1042                        if( assoc!=null && assoc.length>0 ){
1043                                for(int p=0;p<assoc.length;p++){
1044
1045                                        reponse=(new stringSplit()).split(assoc[p],"%");
1046                                        nomfile=reponse[0];
1047                                        nomvariable=reponse[1];
1048                                        nomsubvariable=reponse[2];
1049                                        src=reponse[3];
1050
1051                                        tab_paux=nomfile+",";
1052                                        tab_paux+=nomvariable+",";
1053                                        tab_paux+=nomsubvariable+",";
1054                                        tab_paux+=src;
1055                                        nassoc=scanAssociates("info",sel_tpl_id,(new File(nomfile)).getName(),rep_data,req);
1056                                        if (nassoc!=null && nassoc.length>0) tab_paux+=","+nassoc[0];
1057                                        else tab_paux+=",.";
1058
1059                                        auxstruct+=tab_paux;
1060                                        if( p<assoc.length-1 )auxstruct+="&";
1061
1062                                }
1063                        }
1064                        else{
1065                                tab_paux="none,";
1066                                tab_paux+="none,";
1067                                tab_paux+="none,";
1068                                tab_paux+="none,";
1069                                tab_paux+=".";
1070                                auxstruct+=tab_paux;
1071                                isParamaux=false;
1072                        }
1073
1074                        if (i<len-1) auxstruct+="@";
1075
1076                }
1077        }
1078        /**************************CREATION FICHIER XML*********************************************/
1079
1080        structureXML docXML = new structureXML();
1081       
1082        docXML.rep_xml=rep_xml;
1083
1084        docXML.id_session=id_session;
1085        docXML.uniqueid=uniqueid;
1086        docXML.mode=mode;
1087
1088        docXML.private_data_flag=private_data_flag;
1089        docXML.download_auth=download_auth;
1090        docXML.flag_extrapolate_auth=flag_extrapolate_auth;
1091
1092        docXML._1d_interpolator_method=_1d_interpolator_method;
1093        docXML._1d_spacing=_1d_spacing;
1094        docXML._1d_Nmax=_1d_Nmax;
1095        docXML._1d_Nmin=_1d_Nmin;
1096
1097        docXML.irreg_grid_method=irreg_grid_method;
1098        docXML.reg_grid_method=reg_grid_method;
1099        docXML._2d_xspacing=_2d_xspacing;
1100        docXML._2d_yspacing=_2d_yspacing;
1101        docXML._2d_NXmax=_2d_NXmax;
1102        docXML._2d_NXmin=_2d_NXmin;
1103        docXML._2d_NYmax=_2d_NYmax;
1104        docXML._2d_NYmin=_2d_NYmin;
1105        docXML.flag_validity_mask=flag_validity_mask;
1106
1107        if (file_type_abs.equals("densite")) {
1108                densite="1";
1109                docXML.profil_flag="1";
1110        }
1111        else docXML.profil_flag="0";
1112
1113        docXML.densite=densite;
1114
1115        docXML.experiment_name=sel_tpl_name;
1116
1117        docXML.plot_type=graph_sel;
1118        docXML.reader=reader;
1119        docXML.tab_file=tab_file_name;
1120        docXML.tab_infofile=infofile;
1121
1122        if (!file_type_abs.equals("densite")) {
1123                docXML.mindate=DSMinDate;
1124                docXML.maxdate=DSMaxDate;
1125        }
1126        else {
1127                docXML.mindate=sel_date_time+"-00:00:00:000";
1128                docXML.maxdate=sel_date_time+"-23:59:59:000";
1129        }
1130
1131        docXML.latmin=latmin;
1132        docXML.latmax=latmax;
1133        docXML.lonmin=lonmin;
1134        docXML.lonmax=lonmax;
1135
1136        docXML.observation_height=observation_height;
1137        docXML.num_version=sel_version;
1138        docXML.map_projection=map_projection;
1139
1140        docXML.hemisphere=hemisphere;
1141
1142        docXML.title=ftitle;
1143        docXML.sub_title=ftitle;
1144
1145        docXML.colour_bar_title=colour_bar_title;
1146        docXML.map_information_level=map_information_level;
1147        docXML.map_filling=map_filling;
1148        docXML.map_axes_type=map_axes_type;
1149        docXML.grid_linestyle=grid_linestyle;
1150        docXML.latitude_posting=latitude_posting;
1151        docXML.longitude_posting=longitude_posting;
1152        docXML.colour_bar_grid=colour_bar_grid;
1153        docXML.colour_bar_nb_value=colour_bar_nb_value;
1154
1155        docXML.auxstruct=auxstruct;
1156
1157        docXML.read_param_varid=reader_param_varid;
1158
1159        docXML.parameter_name=form_par_abs;
1160        docXML.vertical_scale_name=file_par_ord;
1161
1162        docXML.vertical_scale_unit=sel_unit_ord;
1163        docXML.parameter_unit=sel_unit_abs;
1164        docXML.sub_parameter=form_sspar_abs;
1165
1166        docXML.xvariable=file_par_abs;
1167        docXML.xnature=file_nature_abs;
1168        if (sel_sspar_abs.equals(".")) docXML.xsubvariable="none";
1169        else docXML.xsubvariable=sel_sspar_abs;
1170        docXML.xunite=sel_unit_abs;
1171
1172        docXML.contour_display_mode=contour_display_mode;
1173        docXML.contour_default_colour_flag=contour_default_colour_flag;
1174        docXML.contour_default_colour=contour_default_colour;
1175        docXML.contour_default_linestyle=contour_default_linestyle;
1176        docXML.contour_default_line_thickness=contour_default_line_thickness;
1177        docXML.contour_default_label_flag=contour_default_label_flag;
1178
1179        if (graph_sel.equals("13") && contour_default_colour_flag.equals("0")) {
1180                if (contour_display_mode.equals("0")) {
1181                        if (contour_default_colour_flag.equals("0") && contour_default_colour.equals("0,0,0")) {
1182                                docXML.idl_colour_table_id="";
1183                                docXML.contour_default_colour_flag="1";
1184                        }
1185                        else {
1186                                docXML.line_colour=contour_default_colour;
1187                        }
1188                }
1189                else {
1190                        docXML.idl_colour_table_id="";
1191                        docXML.contour_default_colour_flag="1";
1192                }
1193
1194        }
1195        else if ((graph_sel.equals("3") && dot_plot_colour_flag.equals("1")) ||
1196                        (graph_sel.equals("13") && contour_default_colour_flag.equals("1")) ||
1197                        (graph_sel.equals("0"))
1198                ) {
1199                docXML.idl_colour_table_id=idl_colour_table_id;
1200
1201                if (!imported_colour_table.equals("") && !imported_colour_table.equals("null") && imported_colour_table!="" && imported_colour_table!=null)
1202                {
1203                        docXML.imported_colour_table=imported_colour_table;
1204                }
1205
1206                docXML.val_min_bd=val_min_bd;
1207                docXML.val_max_bd=val_max_bd;
1208                docXML.unite_bd=unite_bd;
1209
1210        }
1211
1212        sql="SELECT mt_id ";
1213        sql+="FROM sil_type_trace WHERE tt_id="+graph_sel;
1214        file_list=null;
1215        file_list=req.get_list(sql,metat_columns);
1216
1217        if (file_list==null || file_list.size()==0) {
1218        }else{
1219                nfile=file_list.size()/metat_columns.length;
1220                if (nfile>0) {
1221                        k=0;
1222                        docXML.meta_type=file_list.get(k).toString();
1223                }
1224        }
1225
1226        docXML.transfo=TRANSFO;
1227
1228        docXML.dot_plot_dot_style=dot_plot_dot_style;
1229        if (dot_plot_colour_flag.equals("0")) docXML.dot_plot_colour_flag="1";
1230        else docXML.dot_plot_colour_flag=dot_plot_colour_flag;
1231
1232        docXML.dot_plot_dotcolour=dot_plot_dotcolour;
1233        docXML.dot_plot_dotsize=dot_plot_dotsize;
1234
1235        if (levels.equals("1") && !userLevels.equals("") && !userLevels.equals("null")) {
1236                docXML.userLevels=userLevels;
1237                docXML.contour_level_setting_mode=levels;
1238        }
1239        else {
1240                docXML.userLevels="";
1241                docXML.contour_level_setting_mode="0";
1242        }
1243
1244
1245        String ret=docXML.generate();
1246        if (mode.equals("BATCH")) {
1247               
1248                pageMode="lanceEnTacheDeFond.jsp";
1249                if (!login.equals("") && !passu.equals("")) {
1250                        chainePageMode="?id="+id_session+"&uniqueid="+uniqueid+"&mode="+mode+"&email="+email;
1251                }
1252                else {
1253                        chainePageMode="?id="+id_session+"&uniqueid="+uniqueid+"&mode="+mode+"&email="+cemail;
1254                }
1255        }
1256        else {
1257                pageMode="lanceAppletEtherVisu.html";
1258                chainePageMode="?id="+id_session+"&uniqueid="+uniqueid+"&mode="+mode+"&email=";
1259        }
1260
1261}
1262}
1263}
1264par_options_abs+="<option class=selection value=''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>";
1265
1266par_options_abs0+="<option class=selection value=''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>";
1267
1268par_options_ord+="<option class=selection value=''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>";
1269
1270unit_options_abs+="<option class=selection value=''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>";
1271
1272//if (sspar_options.equals("") || sspar_options.equals("null") || sspar_options=="" || sspar_options==null) sspar_options="<OPTION class=selection VALUE=\".
1273//\" selected>None</OPTION>";
1274
1275sspar_options+="<option class=selection value=''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>";
1276
1277ssparord_options+="<option class=selection value=''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>";
1278
1279unit_options_ord+="<option class=selection value=''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>";
1280
1281exp_options+="<option class=selection value=''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>";
1282
1283
1284req.close_connection();
1285%>
1286<html>
1287<head>
1288<title>setAttribute et tableaux</title>
1289<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
1290<link rel="stylesheet" href="ether.css" type="text/css">
1291<script language="Javascript">
1292//<!--
1293var longdate="";
1294var regExpEmpty=/^(\s)*$/g;
1295
1296function updateCreation(mode) {
1297parent.creation.document.thisForm.active.value=mode;
1298parent.creation.document.thisForm.submit();
1299return true;
1300}
1301
1302function lancerMode(page,chainePage) {
1303if (page!='' && chainePage!='') {
1304Newfen(page+chainePage,'Visualisation_V3','800','800');
1305}
1306
1307return true;
1308
1309}
1310
1311function initForm(niv) {
1312var obj=document.thisForm;
1313if (niv=='5') {
1314        if (obj.file_type_abs.value=='densite') niv='6b';
1315        updateTitle();
1316}
1317
1318if (niv=='2') {
1319        obj.class_data_set.value="ssrubrique";
1320        obj.dis_data_set.value="";     
1321
1322        obj.class_component.value="inactif";
1323        obj.dis_component.value="disabled";
1324
1325        obj.class_axis.value="inactif";
1326
1327        obj.class_vertical_scale.value="inactif";
1328        obj.dis_vertical_scale.value="disabled";
1329               
1330        obj.class_time.value="inactif";
1331        obj.dis_time.value="disabled";
1332
1333        obj.class_ho.value="inactif";
1334        obj.dis_ho.value="disabled";
1335       
1336        obj.class_location.value="inactif";
1337        obj.class_location2.value="inactif";
1338       
1339        obj.sel_tpl_id.value="";
1340        obj.graph_sel.value="";
1341       
1342        openListGraph('1','1','');
1343}
1344
1345
1346if (obj.graph_sel.value=='' && niv!='2') {
1347        openListGraph('1','1');
1348        niv='2';
1349        obj.sel_tpl_id.value="";
1350}
1351
1352if (obj.graph_sel.value!='' && niv=='2') {
1353        //niv='3';
1354}
1355
1356
1357if (niv=='4' || niv=='1' || niv=='2') {
1358        obj.sel_par_abs.value="";
1359        obj.sel_par_ord.value="";
1360        obj.sel_unit_abs.value="";
1361        obj.sel_unit_ord.value="";
1362        obj.sel_sspar_abs.value="";
1363        obj.observation_height.value="";
1364        obj.latmin.value="";
1365        obj.lonmin.value="";
1366        obj.latmax.value="";
1367        obj.lonmax.value="";
1368
1369        obj.class_data_set.value="ssrubrique";
1370        obj.dis_data_set.value="";
1371
1372        obj.class_component.value="inactif";
1373        obj.dis_component.value="disabled";
1374        obj.class_axis.value="inactif";
1375
1376        obj.class_vertical_scale.value="inactif";
1377        obj.dis_vertical_scale.value="disabled";
1378
1379        obj.class_time.value="inactif";
1380        obj.dis_time.value="disabled";
1381
1382        obj.class_ho.value="inactif";
1383        obj.dis_ho.value="disabled";
1384        obj.class_location.value="inactif";
1385        obj.class_location2.value="inactif";
1386
1387}
1388
1389if (niv=='4') {
1390       
1391        obj.class_component.value="ssrubrique";
1392        obj.dis_component.value="";
1393        obj.class_axis.value="rubrique";
1394}
1395
1396if (niv=='5') {
1397        obj.sel_par_ord.value="";
1398        obj.sel_unit_ord.value="";
1399        obj.observation_height.value="";
1400        obj.latmin.value="";
1401        obj.lonmin.value="";
1402        obj.latmax.value="";
1403        obj.lonmax.value="";
1404
1405        obj.class_data_set.value="ssrubrique";
1406        obj.dis_data_set.value="";
1407
1408        obj.class_component.value="ssrubrique";
1409        obj.dis_component.value="";
1410        obj.class_axis.value="rubrique";
1411
1412        obj.class_vertical_scale.value="ssrubrique";
1413        obj.dis_vertical_scale.value="";
1414
1415        obj.class_time.value="ssrubrique";
1416        obj.dis_time.value="";
1417
1418        obj.class_ho.value="inactif";
1419        obj.dis_ho.value="disabled";
1420        obj.class_location.value="inactif";
1421        obj.class_location2.value="rubrique";
1422
1423}
1424
1425if (niv=='6') {
1426        obj.observation_height.value="";       
1427
1428        obj.class_data_set.value="ssrubrique";
1429        obj.dis_data_set.value="";
1430
1431        obj.class_component.value="ssrubrique";
1432        obj.dis_component.value="";
1433        obj.class_axis.value="rubrique";
1434
1435        obj.class_vertical_scale.value="ssrubrique";
1436        obj.dis_vertical_scale.value="";
1437
1438        obj.class_time.value="ssrubrique";
1439        obj.dis_time.value="";
1440
1441        obj.class_ho.value="ssrubrique";
1442        obj.dis_ho.value="";
1443        obj.class_location.value="rubrique";
1444}
1445
1446if (niv=='6b') {
1447       obj.observation_height.value="";
1448
1449       obj.class_data_set.value="ssrubrique";
1450       obj.dis_data_set.value="";
1451 
1452       obj.class_component.value="ssrubrique";
1453       obj.dis_component.value="";
1454       obj.class_axis.value="rubrique";
1455 
1456       obj.class_vertical_scale.value="ssrubrique";
1457       obj.dis_vertical_scale.value="";
1458
1459       obj.class_time.value="ssrubrique";
1460       obj.dis_time.value="";
1461 
1462       obj.class_ho.value="ssrubrique";
1463       obj.dis_ho.value="";
1464       obj.class_location.value="rubrique";
1465}
1466
1467
1468if (niv=='6' || niv=='6b') updateCreation('1');
1469else updateCreation('0');
1470
1471
1472parent.user_info.location.href='user_info.jsp?num_step='+niv+'&is_private='+<%=is_private%>;
1473//parent.user_info.document.thisForm.num_step.value=niv;
1474//parent.user_info.document.thisForm.submit(); 
1475
1476return true;
1477}
1478
1479function blocForm() {
1480document.thisForm.submit();
1481
1482document.thisForm.sel_tpl_id.disabled=true;
1483document.thisForm.sel_par_abs.disabled=true;
1484document.thisForm.sel_unit_abs.disabled=true;
1485document.thisForm.sel_sspar_abs.disabled=true;
1486if (document.thisForm.sel_par_ord) {
1487        document.thisForm.sel_par_ord.disabled=true;
1488        document.thisForm.sel_unit_ord.disabled=true;
1489}
1490document.thisForm.latmin.disabled=true;
1491document.thisForm.latmax.disabled=true;
1492document.thisForm.lonmin.disabled=true;
1493document.thisForm.lonmax.disabled=true;
1494document.thisForm.mindate.disabled=true;
1495document.thisForm.maxdate.disabled=true;
1496document.thisForm.observation_height.disabled=true;
1497document.thisForm.ftitle.disabled=true;
1498document.thisForm.colour_bar_title.disabled=true;
1499
1500
1501}
1502
1503function updateLegend() {
1504document.thisForm.colour_bar_title.value="";
1505
1506abs=document.thisForm.form_par_abs.value;
1507unit=document.thisForm.sel_unit_abs.value;
1508
1509legend=abs+' ('+unit+')';
1510
1511document.thisForm.colour_bar_title.value=legend;
1512
1513return true;
1514
1515}
1516
1517function updateTitle() {
1518document.thisForm.ftitle.value="";
1519oh=document.thisForm.observation_height.value;
1520
1521exp=document.thisForm.sel_tpl_name.value;
1522mid=document.thisForm.mindate.value;
1523mad=document.thisForm.maxdate.value;
1524par_observation_height=document.thisForm.par_observation_height.value;
1525sel_unit_ord=document.thisForm.sel_unit_ord.value;
1526
1527tt=exp;
1528if (document.thisForm.file_type_abs.value!="densite") {
1529if (oh!='' && !matchRegExp(oh, regExpEmpty)) {
1530        tt+=' - '+oh+' '+sel_unit_ord+' - ';
1531        tt+=document.thisForm.mindate.value.substring(0,10)+' to '+document.thisForm.maxdate.value.substring(0,10);
1532}
1533}
1534else tt+=' - '+document.thisForm.sel_date_time.value;
1535document.thisForm.ftitle.value=tt;
1536
1537return true;
1538
1539}
1540
1541function choixIdent(is_batch) {
1542if (document.thisForm.modei.value=="email") {
1543        //Newfen('email.jsp?cemail=&modifye=0&is_batch=','Email','400','300');
1544}
1545else if (document.thisForm.modei.value=="loginu") {
1546        //Newfen('loginu.jsp?modifye=0&is_batch='+is_batch,'Authentification','650','550');
1547}
1548document.thisForm.lance.value="1";
1549return true;
1550}
1551
1552function updateOverview() {
1553        graph_sel=document.thisForm.graph_sel.value;
1554        chaineURL="overview.jsp?graph_sel="+graph_sel;
1555        chaineURL+="&meta_type="+document.thisForm.lib_meta_type.value;
1556        chaineURL+="&file_type_abs="+document.thisForm.file_type_abs.value;
1557       
1558        if (document.thisForm.mindate.value!='') chaineURL+="&datemin="+document.thisForm.mindate.value;
1559        if (document.thisForm.maxdate.value!='') chaineURL+="&datemax="+document.thisForm.maxdate.value;
1560        if (document.thisForm.latmin.value!='') chaineURL+="&latmin="+document.thisForm.latmin.value;
1561        if (document.thisForm.latmax.value!='') chaineURL+="&latmax="+document.thisForm.latmax.value;
1562        if (document.thisForm.lonmin.value!='') chaineURL+="&lonmin="+document.thisForm.lonmin.value;
1563        if (document.thisForm.lonmax.value!='') chaineURL+="&lonmax="+document.thisForm.lonmax.value;
1564        if (document.thisForm.ftitle.value!='') chaineURL+="&title="+document.thisForm.ftitle.value;
1565        if (document.thisForm.sel_tpl_name.value!='') chaineURL+="&sel_tpl_name="+document.thisForm.sel_tpl_name.value;
1566        if (document.thisForm.sel_tpl_id.value!='') chaineURL+="&sel_tpl_id="+document.thisForm.lib_tpl_id.value;
1567        if (document.thisForm.sel_par_abs.value!='') chaineURL+="&sel_par_abs="+document.thisForm.lib_param.value;
1568        if (document.thisForm.sel_sspar_abs.value!='') chaineURL+="&sel_sspar_abs="+document.thisForm.sel_sspar_abs.value;
1569        if (document.thisForm.sel_par_ord.value!='') chaineURL+="&sel_par_ord="+document.thisForm.form_par_ord.value;
1570        if (document.thisForm.sel_unit_ord.value!='') chaineURL+="&sel_unit_ord="+document.thisForm.sel_unit_ord.value;
1571        if (document.thisForm.sel_unit_abs.value!='') chaineURL+="&sel_unit_abs="+document.thisForm.sel_unit_abs.value;
1572        if (document.thisForm.colour_bar_title!='') chaineURL+="&colour_bar_title="+document.thisForm.colour_bar_title.value;
1573        if (document.thisForm.observation_height!='') chaineURL+="&observation_height="+document.thisForm.observation_height.value;
1574
1575        parent.overview.location.href=chaineURL;
1576        return true;
1577}
1578
1579function showTrace(id_session,uniqueid,mode) {
1580var chaine='pop_upapplet.jsp?id_session='+id_session+'&uniqueid='+uniqueid+'&mode='+mode;
1581
1582Newfen(chaine,'Visualisation_V3','600','600');
1583
1584return true;
1585}
1586
1587
1588function checkObservationHeight(type_abs) {
1589if (type_abs!='profil') return false;
1590if (checkOH()) {
1591        return false;
1592}
1593else return true;
1594
1595}
1596
1597function checkOH() {
1598        if (!checkValue(document.thisForm.observation_height.value,'The height observation','','1')) {
1599                return false;
1600        }
1601        else {
1602                if (!matchRegExp(document.thisForm.observation_height.value, regExpEmpty) && document.thisForm.observation_height.value!='') {
1603                        return true;
1604                }
1605                else {
1606                        alert("You must enter an observation height");
1607                        return false;
1608                }
1609        }
1610
1611}
1612
1613function checkValue(valeur,texte,def,mode) {
1614if (isNaN(valeur)) {
1615        if (mode=='1') alert(texte+' must be numeric');
1616        if (texte=="Level value") document.thisForm.level_value.value=def;
1617        else if (mode=='1') document.thisForm.observation_height.value=def;
1618        return false;
1619}
1620return true;
1621}
1622
1623
1624function matchRegExp(valeur, regularExpression) {
1625        var resultat = valeur.match(regularExpression);
1626        if(resultat!=null && resultat.length==1) return true;
1627        else return false;
1628}
1629
1630function checkLongitude(minL,maxL){
1631        var text='';
1632
1633        if (isNaN(document.thisForm.lonmin.value) || isNaN(document.thisForm.lonmax.value)) {
1634                alert("Error : Invalid longitude format");
1635                document.thisForm.lonmin.value=minL;
1636                document.thisForm.lonmax.value=maxL;
1637                return false;
1638        }
1639
1640        minlon=parseFloat(document.thisForm.lonmin.value);
1641        maxlon=parseFloat(document.thisForm.lonmax.value);
1642        if( minlon > maxlon ){
1643                alert("Error : Latitude min is greater than latitude max");
1644                document.thisForm.lonmin.value=minL;
1645                document.thisForm.lonmax.value=maxL;
1646                return false;
1647        }
1648        if( minlon<-180 || maxlon>180 ){
1649                alert("Error : the selected longitude is out of range [-180,180]");
1650                if (minlon<-180) document.thisForm.lonmin.value=minL;
1651                if (maxlon>180) document.thisForm.lonmax.value=maxL;
1652                return false;
1653        }
1654        if( minlon<minL || maxlon>maxL ){
1655                alert("Error : the selected longitude is out of range of the experiment files ["+minL+","+maxL+"]");
1656                if (minlon<minL) document.thisForm.lonmin.value=minL;
1657                if (maxlon>maxL) document.thisForm.lonmax.value=maxL;
1658                return false;
1659        }
1660
1661        if (matchRegExp(document.thisForm.lonmax.value, regExpEmpty) || document.thisForm.lonmax.value=='') {
1662                document.thisForm.lonmax.value=maxL;
1663        }
1664        if (matchRegExp(document.thisForm.lonmin.value, regExpEmpty) || document.thisForm.lonmin.value=='') {
1665                document.thisForm.lonmin.value=minL;
1666        }
1667        updateOverview();
1668        return true;
1669}
1670
1671
1672function checkLatitude(minL,maxL) {
1673
1674        if (isNaN(document.thisForm.latmin.value) || isNaN(document.thisForm.latmax.value)) {
1675                alert("Error : Invalid latitude format");
1676                document.thisForm.latmin.value=minL;
1677                document.thisForm.latmax.value=maxL;
1678                return false;
1679        }
1680
1681        minlat=parseFloat(document.thisForm.latmin.value);
1682        maxlat=parseFloat(document.thisForm.latmax.value);
1683
1684
1685        if( minlat > maxlat ){
1686                alert("Error : Latitude min is greater than latitude max");
1687                document.thisForm.latmin.value=minL;
1688                document.thisForm.latmax.value=maxL;
1689                return false;
1690        }
1691        if( minlat<-90 || maxlat>90 ){
1692                alert("Error : the selected latitude is out of range [-90,90]");
1693                if (minlat<-90) document.thisForm.latmin.value=minL;
1694                if (maxlat>90) document.thisForm.latmax.value=maxL;
1695                return false;
1696        }
1697        if (minlat<minL || maxlat>maxL) {
1698                alert("Error : the selected latitude is out of range of the experiment files ["+minL+","+maxL+"]");
1699                if (minlat<minL) document.thisForm.latmin.value=minL;
1700                if (maxlat>maxL) document.thisForm.latmax.value=maxL;
1701                return false;
1702        }
1703
1704
1705        if (matchRegExp(document.thisForm.latmax.value, regExpEmpty) || document.thisForm.latmax.value=='') {
1706                document.thisForm.latmax.value=maxL;
1707        }
1708        if (matchRegExp(document.thisForm.latmin.value, regExpEmpty) || document.thisForm.latmin.value=='') {
1709                document.thisForm.latmin.value=minL;
1710        }
1711        updateOverview();
1712        return true;
1713}
1714
1715function isDate2(s) {
1716        // Verification de la date
1717        var a1=s.split("/");
1718        var e=true;
1719        if( (a1.length!=3) && (a1[0].length!=4 || a1[1].length!=2 || a1[2].length!=2)) {
1720               e=false;
1721        }else{
1722                var y=a1[0],m=a1[1],d=a1[2];
1723                if (isPositiveInteger(a1[0]) && isPositiveInteger(a1[1]) && isPositiveInteger(a1[2])){
1724                if ( (y<1000)||(y.length>4) )e=false
1725                        if (e) {
1726                                v=new Date(m+"/"+d+"/"+y);
1727                                longdate=y+m+d;
1728                                if (v.getMonth()!=m-1)e=false;
1729                        }
1730                }
1731                else {
1732                       e=false;
1733                }
1734        }
1735       
1736        return e
1737}
1738
1739
1740function isDate(s) {
1741        var a0=s.split("-");
1742        if ((a0.length!=2)){
1743                e=false;
1744        }else{
1745        // Verification de la date
1746                var a1=a0[0].split("/");
1747                var a2=a0[1].split(":");
1748                var e=true;
1749                if( (a1.length!=3) && (a2.length!=4) && (a1[0].length!=4 || a1[1].length!=2 || a1[2].length!=2 || a2[0].length!=2 || a2[1].length!=2 || a2[2
1750].length!=2 || a2[3].length!=3 )){
1751                        e=false;
1752                }else{
1753                        var y=a1[0],m=a1[1],d=a1[2];
1754                        if (isPositiveInteger(a1[0]) && isPositiveInteger(a1[1]) && isPositiveInteger(a1[2])){
1755                                if ( (y<1000)||(y.length>4) )e=false
1756                                if (e) {
1757                                        v=new Date(m+"/"+d+"/"+y);
1758                                        if (v.getMonth()!=m-1)e=false;
1759                                }
1760                        }else{
1761                                e=false;
1762                        }
1763                // Verification de l'heure
1764                        if( e ){
1765                                if (isPositiveInteger(a2[0]) && isPositiveInteger(a2[1]) && isPositiveInteger(a2[2])){
1766                                        var hh=a2[0],mm=a2[1],ss=a2[2],ms=a2[3];
1767                                        if( ms.length<3 )e=false;
1768                                        if (e) {
1769                                                v=new Date(m+"/"+d+"/"+y+" "+hh+":"+mm+":"+ss);
1770                                                longdate=y+m+d+hh+mm+ss+ms;
1771                                                if (v.getMonth()!=m-1)e=false;
1772                                        }
1773                                }else{
1774                                        e=false;
1775                                }
1776                        }
1777                }
1778        }
1779        return e
1780}
1781
1782
1783function isDigit(theDigit)
1784{
1785        var digitArray = new Array('0','1','2','3','4','5','6','7','8','9'),j;
1786
1787        for (j = 0; j < digitArray.length; j++)
1788        {
1789                if (theDigit == digitArray[j])return true
1790        }
1791        return false
1792
1793}
1794
1795function isPositiveInteger(theString){
1796        var theData = new String(theString)
1797
1798        if (!isDigit(theData.charAt(0)))
1799                if (!(theData.charAt(0)== '+'))return false
1800
1801        for (var i = 1; i < theData.length; i++)
1802                if (!isDigit(theData.charAt(i)))return false
1803        return true
1804}
1805
1806function checkDate(minDT,maxDT) {
1807        var minD="";
1808        mindate=document.thisForm.mindate.value;
1809
1810
1811        isDate(minDT);
1812        long_minDT=longdate;
1813
1814        isDate(maxDT);
1815        long_maxDT=longdate;
1816       
1817        if (document.thisForm.file_type_abs!='densite') {       
1818        if( !isDate(mindate) ){
1819                alert("Warning : The format of the Date min is not correct, it should be YYYY/MM/DD-HH:MM:SS:MSC");
1820                document.thisForm.mindate.value=minDT;
1821                return false;
1822        }
1823        longdatemin=longdate;
1824        maxdate=document.thisForm.maxdate.value;
1825        if( !isDate(maxdate) ){
1826                alert("Warning : The format of the Date max is not correct, it should be YYYY/MM/DD-HH:MM:SS:MSC");
1827                document.thisForm.maxdate.value=maxDT;
1828                return false;
1829        }
1830        longdatemax=longdate;
1831        if (parseFloat(longdatemin)<parseFloat(long_minDT)) {
1832                alert("Warning: Date min can not be less than the Date min of the experiment files ("+minDT+")");
1833                document.thisForm.mindate.value=minDT;
1834                return false;
1835        }
1836
1837        if (parseFloat(longdatemax)>parseFloat(long_maxDT)) {
1838                alert("Warning: Date max can not be greater than the Date max of the experiment files ("+maxDT+")");
1839                document.thisForm.maxdate.value=maxDT;
1840                return false;
1841        }
1842
1843        if( parseFloat(longdatemin)>parseFloat(longdatemax) ){
1844                alert("Warning : Date min can not be greater than the Date max");
1845                document.thisForm.maxdate.value=maxDT;
1846                document.thisForm.mindate.value=minDT;
1847                return false;
1848        }
1849       
1850        }
1851
1852        //document.thisForm.mindate.focus();
1853        updateOverview();
1854       
1855        updateTitle();
1856        return true;
1857}
1858
1859function checkDate2(minDT,maxDT) {
1860        var minD="";
1861        seldate=document.thisForm.sel_date_time.value;
1862
1863        minDT=minDT.substr(0,10);
1864        maxDT=maxDT.substr(0,10);
1865       
1866        isDate2(minDT);
1867        long_minDT=longdate;
1868
1869        isDate2(maxDT);
1870        long_maxDT=longdate;
1871
1872        if( !isDate2(seldate) ){
1873                alert("Warning : The format of the Date is not correct, it should be YYYY/MM/DD");
1874                document.thisForm.sel_date_time.value=minDT;
1875                return false;
1876        }
1877
1878        longdatetime=longdate;
1879        if (parseFloat(longdatetime)<parseFloat(long_minDT) || parseFloat(longdatetime)>parseFloat(long_maxDT)) {
1880                alert("Warning: Date is out of range. Range : ["+minDT+","+maxDT+"]");
1881                document.thisForm.sel_date_time.value=minDT;
1882                return false;
1883        }
1884
1885        //document.thisForm.mindate.focus();
1886        updateOverview();
1887
1888        updateTitle();
1889        return true;
1890}
1891
1892
1893function Newfen (URL,NAME,W,H)
1894{
1895  var wconf = 'scrollbars=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,width=' + W + ',height=' + H;
1896  var w = window.open (URL, NAME, wconf);
1897
1898}
1899
1900function lancerTrace(type_abs,is_batch) {
1901var ok='0';
1902
1903if (document.thisForm.modei.value=='email') {
1904        if (document.thisForm.email.value!='') ok='1';
1905        else ok='0';
1906}
1907else if (document.thisForm.modei.value=='loginu') {
1908
1909        if (document.thisForm.login.value!='' && document.thisForm.passu.value!='') ok='1';
1910        else if (document.thisForm.email.value!='') ok='1';
1911        else if (document.thisForm.onlydata.value=="1") ok='1';
1912        else ok='0';
1913        ok='1';
1914}
1915
1916if (document.thisForm.modei.value=='none' || document.thisForm.modei.value=='err') {
1917        ok='1';
1918}
1919
1920
1921if (ok=='1') {
1922if (document.thisForm.sel_par_abs.value=='' || document.thisForm.sel_unit_abs.value=='' || document.thisForm.sel_sspar_abs.value=='' || document.thisForm.sel_par_ord.value=='' || document.thisForm.sel_unit_ord.value=='') {
1923        alert("The parameters information are not complete");
1924        return false;
1925}
1926else if (checkObservationHeight(type_abs)) {
1927        return false;
1928}
1929else if (confirm('Confirm your selection ?')) {
1930        document.thisForm.afficheTrace.value="1";
1931        blocForm();
1932}
1933else {
1934        return false;
1935}
1936}
1937else return false;
1938return true;
1939
1940}
1941
1942function openListGraph(mode,appel,graph) {
1943var page='';
1944if (document.thisForm.sel_tpl_name.value!='') {
1945page="list_graphiques.jsp?sel_tpl_name="+document.thisForm.sel_tpl_name.value+"&modef="+mode+"&appel="+appel+"&graph_sel="+graph;
1946//window.blur();
1947Newfen(page,'Graphicslist','800','600');
1948//alert(Graphicslist.closed);
1949return true;
1950}
1951
1952return false;
1953
1954}
1955
1956function attach() {
1957        var element = document.getElementById('ligne1');
1958        element.setAttribute("class","gros");
1959}
1960
1961function updateUser(rt,n,fn,ib,ip,l,m,sei) {
1962var chaineURL='';
1963var obj=parent.user_info.document.thisForm;
1964//chaineURL='user_info.jsp?rightText='+rt+'&name='+n+'&first_name='+fn+'&email='+e+'&is_batch='+ib+'&is_private='+ip+'&lance='+l;
1965//obj.rightTexte.value=rt;
1966obj.name.value=n;
1967obj.first_name.value=fn;
1968//obj.email.value=e;
1969obj.is_batch.value=ib;
1970obj.is_private.value=ip;
1971obj.lance.value=l;
1972obj.modei.value=m;
1973obj.sel_exp_id.value=sei;
1974
1975obj.submit();
1976               
1977}
1978 
1979//window.onload = attach;
1980</script>
1981</head>
1982
1983<body onLoad="updateUser('<%=rightTexte%>','<%=name%>','<%=first_name%>','<%=is_batch%>','<%=is_private%>','<%=lance%>','<%=modei%>','<%=sel_exp_id%>');updateOverview();lancerMode('<%=pageMode%>','<%=chainePageMode%>'); if (document.thisForm.file_type_abs.value=='densite') {initForm('5');}">
1984<%!
1985boolean isUnitIdentique(String param1, String param2, String isord,send_request req) {
1986
1987String list="";
1988String[] cols1={"cls_acronym"};
1989ArrayList _list1=req.get_list("select cls_acronym from ether.dcp_parameter where par_acronym='"+param1+"' and (isord=2 or isord=1)",cols1);
1990if( _list1==null || _list1.size()<1 ) return false;
1991else {
1992        String[] cols2={"cls_acronym"};
1993        ArrayList _list2=req.get_list("select cls_acronym from ether.dcp_parameter where par_acronym='"+param2+"' and (isord=2 or isord=1)",cols2);
1994        if( _list2==null || _list2.size()<1 ) return false;
1995        else {
1996                if (_list1.get(0).equals(_list2.get(0))) return true;
1997                else return false;
1998        }
1999}
2000}
2001
2002String getTransform(String trf_id,send_request req){
2003        String list="";
2004
2005  String columns[]={"par_orig", "par_acr_orig", "unit_orig", "unit_acr_orig","par_final", "par_acr_final", "unit_final", "unit_acr_final","par_aux0", "par_acr_aux0", "unit_aux0", "unit_acr_aux0","par_aux1", "par_acr_aux1", "unit_aux1", "unit_acr_aux1"};
2006            ArrayList _list=req.get_list(
2007                    "select "+
2008                  "par_orig, "+
2009                    "param0.par_acronym as par_acr_orig, "+
2010                    "unit_orig,  "+
2011                    "unit0.unit_acronym as unit_acr_orig, "+
2012                    "par_final,  "+
2013                    "param3.par_acronym as par_acr_final, "+
2014                    "unit_final, "+
2015                    "unit3.unit_acronym as unit_acr_final, "+
2016                    "par_aux0,  "+
2017                    "param1.par_acronym as par_acr_aux0, "+
2018                    "unit_aux0,  "+
2019                    "unit1.unit_acronym as unit_acr_aux0,  "+
2020                    "par_aux1,  "+
2021                    "param2.par_acronym as par_acr_aux1, "+
2022                    "unit_aux1,  "+
2023                    "unit2.unit_acronym as unit_acr_aux1 "+
2024                    "from  "+
2025                    "ether.dcp_transformation, "+
2026                    "ether.dcp_parameter param0, "+
2027                    "ether.dcp_parameter param1,  "+
2028                    "ether.dcp_parameter param2,  "+
2029                    "ether.dcp_unit unit0,  "+
2030                    "ether.dcp_unit unit1, "+
2031                    "ether.dcp_parameter param3, "+
2032                    "ether.dcp_unit unit2,  "+
2033                    "ether.dcp_unit unit3 "+
2034                    "where  "+
2035                    "param0.par_id = dcp_transformation.par_orig "+
2036                    "and param3.par_id=dcp_transformation.par_final "+
2037                    "and param1.par_id=dcp_transformation.par_aux0 "+
2038                    "and unit0.unit_id=dcp_transformation.unit_orig "+
2039                    "and unit3.unit_id=dcp_transformation.unit_final "+
2040                    "and unit1.unit_id=dcp_transformation.unit_aux0 "+
2041                    "and unit2.unit_id=dcp_transformation.unit_aux1 "+
2042                    "and param2.par_id=dcp_transformation.par_aux1 "+
2043                    "and trf_id= "+trf_id,
2044                    columns);
2045            if( _list==null || _list.size()<1 ){
2046                    return "-1";
2047          }else{
2048                  for(int i=0;i<_list.size();i++)
2049                           list+=_list.get(i).toString()+"%";
2050            }
2051            return list;
2052    }
2053
2054String getCombin(String combin_id,send_request req){
2055        String list="";
2056
2057        String[] cols1={"trf_id"};
2058        ArrayList _list=req.get_list(
2059                "select trf_id from ether.dcp_transf_comb where id="+combin_id+" order by trf_order",
2060                cols1);
2061        if( _list==null || _list.size()<1 ){
2062                return "999";
2063        }else{
2064                for(int i=0;i<_list.size();i++)
2065                        list+=_list.get(i).toString()+"%";
2066        }
2067        return list;
2068}
2069
2070/******************************************************/
2071String convert(String date){
2072String[] ddt=(new stringSplit()).split(date,"-");
2073String[] dates=(new stringSplit()).split(ddt[0],"/");
2074String[] times=(new stringSplit()).split(ddt[1],":");
2075return dates[0]+dates[1]+dates[2]+times[0]+times[1]+times[2];
2076}
2077
2078
2079/*******************************************************/
2080
2081// Traitement des combinaisons de transformations unitaires
2082String treat_cbn(String cbn_id, String sel_tpl_id, int count, String origin_unit, String selected_unit, send_request req){
2083        String varX="", more_varid="", Xtransfo="", AUX0transfo="", AUX1transfo="";
2084        int num_aux0=999, num_aux1=999;
2085// Liste des transformations unitaires \340 appliquer
2086        String list=getCombin(cbn_id,req);
2087        System.err.println(" LIST CBN : "+list);
2088        String[] cblist=(new stringSplit()).split(list,"%");
2089        String mess="",result="";       
2090        int len=cblist.length;
2091        if( cblist[cblist.length-1].equals("") )len=len-1;
2092        mess="";
2093        for(int i=0;i<len;i++){
2094                String trf_id=cblist[i];
2095                boolean testUnit=false;
2096                if(i==cblist.length-1 )testUnit=true;
2097                //mess+="<br>trf_id="+cblist[i]+"->sel_tpl_id="+sel_tpl_id+"->count="+count+"->origin_unit="+origin_unit+"->selected_unit="+selected_unit+"->testUnit="+testUnit;
2098                       
2099                result=treat_trf(trf_id, sel_tpl_id, count, origin_unit, selected_unit, true, testUnit,req);
2100                //mess+="<br>";
2101                //mess+=result;
2102                String[] spl=(new stringSplit()).split(result,"%");
2103
2104                // Seule la variable origine de la 1ere transformation est retenue
2105                if(i==0 ) {
2106                        varX+=spl[0];
2107                       
2108                }
2109                // Ajout d'une commande de transformation en bout de ligne
2110               
2111                if( i>0 ){
2112                               
2113                        Xtransfo=Xtransfo.substring(0,Xtransfo.length()-2)+",";
2114                        //spl[1]=spl[1].substring(9);
2115                }
2116                Xtransfo+=spl[1];
2117                //mess+="@@"+spl[1];
2118                AUX0transfo=spl[2];
2119                AUX1transfo=spl[3];
2120                count=Integer.parseInt(spl[4]);
2121                more_varid+=spl[5];
2122        }
2123
2124       
2125        return varX+"%"+Xtransfo+"%"+AUX0transfo+"%"+AUX1transfo+"%"+count+"%"+more_varid;
2126
2127}
2128
2129
2130// Recherche des fichiers associ\351s au tuple tpl_id
2131String[] scanAssociates(String type, String tpl_id, String file, String rep_data,send_request req){
2132
2133        String[] retour=null;
2134        String sfile=new File(file).getName();
2135//
2136        String columns[]={"type", "command"};
2137        ArrayList _list=req.get_list(
2138                "select * from ether.dcp_associate "+
2139                "where type='"+type+"' and tpl_id="+tpl_id,
2140                columns);
2141        if( _list==null || _list.size()<1 ){
2142                return retour;
2143        }else{
2144                int nrow=_list.size()/columns.length;
2145                retour=new String[nrow];
2146                int k=0;
2147                for(int j=0;j<nrow;j++){
2148                        String stype=_list.get(k).toString();
2149                        String command=_list.get(k+1).toString();
2150                        String new_command=(new stringReplace(command,"%",sfile)).newstring;
2151                        new_command=(new stringReplace(new_command,"$","'")).newstring;
2152                        String cols[]={"eth_tar_file"};
2153                        String cols1[]={"eth_tar_file", "eth_parameter", "eth_subparameter", "src"};
2154                        ArrayList _list0=null;
2155                        if( type.equals("info" ) )
2156                                _list0=req.get_list(new_command,cols);
2157                        else
2158                                _list0=req.get_list(new_command,cols1);
2159                        if( _list0==null || _list0.size()<1 ){
2160                                retour=null;
2161                                return retour;
2162                        }else{
2163                                if( type.equals("info") )retour[j]=rep_data+_list0.get(0).toString();
2164                                else retour[j]=rep_data+_list0.get(0).toString()+"%"+_list0.get(1).toString()+"%"+_list0.get(2).toString()+"%"+_list0.get(3).toString();
2165
2166                        }
2167                        k+=columns.length;
2168                }
2169        }
2170        return retour;
2171}
2172
2173boolean isDef(String valeur) {
2174        if (valeur==null || valeur.equals("") || valeur.equals("null")) return false;
2175        else return true;
2176}
2177
2178int occurence(String string, String search){
2179        int z=0, zcount=0;
2180        while( true ){
2181                z=string.indexOf(search,z);
2182                if( z>=0 ){
2183                        zcount++;
2184                        z+=search.length();
2185                }else{
2186                        break;
2187                }
2188        }
2189        return zcount;
2190}
2191
2192
2193      String treat_trf(String trf_id, String sel_tpl_id, int count, String origin_unit,
2194                String selected_unit, boolean testUnit0, boolean testUnit1 ,send_request req){
2195                String more_varid="", Xtransfo="", AUX0transfo="", AUX1transfo="";
2196                int num_aux0=999, num_aux1=999;
2197                String list=getTransform(trf_id,req);
2198                String[] tlist=(new stringSplit()).split(list,"%"); //(0:par_id,1:par_acr,2:unit_id,3:unit_acr)
2199               
2200                String natx=getField(sel_tpl_id,"src_acronym",tlist[1],req);
2201                String sspar0=getField(sel_tpl_id,"subvariable",tlist[1],req);
2202               
2203                //return "tlist1="+tlist[1]+"--> natx="+natx;
2204               
2205//                String varX=",{variable:'"+tlist[1]+"', nature:'"+natx+
2206//                        "', subvariable:'.', unite:'"+tlist[3]+"'}";
2207String varX=tlist[1]+","+natx+","+sspar0+","+tlist[3];
2208
2209//              V\351rification de l'unit\351 de la variable origine : est-ce la m\352me que celle requise par la transformation
2210                 String before_trf="";
2211                 if( testUnit0 && !origin_unit.equals(tlist[3]) ){
2212                         String ids=get_conv("acr", origin_unit, tlist[3],req);
2213                         String cnv_id=(new stringSplit()).split(ids,"%")[0];
2214                         before_trf="conv"+cnv_id+",999,999#";
2215                 }
2216//              V\351rification de l'unit\351 de la variable finale / s\351lectionn\351e
2217                 String more_trf="";
2218                 if( testUnit1 && !selected_unit.equals(tlist[7]) ){
2219                         String ids=get_conv("acr", tlist[7], selected_unit,req);
2220                         String cnv_id=(new stringSplit()).split(ids,"%")[0];
2221                         more_trf="#conv"+cnv_id+",999,999";
2222                 }
2223
2224        // Il y a une variable auxiliaire (0)
2225                AUX0transfo="";
2226                if( tlist.length>3 && !tlist[8].equals("999") ){
2227                        String nat=getField(sel_tpl_id,"src_acronym",tlist[9],req);
2228                        String unit_id=getField(sel_tpl_id,"unit_id",tlist[9],req);
2229                        String sspar1=getField(sel_tpl_id,"subvariable",tlist[9],req);
2230                        more_varid+="&"+tlist[9]+","+nat+","+sspar1+","+tlist[11];
2231                        count++;
2232                        num_aux0=count;
2233                // Changement d'unit\351 pour la variable auxiliaire 0
2234                        if( !unit_id.equals("-1") && !unit_id.equals(tlist[10]) ){
2235                                String ids0=get_conv("id", unit_id, tlist[10],req);
2236                                String cnv_id0=(new stringSplit()).split(ids0,"%")[0];
2237                                if( !Xtransfo.equals("") )Xtransfo+=",";
2238                                AUX0transfo="conv"+cnv_id0+",999,999";
2239                        }else{
2240                                AUX0transfo="t999,999,999";
2241                        }
2242                }
2243        // Il y a une autre variable auxiliaire (1)
2244                AUX1transfo="";
2245                if( tlist.length>7 && !tlist[12].equals("999") ){
2246                        String nat=getField(sel_tpl_id,"src_acronym",tlist[13],req);
2247                        String unit_id=getField(sel_tpl_id,"unit_id",tlist[13],req);
2248                        String sspar2=getField(sel_tpl_id,"subvariable",tlist[13],req);
2249                        more_varid+="&"+tlist[13]+","+nat+","+sspar2+","+tlist[15];
2250
2251                        count++;
2252                        num_aux1=count;
2253                // Changement d'unit\351 pour la variable auxiliaire 1
2254                        if( !unit_id.equals("-1") && !unit_id.equals(tlist[14]) ){
2255                                String ids1=get_conv("id", unit_id, tlist[14],req);
2256                                String cnv_id1=(new stringSplit()).split(ids1,"%")[0];
2257
2258                                AUX1transfo="conv"+cnv_id1+",999,999";
2259                        }else{
2260                                AUX1transfo="t999,999,999";
2261                        }
2262                }
2263
2264                Xtransfo=before_trf+"t"+trf_id+","+num_aux0+","+num_aux1+more_trf;
2265//
2266                return varX+"%"+Xtransfo+"%"+AUX0transfo+"%"+AUX1transfo+"%"+count+"%"+more_varid;
2267        }
2268
2269String getField(String tpl_id, String field, String parameter,send_request req){
2270        String list="";
2271        String columns[]={field};
2272        ArrayList _list=req.get_list(
2273                "select "+field+" from ether.dcp_descripteur where (tpl_id="+tpl_id+
2274                " or tpl_id=(select tpl_id from ether.dcp_file_class where associate="+tpl_id+
2275                ")) and par_acronym='"+parameter+"'",columns);
2276        if( _list==null || _list.size()<1 ){
2277                //_list="select "+field+" from ether.dcp_descripteur where (tpl_id="+tpl_id;
2278                //_list+=" or tpl_id=(select tpl_id from ether.dcp_file_class where associate="+tpl_id;
2279                //_list+=")) and par_acronym='"+parameter+"'";
2280                return "-1";
2281        }else{
2282                list=_list.get(0).toString();
2283        }
2284        return list;
2285}
2286
2287
2288
2289
2290String get_conv(String type, String unit_orig, String unit_final,send_request req){
2291String cnv_id="", trf_id="";
2292        String unit_id_orig="", unit_id_final="";
2293        ArrayList _list;
2294        if( type.equals("acr") ){
2295                String columns[]={"unit_id"};
2296                _list=req.get_list(
2297                        "SELECT * FROM ether.dcp_unit where unit_acronym='"+unit_orig+"'",columns);
2298                if( _list==null || _list.size()!=1 ){
2299                        return "-1%-1";
2300                }
2301                unit_id_orig=_list.get(0).toString();
2302                _list=req.get_list(
2303                        "SELECT * FROM ether.dcp_unit where unit_acronym='"+unit_final+"'",columns);
2304                if( _list==null || _list.size()!=1 ){
2305                        return "-1%-1";
2306                }
2307                unit_id_final=_list.get(0).toString();
2308        }else if( type.equals("id") ){
2309                unit_id_orig=unit_orig;
2310                unit_id_final=unit_final;
2311        }
2312        String cols[]={"cnv_id", "trf_id"};
2313        _list=req.get_list(
2314                "SELECT * FROM ether.dcp_conversion where unit_orig="+unit_id_orig+
2315                " and unit_final="+unit_id_final,cols);
2316        if( _list==null || _list.size()!=cols.length ){
2317                return "-1%-1";
2318        }else{
2319                cnv_id=_list.get(0).toString();
2320                trf_id=_list.get(1).toString();
2321        }
2322        return cnv_id+"%"+trf_id;
2323}
2324
2325
2326/**********************************/
2327
2328String file_reader(String sel_tpl_id, send_request req) {
2329
2330String rd_function="";
2331String columns[]={"rd_function"};
2332
2333ArrayList _list=req.get_list("SELECT * from ether.dcp_reader, ether.dcp_file_class where dcp_file_class.rd_acronym=dcp_reader.rd_acronym and tpl_id="+sel_tpl_id,columns);
2334if(_list==null || _list.size()<1 ) return "-1";
2335else rd_function=_list.get(0).toString();
2336
2337return rd_function;
2338}
2339
2340String getValueParam(String nameParam, String defaultValueParam, ServletRequest request) {
2341
2342String var=request.getParameter(nameParam);
2343if (var==null || var.equals("") || var.equals("null")) {
2344        var=defaultValueParam;
2345}
2346
2347return var;
2348}
2349
2350%>
2351<form name="thisForm">
2352<table border="0" cellpadding="2" cellspacing="2" width="800">
2353<tr>
2354<td colspan=4>
2355<table>
2356<input type="hidden" name="exp_nrecouv" value="<%=exp_nrecouv%>">
2357<input type="hidden" name="sel_temp_name" value="<%=sel_temp_name%>">
2358<input type="hidden" name="class_data_set" value="<%=class_data_set%>">
2359<input type="hidden" name="class_component" value="<%=class_component%>">
2360<input type="hidden" name="class_axis" value="<%=class_axis%>">
2361<input type="hidden" name="class_location" value="<%=class_location%>">
2362<input type="hidden" name="class_location2" value="<%=class_location2%>">
2363<input type="hidden" name="class_vertical_scale" value="<%=class_vertical_scale%>">
2364<input type="hidden" name="class_ho" value="<%=class_ho%>">
2365<input type="hidden" name="class_time" value="<%=class_time%>">
2366<input type="hidden" name="dis_data_set" value="<%=dis_data_set%>">
2367<input type="hidden" name="dis_component" value="<%=dis_component%>">
2368<input type="hidden" name="dis_vertical_scale" value="<%=dis_vertical_scale%>">
2369<input type="hidden" name="dis_ho" value="<%=dis_ho%>">
2370<input type="hidden" name="dis_time" value="<%=dis_time%>">
2371<input type="hidden" name="map_information_level" value="<%=map_information_level%>">
2372<input type="hidden" name="map_filling" value="<%=map_filling%>">
2373<input type="hidden" name="map_axes_type" value="<%=map_axes_type%>">
2374<input type="hidden" name="grid_linestyle" value="<%=grid_linestyle%>">
2375<input type="hidden" name="latitude_posting" value="<%=latitude_posting%>">
2376<input type="hidden" name="longitude_posting" value="<%=longitude_posting%>">
2377<input type="hidden" name="colour_bar_nb_value" value="<%=colour_bar_nb_value%>">
2378<input type="hidden" name="colour_bar_grid" value="<%=colour_bar_grid%>">
2379<input type="hidden" name="modei" value="<%=modei%>">
2380<input type="hidden" name="pageMode" value="<%=pageMode%>">
2381<input type="hidden" name="chainePageMode" value="<%=chainePageMode%>">
2382<input type="hidden" name="contour_default_label_flag" value="<%=contour_default_label_flag%>">
2383<input type="hidden" name="idl_colour_table_id" value="<%=idl_colour_table_id%>">
2384<input type="hidden" name="cemail" value="<%=cemail%>">
2385<input type="hidden" name="download_auth" value="<%=download_auth%>">
2386<input type="hidden" name="email" value="<%=email%>">
2387<input type="hidden" name="login" value="<%=login%>">
2388<input type="hidden" name="passu" value="<%=passu%>">
2389<input type="hidden" name="name" value="<%=name%>">
2390<input type="hidden" name="first_name" value="<%=first_name%>">
2391<input type="hidden" name="onlydata" value="<%=onlydata%>">
2392<input type="hidden" name="continuer" value="<%=continuer%>">
2393<input type="hidden" name="id_session" value="<%=id_session%>">
2394<input type="hidden" name="contour_display_mode" value="<%=contour_display_mode%>">
2395<input type="hidden" name="contour_default_colour_flag" value="<%=contour_default_colour_flag%>">
2396<input type="hidden" name="contour_default_colour" value="<%=contour_default_colour%>">
2397<input type="hidden" name="contour_default_linestyle" value="<%=contour_default_linestyle%>">
2398<input type="hidden" name="contour_default_line_thickness" value="<%=contour_default_line_thickness%>">
2399<input type="hidden" name="lib_meta_type" value="<%=lib_meta_type%>">
2400<input type="hidden" name="lib_param" value="<%=lib_param%>">
2401<input type="hidden" name="form_par_ord" value="<%=form_par_ord%>">
2402<input type="hidden" name="lib_tpl_id" value="<%=lib_tpl_id%>">
2403<input type="hidden" name="meta_type" value="<%=meta_type%>">
2404<input type="hidden" name="flag_extrapolate_auth" value="<%=flag_extrapolate_auth%>">
2405<input type="hidden" name="uniqueid" value="<%=uniqueid%>">
2406<input type="hidden" name="mode" value="<%=mode%>">
2407<input type="hidden" name="lance" value="<%=lance%>">
2408<input type="hidden" name="exp_alt_min" value="<%=exp_alt_min%>">
2409<input type="hidden" name="exp_alt_max" value="<%=exp_alt_max%>">
2410<input type="hidden" name="ssel_tpl_name" value="<%=sel_tpl_name%>">
2411<input type="hidden" name="graph_sel" value="<%=graph_sel%>">
2412<input type="hidden" name="afficheTrace" value="">
2413<input type="hidden" name="interpolatormethod1d" value="<%=_1d_interpolator_method%>">
2414<input type="hidden" name="spacing1d" value="<%=_1d_spacing%>">
2415<input type="hidden" name="nmin1d" value="50">
2416<input type="hidden" name="nmax1d" value="500">
2417<input type="hidden" name="reg_grid_method" value="<%=reg_grid_method%>">
2418<input type="hidden" name="irreg_grid_method" value="<%=irreg_grid_method%>">
2419<input type="hidden" name="xspacing2d" value="<%=_2d_xspacing%>">
2420<input type="hidden" name="nxmin2d" value="50">
2421<input type="hidden" name="nxmax2d" value="500">
2422<input type="hidden" name="yspacing2d" value="<%=_2d_yspacing%>">
2423<input type="hidden" name="nymin2d" value="50">
2424<input type="hidden" name="nymax2d" value="500">
2425<input type="hidden" name="flag_validity_mask" value="1">
2426<input type="hidden" name="form_par_abs" value="<%=form_par_abs%>">
2427<input type="hidden" name="userLevels" value="<%=userLevels%>">
2428<input type="hidden" name="dot_plot_dot_style" value="<%=dot_plot_dot_style%>">
2429<input type="hidden" name="dot_plot_colour_flag" value="<%=dot_plot_colour_flag%>">
2430<input type="hidden" name="dot_plot_dotcolour" value="<%=dot_plot_dotcolour%>">
2431<input type="hidden" name="dot_plot_dotsize" value="<%=dot_plot_dotsize%>">
2432<input type="hidden" name="DSMinDate_file" value="<%=DSMinDate_file%>">
2433<input type="hidden" name="DSMaxDate_file" value="<%=DSMaxDate_file%>">
2434<input type="hidden" name="lonmin_file" value="<%=lonmin_file%>">
2435<input type="hidden" name="lonmax_file" value="<%=lonmax_file%>">
2436<input type="hidden" name="latmin_file" value="<%=latmin_file%>">
2437<input type="hidden" name="latmax_file" value="<%=latmax_file%>">
2438<input type="hidden" name="file_type_abs" value="<%=file_type_abs%>">
2439<input type="hidden" name="imSelected" value="<%=imSelected%>">
2440
2441</table>
2442</td>
2443</tr>
2444<tr>
2445<td>
2446<table border="0" cellpadding="2" cellspacing="2" width="800">
2447<tr><td class='titreN'><b>DATA SETTINGS</b></td></tr>
2448</table>
2449</td>
2450</tr>
2451<tr>
2452<td>
2453<table border="0" cellpadding="2" cellspacing="2" width="800">
2454<tr><td colspan=4 class='rubrique'><b>DATA SELECTION</b></td></tr>
2455<tr>
2456        <td class="ssrubrique" nowrap>Experiment</td>
2457        <td width="5%">&nbsp;</td>
2458        <td class="<%=class_data_set%>" colspan=2>Data set</td>
2459</tr>
2460<tr>
2461        <td valign=top nowrap>
2462        <select size=5 name="sel_tpl_name" onChange="initForm('2');document.thisForm.file_type_abs.value='';return blocForm();">
2463                <%=exp_options0%>
2464        </select>
2465        </td>
2466        <td width="10%">&nbsp;</td>
2467        <td valign="top" nowrap rowspan=2>
2468        <select size=7 name="sel_tpl_id" size=6 onChange="if (document.thisForm.lance.value!='') document.thisForm.lance.value='0';initForm('4');return blocForm();" <%=dis_data_set%>>
2469                <%=exp_options%>
2470        </select>
2471        </td>
2472        <td width=100% valign=top>
2473        <table cellpadding="2" cellspacing="2">
2474                <tr>
2475                        <td align="right" class="<%=class_data_set%>">Mission</td>
2476                        <td class=inactif><b><%=lib_mission%></b></td>
2477                </tr>
2478                <tr>
2479                        <td align="right" class="<%=class_data_set%>">Version</td>
2480                        <td class=inactif><b><%=lib_version%></b></td>
2481                </tr>
2482                <tr>
2483                        <td align="right" class="<%=class_data_set%>">Level</td>
2484                        <td class=inactif><b><%=lib_level%></b></td>
2485                </tr>
2486                <tr>
2487                        <td align="right" class="<%=class_data_set%>">Sublevel</td>
2488                        <td class=inactif><b><%=lib_sublevel%></b></td>
2489                </tr>
2490                <tr>
2491                        <td align="right" class="<%=class_data_set%>">File format</td>
2492                        <td class=inactif><b><%=lib_fileformat%></b></td>
2493                </tr>
2494        </table>
2495        </td>
2496
2497</tr>
2498</table>
2499</td>
2500</tr>
2501
2502<tr>
2503<td>
2504<table border="0" cellpadding="2" cellspacing="2" width="800">
2505<tr><td colspan=5 class="<%=class_axis%>"><b>PARAMETERS</b></td></tr>
2506<tr>
2507        <td class="<%=class_component%>" colspan=2 nowrap>Component</td>
2508        <td width="10%">&nbsp;</td>
2509        <%
2510        if (!file_type_abs.equals("densite")) {%>
2511                <%if (graph_sel.equals("2")) {%>
2512                <td class="<%=class_vertical_scale%>" colspan=2>Component in Y axis</td>
2513                <%}
2514                else {%>
2515                <td class="<%=class_vertical_scale%>">Vertical scale</td>
2516                <%}%>
2517        <%}
2518        else {%>
2519                <td class=normal><b>Density column data : no vertical scale to select</b></td>
2520        <%}%>
2521</tr>
2522<tr>
2523<td colspan=2 nowrap valign="top">
2524        <select <%=dis_component%> size=5 name="sel_par_abs" onChange="if (document.thisForm.lance.value!='') document.thisForm.lance.value='0';document.thisForm.sel_unit_abs.value='';document.thisForm.colour_bar_title.value='';initForm('5');return blocForm();">
2525                <%=par_options_abs%>
2526        </select>
2527</td>
2528        <td>&nbsp;</td>
2529        <%if (!file_type_abs.equals("densite")) {%>
2530        <%if (graph_sel.equals("2")) {%>
2531        <td width="100%" colspan=2>
2532        <%}
2533        else {%>
2534        <td width="100%">
2535        <%}%>
2536        <select name="sel_par_ord" size=5 onChange="if (document.thisForm.lance.value!='') document.thisForm.lance.value='0';document.thisForm.ftitle.value='';initForm('6');blocForm();updateTitle();" <%=dis_vertical_scale%>>
2537                <%=par_options_ord%>
2538        </select><br><span class="normal"><i>Data calculated come from ECMWF data or from a model</i></span>
2539        </td>
2540        <%}
2541        else {%>       
2542        <td width="100%">&nbsp;
2543        <input type=hidden value="<%=sel_par_ord%>" name="sel_par_ord">
2544        </td>
2545        <%}%>   
2546</tr>
2547<tr>
2548<%if (!file_type_abs.equals("densite")) {%>
2549        <td class="<%=class_component%>" nowrap>Units</td>
2550        <td class="<%=class_component%>" nowrap>Sub-parameter</td>
2551        <td>&nbsp;</td>
2552        <%if (graph_sel.equals("2")) {%>
2553        <td class="<%=class_vertical_scale%>" valign="top" width="75%">Units</td>
2554        <td class="<%=class_vertical_scale%>" valign="top" width="25%">Sub-parameter</td>
2555        <%}
2556        else {
2557        %>
2558        <td class="<%=class_vertical_scale%>" valign="top" width=100% colspan=2>Units</td>
2559        <%}%>
2560<%}
2561 else {%>
2562        <td class="<%=class_component%>" nowrap>Units</td>
2563        <td class="<%=class_component%>" nowrap>Sub-parameter</td>
2564        <td>&nbsp;</td>
2565        <td width="100%">&nbsp;</td>
2566
2567<%}%>
2568</tr>
2569<tr>
2570        <td nowrap>
2571                <select <%=dis_component%> name="sel_unit_abs" onChange="updateLegend()">
2572                <%=unit_options_abs%>
2573                </select>
2574                <br><span class="normal"><i>The first unit in the list<br>corresponds to the file experiment unit</i></span>
2575        </td>
2576        <td nowrap valign="top" onChange="initForm('5');return blocForm();"><select <%=dis_component%> name="sel_sspar_abs"><%=sspar_options%></select></td>
2577        <td>&nbsp;</td>
2578<%if (!file_type_abs.equals("densite")) {%>
2579        <%if (graph_sel.equals("2")) {%>
2580                <td width="75%" valign="top">
2581                <select name="sel_unit_ord" <%=dis_vertical_scale%> onChange="document.thisForm.unit_observation_height.value=document.thisForm.sel_unit_ord.value;updateTitle();updateOverview();">
2582                <%=unit_options_ord%>
2583                </select>       
2584                </td>
2585                <td width="25%" valign="top">
2586                <select name="sel_sspar_ord" <%=dis_vertical_scale%> onChange="updateTitle();updateOverview();">
2587                <%=ssparord_options%>
2588                </select>
2589                </td>
2590        <%}
2591        else {%>
2592        <td width="100%" valign="top">
2593        <select name="sel_unit_ord" <%=dis_vertical_scale%> onChange="document.thisForm.unit_observation_height.value=document.thisForm.sel_unit_ord.value;updateTitle();updateOverview();">
2594        <%=unit_options_ord%>
2595        </select>
2596        </td>
2597<%}%>
2598<%}else {%>
2599        <td width="100%">&nbsp;
2600        <input type=hidden name="sel_unit_ord" value="<%=sel_unit_ord%>"></td>
2601<%}%>
2602</tr>
2603
2604</table>
2605</td>
2606</tr>
2607
2608<tr>
2609<td>
2610<table border="0" cellpadding="2" cellspacing="2" width="800">
2611<tr>
2612        <%if (!file_type_abs.equals("densite")) {%>
2613        <td class="<%=class_location%>"><b>LOCATION AND TIME RANGE</b></td>
2614        <%} else {%>
2615        <td class="<%=class_location2%>"><b>LOCATION AND TIME RANGE</b></td>
2616        <%}%>
2617</tr>
2618
2619</table>
2620</td>
2621</tr>
2622<tr>
2623<td>
2624<table border="0" cellpadding="2" cellspacing="2" width="800">
2625<%if (!file_type_abs.equals("densite")) {%>
2626<tr>
2627        <td nowrap class="<%=class_ho%>" align="right" nowrap>Latitude</td>
2628        <td nowrap><input onChange=checkLatitude('<%=latmin_file%>','<%=latmax_file%>') type="text" name="latmin" size="10" value="<%=latmin%>" <%=dis_ho%>></td>
2629        <td class="normal" nowrap>to</td>
2630        <td nowrap><input onChange=checkLatitude('<%=latmin_file%>','<%=latmax_file%>') type="text" name="latmax" size="10" value="<%=latmax%>" <%=dis_ho%>>
2631
2632</td>
2633        <td class="normal" width="10%">&nbsp;</td>
2634        <td nowrap class="<%=class_ho%>">Date</td>
2635        <td nowrap><input type="text" disabled name="temp_mindate" size="25" value="<%=DSMinDate%>"><input type="hidden" name="mindate" size="25" value="<%=DSMinDate%>">
2636
2637</td>
2638        <td nowrap class="normal">to</td>
2639        <td width=100%><input type="text" disabled name="temp_maxdate" size="25" value="<%=DSMaxDate%>"><input type="hidden" name="maxdate" size="25" value="<%=DSMaxDate%>">
2640&nbsp;<a href="Javascript:Newfen('select_date.jsp?op=add&sel_date_max='+document.thisForm.maxdate.value+'&sel_date_min='+document.thisForm.mindate.value+'&date_max_file=<%=DSMaxDate_file%>&date_min_file=<%=DSMinDate_file%>&periode=<%=exp_nrecouv%>','Date_range','580','280')"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2641        <input type="hidden" value="" name="sel_date_time">     
2642</tr>
2643<tr>
2644        <td nowrap class="<%=class_ho%>" align="right">Longitude</td>
2645        <td><input onChange=checkLongitude('<%=lonmin_file%>','<%=lonmax_file%>') type="text" name="lonmin" size="10" value="<%=lonmin%>" <%=dis_ho%>></td>
2646        <td class="normal" class="normal">to</td>
2647        <td><input onChange=checkLongitude('<%=lonmin_file%>','<%=lonmax_file%>') type="text" name="lonmax" size="10" value="<%=lonmax%>" <%=dis_ho%>>
2648        </td>
2649        <td colspan=2>&nbsp;</td>
2650        <td class="normal" colspan=3 valign="top">
2651        <%if (DSMinDate!="" && DSMinDate!=null) {%>
2652<span class="normal">Files time range :&nbsp;[&nbsp;<%=DSMinDate_file%>&nbsp;-&nbsp;<%=DSMaxDate_file%>&nbsp;]<br>
2653<%if (!exp_nrecouv.equals("-1")) {%>
2654Period of no data overlapping : <%=exp_nrecouv%> days<%}
2655else {%>
2656Period of no data overlapping : None
2657<%}%>
2658</span>
2659<%}
2660else {%>
2661&nbsp;
2662<%}%>
2663</td>
2664
2665</tr>
2666<%}
2667else {%>
2668<tr>
2669        <td nowrap class="<%=class_time%>" align="right" nowrap>Latitude</td>
2670        <td nowrap><input onChange=checkLatitude('<%=latmin_file%>','<%=latmax_file%>') type="text" name="latmin" size="10" value="<%=latmin%>" <%=dis_time%>>
2671</td>
2672        <td class="normal" nowrap>to</td>
2673        <td nowrap><input onChange=checkLatitude('<%=latmin_file%>','<%=latmax_file%>') type="text" name="latmax" size="10" value="<%=latmax%>" <%=dis_time%>></td>
2674        <td class="normal" width="10%">&nbsp;</td>
2675<td nowrap class="<%=class_time%>">Date</td>
2676        <td colspan=3 width="100%">
2677        <input type="text" onChange="checkDate2('<%=DSMinDate_file%>','<%=DSMaxDate_file%>')" name="sel_date_time" size="12" value="<%=sel_date_time%>" <%=dis_time%>>
2678        <input type="hidden" name="mindate" size="25" value="<%=DSMinDate%>">
2679        <input type="hidden" name="maxdate" size="25" value="<%=DSMaxDate%>">
2680        <%if (DSMinDate!="" && DSMinDate!=null) {%>
2681&nbsp;<span class="normal">Range :&nbsp;[&nbsp;<%=DSMinDate_file.substring(0,10)%>&nbsp;-&nbsp;<%=DSMaxDate_file.substring(0,10)%>&nbsp;]</span>
2682<%}%>
2683
2684</td>
2685</tr>
2686<tr>
2687        <td nowrap class="<%=class_time%>" align="right">Longitude</td>
2688        <td><input onChange=checkLongitude('<%=lonmin_file%>','<%=lonmax_file%>') type="text" name="lonmin" size="10" value="<%=lonmin%>" <%=dis_time%>>
2689        <td class="normal">to</td>
2690        <td><input onChange=checkLongitude('<%=lonmin_file%>','<%=lonmax_file%>') type="text" name="lonmax" size="10" value="<%=lonmax%>" <%=dis_time%>>
2691        <td colspan=2>&nbsp;</td>
2692</tr>
2693
2694<%}%>
2695</table>
2696</td>
2697</tr>
2698<%if (!file_type_abs.equals("densite")) {%>
2699<tr>
2700<td>
2701<table border="0" cellpadding="2" cellspacing="2" width="800">
2702<tr><td class='<%=class_location%>'><b>HEIGHT OBSERVATION</b>&nbsp;<%=heightTexte%></td></tr>
2703</table>
2704</td>
2705</tr>
2706
2707<table border="0" cellpadding="2" cellspacing="2" width="800">
2708<tr>
2709        <td nowrap class="<%=class_ho%>">Value</td>
2710        <td nowrap><input type="text" name="observation_height" size="10" value="<%=observation_height%>" onChange="updateTitle();updateOverview();" <%=dis_ho%>></td>
2711        <td class="normal" width="10%">&nbsp;</td>
2712        <td nowrap class="<%=class_ho%>">Vertical scale selected</td>
2713        <td nowrap><input type="text" name="par_observation_height" value="<%=par_observation_height%>" size="45" disabled></td>
2714        <td class="normal" width="10%">&nbsp;</td>
2715        <td nowrap class="<%=class_ho%>">Units selected</td>
2716        <td nowrap><input type="text" name="unit_observation_height" value="<%=sel_unit_ord%>" size="10" disabled></td>
2717</tr>
2718</table>
2719<%}
2720else {%>
2721<input type="hidden" name="par_observation_height" value="">
2722<input type="hidden" name="observation_height" value="">
2723<input type="hidden" name="unit_observation_height" value="">
2724<%}%>
2725
2726<tr><td>&nbsp;</td></tr>
2727<tr>
2728<td>
2729<table border="0" cellpadding="2" cellspacing="2" width="800">
2730<tr><td class='titreN'><b>GRAPHIC SETTINGS</b></td></tr>
2731<tr><td class="normal" align="left"><i>Interpolation settings</i>&nbsp;<a href="Javascript:Newfen('pop_up1.jsp','Interpolation_set_up','790','490')"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2732</tr>
2733</table>
2734</td>
2735</tr>
2736<tr>
2737<td>
2738<table border="0" cellpadding="2" cellspacing="2" width="800">
2739<tr><td class='rubrique'><b>GEOGRAPHIC PROJECTION</b></td></tr>
2740</table>
2741</td>
2742</tr>
2743<table border="0" cellpadding="2" cellspacing="2" width="800">
2744  <tr>
2745    <td nowrap><input type="radio" onClick="document.thisForm.hemisphere.disabled=true;" name="map_projection" value="0" <%if (map_projection.equals("0")) out.write("checked");%>></td>
2746        <td class="normal" nowrap>Standard (latitude/longitude grid)</td>
2747        <td width="40">&nbsp;</td>
2748    <td align="right"><input type="radio" onClick="document.thisForm.hemisphere.disabled=false;" name="map_projection" value="1" <%if (map_projection.equals
2749("1")) out.write("checked");%>></td>
2750        <td class="normal" nowrap align="left">Stereopolar (</td>
2751        <td nowrap>
2752        <select name="hemisphere" <%if (map_projection.equals("0")) {out.write("disabled");} else {out.write("");}%>>
2753        <option value="1" <%if (hemisphere.equals("1")) out.write("selected");%>>North</option>
2754        <option value="2" <%if (hemisphere.equals("2")) out.write("selected");%>>South</option>
2755        </select></td>
2756        <td class="normal" nowrap> Pole)</td>
2757        <td width="100%">&nbsp;</td>
2758        </tr>
2759        <%if ((!sel_tpl_name.equals("") && !sel_tpl_name.equals("null")) && (graph_sel.equals("") || graph_sel.equals("null"))) {%>
2760        <tr>
2761        <td colspan=8 class="normal" nowrap><i>Select a graph</i>&nbsp;&nbsp;<a href="#" onClick="openListGraph('2','1','<%=graph_sel%>')"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2762
2763        </tr>
2764        <%}%>
2765</table>
2766</td>
2767</tr>
2768
2769
2770<%if (graph_sel.equals("0")) {%>
2771<tr>
2772<td>
2773<table border="0" cellpadding="2" cellspacing="2" width="800">
2774<tr><td class='rubrique' colspan=3><b>VERTICAL ANALYSIS</b></td></tr>
2775<tr>
2776<td class="normal" valign="top" width=50%><i>Fine Range Settings</i>&nbsp;&nbsp;<a href="Javascript:Newfen('pop_up00.jsp','pop_up00','775','450')"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2777
2778<td class="normal" align=right valign="top" width=50%><i>Change type of graphic</i>&nbsp;&nbsp;<a href="#" onClick="openListGraph('2','','<%=graph_sel%>')"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2779<td class="normal" align=right nowrap><img src="<%=imSelected%>" name="imSelected" width="40" height="40" border="1" align="absmiddle"></td>
2780
2781</tr>
2782</table>
2783</td>
2784</tr>
2785
2786<%}%>
2787
2788
2789<%if (graph_sel.equals("1")) {%>
2790<tr>
2791<td>
2792<table border="0" cellpadding="2" cellspacing="2" width="800">
2793<tr><td class='rubrique' colspan=3><b>TIME ANALYSIS</b></td></tr>
2794<tr>
2795<td class="normal" valign="top" width=50%><i>Fine Range Settings</i>&nbsp;&nbsp;<a href="Javascript:Newfen('pop_up01.jsp','pop_up01','775','450')"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2796
2797<td class="normal" align=right valign="top" width=50%><i>Change type of graphic</i>&nbsp;&nbsp;<a href="#" onClick="openListGraph('2','','<%=graph_sel%>')">
2798<img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2799<td class="normal" align=right nowrap><img src="<%=imSelected%>" name="imSelected" width="40" height="40" border="1" align="absmiddle"></td>
2800
2801</tr>
2802</table>
2803</td>
2804</tr>
2805
2806<%}%>
2807
2808
2809<%if (graph_sel.equals("2")) {%>
2810<tr>
2811<td>
2812<table border="0" cellpadding="2" cellspacing="2" width="800">
2813<tr><td class='rubrique' colspan=3><b>XY PLOT</b></td></tr>
2814<tr>
2815<td class="normal" valign="top" width=50%><i>Fine Range Settings</i>&nbsp;&nbsp;<a href="Javascript:Newfen('pop_up02.jsp','pop_up02','775','450')"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2816
2817<td class="normal" align=right valign="top" width=50%><i>Change type of graphic</i>&nbsp;&nbsp;<a href="#" onClick="openListGraph('2','','<%=graph_sel%>')">
2818<img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2819<td class="normal" align=right nowrap><img src="<%=imSelected%>" name="imSelected" width="40" height="40" border="1" align="absmiddle"></td>
2820
2821</tr>
2822</table>
2823</td>
2824</tr>
2825
2826<%}%>
2827
2828
2829<%if (graph_sel.equals("3")) {%>
2830<tr>
2831<td>
2832<table border="0" cellpadding="2" cellspacing="2" width="800">
2833<tr><td class='rubrique' colspan=3><b>DOT DISTRIBUTION PLOT SET-UP</b></td></tr>
2834<tr>
2835<td class="normal" valign="top" width=50%><i>Fine Range Settings</i>&nbsp;&nbsp;<a href="Javascript:Newfen('pop_up7.jsp','pop_up7','775','450')"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2836
2837
2838<td class="normal" align=right valign="top" width=50%><i>Change type of graphic</i>&nbsp;&nbsp;<a href="#" onClick="openListGraph('2','','<%=graph_sel%>')"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2839<td class="normal" align=right nowrap><img src="<%=imSelected%>" name="imSelected" width="40" height="40" border="1" align="absmiddle"></td>
2840
2841</tr>
2842</table>
2843</td>
2844</tr>
2845
2846<%}%>
2847
2848<%if (graph_sel.equals("13")) {%>
2849<tr>
2850<td>
2851<table border="0" cellpadding="2" cellspacing="2" width="800">
2852<tr><td colspan=10 class='rubrique'><b>CONTOUR PLOT SET-UP</b></td></tr>
2853<tr>
2854        <td nowrap align="right"><input type="radio" name="levels" value="0" <%if (levels.equals("0")) out.write("checked");%>></td>
2855        <td nowrap class="normal">Default levels</td>
2856        <td width="10%">&nbsp;</td>
2857        <td align="right" nowrap><input type="radio" name="levels" value="1" <%if (levels.equals("1")) out.write("checked");%>></td>
2858        <td class="normal" nowrap>User Defined levels&nbsp;&nbsp;<a href="Javascript:if (document.thisForm.sel_par_abs.value=='') {alert('For these advanced settings a component must be selected');} else {document.thisForm.levels[1].checked=true;Newfen('pop_up2.jsp','pop_up2','775','450');}"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2859        <td width="10%">&nbsp;</td>
2860        <td class="ssrubrique" nowrap height=5 align="right">Number of Default levels</td>
2861        <td align="left" width="100%"><input disabled type="text" name="level_value" value="5" size="5" onChange="checkValue(document.thisForm.level_value.value,'Level value','5','1');"></td>
2862        <td class="normal" align=right valign="top" nowrap><i>Change type of graph</i>&nbsp;&nbsp;<a href="#" onClick="openListGraph('2','','<%=graph_sel%>');"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2863<td class="normal" align=right rowspan=2 nowrap><img src="<%=imSelected%>" name="imSelected" width="40" height="40" border="1" align="absmiddle"></td>
2864
2865</tr>
2866<tr>
2867    <td class="normal" colspan="9" align="left"><i>Advanced settings</i>&nbsp;<a href="Javascript:if (document.thisForm.sel_par_abs.value=='') {alert('For these advanced settings a component must be selected');} else{Newfen('pop_up3.jsp','Contour_Set_up','775','450')}"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></td>
2868</tr>
2869</table>
2870</td>
2871</tr>
2872<%}%>
2873
2874<tr>
2875<td>
2876<table border="0" cellpadding="2" cellspacing="2" width="800">
2877<tr><td colspan=3 class='rubrique'><b>LEGENDS SET-UP</b></td></tr>
2878<tr>
2879        <td class="ssrubrique" nowrap align="right">Title</td>
2880        <td nowrap><input type="text" name="ftitle" size="80" maxsize="300" value="<%=ftitle%>" onChange="updateOverview();"></td>
2881        <td class="normal" width="100%"><i>Advanced Settings</i>&nbsp;&nbsp;<a href="Javascript:Newfen('pop_up6.jsp','pop_up6','800','450')"><img src="Icons/infos.gif" width="17" height="17" border="0" align="absmiddle"></a></td>
2882
2883</tr>
2884<tr>
2885        <td class="ssrubrique" nowrap align="left">Colour Bar Legend</td>
2886        <td colspan=2 width="100%"><input type="text" name="colour_bar_title" size="80" maxsize="150" value="<%=colour_bar_title%>"></td>
2887</tr>
2888</table>
2889</td>
2890</tr>
2891</table>
2892</form>
2893</body>
2894</html>
2895
Note: See TracBrowser for help on using the repository browser.