source: ether_visual/trunk/save_form/formulaire.jsp.V3.1 @ 678

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

ajout V3

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