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

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

ajout V3

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