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

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

ajout V3

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