source: ether_visual/trunk/save_form/formulaire.jsp.new @ 678

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

ajout V3

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