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

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

ajout V3

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