source: ether_visual/trunk/save_form/formulaire_traj.jsp @ 678

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

ajout V3

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