source: ether_visual/trunk/save_form/formulaire040706.jsp @ 848

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

ajout V3

File size: 133.5 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 or isord=2) 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
578
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
730        _parameters=new ArrayList();
731        for(i=0;i<TRF.parameter.length;i++) if (!TRF.parameter[i].equals("Time") and !TRF.parameter[i].equals("Latitude") and !TRF.parameter[i].equals("Longitude")) {
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                for(i=0;i<TRF.cal_parameter.length;i++) {
775                        selected="";
776                        svalue=TRF.cal_par_acr[i]+"%"+TRF.cal_nature[i]+"%"+TRF.cal_par_acr_orig[i]+"%";
777                        svalue+=TRF.cal_ssparameter[i];
778                        if( sel_par_ord!=null && sel_par_ord!="" && !sel_par_ord.equals("null") && TRF.cal_par_acr[i]!=null && svalue.equals(sel_par_ord) ){
779                                selected="selected";
780                                file_par_ord=TRF.cal_par_acr[i];
781                                file_sspar_ord=TRF.cal_ssparameter[i];
782                                file_unit_ord=TRF.cal_unit[i];
783
784                                if( sel_unit_ord==null || sel_unit_ord.equals("") || sel_unit_ord.equals("null") ){
785                                        sel_unit_ord=file_unit_ord;
786                                        isUnitOrd=true;
787                                }
788
789                                file_nature_ord=TRF.cal_nature[i];
790                                display_type="transformed";
791
792                                file_par_aux=TRF.cal_par_acr_aux[i];
793                                file_unit_aux=TRF.cal_unit_aux[i];
794                                file_nature_aux=TRF.cal_nature_aux[i];
795                                file_par_aux1=TRF.cal_par_acr_aux1[i];
796                                file_unit_aux1=TRF.cal_unit_aux1[i];
797                                file_nature_aux1=TRF.cal_nature_aux1[i];
798
799                                file_trf_id=TRF.cal_trf_id[i];
800                                file_par_orig=TRF.cal_par_acr_orig[i];
801                                file_unit_orig=TRF.cal_unit_orig[i];
802                                file_nature_orig=TRF.cal_nature_orig[i];
803                        }
804
805                        if( !TRF.isRedundant[i] && !TRF.cal_trf_id[i].equals("999")) {// && !svalue.equals("Geopotential%Cal%Press%.")) {
806                                par_options_ord+="<OPTION class=selection VALUE=\""+svalue+"\" "+selected+">";
807                                par_options_ord+=TRF.cal_parameter[i]+from+TRF.cal_parameter_orig[i]+" (Calculated)</OPTION>";
808                                if (selected.equals("selected")) par_observation_height=TRF.cal_parameter[i]+from+TRF.cal_parameter_orig[i]+" (Calculated)";
809                        }
810
811                        _parameters.add(TRF.cal_par_acr[i]);
812                }
813        }
814
815
816        // PARAMETRES OBTENUS PAR TRANSFORMATIONS COMBINEES
817        if( file_type_abs.equals("profil") && TRF.cbn_parameter!=null ){
818                for(i=0;i<TRF.cbn_parameter.length;i++){
819                        selected="";
820
821                        svalue=TRF.cbn_par_acr[i][TRF.cbn_parameter[i].length-1];
822                        svalue+="%"+TRF.cbn_nature[i][TRF.cbn_parameter[i].length-1]+"%";
823                        svalue+=TRF.cbn_par_acr_orig[i][0]+"%"+TRF.cbn_nature[i][TRF.cbn_ssparameter[i].length-1];
824
825                        if( sel_par_ord!=null && sel_par_ord!="" && !sel_par_ord.equals("null") && svalue.equals(sel_par_ord) ) {
826                                selected="selected";
827                                file_par_ord=TRF.cbn_par_acr[i][TRF.cbn_parameter[i].length-1];
828                                file_sspar_ord=TRF.cbn_ssparameter[i][TRF.cbn_parameter[i].length-1];
829                                file_unit_ord=TRF.cbn_unit[i][TRF.cbn_parameter[i].length-1];
830
831                                if( sel_unit_ord==null || sel_unit_ord.equals("") || sel_unit_ord.equals("null") ){
832                                        sel_unit_ord=file_unit_ord;
833                                        isUnitOrd=true;
834                                }
835                                file_nature_ord=TRF.cbn_nature[i][TRF.cbn_parameter[i].length-1];
836                                display_type="combined";
837                                file_trf_id=TRF.cbn_trf_id[i];
838                                file_par_orig=TRF.cbn_par_acr_orig[i][0];
839                                file_unit_orig=TRF.cbn_unit_orig[i][0];
840                                file_nature_orig=TRF.cbn_nature_orig[i][0];
841                         }
842
843                         // ON ECARTE LES TRANSFORMATIONS DONT LE PARAMETRE ORIGINE N'APPARTIENT PAS AU FICHIER
844                         // ON ECARTE EGALEMENT LES TRANSFORMATIONS REDONDANTES
845                         if( TRF.cbn_nature_orig[i][0]!=null && !TRF.cbn_nature_orig[i][0].equals("Cal") && !TRF.isRedundantCbn[i]) {
846                                par_options_ord+="<OPTION class=selection VALUE=\""+svalue+"\" "+selected+">";
847                                par_options_ord+=TRF.cbn_parameter[i][TRF.cbn_parameter[i].length-1]+from;
848                                par_options_ord+=TRF.cbn_parameter_orig[i][0];
849                                par_options_ord+=" (Calculated)</OPTION>";
850                                if (selected.equals("selected"))
851                                        par_observation_height=TRF.cbn_parameter[i][TRF.cbn_parameter[i].length-1]+from+TRF.cbn_parameter_orig[i][0]+" (Calculated)";
852
853
854                                _parameters.add(TRF.cbn_par_acr[i][TRF.cbn_parameter[i].length-1]);
855                         }
856
857       
858                }
859        }
860
861}
862}
863
864
865
866
867//UNITES
868nunit_abs=-1;
869nunit_ord=-1;
870if (isFile) {
871        sql="select unit2.unit_acronym from ether.dcp_unit,ether.dcp_parameter,ether.dcp_unit unit2,ether.dcp_conversion ";
872        sql+="where par_acronym = '"+file_par_abs+"' and dcp_unit.unit_acronym = '"+file_unit_abs+"'";
873        sql+="and dcp_parameter.cls_acronym = dcp_unit.cls_acronym ";
874        sql+="and dcp_unit.unit_id = dcp_conversion.unit_orig and dcp_conversion.unit_final = unit2.unit_id";
875
876        unit_list_abs=req.get_list(sql,unit_columns);
877        isUnitAbs=true;
878        Object obs1=new Object();
879        obs1=file_unit_abs;
880        unit_list_abs.add(0,obs1);
881        nunit_abs=unit_list_abs.size()/unit_columns.length;
882        unit_options_abs="";
883
884        if( nunit_abs>0 ){
885                k=0;
886                if (!(sel_unit_abs!=null && !sel_unit_abs.equals("")) && sel_par_abs!=null
887                                && !sel_par_abs.equals("")) sel_unit_abs=unit_list_abs.get(0).toString();
888
889                for(i=0;i<nunit_abs;i++){
890                        selected="";
891                        if( isUnitAbs && unit_list_abs.get(k).toString().equals(sel_unit_abs)) selected="selected";
892
893                        unit_options_abs+="<OPTION class=selection VALUE=\"";
894                        unit_options_abs+=unit_list_abs.get(k)+"\" "+selected+">"+unit_list_abs.get(k)+"</OPTION>";
895                        k+=unit_columns.length;
896                }
897         }
898         if( isParOrd && file_par_ord!=null && !file_par_ord.equals("null") &&
899                                file_unit_ord!=null && !file_unit_ord.equals("null") && !file_unit_ord.equals("") ) {
900
901                sql="select unit2.unit_acronym from ether.dcp_unit, ether.dcp_parameter, ether.dcp_unit unit2,";
902                sql+="ether.dcp_conversion where par_acronym = '"+file_par_ord+"' and dcp_unit.unit_acronym = '"+file_unit_ord+"' ";
903                sql+="and dcp_parameter.cls_acronym = dcp_unit.cls_acronym and dcp_unit.unit_id = dcp_conversion.unit_orig ";
904                sql+="and dcp_conversion.unit_final = unit2.unit_id";
905                unit_list_ord=req.get_list(sql,unit_columns);
906
907                // RAJOUT DE L'UNITE DU FICHIER
908                Object obs=new Object();
909                obs=file_unit_ord;
910                unit_list_ord.add(0,obs);
911                isUnitOrd=true;
912                nunit_ord=unit_list_ord.size()/unit_columns.length;
913                unit_options_ord="";
914                if( nunit_ord>0 ){
915                        k=0;
916                        // ON FORCE LA SELECTION DE L'UNITE EN ORDONNEE A CELLE DU FICHIER PAR DEFAUT
917                        issel=false;
918                        for(i=0;i<nunit_ord;i++){
919                                if( isUnitOrd && unit_list_ord.get(k).toString().equals(sel_unit_ord) ){
920                                        issel=true;
921                                        break;
922                                }
923                                k+=unit_columns.length;
924                        }
925
926                        if( !issel ) sel_unit_ord=file_unit_ord;
927
928                        k=0;
929                        for(i=0;i<nunit_ord;i++){
930                                selected="";
931                                if( isUnitOrd && unit_list_ord.get(k).toString().equals(sel_unit_ord) )selected="selected";
932                                unit_options_ord+="<OPTION class=selection VALUE=\""+unit_list_ord.get(k)+"\" "+selected+">";
933                                unit_options_ord+=unit_list_ord.get(k)+"</OPTION>";
934                                k+=unit_columns.length;
935                        }
936                }
937        }
938
939}
940
941if (!afficheTrace.equals("null") && afficheTrace.equals("1")) {
942count=1;
943//UNITE DIFFERENTE
944//POUR L'ABSCISSE
945if( sel_unit_abs!=null && !sel_unit_abs.equals("") && !file_unit_abs.equals(sel_unit_abs) ){
946        ids=get_conv("acr", file_unit_abs, sel_unit_abs,req);
947        cnv_id=(new stringSplit()).split(ids,"%")[0];
948        trf_id=(new stringSplit()).split(ids,"%")[1];
949        // EST-CE UNE CONVERSION OU/ET UNE TRANSFORMATION (EN ABSCISSE SEULE UNE TRANFO NON COMBINEE PEUT AVOIR LIEU
950
951        if( !trf_id.equals("999") ){
952                // LA CONVERSION POINTE VERS UNE TRANSFORMATION: ATTENTION DANS CE CAS LA VARIABLE N'EST PAS TRANSFORMEE
953                // CELA RESTE UN CHANGEMENT D'UNITE
954                // DONC LA VARIABLE A LIRE RESTE LA MEME (CONTRAIREMENT A L'ORDONNEE OU CELLE A LIRE EST
955                // LA VARIABLE ORIGINE DE LA TRANSFORMATION ET NON PAS LA VARIABLE CHOISIE PAR L'UTILISATEUR
956                // QUI N'EXISTE PAS DANS LE FICHIER DE MESURE PUISQUE CALCULEE)
957                result=treat_trf(trf_id, sel_tpl_id, count,"",sel_unit_abs,false,true,req);
958                spl=(new stringSplit()).split(result,"%");
959                Xtransfo=spl[1];
960                AUX0transfo=spl[2];
961                AUX1transfo=spl[3];
962                count=Integer.parseInt(spl[4]);
963                more_varid+=spl[5];
964         }
965         else if( !cnv_id.equals("-1") ){
966                // C'EST UNE CONVERSION SIMPLE
967                Xtransfo="conv"+cnv_id+",999,999";
968         }
969        else{
970                sel_unit_abs=file_unit_abs;
971                Xtransfo="t999,999,999";
972        }
973 }
974 else{
975        Xtransfo="t999,999,999";
976 }
977
978//POUR ORDONNEE
979//out.write("<br>file_trf_id="+file_trf_id);
980
981
982if(sel_unit_ord!=null && !sel_unit_ord.equals("")) {//&& !file_unit_ord.equals(sel_unit_abs) ){
983        ordonnee=file_par_ord;
984        sspar_ordonnee=file_sspar_ord;
985        numY_aux0=999;
986        numY_aux1=999;
987        isTransform=false;
988
989        // LA VARIABLE DEMANDEE EN ORDONNEE N'EST PAS DISPONIBLE DANS LE FICHIER
990        // ON CREE DE LA DONNEE VIA UNE TRANSFORMATION DE VARIABLE
991        if( !display_type.equals("available") ){
992
993                isTransform=true;
994                auxiliary=file_par_aux;
995                auxiliary_nature=file_nature_aux;
996                auxiliary1=file_par_aux1;
997                auxiliary_nature1="file_nature_aux1";
998                origin="file_par_orig";
999                origin_unit=file_unit_orig;
1000                origin_nature=file_nature_orig;
1001
1002                // 2 POSSIBILITES :
1003                // 1/ ON TRANSFORME LA VARIABLE INITIALE PAR UNE TRANSFORMATION SIMPLE
1004                if( display_type.equals("transformed") ){
1005                        if( !file_trf_id.equals("999") ){
1006                                //LA CONVERSION POINTE VERS UNE TRANSFORMATION
1007                                result=treat_trf(file_trf_id, sel_tpl_id, count,origin_unit,sel_unit_ord,true,true,req);
1008                                spl=(new stringSplit()).split(result,"%");
1009                                varY=spl[0];
1010                                Ytransfo=spl[1];
1011                                AUY0transfo=spl[2];
1012                                //AUY0transfo=spl[2];
1013                                AUY1transfo=spl[3];
1014                                count=Integer.parseInt(spl[4]);
1015
1016                                more_varid+=spl[5];
1017
1018                         }else{
1019                                sel_unit_ord=file_unit_ord;
1020                                Ytransfo="t999,999,999";
1021
1022                         }
1023                 // 2/ ON TRANSFORME LA VARIABLE INITIALE PAR UNE TRANSFORMATION COMBINEE
1024                 }
1025                else if( display_type.equals("combined") ){
1026                        if( !file_trf_id.equals("999") ){
1027                                /*out.write("<br>file_trf_id="+file_trf_id);
1028                                out.write("<br>sel_tpl_id="+sel_tpl_id);
1029                                out.write("<br>count="+count);
1030                                out.write("<br>origin_unit="+origin_unit);
1031                                out.write("<br>sel_unit_ord="+sel_unit_ord);*/
1032                                //La conversion pointe vers une transformation
1033                                result=treat_cbn(file_trf_id, sel_tpl_id, count,origin_unit,sel_unit_ord,req);
1034                                //out.write("result="+result+"****<br>");       
1035                                spl=(new stringSplit()).split(result,"%");
1036                                varY=spl[0];
1037                               
1038                                Ytransfo=spl[1];
1039                                AUY0transfo=spl[2];
1040                                AUY1transfo=spl[3];
1041                                count=Integer.parseInt(spl[4]);
1042                                more_varid+=spl[5];
1043                        }else {
1044                                sel_unit_ord=file_unit_ord;
1045                                Ytransfo="t999,999,999";
1046                        }
1047                 }
1048                 }else{
1049                        // PAS DE TRANSFORMATION MAIS PEUT-ETRE UNE CONVERSION
1050                      nature_ord=file_nature_ord;
1051                      //varY=",{variable:'"+ordonnee+"', nature:'"+nature_ord+"', subvariable:'"+sspar_ordonnee+"', unite:'"+sel_unit_ord+"'}";
1052                        varY=ordonnee+","+nature_ord+","+sspar_ordonnee+","+sel_unit_ord;
1053                      if( !file_unit_ord.equals(sel_unit_ord) ){
1054                                ids=get_conv("acr", file_unit_ord, sel_unit_ord,req);
1055                                cnv_id=(new stringSplit()).split(ids,"%")[0];
1056                                trf_id=(new stringSplit()).split(ids,"%")[1];
1057
1058                                //EST-CE UNE CONVERSION OU/ET UNE TRANSFORMATION (EN ORDONNEE TRANFO OU COMBINEE PEUVENT
1059                                //AVOIR LIEU
1060                                if( !trf_id.equals("999") ){
1061                                        //LA CONVERSION POINTE VERS UNE TRANSFORMATION
1062                                        result=treat_trf(trf_id, sel_tpl_id, count, "", sel_unit_ord,false,true,req);
1063                                        spl=(new stringSplit()).split(result,"%");
1064                                        varY=spl[0];
1065                                        Ytransfo=spl[1];
1066                                        AUY0transfo=spl[2];
1067                                        AUY1transfo=spl[3];
1068                                        count=Integer.parseInt(spl[4]);
1069                                        more_varid+=spl[5];
1070                                }
1071                                else if( !cnv_id.equals("-1") ){
1072                                        //C'EST UNE CONVERSION SIMPLE
1073                                        Ytransfo="conv"+cnv_id+",999,999";
1074
1075                                }else{
1076                                        sel_unit_ord=file_unit_ord;
1077                                        Ytransfo="t999,999,999";
1078                                }
1079                        }else{
1080                                        Ytransfo="t999,999,999";
1081                        }
1082                 }
1083
1084}
1085TRANSFO="";
1086TRANSFO+=Xtransfo+"&"+Ytransfo;
1087if( !AUX0transfo.equals("") )TRANSFO+="&"+AUX0transfo;
1088if( !AUX1transfo.equals("") )TRANSFO+="&"+AUX1transfo;
1089if( !AUY0transfo.equals("") )TRANSFO+="&"+AUY0transfo;
1090if( !AUY1transfo.equals("") )TRANSFO+="&"+AUY1transfo;
1091}
1092
1093//if (!afficheTrace.equals("null") && afficheTrace.equals("1")) {
1094nfile=-1;
1095if (isParAbs && sel_par_abs!=null && isParOrd ) {
1096        if (sel_par_ord!=null && sel_par_ord!="") {
1097        sel_par="";
1098        if (sel_par_abs!=null) sel_par=(new stringSplit()).split(sel_par_abs,"%")[0];
1099        //DETERMINATION DES BORNES SPATIO-TEMPROELLES
1100                if ((sel_mindate==null || sel_mindate.equals("") || sel_mindate.equals("null")
1101                        || sel_maxdate==null || sel_maxdate.equals("") || sel_maxdate.equals("null")
1102                        || lonmin==null || lonmin.equals("") || lonmin.equals("null")
1103                        || lonmax==null || lonmax.equals("") || lonmax.equals("null")
1104                        || latmin==null || latmin.equals("") || latmin.equals("null")
1105                        || latmax==null || latmax.equals("") || latmax.equals("null"))
1106                        && sel_exp_id!=null && sel_sspar_abs!=null) {
1107
1108                        sql="SELECT min(eth_first_date) as mindate, max(eth_last_date) as maxdate,min(eth_lon_min) as lonmin";
1109                        sql+=",max(eth_lon_max) as lonmax,min(eth_lat_min) as latmin, max(eth_lat_max) as latmax ";
1110                        sql+="FROM ether.ether_file where (eth_id_experiment="+sel_exp_id;
1111                        sql+=" or eth_id_experiment=(select exp_id from ether.dcp_file_class where associate="+sel_tpl_id+")) ";
1112                        sql+=" and (eth_subparameter='"+sel_sspar_abs+"' or eth_subparameter='.') and eth_parameter='"+sel_par+"'";
1113                        al1=req.get_list(sql,cols);
1114                        if(al1!=null && al1.size()>0) {
1115
1116                                if (sel_mindate==null || sel_mindate.equals("") || sel_mindate.equals("null")) {
1117                                        mindate_ms=Long.parseLong(al1.get(0).toString());
1118                                        DSMinDate=(new calDate(mindate_ms)).date_cal;
1119                                }
1120                                else {
1121                                        DSMinDate=sel_mindate;
1122                                        mindate_ms=(new calDate()).invers(sel_mindate);
1123                                }
1124
1125                                if (sel_maxdate==null || sel_maxdate.equals("") || sel_maxdate.equals("null")) {
1126                                        maxdate_ms=Long.parseLong(al1.get(1).toString());
1127                                        DSMaxDate=(new calDate(maxdate_ms)).date_cal;
1128                                }
1129                                else {
1130                                        DSMaxDate=sel_maxdate;
1131                                        maxdate_ms=(new calDate()).invers(sel_maxdate);
1132                                }
1133                                if (lonmin==null || lonmin.equals("") || lonmin.equals("null")) lonmin=al1.get(2).toString();
1134                                if (lonmax==null || lonmax.equals("") || lonmax.equals("null")) lonmax=al1.get(3).toString();
1135
1136                                if (latmin==null || latmin.equals("") || latmin.equals("null")) latmin=al1.get(4).toString();
1137                                if (latmax==null || latmax.equals("") || latmax.equals("null")) latmax=al1.get(5).toString();
1138
1139                                DSMinDate_file=DSMinDate;
1140                                DSMaxDate_file=DSMaxDate;
1141                                if (file_type_abs.equals("densite")) {
1142                                        sel_date_time=DSMinDate.substring(0,10);
1143                                }
1144                                lonmin_file=lonmin;
1145                                lonmax_file=lonmax;
1146                                latmin_file=latmin;
1147                                latmax_file=latmax;
1148
1149                        }
1150
1151                        if (!exp_nrecouv.equals("-1")) {
1152                                calNRecouv pnrecouv = new calNRecouv((new calDate()).invers(DSMinDate),Integer.parseInt(exp_nrecouv),"jour");
1153                                DSMaxDate=pnrecouv.date_cal;
1154                                if ((new calDate()).invers(DSMaxDate) > (new calDate()).invers(DSMaxDate_file)) DSMaxDate=DSMaxDate_file;
1155                        }
1156
1157
1158        }
1159        else if ((sel_mindate!=null && sel_maxdate!=null)) {//|| (sel_date_time!="" && sel_date_time!=null)) {
1160                DSMinDate=sel_mindate;
1161                DSMaxDate=sel_maxdate;
1162
1163                if (!file_type_abs.equals("densite")) {
1164                        mindate_ms=(new calDate()).invers(sel_mindate);
1165                        maxdate_ms=(new calDate()).invers(sel_maxdate);
1166                }
1167                else {
1168                        mindate_ms=(new calDate()).invers(sel_date_time+"-00:00:00:000");
1169                        maxdate_ms=(new calDate()).invers(sel_date_time+"-23:59:59:000");
1170                }
1171        }
1172
1173}
1174
1175}
1176// LISTE DES FICHIERS disponibles
1177sel_file="";
1178file_list=null;
1179nfile=0;
1180
1181
1182sql="select is_batch, exp_nrecouv from sil_experiment_attribut where exp_id='"+sel_exp_id+"'";
1183exp_attribut_list=req.get_list(sql,exp_attribut_columns);
1184
1185if (exp_attribut_list==null || exp_attribut_list.size()==0) {
1186        is_batch="0";
1187        exp_nrecouv="-1";
1188}
1189else{
1190        nreq=exp_attribut_list.size()/exp_attribut_columns.length;
1191        if( nreq>0 ){
1192            k=0;
1193            is_batch=exp_attribut_list.get(k).toString();
1194            exp_nrecouv=exp_attribut_list.get(k+1).toString();
1195        }
1196} 
1197
1198if (sel_exp_public.equals("1")) {
1199        is_private="1";
1200        private_data_flag="1";
1201}
1202else {
1203        is_private="0";
1204        private_data_flag="0";
1205}
1206
1207
1208if (is_private.equals("1")) {
1209        if (is_batch.equals("0")) {
1210                droit="1";
1211                modei="none";
1212        }
1213        else {
1214                modei="email";
1215                if (cemail.equals("") || cemail.equals("null")) {
1216                        droit="0";
1217                }
1218                else {
1219                        droit="1";
1220                }
1221        }
1222        download_auth="0";
1223}
1224if (is_private.equals("0")) {
1225//      email="";
1226        modei="loginu";
1227
1228        if (onlydata.equals("1")) {
1229                download_auth="1";
1230                droit="1";
1231                rightTexte="Only data";
1232        }
1233        else {
1234        if (is_batch.equals("1")) {
1235                if (!cemail.equals("") && !cemail.equals("null")) {
1236                        download_auth="1";
1237                        email=cemail;
1238                        droit="1";
1239                        continuer="0";
1240                }
1241                else continuer="1";
1242        }
1243        else continuer="1";
1244
1245        if (continuer.equals("1")) {
1246
1247        if (!login.equals("") && !passu.equals("")) {
1248
1249        //recherche donnees utilisateur
1250        sql="select id,email,name,first_name from ether_user where login='"+login+"' and password='"+passu+"'";
1251        user_list=req.get_list(sql,user_columns);
1252
1253        if (user_list==null || user_list.size()==0) {
1254                droit="0";
1255                login="";
1256                passu="";
1257                lance="0";
1258                name="Login non-existent in Ether base";
1259                modei="err";
1260
1261        }
1262        else{
1263                nreq=user_list.size()/user_columns.length;
1264                if( nreq>0 ){
1265                        k=0;
1266                        userid=user_list.get(k).toString();
1267                        email=user_list.get(k+1).toString();
1268                        name=user_list.get(k+2).toString();
1269                        first_name=user_list.get(k+3).toString();
1270
1271                }
1272
1273        }
1274
1275
1276        //recherche group_id de l'experience
1277        sql="select eri_group_id from ether_experiment_right where eri_experiment_id='"+sel_exp_id+"'";
1278        group_list=req.get_list(sql,group_columns);
1279
1280        if (group_list==null || group_list.size()==0) {
1281        }
1282        else{
1283               nreq=group_list.size()/group_columns.length;
1284               if( nreq>0 ){
1285                        k=0;
1286                        group=group_list.get(k).toString();
1287                }
1288
1289        }
1290
1291        //recherche droit utilisateur
1292        sql="select id from ether_group_user where user_id='"+userid+"' and group_id='"+group+"'";
1293        priv_list=req.get_list(sql,priv_columns);
1294
1295        if (priv_list==null || priv_list.size()==0) {
1296                download_auth="1";
1297                login="";
1298                passu="";
1299        }
1300        else{
1301                nreq=priv_list.size()/priv_columns.length;
1302                if( nreq>0 ){
1303                        droit="1";
1304                        download_auth="0";
1305                }
1306                else {
1307                        download_auth="1";
1308                }
1309
1310        }
1311
1312        }
1313        droit="1";
1314        }
1315        if (download_auth.equals("0")) rightTexte="Data and download";
1316        else rightTexte="Only data";
1317
1318        }
1319
1320}
1321
1322if (download_auth.equals("0")) rightTexte="Data and download";
1323else rightTexte="Only data";
1324
1325
1326if (is_batch.equals("1")) modeTexte="BATCH";
1327else modeTexte="DIRECT";
1328
1329ftitle=request.getParameter("ftitle");
1330if (ftitle==null || ftitle.equals("") || ftitle.equals("null")) {
1331                ftitle="";
1332}
1333
1334if (colour_bar_title==null || colour_bar_title.equals("") || colour_bar_title.equals("null")) {
1335        colour_bar_title=form_legend;
1336
1337}
1338
1339if (droit.equals("1") && !afficheTrace.equals("null") && afficheTrace.equals("1")) {
1340
1341        sql="select * from ether.ether_file,ether.dcp_file_class file_class ";
1342        sql+="where eth_id_experiment=exp_id ";
1343        sql+="and eth_dataset_version=set_dataset_version ";
1344        sql+="and eth_ceos_level=set_ceos_level ";
1345        sql+="and eth_ceos_sublevel=set_ceos_sublevel ";
1346        sql+="and eth_format=set_format and ";
1347        sql+="eth_id_experiment=exp_id and eth_id_experiment="+sel_exp_id;
1348        sql+=" and (eth_subparameter='"+sel_sspar_abs+"' ";
1349        sql+=" or eth_subparameter='.') ";
1350        sql+=" and eth_parameter='"+file_par_abs+"' and associate=-1 ";
1351        sql+=" and eth_dataset_version='"+sel_version+"' ";
1352        sql+=" and eth_ceos_level='"+sel_level+"' ";
1353        sql+=" and eth_ceos_sublevel='"+sel_sublevel+"' ";
1354        sql+=" and eth_format='"+sel_format+"' and ";
1355        sql+=" (eth_last_date>="+mindate_ms+" and eth_first_date<="+maxdate_ms+") ";
1356        sql+="and (eth_lon_max>="+lonmin+" and eth_lon_min<="+lonmax+") and (eth_lat_max>="+latmin+" and eth_lat_min<="+latmax+") ";
1357
1358
1359
1360        file_list=req.get_list(sql,file_columns2);
1361
1362        if (file_list==null || file_list.size()==0) {
1363                out.write("<script>alert('No experiment files found for this selection');</script>");
1364                isFile=false;
1365        }else{
1366                isFile=true;
1367                nfile=file_list.size()/file_columns2.length;
1368                if( nfile>0 ){
1369                        if (is_batch.equals("1")) mode="BATCH";
1370                        else mode="DIRECT";
1371                        k=0;
1372                        for(i=0;i<nfile;i++){
1373                                sel_file+=file_list.get(k+2)+","+file_list.get(k+5)+","+file_list.get(k+6)+","+file_list.get(k+7);
1374                                sel_file+=","+file_list.get(k+8)+"&";
1375                                k+=file_columns2.length;
1376                        }
1377                }
1378
1379        }
1380
1381
1382
1383pageMode="";
1384
1385if (sel_tpl_id!=null && !sel_tpl_id.equals("") && isFile==true) {
1386        pageMode="";
1387        reader=file_reader(sel_tpl_id,req);
1388        if (sel_file!=null && !sel_file.equals("")) {
1389
1390                files=sel_file;
1391                varid="[{variable:'"+file_par_abs+"', nature:'"+file_nature_abs+"', subvariable:'"+sel_sspar_abs+"', unite:'"+sel_unit_abs+"'}"+varY;
1392                varid+=more_varid;
1393                varid+="]";
1394
1395                typeOrdonnee=file_par_ord;
1396
1397                reader_param_varid=file_par_abs+","+file_nature_abs+","+sel_sspar_abs+","+sel_unit_abs;
1398                reader_param_varid+="&";
1399                reader_param_varid+=varY+more_varid;
1400                //out.write("reader_param_varid="+reader_param_varid);
1401
1402                tt=(new stringSplit()).split(files,"&");
1403                len=tt.length;
1404                if( tt[len-1].equals("")) len=len-1;
1405                filename=new String[len];
1406                auxfile=new String[len];
1407                infofile="";
1408
1409                for(i=0; i<len;i++){
1410                        filename[i]=(new stringSplit()).split(tt[i],",")[0];
1411                        tab_file_name+=rep_data+filename[i];
1412                        if( i<len-1 )tab_file_name+=",";
1413
1414
1415                        assoc=scanAssociates("info",sel_tpl_id,filename[i],rep_data,req);
1416                        if( assoc!=null && assoc.length>0 ){
1417                                infofile+=assoc[0];
1418                        }else{
1419                                infofile+="none";
1420                        }
1421
1422                        if (i<len-1) infofile+=",";
1423
1424                        ///////////////////////////////////////////////
1425                        assoc=scanAssociates("paramaux",sel_tpl_id,filename[i],rep_data,req);
1426                        if( assoc!=null && assoc.length>0 ){
1427                                for(int p=0;p<assoc.length;p++){
1428
1429                                        reponse=(new stringSplit()).split(assoc[p],"%");
1430                                        nomfile=reponse[0];
1431                                        nomvariable=reponse[1];
1432                                        nomsubvariable=reponse[2];
1433                                        src=reponse[3];
1434
1435                                        tab_paux=nomfile+",";
1436                                        tab_paux+=nomvariable+",";
1437                                        tab_paux+=nomsubvariable+",";
1438                                        tab_paux+=src;
1439                                        nassoc=scanAssociates("info",sel_tpl_id,(new File(nomfile)).getName(),rep_data,req);
1440                                        if (nassoc!=null && nassoc.length>0) tab_paux+=","+nassoc[0];
1441                                        else tab_paux+=",.";
1442
1443                                        auxstruct+=tab_paux;
1444                                        if( p<assoc.length-1 )auxstruct+="&";
1445
1446                                }
1447                        }
1448                        else{
1449                                tab_paux="none,";
1450                                tab_paux+="none,";
1451                                tab_paux+="none,";
1452                                tab_paux+="none,";
1453                                tab_paux+=".";
1454                                auxstruct+=tab_paux;
1455                                isParamaux=false;
1456                        }
1457
1458                        if (i<len-1) auxstruct+="@";
1459
1460                }
1461        }
1462        /**************************CREATION FICHIER XML*********************************************/
1463
1464        structureXML docXML = new structureXML();
1465       
1466        docXML.rep_xml=rep_xml;
1467
1468        docXML.id_session=id_session;
1469        docXML.uniqueid=uniqueid;
1470        docXML.mode=mode;
1471
1472        docXML.private_data_flag=private_data_flag;
1473        docXML.download_auth=download_auth;
1474        docXML.flag_extrapolate_auth=flag_extrapolate_auth;
1475
1476        docXML._1d_interpolator_method=_1d_interpolator_method;
1477        docXML._1d_spacing=_1d_spacing;
1478        docXML._1d_Nmax=_1d_Nmax;
1479        docXML._1d_Nmin=_1d_Nmin;
1480
1481        docXML.irreg_grid_method=irreg_grid_method;
1482        docXML.reg_grid_method=reg_grid_method;
1483        docXML._2d_xspacing=_2d_xspacing;
1484        docXML._2d_yspacing=_2d_yspacing;
1485        docXML._2d_NXmax=_2d_NXmax;
1486        docXML._2d_NXmin=_2d_NXmin;
1487        docXML._2d_NYmax=_2d_NYmax;
1488        docXML._2d_NYmin=_2d_NYmin;
1489        docXML.flag_validity_mask=flag_validity_mask;
1490
1491        if (file_type_abs.equals("densite")) {
1492                densite="1";
1493                docXML.profil_flag="1";
1494        }
1495        else docXML.profil_flag="0";
1496
1497        docXML.densite=densite;
1498
1499        docXML.experiment_name=sel_tpl_name;
1500
1501        docXML.plot_type=graph_sel;
1502        docXML.reader=reader;
1503        docXML.tab_file=tab_file_name;
1504        docXML.tab_infofile=infofile;
1505
1506        if (!file_type_abs.equals("densite")) {
1507                docXML.mindate=DSMinDate;
1508                docXML.maxdate=DSMaxDate;
1509        }
1510        else {
1511                docXML.mindate=sel_date_time+"-00:00:00:000";
1512                docXML.maxdate=sel_date_time+"-23:59:59:000";
1513        }
1514
1515        docXML.latmin=latmin;
1516        docXML.latmax=latmax;
1517        docXML.lonmin=lonmin;
1518        docXML.lonmax=lonmax;
1519
1520        docXML.observation_height=observation_height;
1521        docXML.num_version=sel_version;
1522        docXML.map_projection=map_projection;
1523
1524        docXML.hemisphere=hemisphere;
1525
1526        docXML.title=ftitle;
1527        docXML.sub_title=ftitle;
1528
1529        docXML.colour_bar_title=colour_bar_title;
1530        docXML.map_information_level=map_information_level;
1531        docXML.map_filling=map_filling;
1532        docXML.map_axes_type=map_axes_type;
1533        docXML.grid_linestyle=grid_linestyle;
1534        docXML.latitude_posting=latitude_posting;
1535        docXML.longitude_posting=longitude_posting;
1536        docXML.colour_bar_grid=colour_bar_grid;
1537        docXML.colour_bar_nb_value=colour_bar_nb_value;
1538
1539        docXML.auxstruct=auxstruct;
1540
1541        docXML.read_param_varid=reader_param_varid;
1542
1543        docXML.parameter_name=form_par_abs;
1544        docXML.vertical_scale_name=file_par_ord;
1545
1546        docXML.vertical_scale_unit=sel_unit_ord;
1547        docXML.parameter_unit=sel_unit_abs;
1548        docXML.sub_parameter=form_sspar_abs;
1549
1550        docXML.xvariable=file_par_abs;
1551        docXML.xnature=file_nature_abs;
1552        if (sel_sspar_abs.equals(".")) docXML.xsubvariable="none";
1553        else docXML.xsubvariable=sel_sspar_abs;
1554        docXML.xunite=sel_unit_abs;
1555
1556        docXML.contour_display_mode=contour_display_mode;
1557        docXML.contour_default_colour_flag=contour_default_colour_flag;
1558        docXML.contour_default_colour=contour_default_colour;
1559        docXML.contour_default_linestyle=contour_default_linestyle;
1560        docXML.contour_default_line_thickness=contour_default_line_thickness;
1561        docXML.contour_default_label_flag=contour_default_label_flag;
1562
1563        if (graph_sel.equals("13") && contour_default_colour_flag.equals("0")) {
1564                if (contour_display_mode.equals("0")) {
1565                        if (contour_default_colour_flag.equals("0") && contour_default_colour.equals("0,0,0")) {
1566                                docXML.idl_colour_table_id="";
1567                                docXML.contour_default_colour_flag="1";
1568                        }
1569                        else {
1570                                docXML.default_linecolour=contour_default_colour;
1571                        }
1572                }
1573                else {
1574                        docXML.idl_colour_table_id="";
1575                        docXML.contour_default_colour_flag="1";
1576                }
1577
1578        }
1579        else if ((graph_sel.equals("3") && dot_plot_colour_flag.equals("1")) || (graph_sel.equals("13") && contour_default_colour_flag.equals("1"))) {
1580                docXML.idl_colour_table_id=idl_colour_table_id;
1581
1582                if (!imported_colour_table.equals("") && !imported_colour_table.equals("null") && imported_colour_table!="" && imported_colour_table!=null)
1583                {
1584                        docXML.imported_colour_table=imported_colour_table;
1585                }
1586
1587                docXML.val_min_bd=val_min_bd;
1588                docXML.val_max_bd=val_max_bd;
1589                docXML.unite_bd=unite_bd;
1590
1591        }
1592
1593        sql="SELECT mt_id ";
1594        sql+="FROM sil_type_trace WHERE tt_id="+graph_sel;
1595        file_list=null;
1596        file_list=req.get_list(sql,metat_columns);
1597
1598        if (file_list==null || file_list.size()==0) {
1599        }else{
1600                nfile=file_list.size()/metat_columns.length;
1601                if (nfile>0) {
1602                        k=0;
1603                        docXML.meta_type=file_list.get(k).toString();
1604                }
1605        }
1606
1607        docXML.transfo=TRANSFO;
1608
1609        docXML.dot_plot_dot_style=dot_plot_dot_style;
1610        if (dot_plot_colour_flag.equals("0")) docXML.dot_plot_colour_flag="1";
1611        else docXML.dot_plot_colour_flag=dot_plot_colour_flag;
1612
1613        docXML.dot_plot_dotcolour=dot_plot_dotcolour;
1614        docXML.dot_plot_dotsize=dot_plot_dotsize;
1615
1616        if (levels.equals("1") && !userLevels.equals("") && !userLevels.equals("null")) {
1617                docXML.userLevels=userLevels;
1618                docXML.contour_level_setting_mode=levels;
1619        }
1620        else {
1621                docXML.userLevels="";
1622                docXML.contour_level_setting_mode="0";
1623        }
1624
1625
1626        String ret=docXML.generate();
1627        if (mode.equals("BATCH")) {
1628               
1629                pageMode="lanceEnTacheDeFond.jsp";
1630                if (!login.equals("") && !passu.equals("")) {
1631                        chainePageMode="?id="+id_session+"&uniqueid="+uniqueid+"&mode="+mode+"&email="+email;
1632                }
1633                else {
1634                        chainePageMode="?id="+id_session+"&uniqueid="+uniqueid+"&mode="+mode+"&email="+cemail;
1635                }
1636        }
1637        else {
1638                pageMode="lanceAppletEtherVisu.html";
1639                chainePageMode="?id="+id_session+"&uniqueid="+uniqueid+"&mode="+mode+"&email=";
1640        }
1641
1642}
1643}
1644}
1645par_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>";
1646
1647par_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>";
1648
1649par_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>";
1650
1651unit_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>";
1652
1653//if (sspar_options.equals("") || sspar_options.equals("null") || sspar_options=="" || sspar_options==null) sspar_options="<OPTION class=selection VALUE=\".
1654//\" selected>None</OPTION>";
1655
1656sspar_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>";
1657
1658unit_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>";
1659
1660exp_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>";
1661
1662
1663req.close_connection();
1664%>
1665<html>
1666<head>
1667<title>setAttribute et tableaux</title>
1668<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
1669<link rel="stylesheet" href="ether.css" type="text/css">
1670<script language="Javascript">
1671//<!--
1672var longdate="";
1673var regExpEmpty=/^(\s)*$/g;
1674
1675function updateCreation(mode) {
1676parent.creation.document.thisForm.active.value=mode;
1677parent.creation.document.thisForm.submit();
1678return true;
1679}
1680
1681function lancerMode(page,chainePage) {
1682if (page!='' && chainePage!='') {
1683Newfen(page+chainePage,'Visualisation_V3','800','800');
1684}
1685
1686return true;
1687
1688}
1689
1690function initForm(niv) {
1691var obj=document.thisForm;
1692if (niv=='5') {
1693        if (obj.file_type_abs.value=='densite') niv='6b';
1694        updateTitle();
1695}
1696
1697if (niv=='2') {
1698        obj.class_data_set.value="ssrubrique";
1699        obj.dis_data_set.value="";     
1700
1701        obj.class_component.value="inactif";
1702        obj.dis_component.value="disabled";
1703
1704        obj.class_axis.value="inactif";
1705
1706        obj.class_vertical_scale.value="inactif";
1707        obj.dis_vertical_scale.value="disabled";
1708               
1709        obj.class_time.value="inactif";
1710        obj.dis_time.value="disabled";
1711
1712        obj.class_ho.value="inactif";
1713        obj.dis_ho.value="disabled";
1714       
1715        obj.class_location.value="inactif";
1716        obj.class_location2.value="inactif";
1717       
1718        obj.sel_tpl_id.value="";
1719        obj.graph_sel.value="";
1720       
1721        openListGraph('1','1','');
1722}
1723
1724
1725if (obj.graph_sel.value=='' && niv!='2') {
1726        openListGraph('1','1');
1727        niv='2';
1728        obj.sel_tpl_id.value="";
1729}
1730
1731if (obj.graph_sel.value!='' && niv=='2') {
1732        //niv='3';
1733}
1734
1735
1736if (niv=='4' || niv=='1' || niv=='2') {
1737        obj.sel_par_abs.value="";
1738        obj.sel_par_ord.value="";
1739        obj.sel_unit_abs.value="";
1740        obj.sel_unit_ord.value="";
1741        obj.sel_sspar_abs.value="";
1742        obj.observation_height.value="";
1743        obj.latmin.value="";
1744        obj.lonmin.value="";
1745        obj.latmax.value="";
1746        obj.lonmax.value="";
1747
1748        obj.class_data_set.value="ssrubrique";
1749        obj.dis_data_set.value="";
1750
1751        obj.class_component.value="inactif";
1752        obj.dis_component.value="disabled";
1753        obj.class_axis.value="inactif";
1754
1755        obj.class_vertical_scale.value="inactif";
1756        obj.dis_vertical_scale.value="disabled";
1757
1758        obj.class_time.value="inactif";
1759        obj.dis_time.value="disabled";
1760
1761        obj.class_ho.value="inactif";
1762        obj.dis_ho.value="disabled";
1763        obj.class_location.value="inactif";
1764        obj.class_location2.value="inactif";
1765
1766}
1767
1768if (niv=='4') {
1769       
1770        obj.class_component.value="ssrubrique";
1771        obj.dis_component.value="";
1772        obj.class_axis.value="rubrique";
1773}
1774
1775if (niv=='5') {
1776        obj.sel_par_ord.value="";
1777        obj.sel_unit_ord.value="";
1778        obj.observation_height.value="";
1779        obj.latmin.value="";
1780        obj.lonmin.value="";
1781        obj.latmax.value="";
1782        obj.lonmax.value="";
1783
1784        obj.class_data_set.value="ssrubrique";
1785        obj.dis_data_set.value="";
1786
1787        obj.class_component.value="ssrubrique";
1788        obj.dis_component.value="";
1789        obj.class_axis.value="rubrique";
1790
1791        obj.class_vertical_scale.value="ssrubrique";
1792        obj.dis_vertical_scale.value="";
1793
1794        obj.class_time.value="ssrubrique";
1795        obj.dis_time.value="";
1796
1797        obj.class_ho.value="inactif";
1798        obj.dis_ho.value="disabled";
1799        obj.class_location.value="inactif";
1800        obj.class_location2.value="rubrique";
1801
1802}
1803
1804if (niv=='6') {
1805        obj.observation_height.value="";       
1806
1807        obj.class_data_set.value="ssrubrique";
1808        obj.dis_data_set.value="";
1809
1810        obj.class_component.value="ssrubrique";
1811        obj.dis_component.value="";
1812        obj.class_axis.value="rubrique";
1813
1814        obj.class_vertical_scale.value="ssrubrique";
1815        obj.dis_vertical_scale.value="";
1816
1817        obj.class_time.value="ssrubrique";
1818        obj.dis_time.value="";
1819
1820        obj.class_ho.value="ssrubrique";
1821        obj.dis_ho.value="";
1822        obj.class_location.value="rubrique";
1823}
1824
1825if (niv=='6b') {
1826       obj.observation_height.value="";
1827
1828       obj.class_data_set.value="ssrubrique";
1829       obj.dis_data_set.value="";
1830 
1831       obj.class_component.value="ssrubrique";
1832       obj.dis_component.value="";
1833       obj.class_axis.value="rubrique";
1834 
1835       obj.class_vertical_scale.value="ssrubrique";
1836       obj.dis_vertical_scale.value="";
1837
1838       obj.class_time.value="ssrubrique";
1839       obj.dis_time.value="";
1840 
1841       obj.class_ho.value="ssrubrique";
1842       obj.dis_ho.value="";
1843       obj.class_location.value="rubrique";
1844}
1845
1846
1847if (niv=='6' || niv=='6b') updateCreation('1');
1848else updateCreation('0');
1849
1850
1851parent.user_info.location.href='user_info.jsp?num_step='+niv+'&is_private='+<%=is_private%>;
1852//parent.user_info.document.thisForm.num_step.value=niv;
1853//parent.user_info.document.thisForm.submit(); 
1854
1855return true;
1856}
1857
1858function blocForm() {
1859document.thisForm.submit();
1860
1861document.thisForm.sel_tpl_id.disabled=true;
1862document.thisForm.sel_par_abs.disabled=true;
1863document.thisForm.sel_unit_abs.disabled=true;
1864document.thisForm.sel_sspar_abs.disabled=true;
1865if (document.thisForm.sel_par_ord) {
1866        document.thisForm.sel_par_ord.disabled=true;
1867        document.thisForm.sel_unit_ord.disabled=true;
1868}
1869document.thisForm.latmin.disabled=true;
1870document.thisForm.latmax.disabled=true;
1871document.thisForm.lonmin.disabled=true;
1872document.thisForm.lonmax.disabled=true;
1873document.thisForm.mindate.disabled=true;
1874document.thisForm.maxdate.disabled=true;
1875document.thisForm.observation_height.disabled=true;
1876document.thisForm.ftitle.disabled=true;
1877document.thisForm.colour_bar_title.disabled=true;
1878
1879
1880}
1881
1882function updateLegend() {
1883document.thisForm.colour_bar_title.value="";
1884
1885abs=document.thisForm.form_par_abs.value;
1886unit=document.thisForm.sel_unit_abs.value;
1887
1888legend=abs+' ('+unit+')';
1889
1890document.thisForm.colour_bar_title.value=legend;
1891
1892return true;
1893
1894}
1895
1896function updateTitle() {
1897document.thisForm.ftitle.value="";
1898oh=document.thisForm.observation_height.value;
1899
1900exp=document.thisForm.sel_tpl_name.value;
1901mid=document.thisForm.mindate.value;
1902mad=document.thisForm.maxdate.value;
1903par_observation_height=document.thisForm.par_observation_height.value;
1904sel_unit_ord=document.thisForm.sel_unit_ord.value;
1905
1906tt=exp;
1907if (document.thisForm.file_type_abs.value!="densite") {
1908if (oh!='' && !matchRegExp(oh, regExpEmpty)) {
1909        tt+=' - '+oh+' '+sel_unit_ord+' - ';
1910        tt+=document.thisForm.mindate.value.substring(0,10)+' to '+document.thisForm.maxdate.value.substring(0,10);
1911}
1912}
1913else tt+=' - '+document.thisForm.sel_date_time.value;
1914document.thisForm.ftitle.value=tt;
1915
1916return true;
1917
1918}
1919
1920function choixIdent(is_batch) {
1921if (document.thisForm.modei.value=="email") {
1922        //Newfen('email.jsp?cemail=&modifye=0&is_batch=','Email','400','300');
1923}
1924else if (document.thisForm.modei.value=="loginu") {
1925        //Newfen('loginu.jsp?modifye=0&is_batch='+is_batch,'Authentification','650','550');
1926}
1927document.thisForm.lance.value="1";
1928return true;
1929}
1930
1931function updateOverview() {
1932        graph_sel=document.thisForm.graph_sel.value;
1933        chaineURL="overview.jsp?graph_sel="+graph_sel;
1934        chaineURL+="&meta_type="+document.thisForm.lib_meta_type.value;
1935        chaineURL+="&file_type_abs="+document.thisForm.file_type_abs.value;
1936       
1937        if (document.thisForm.mindate.value!='') chaineURL+="&datemin="+document.thisForm.mindate.value;
1938        if (document.thisForm.maxdate.value!='') chaineURL+="&datemax="+document.thisForm.maxdate.value;
1939        if (document.thisForm.latmin.value!='') chaineURL+="&latmin="+document.thisForm.latmin.value;
1940        if (document.thisForm.latmax.value!='') chaineURL+="&latmax="+document.thisForm.latmax.value;
1941        if (document.thisForm.lonmin.value!='') chaineURL+="&lonmin="+document.thisForm.lonmin.value;
1942        if (document.thisForm.lonmax.value!='') chaineURL+="&lonmax="+document.thisForm.lonmax.value;
1943        if (document.thisForm.ftitle.value!='') chaineURL+="&title="+document.thisForm.ftitle.value;
1944        if (document.thisForm.sel_tpl_name.value!='') chaineURL+="&sel_tpl_name="+document.thisForm.sel_tpl_name.value;
1945        if (document.thisForm.sel_tpl_id.value!='') chaineURL+="&sel_tpl_id="+document.thisForm.lib_tpl_id.value;
1946        if (document.thisForm.sel_par_abs.value!='') chaineURL+="&sel_par_abs="+document.thisForm.lib_param.value;
1947        if (document.thisForm.sel_sspar_abs.value!='') chaineURL+="&sel_sspar_abs="+document.thisForm.sel_sspar_abs.value;
1948        if (document.thisForm.sel_par_ord.value!='') chaineURL+="&sel_par_ord="+document.thisForm.form_par_ord.value;
1949        if (document.thisForm.sel_unit_ord.value!='') chaineURL+="&sel_unit_ord="+document.thisForm.sel_unit_ord.value;
1950        if (document.thisForm.sel_unit_abs.value!='') chaineURL+="&sel_unit_abs="+document.thisForm.sel_unit_abs.value;
1951        if (document.thisForm.colour_bar_title!='') chaineURL+="&colour_bar_title="+document.thisForm.colour_bar_title.value;
1952        if (document.thisForm.observation_height!='') chaineURL+="&observation_height="+document.thisForm.observation_height.value;
1953
1954        parent.overview.location.href=chaineURL;
1955        return true;
1956}
1957
1958function showTrace(id_session,uniqueid,mode) {
1959var chaine='pop_upapplet.jsp?id_session='+id_session+'&uniqueid='+uniqueid+'&mode='+mode;
1960
1961Newfen(chaine,'Visualisation_V3','600','600');
1962
1963return true;
1964}
1965
1966
1967function checkObservationHeight(type_abs) {
1968if (type_abs!='profil') return false;
1969if (checkOH()) {
1970        return false;
1971}
1972else return true;
1973
1974}
1975
1976function checkOH() {
1977        if (!checkValue(document.thisForm.observation_height.value,'The height observation','','1')) {
1978                return false;
1979        }
1980        else {
1981                if (!matchRegExp(document.thisForm.observation_height.value, regExpEmpty) && document.thisForm.observation_height.value!='') {
1982                        return true;
1983                }
1984                else {
1985                        alert("You must enter an observation height");
1986                        return false;
1987                }
1988        }
1989
1990}
1991
1992function checkValue(valeur,texte,def,mode) {
1993if (isNaN(valeur)) {
1994        if (mode=='1') alert(texte+' must be numeric');
1995        if (texte=="Level value") document.thisForm.level_value.value=def;
1996        else if (mode=='1') document.thisForm.observation_height.value=def;
1997        return false;
1998}
1999return true;
2000}
2001
2002
2003function matchRegExp(valeur, regularExpression) {
2004        var resultat = valeur.match(regularExpression);
2005        if(resultat!=null && resultat.length==1) return true;
2006        else return false;
2007}
2008
2009function checkLongitude(minL,maxL){
2010        var text='';
2011
2012        if (isNaN(document.thisForm.lonmin.value) || isNaN(document.thisForm.lonmax.value)) {
2013                alert("Error : Invalid longitude format");
2014                document.thisForm.lonmin.value=minL;
2015                document.thisForm.lonmax.value=maxL;
2016                return false;
2017        }
2018
2019        minlon=parseFloat(document.thisForm.lonmin.value);
2020        maxlon=parseFloat(document.thisForm.lonmax.value);
2021        if( minlon > maxlon ){
2022                alert("Error : Latitude min is greater than latitude max");
2023                document.thisForm.lonmin.value=minL;
2024                document.thisForm.lonmax.value=maxL;
2025                return false;
2026        }
2027        if( minlon<-180 || maxlon>180 ){
2028                alert("Error : the selected longitude is out of range [-180,180]");
2029                if (minlon<-180) document.thisForm.lonmin.value=minL;
2030                if (maxlon>180) document.thisForm.lonmax.value=maxL;
2031                return false;
2032        }
2033        if( minlon<minL || maxlon>maxL ){
2034                alert("Error : the selected longitude is out of range of the experiment files ["+minL+","+maxL+"]");
2035                if (minlon<minL) document.thisForm.lonmin.value=minL;
2036                if (maxlon>maxL) document.thisForm.lonmax.value=maxL;
2037                return false;
2038        }
2039
2040        if (matchRegExp(document.thisForm.lonmax.value, regExpEmpty) || document.thisForm.lonmax.value=='') {
2041                document.thisForm.lonmax.value=maxL;
2042        }
2043        if (matchRegExp(document.thisForm.lonmin.value, regExpEmpty) || document.thisForm.lonmin.value=='') {
2044                document.thisForm.lonmin.value=minL;
2045        }
2046        updateOverview();
2047        return true;
2048}
2049
2050
2051function checkLatitude(minL,maxL) {
2052
2053        if (isNaN(document.thisForm.latmin.value) || isNaN(document.thisForm.latmax.value)) {
2054                alert("Error : Invalid latitude format");
2055                document.thisForm.latmin.value=minL;
2056                document.thisForm.latmax.value=maxL;
2057                return false;
2058        }
2059
2060        minlat=parseFloat(document.thisForm.latmin.value);
2061        maxlat=parseFloat(document.thisForm.latmax.value);
2062
2063
2064        if( minlat > maxlat ){
2065                alert("Error : Latitude min is greater than latitude max");
2066                document.thisForm.latmin.value=minL;
2067                document.thisForm.latmax.value=maxL;
2068                return false;
2069        }
2070        if( minlat<-90 || maxlat>90 ){
2071                alert("Error : the selected latitude is out of range [-90,90]");
2072                if (minlat<-90) document.thisForm.latmin.value=minL;
2073                if (maxlat>90) document.thisForm.latmax.value=maxL;
2074                return false;
2075        }
2076        if (minlat<minL || maxlat>maxL) {
2077                alert("Error : the selected latitude is out of range of the experiment files ["+minL+","+maxL+"]");
2078                if (minlat<minL) document.thisForm.latmin.value=minL;
2079                if (maxlat>maxL) document.thisForm.latmax.value=maxL;
2080                return false;
2081        }
2082
2083
2084        if (matchRegExp(document.thisForm.latmax.value, regExpEmpty) || document.thisForm.latmax.value=='') {
2085                document.thisForm.latmax.value=maxL;
2086        }
2087        if (matchRegExp(document.thisForm.latmin.value, regExpEmpty) || document.thisForm.latmin.value=='') {
2088                document.thisForm.latmin.value=minL;
2089        }
2090        updateOverview();
2091        return true;
2092}
2093
2094function isDate2(s) {
2095        // Verification de la date
2096        var a1=s.split("/");
2097        var e=true;
2098        if( (a1.length!=3) && (a1[0].length!=4 || a1[1].length!=2 || a1[2].length!=2)) {
2099               e=false;
2100        }else{
2101                var y=a1[0],m=a1[1],d=a1[2];
2102                if (isPositiveInteger(a1[0]) && isPositiveInteger(a1[1]) && isPositiveInteger(a1[2])){
2103                if ( (y<1000)||(y.length>4) )e=false
2104                        if (e) {
2105                                v=new Date(m+"/"+d+"/"+y);
2106                                longdate=y+m+d;
2107                                if (v.getMonth()!=m-1)e=false;
2108                        }
2109                }
2110                else {
2111                       e=false;
2112                }
2113        }
2114       
2115        return e
2116}
2117
2118
2119function isDate(s) {
2120        var a0=s.split("-");
2121        if ((a0.length!=2)){
2122                e=false;
2123        }else{
2124        // Verification de la date
2125                var a1=a0[0].split("/");
2126                var a2=a0[1].split(":");
2127                var e=true;
2128                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
2129].length!=2 || a2[3].length!=3 )){
2130                        e=false;
2131                }else{
2132                        var y=a1[0],m=a1[1],d=a1[2];
2133                        if (isPositiveInteger(a1[0]) && isPositiveInteger(a1[1]) && isPositiveInteger(a1[2])){
2134                                if ( (y<1000)||(y.length>4) )e=false
2135                                if (e) {
2136                                        v=new Date(m+"/"+d+"/"+y);
2137                                        if (v.getMonth()!=m-1)e=false;
2138                                }
2139                        }else{
2140                                e=false;
2141                        }
2142                // Verification de l'heure
2143                        if( e ){
2144                                if (isPositiveInteger(a2[0]) && isPositiveInteger(a2[1]) && isPositiveInteger(a2[2])){
2145                                        var hh=a2[0],mm=a2[1],ss=a2[2],ms=a2[3];
2146                                        if( ms.length<3 )e=false;
2147                                        if (e) {
2148                                                v=new Date(m+"/"+d+"/"+y+" "+hh+":"+mm+":"+ss);
2149                                                longdate=y+m+d+hh+mm+ss+ms;
2150                                                if (v.getMonth()!=m-1)e=false;
2151                                        }
2152                                }else{
2153                                        e=false;
2154                                }
2155                        }
2156                }
2157        }
2158        return e
2159}
2160
2161
2162function isDigit(theDigit)
2163{
2164        var digitArray = new Array('0','1','2','3','4','5','6','7','8','9'),j;
2165
2166        for (j = 0; j < digitArray.length; j++)
2167        {
2168                if (theDigit == digitArray[j])return true
2169        }
2170        return false
2171
2172}
2173
2174function isPositiveInteger(theString){
2175        var theData = new String(theString)
2176
2177        if (!isDigit(theData.charAt(0)))
2178                if (!(theData.charAt(0)== '+'))return false
2179
2180        for (var i = 1; i < theData.length; i++)
2181                if (!isDigit(theData.charAt(i)))return false
2182        return true
2183}
2184
2185function checkDate(minDT,maxDT) {
2186        var minD="";
2187        mindate=document.thisForm.mindate.value;
2188
2189
2190        isDate(minDT);
2191        long_minDT=longdate;
2192
2193        isDate(maxDT);
2194        long_maxDT=longdate;
2195       
2196        if (document.thisForm.file_type_abs!='densite') {       
2197        if( !isDate(mindate) ){
2198                alert("Warning : The format of the Date min is not correct, it should be YYYY/MM/DD-HH:MM:SS:MSC");
2199                document.thisForm.mindate.value=minDT;
2200                return false;
2201        }
2202        longdatemin=longdate;
2203        maxdate=document.thisForm.maxdate.value;
2204        if( !isDate(maxdate) ){
2205                alert("Warning : The format of the Date max is not correct, it should be YYYY/MM/DD-HH:MM:SS:MSC");
2206                document.thisForm.maxdate.value=maxDT;
2207                return false;
2208        }
2209        longdatemax=longdate;
2210        if (parseFloat(longdatemin)<parseFloat(long_minDT)) {
2211                alert("Warning: Date min can not be less than the Date min of the experiment files ("+minDT+")");
2212                document.thisForm.mindate.value=minDT;
2213                return false;
2214        }
2215
2216        if (parseFloat(longdatemax)>parseFloat(long_maxDT)) {
2217                alert("Warning: Date max can not be greater than the Date max of the experiment files ("+maxDT+")");
2218                document.thisForm.maxdate.value=maxDT;
2219                return false;
2220        }
2221
2222        if( parseFloat(longdatemin)>parseFloat(longdatemax) ){
2223                alert("Warning : Date min can not be greater than the Date max");
2224                document.thisForm.maxdate.value=maxDT;
2225                document.thisForm.mindate.value=minDT;
2226                return false;
2227        }
2228       
2229        }
2230
2231        //document.thisForm.mindate.focus();
2232        updateOverview();
2233       
2234        updateTitle();
2235        return true;
2236}
2237
2238function checkDate2(minDT,maxDT) {
2239        var minD="";
2240        seldate=document.thisForm.sel_date_time.value;
2241
2242        minDT=minDT.substr(0,10);
2243        maxDT=maxDT.substr(0,10);
2244       
2245        isDate2(minDT);
2246        long_minDT=longdate;
2247
2248        isDate2(maxDT);
2249        long_maxDT=longdate;
2250
2251        if( !isDate2(seldate) ){
2252                alert("Warning : The format of the Date is not correct, it should be YYYY/MM/DD");
2253                document.thisForm.sel_date_time.value=minDT;
2254                return false;
2255        }
2256
2257        longdatetime=longdate;
2258        if (parseFloat(longdatetime)<parseFloat(long_minDT) || parseFloat(longdatetime)>parseFloat(long_maxDT)) {
2259                alert("Warning: Date is out of range. Range : ["+minDT+","+maxDT+"]");
2260                document.thisForm.sel_date_time.value=minDT;
2261                return false;
2262        }
2263
2264        //document.thisForm.mindate.focus();
2265        updateOverview();
2266
2267        updateTitle();
2268        return true;
2269}
2270
2271
2272function Newfen (URL,NAME,W,H)
2273{
2274  var wconf = 'scrollbars=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,width=' + W + ',height=' + H;
2275  var w = window.open (URL, NAME, wconf);
2276
2277}
2278
2279function lancerTrace(type_abs,is_batch) {
2280var ok='0';
2281
2282if (document.thisForm.modei.value=='email') {
2283        if (document.thisForm.email.value!='') ok='1';
2284        else ok='0';
2285}
2286else if (document.thisForm.modei.value=='loginu') {
2287
2288        if (document.thisForm.login.value!='' && document.thisForm.passu.value!='') ok='1';
2289        else if (document.thisForm.email.value!='') ok='1';
2290        else if (document.thisForm.onlydata.value=="1") ok='1';
2291        else ok='0';
2292        ok='1';
2293}
2294
2295if (document.thisForm.modei.value=='none' || document.thisForm.modei.value=='err') {
2296        ok='1';
2297}
2298
2299
2300if (ok=='1') {
2301if (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=='') {
2302        alert("The parameters information are not complete");
2303        return false;
2304}
2305else if (checkObservationHeight(type_abs)) {
2306        return false;
2307}
2308else if (confirm('Confirm your selection ?')) {
2309        document.thisForm.afficheTrace.value="1";
2310        blocForm();
2311}
2312else {
2313        return false;
2314}
2315}
2316else return false;
2317return true;
2318
2319}
2320
2321function openListGraph(mode,appel,graph) {
2322var page='';
2323if (document.thisForm.sel_tpl_name.value!='') {
2324page="list_graphiques.jsp?sel_tpl_name="+document.thisForm.sel_tpl_name.value+"&modef="+mode+"&appel="+appel+"&graph_sel="+graph;
2325//window.blur();
2326Newfen(page,'Graphicslist','800','300');
2327//alert(Graphicslist.closed);
2328return true;
2329}
2330
2331return false;
2332
2333}
2334
2335function attach() {
2336        var element = document.getElementById('ligne1');
2337        element.setAttribute("class","gros");
2338}
2339
2340function updateUser(rt,n,fn,ib,ip,l,m,sei) {
2341var chaineURL='';
2342var obj=parent.user_info.document.thisForm;
2343//chaineURL='user_info.jsp?rightText='+rt+'&name='+n+'&first_name='+fn+'&email='+e+'&is_batch='+ib+'&is_private='+ip+'&lance='+l;
2344//obj.rightTexte.value=rt;
2345obj.name.value=n;
2346obj.first_name.value=fn;
2347//obj.email.value=e;
2348obj.is_batch.value=ib;
2349obj.is_private.value=ip;
2350obj.lance.value=l;
2351obj.modei.value=m;
2352obj.sel_exp_id.value=sei;
2353
2354obj.submit();
2355               
2356}
2357 
2358//window.onload = attach;
2359</script>
2360</head>
2361
2362<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');}">
2363<%!
2364boolean isUnitIdentique(String param1, String param2, String isord,send_request req) {
2365
2366String list="";
2367String[] cols1={"cls_acronym"};
2368ArrayList _list1=req.get_list("select cls_acronym from ether.dcp_parameter where par_acronym='"+param1+"' and (isord=2 or isord=1)",cols1);
2369if( _list1==null || _list1.size()<1 ) return false;
2370else {
2371        String[] cols2={"cls_acronym"};
2372        ArrayList _list2=req.get_list("select cls_acronym from ether.dcp_parameter where par_acronym='"+param2+"' and (isord=2 or isord=1)",cols2);
2373        if( _list2==null || _list2.size()<1 ) return false;
2374        else {
2375                if (_list1.get(0).equals(_list2.get(0))) return true;
2376                else return false;
2377        }
2378}
2379}
2380
2381String getTransform(String trf_id,send_request req){
2382        String list="";
2383
2384  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"};
2385            ArrayList _list=req.get_list(
2386                    "select "+
2387                  "par_orig, "+
2388                    "param0.par_acronym as par_acr_orig, "+
2389                    "unit_orig,  "+
2390                    "unit0.unit_acronym as unit_acr_orig, "+
2391                    "par_final,  "+
2392                    "param3.par_acronym as par_acr_final, "+
2393                    "unit_final, "+
2394                    "unit3.unit_acronym as unit_acr_final, "+
2395                    "par_aux0,  "+
2396                    "param1.par_acronym as par_acr_aux0, "+
2397                    "unit_aux0,  "+
2398                    "unit1.unit_acronym as unit_acr_aux0,  "+
2399                    "par_aux1,  "+
2400                    "param2.par_acronym as par_acr_aux1, "+
2401                    "unit_aux1,  "+
2402                    "unit2.unit_acronym as unit_acr_aux1 "+
2403                    "from  "+
2404                    "ether.dcp_transformation, "+
2405                    "ether.dcp_parameter param0, "+
2406                    "ether.dcp_parameter param1,  "+
2407                    "ether.dcp_parameter param2,  "+
2408                    "ether.dcp_unit unit0,  "+
2409                    "ether.dcp_unit unit1, "+
2410                    "ether.dcp_parameter param3, "+
2411                    "ether.dcp_unit unit2,  "+
2412                    "ether.dcp_unit unit3 "+
2413                    "where  "+
2414                    "param0.par_id = dcp_transformation.par_orig "+
2415                    "and param3.par_id=dcp_transformation.par_final "+
2416                    "and param1.par_id=dcp_transformation.par_aux0 "+
2417                    "and unit0.unit_id=dcp_transformation.unit_orig "+
2418                    "and unit3.unit_id=dcp_transformation.unit_final "+
2419                    "and unit1.unit_id=dcp_transformation.unit_aux0 "+
2420                    "and unit2.unit_id=dcp_transformation.unit_aux1 "+
2421                    "and param2.par_id=dcp_transformation.par_aux1 "+
2422                    "and trf_id= "+trf_id,
2423                    columns);
2424            if( _list==null || _list.size()<1 ){
2425                    return "-1";
2426          }else{
2427                  for(int i=0;i<_list.size();i++)
2428                           list+=_list.get(i).toString()+"%";
2429            }
2430            return list;
2431    }
2432
2433String getCombin(String combin_id,send_request req){
2434        String list="";
2435
2436        String[] cols1={"trf_id"};
2437        ArrayList _list=req.get_list(
2438                "select trf_id from ether.dcp_transf_comb where id="+combin_id+" order by trf_order",
2439                cols1);
2440        if( _list==null || _list.size()<1 ){
2441                return "999";
2442        }else{
2443                for(int i=0;i<_list.size();i++)
2444                        list+=_list.get(i).toString()+"%";
2445        }
2446        return list;
2447}
2448
2449/******************************************************/
2450String convert(String date){
2451String[] ddt=(new stringSplit()).split(date,"-");
2452String[] dates=(new stringSplit()).split(ddt[0],"/");
2453String[] times=(new stringSplit()).split(ddt[1],":");
2454return dates[0]+dates[1]+dates[2]+times[0]+times[1]+times[2];
2455}
2456
2457
2458/*******************************************************/
2459
2460// Traitement des combinaisons de transformations unitaires
2461String treat_cbn(String cbn_id, String sel_tpl_id, int count, String origin_unit, String selected_unit, send_request req){
2462        String varX="", more_varid="", Xtransfo="", AUX0transfo="", AUX1transfo="";
2463        int num_aux0=999, num_aux1=999;
2464// Liste des transformations unitaires \340 appliquer
2465        String list=getCombin(cbn_id,req);
2466        System.err.println(" LIST CBN : "+list);
2467        String[] cblist=(new stringSplit()).split(list,"%");
2468        String mess="",result="";       
2469        int len=cblist.length;
2470        if( cblist[cblist.length-1].equals("") )len=len-1;
2471        mess="";
2472        for(int i=0;i<len;i++){
2473                String trf_id=cblist[i];
2474                boolean testUnit=false;
2475                if(i==cblist.length-1 )testUnit=true;
2476                //mess+="<br>trf_id="+cblist[i]+"->sel_tpl_id="+sel_tpl_id+"->count="+count+"->origin_unit="+origin_unit+"->selected_unit="+selected_unit+"->testUnit="+testUnit;
2477                       
2478                result=treat_trf(trf_id, sel_tpl_id, count, origin_unit, selected_unit, true, testUnit,req);
2479                //mess+="<br>";
2480                //mess+=result;
2481                String[] spl=(new stringSplit()).split(result,"%");
2482
2483                // Seule la variable origine de la 1ere transformation est retenue
2484                if(i==0 ) {
2485                        varX+=spl[0];
2486                       
2487                }
2488                // Ajout d'une commande de transformation en bout de ligne
2489               
2490                if( i>0 ){
2491                               
2492                        Xtransfo=Xtransfo.substring(0,Xtransfo.length()-2)+",";
2493                        //spl[1]=spl[1].substring(9);
2494                }
2495                Xtransfo+=spl[1];
2496                //mess+="@@"+spl[1];
2497                AUX0transfo=spl[2];
2498                AUX1transfo=spl[3];
2499                count=Integer.parseInt(spl[4]);
2500                more_varid+=spl[5];
2501        }
2502
2503       
2504        return varX+"%"+Xtransfo+"%"+AUX0transfo+"%"+AUX1transfo+"%"+count+"%"+more_varid;
2505
2506}
2507
2508
2509// Recherche des fichiers associ\351s au tuple tpl_id
2510String[] scanAssociates(String type, String tpl_id, String file, String rep_data,send_request req){
2511
2512        String[] retour=null;
2513        String sfile=new File(file).getName();
2514//
2515        String columns[]={"type", "command"};
2516        ArrayList _list=req.get_list(
2517                "select * from ether.dcp_associate "+
2518                "where type='"+type+"' and tpl_id="+tpl_id,
2519                columns);
2520        if( _list==null || _list.size()<1 ){
2521                return retour;
2522        }else{
2523                int nrow=_list.size()/columns.length;
2524                retour=new String[nrow];
2525                int k=0;
2526                for(int j=0;j<nrow;j++){
2527                        String stype=_list.get(k).toString();
2528                        String command=_list.get(k+1).toString();
2529                        String new_command=(new stringReplace(command,"%",sfile)).newstring;
2530                        new_command=(new stringReplace(new_command,"$","'")).newstring;
2531                        String cols[]={"eth_tar_file"};
2532                        String cols1[]={"eth_tar_file", "eth_parameter", "eth_subparameter", "src"};
2533                        ArrayList _list0=null;
2534                        if( type.equals("info" ) )
2535                                _list0=req.get_list(new_command,cols);
2536                        else
2537                                _list0=req.get_list(new_command,cols1);
2538                        if( _list0==null || _list0.size()<1 ){
2539                                retour=null;
2540                                return retour;
2541                        }else{
2542                                if( type.equals("info") )retour[j]=rep_data+_list0.get(0).toString();
2543                                else retour[j]=rep_data+_list0.get(0).toString()+"%"+_list0.get(1).toString()+"%"+_list0.get(2).toString()+"%"+_list0.get(3).toString();
2544
2545                        }
2546                        k+=columns.length;
2547                }
2548        }
2549        return retour;
2550}
2551
2552boolean isDef(String valeur) {
2553        if (valeur==null || valeur.equals("") || valeur.equals("null")) return false;
2554        else return true;
2555}
2556
2557int occurence(String string, String search){
2558        int z=0, zcount=0;
2559        while( true ){
2560                z=string.indexOf(search,z);
2561                if( z>=0 ){
2562                        zcount++;
2563                        z+=search.length();
2564                }else{
2565                        break;
2566                }
2567        }
2568        return zcount;
2569}
2570
2571
2572      String treat_trf(String trf_id, String sel_tpl_id, int count, String origin_unit,
2573                String selected_unit, boolean testUnit0, boolean testUnit1 ,send_request req){
2574                String more_varid="", Xtransfo="", AUX0transfo="", AUX1transfo="";
2575                int num_aux0=999, num_aux1=999;
2576                String list=getTransform(trf_id,req);
2577                String[] tlist=(new stringSplit()).split(list,"%"); //(0:par_id,1:par_acr,2:unit_id,3:unit_acr)
2578               
2579                String natx=getField(sel_tpl_id,"src_acronym",tlist[1],req);
2580               
2581                //return "tlist1="+tlist[1]+"--> natx="+natx;
2582               
2583//                String varX=",{variable:'"+tlist[1]+"', nature:'"+natx+
2584//                        "', subvariable:'.', unite:'"+tlist[3]+"'}";
2585String varX=tlist[1]+","+natx+",.,"+tlist[3];
2586
2587//              V\351rification de l'unit\351 de la variable origine : est-ce la m\352me que celle requise par la transformation
2588                 String before_trf="";
2589                 if( testUnit0 && !origin_unit.equals(tlist[3]) ){
2590                         String ids=get_conv("acr", origin_unit, tlist[3],req);
2591                         String cnv_id=(new stringSplit()).split(ids,"%")[0];
2592                         before_trf="conv"+cnv_id+",999,999#";
2593                 }
2594//              V\351rification de l'unit\351 de la variable finale / s\351lectionn\351e
2595                 String more_trf="";
2596                 if( testUnit1 && !selected_unit.equals(tlist[7]) ){
2597                         String ids=get_conv("acr", tlist[7], selected_unit,req);
2598                         String cnv_id=(new stringSplit()).split(ids,"%")[0];
2599                         more_trf="#conv"+cnv_id+",999,999";
2600                 }
2601
2602        // Il y a une variable auxiliaire (0)
2603                AUX0transfo="";
2604                if( tlist.length>3 && !tlist[8].equals("999") ){
2605                        String nat=getField(sel_tpl_id,"src_acronym",tlist[9],req);
2606                        String unit_id=getField(sel_tpl_id,"unit_id",tlist[9],req);
2607                        more_varid+="&"+tlist[9]+","+nat+","+".,"+tlist[11];
2608                        count++;
2609                        num_aux0=count;
2610                // Changement d'unit\351 pour la variable auxiliaire 0
2611                        if( !unit_id.equals("-1") && !unit_id.equals(tlist[10]) ){
2612                                String ids0=get_conv("id", unit_id, tlist[10],req);
2613                                String cnv_id0=(new stringSplit()).split(ids0,"%")[0];
2614                                if( !Xtransfo.equals("") )Xtransfo+=",";
2615                                AUX0transfo="conv"+cnv_id0+",999,999";
2616                        }else{
2617                                AUX0transfo="t999,999,999";
2618                        }
2619                }
2620        // Il y a une autre variable auxiliaire (1)
2621                AUX1transfo="";
2622                if( tlist.length>7 && !tlist[12].equals("999") ){
2623                        String nat=getField(sel_tpl_id,"src_acronym",tlist[13],req);
2624                        String unit_id=getField(sel_tpl_id,"unit_id",tlist[13],req);
2625                        more_varid+="&"+tlist[13]+","+nat+","+".,"+tlist[15];
2626
2627                        count++;
2628                        num_aux1=count;
2629                // Changement d'unit\351 pour la variable auxiliaire 1
2630                        if( !unit_id.equals("-1") && !unit_id.equals(tlist[14]) ){
2631                                String ids1=get_conv("id", unit_id, tlist[14],req);
2632                                String cnv_id1=(new stringSplit()).split(ids1,"%")[0];
2633
2634                                AUX1transfo="conv"+cnv_id1+",999,999";
2635                        }else{
2636                                AUX1transfo="t999,999,999";
2637                        }
2638                }
2639
2640                Xtransfo=before_trf+"t"+trf_id+","+num_aux0+","+num_aux1+more_trf;
2641//
2642                return varX+"%"+Xtransfo+"%"+AUX0transfo+"%"+AUX1transfo+"%"+count+"%"+more_varid;
2643        }
2644
2645String getField(String tpl_id, String field, String parameter,send_request req){
2646        String list="";
2647        String columns[]={field};
2648        ArrayList _list=req.get_list(
2649                "select "+field+" from ether.dcp_descripteur where (tpl_id="+tpl_id+
2650                " or tpl_id=(select tpl_id from ether.dcp_file_class where associate="+tpl_id+
2651                ")) and par_acronym='"+parameter+"'",columns);
2652        if( _list==null || _list.size()<1 ){
2653                //_list="select "+field+" from ether.dcp_descripteur where (tpl_id="+tpl_id;
2654                //_list+=" or tpl_id=(select tpl_id from ether.dcp_file_class where associate="+tpl_id;
2655                //_list+=")) and par_acronym='"+parameter+"'";
2656                return "-1";
2657        }else{
2658                list=_list.get(0).toString();
2659        }
2660        return list;
2661}
2662
2663
2664
2665
2666String get_conv(String type, String unit_orig, String unit_final,send_request req){
2667String cnv_id="", trf_id="";
2668        String unit_id_orig="", unit_id_final="";
2669        ArrayList _list;
2670        if( type.equals("acr") ){
2671                String columns[]={"unit_id"};
2672                _list=req.get_list(
2673                        "SELECT * FROM ether.dcp_unit where unit_acronym='"+unit_orig+"'",columns);
2674                if( _list==null || _list.size()!=1 ){
2675                        return "-1%-1";
2676                }
2677                unit_id_orig=_list.get(0).toString();
2678                _list=req.get_list(
2679                        "SELECT * FROM ether.dcp_unit where unit_acronym='"+unit_final+"'",columns);
2680                if( _list==null || _list.size()!=1 ){
2681                        return "-1%-1";
2682                }
2683                unit_id_final=_list.get(0).toString();
2684        }else if( type.equals("id") ){
2685                unit_id_orig=unit_orig;
2686                unit_id_final=unit_final;
2687        }
2688        String cols[]={"cnv_id", "trf_id"};
2689        _list=req.get_list(
2690                "SELECT * FROM ether.dcp_conversion where unit_orig="+unit_id_orig+
2691                " and unit_final="+unit_id_final,cols);
2692        if( _list==null || _list.size()!=cols.length ){
2693                return "-1%-1";
2694        }else{
2695                cnv_id=_list.get(0).toString();
2696                trf_id=_list.get(1).toString();
2697        }
2698        return cnv_id+"%"+trf_id;
2699}
2700
2701
2702/**********************************/
2703
2704String file_reader(String sel_tpl_id, send_request req) {
2705
2706String rd_function="";
2707String columns[]={"rd_function"};
2708
2709ArrayList _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);
2710if(_list==null || _list.size()<1 ) return "-1";
2711else rd_function=_list.get(0).toString();
2712
2713return rd_function;
2714}
2715%>
2716<form name="thisForm">
2717<table border="0" cellpadding="2" cellspacing="2" width="800">
2718<tr>
2719<td colspan=4>
2720<table>
2721<input type="hidden" name="exp_nrecouv" value="<%=exp_nrecouv%>">
2722<input type="hidden" name="class_data_set" value="<%=class_data_set%>">
2723<input type="hidden" name="class_component" value="<%=class_component%>">
2724<input type="hidden" name="class_axis" value="<%=class_axis%>">
2725<input type="hidden" name="class_location" value="<%=class_location%>">
2726<input type="hidden" name="class_location2" value="<%=class_location2%>">
2727<input type="hidden" name="class_vertical_scale" value="<%=class_vertical_scale%>">
2728<input type="hidden" name="class_ho" value="<%=class_ho%>">
2729<input type="hidden" name="class_time" value="<%=class_time%>">
2730<input type="hidden" name="dis_data_set" value="<%=dis_data_set%>">
2731<input type="hidden" name="dis_component" value="<%=dis_component%>">
2732<input type="hidden" name="dis_vertical_scale" value="<%=dis_vertical_scale%>">
2733<input type="hidden" name="dis_ho" value="<%=dis_ho%>">
2734<input type="hidden" name="dis_time" value="<%=dis_time%>">
2735<input type="hidden" name="map_information_level" value="<%=map_information_level%>">
2736<input type="hidden" name="map_filling" value="<%=map_filling%>">
2737<input type="hidden" name="map_axes_type" value="<%=map_axes_type%>">
2738<input type="hidden" name="grid_linestyle" value="<%=grid_linestyle%>">
2739<input type="hidden" name="latitude_posting" value="<%=latitude_posting%>">
2740<input type="hidden" name="longitude_posting" value="<%=longitude_posting%>">
2741<input type="hidden" name="colour_bar_nb_value" value="<%=colour_bar_nb_value%>">
2742<input type="hidden" name="colour_bar_grid" value="<%=colour_bar_grid%>">
2743<input type="hidden" name="modei" value="<%=modei%>">
2744<input type="hidden" name="pageMode" value="<%=pageMode%>">
2745<input type="hidden" name="chainePageMode" value="<%=chainePageMode%>">
2746<input type="hidden" name="contour_default_label_flag" value="<%=contour_default_label_flag%>">
2747<input type="hidden" name="idl_colour_table_id" value="<%=idl_colour_table_id%>">
2748<input type="hidden" name="cemail" value="<%=cemail%>">
2749<input type="hidden" name="download_auth" value="<%=download_auth%>">
2750<input type="hidden" name="email" value="<%=email%>">
2751<input type="hidden" name="login" value="<%=login%>">
2752<input type="hidden" name="passu" value="<%=passu%>">
2753<input type="hidden" name="name" value="<%=name%>">
2754<input type="hidden" name="first_name" value="<%=first_name%>">
2755<input type="hidden" name="onlydata" value="<%=onlydata%>">
2756<input type="hidden" name="continuer" value="<%=continuer%>">
2757<input type="hidden" name="id_session" value="<%=id_session%>">
2758<input type="hidden" name="contour_display_mode" value="<%=contour_display_mode%>">
2759<input type="hidden" name="contour_default_colour_flag" value="<%=contour_default_colour_flag%>">
2760<input type="hidden" name="contour_default_colour" value="<%=contour_default_colour%>">
2761<input type="hidden" name="contour_default_linestyle" value="<%=contour_default_linestyle%>">
2762<input type="hidden" name="contour_default_line_thickness" value="<%=contour_default_line_thickness%>">
2763<input type="hidden" name="lib_meta_type" value="<%=lib_meta_type%>">
2764<input type="hidden" name="lib_param" value="<%=lib_param%>">
2765<input type="hidden" name="form_par_ord" value="<%=form_par_ord%>">
2766<input type="hidden" name="lib_tpl_id" value="<%=lib_tpl_id%>">
2767<input type="hidden" name="meta_type" value="<%=meta_type%>">
2768<input type="hidden" name="flag_extrapolate_auth" value="<%=flag_extrapolate_auth%>">
2769<input type="hidden" name="uniqueid" value="<%=uniqueid%>">
2770<input type="hidden" name="mode" value="<%=mode%>">
2771<input type="hidden" name="lance" value="<%=lance%>">
2772<input type="hidden" name="exp_alt_min" value="<%=exp_alt_min%>">
2773<input type="hidden" name="exp_alt_max" value="<%=exp_alt_max%>">
2774<input type="hidden" name="ssel_tpl_name" value="<%=sel_tpl_name%>">
2775<input type="hidden" name="graph_sel" value="<%=graph_sel%>">
2776<input type="hidden" name="afficheTrace" value="">
2777<input type="hidden" name="interpolatormethod1d" value="<%=_1d_interpolator_method%>">
2778<input type="hidden" name="spacing1d" value="<%=_1d_spacing%>">
2779<input type="hidden" name="nmin1d" value="50">
2780<input type="hidden" name="nmax1d" value="500">
2781<input type="hidden" name="reg_grid_method" value="<%=reg_grid_method%>">
2782<input type="hidden" name="irreg_grid_method" value="<%=irreg_grid_method%>">
2783<input type="hidden" name="xspacing2d" value="<%=_2d_xspacing%>">
2784<input type="hidden" name="nxmin2d" value="50">
2785<input type="hidden" name="nxmax2d" value="500">
2786<input type="hidden" name="yspacing2d" value="<%=_2d_yspacing%>">
2787<input type="hidden" name="nymin2d" value="50">
2788<input type="hidden" name="nymax2d" value="500">
2789<input type="hidden" name="flag_validity_mask" value="1">
2790<input type="hidden" name="form_par_abs" value="<%=form_par_abs%>">
2791<input type="hidden" name="userLevels" value="<%=userLevels%>">
2792<input type="hidden" name="dot_plot_dot_style" value="<%=dot_plot_dot_style%>">
2793<input type="hidden" name="dot_plot_colour_flag" value="<%=dot_plot_colour_flag%>">
2794<input type="hidden" name="dot_plot_dotcolour" value="<%=dot_plot_dotcolour%>">
2795<input type="hidden" name="dot_plot_dotsize" value="<%=dot_plot_dotsize%>">
2796<input type="hidden" name="DSMinDate_file" value="<%=DSMinDate_file%>">
2797<input type="hidden" name="DSMaxDate_file" value="<%=DSMaxDate_file%>">
2798<input type="hidden" name="lonmin_file" value="<%=lonmin_file%>">
2799<input type="hidden" name="lonmax_file" value="<%=lonmax_file%>">
2800<input type="hidden" name="latmin_file" value="<%=latmin_file%>">
2801<input type="hidden" name="latmax_file" value="<%=latmax_file%>">
2802<input type="hidden" name="file_type_abs" value="<%=file_type_abs%>">
2803<input type="hidden" name="imSelected" value="<%=imSelected%>">
2804
2805</table>
2806</td>
2807</tr>
2808<tr>
2809<td>
2810<table border="0" cellpadding="2" cellspacing="2" width="800">
2811<tr><td class='titreN'><b>DATA SETTINGS</b></td></tr>
2812</table>
2813</td>
2814</tr>
2815<tr>
2816<td>
2817<table border="0" cellpadding="2" cellspacing="2" width="800">
2818<tr><td colspan=4 class='rubrique'><b>DATA SELECTION</b></td></tr>
2819<tr>
2820        <td class="ssrubrique" nowrap>Experiment</td>
2821        <td width="5%">&nbsp;</td>
2822        <td class="<%=class_data_set%>" colspan=2>Data set</td>
2823</tr>
2824<tr>
2825        <td valign=top nowrap>
2826        <select size=5 name="sel_tpl_name" onChange="initForm('2');document.thisForm.file_type_abs.value='';return blocForm();">
2827                <%=exp_options0%>
2828        </select>
2829        </td>
2830        <td width="10%">&nbsp;</td>
2831        <td valign="top" nowrap rowspan=2>
2832        <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%>>
2833                <%=exp_options%>
2834        </select>
2835        </td>
2836        <td width=100% valign=top>
2837        <table cellpadding="2" cellspacing="2">
2838                <tr>
2839                        <td align="right" class="<%=class_data_set%>">Mission</td>
2840                        <td class=inactif><b><%=lib_mission%></b></td>
2841                </tr>
2842                <tr>
2843                        <td align="right" class="<%=class_data_set%>">Version</td>
2844                        <td class=inactif><b><%=lib_version%></b></td>
2845                </tr>
2846                <tr>
2847                        <td align="right" class="<%=class_data_set%>">Level</td>
2848                        <td class=inactif><b><%=lib_level%></b></td>
2849                </tr>
2850                <tr>
2851                        <td align="right" class="<%=class_data_set%>">Sublevel</td>
2852                        <td class=inactif><b><%=lib_sublevel%></b></td>
2853                </tr>
2854                <tr>
2855                        <td align="right" class="<%=class_data_set%>">File format</td>
2856                        <td class=inactif><b><%=lib_fileformat%></b></td>
2857                </tr>
2858        </table>
2859        </td>
2860
2861</tr>
2862</table>
2863</td>
2864</tr>
2865
2866<tr>
2867<td>
2868<table border="0" cellpadding="2" cellspacing="2" width="800">
2869<tr><td colspan=4 class="<%=class_axis%>"><b>PARAMETERS</b></td></tr>
2870<tr>
2871        <td class="<%=class_component%>" colspan=2 nowrap>Component</td>
2872        <td width="10%">&nbsp;</td>
2873        <%
2874        if (!file_type_abs.equals("densite")) {%>
2875                <td class="<%=class_vertical_scale%>">Vertical scale</td>
2876        <%}
2877        else {%>
2878                <td class=normal><b>Density column data : no vertical scale to select</b></td>
2879        <%}%>
2880</tr>
2881<tr>
2882<td colspan=2 nowrap valign="top">
2883        <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();">
2884                <%=par_options_abs%>
2885        </select>
2886</td>
2887        <td>&nbsp;</td>
2888        <%if (!file_type_abs.equals("densite")) {%>
2889        <td width="100%">
2890        <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%>>
2891                <%=par_options_ord%>
2892        </select><br><span class="normal"><i>Data calculated come from ECMWF data or from a model</i></span>
2893        </td>
2894        <%}
2895        else {%>       
2896        <td width="100%">&nbsp;
2897        <input type=hidden value="<%=sel_par_ord%>" name="sel_par_ord">
2898        </td>
2899        <%}%>   
2900</tr>
2901<tr>
2902<%if (!file_type_abs.equals("densite")) {%>
2903        <td class="<%=class_component%>" nowrap>Units</td>
2904        <td class="<%=class_component%>" nowrap>Sub-parameter</td>
2905        <td>&nbsp;</td>
2906        <td class="<%=class_vertical_scale%>" valign="top" width="100%">Units</td>
2907<%} else {%>
2908        <td class="<%=class_component%>" nowrap>Units</td>
2909        <td class="<%=class_component%>" nowrap>Sub-parameter</td>
2910        <td>&nbsp;</td>
2911        <td width="100%">&nbsp;</td>
2912
2913<%}%>
2914</tr>
2915<tr>
2916        <td nowrap>
2917                <select <%=dis_component%> name="sel_unit_abs" onChange="updateLegend()">
2918                <%=unit_options_abs%>
2919                </select>
2920                <br><span class="normal"><i>The first unit in the list<br>corresponds to the file experiment unit</i></span>
2921        </td>
2922        <td nowrap valign="top"><select <%=dis_component%> name="sel_sspar_abs"><%=sspar_options%></select></td>
2923        <td>&nbsp;</td>
2924<%if (!file_type_abs.equals("densite")) {%>
2925        <td width="100%" valign="top">
2926        <select name="sel_unit_ord" <%=dis_vertical_scale%> onChange="document.thisForm.unit_observation_height.value=document.thisForm.sel_unit_ord.value;updateTitle();updateOverview();">
2927        <%=unit_options_ord%>
2928        </select>
2929        </td>
2930<%}else {%>
2931        <td width="100%">&nbsp;
2932        <input type=hidden name="sel_unit_ord" value="<%=sel_unit_ord%>"></td>
2933<%}%>
2934</tr>
2935
2936</table>
2937</td>
2938</tr>
2939
2940<tr>
2941<td>
2942<table border="0" cellpadding="2" cellspacing="2" width="800">
2943<tr>
2944        <%if (!file_type_abs.equals("densite")) {%>
2945        <td class="<%=class_location%>"><b>LOCATION AND TIME RANGE</b></td>
2946        <%} else {%>
2947        <td class="<%=class_location2%>"><b>LOCATION AND TIME RANGE</b></td>
2948        <%}%>
2949</tr>
2950
2951</table>
2952</td>
2953</tr>
2954<tr>
2955<td>
2956<table border="0" cellpadding="2" cellspacing="2" width="800">
2957<%if (!file_type_abs.equals("densite")) {%>
2958<tr>
2959        <td nowrap class="<%=class_ho%>" align="right" nowrap>Latitude</td>
2960        <td nowrap><input onChange=checkLatitude('<%=latmin_file%>','<%=latmax_file%>') type="text" name="latmin" size="10" value="<%=latmin%>" <%=dis_ho%>></td>
2961        <td class="normal" nowrap>to</td>
2962        <td nowrap><input onChange=checkLatitude('<%=latmin_file%>','<%=latmax_file%>') type="text" name="latmax" size="10" value="<%=latmax%>" <%=dis_ho%>>
2963
2964</td>
2965        <td class="normal" width="10%">&nbsp;</td>
2966        <td nowrap class="<%=class_ho%>">Date</td>
2967        <td nowrap><input type="text" disabled name="temp_mindate" size="25" value="<%=DSMinDate%>"><input type="hidden" name="mindate" size="25" value="<%=DSMinDate%>">
2968
2969</td>
2970        <td nowrap class="normal">to</td>
2971        <td width=100%><input type="text" disabled name="temp_maxdate" size="25" value="<%=DSMaxDate%>"><input type="hidden" name="maxdate" size="25" value="<%=DSMaxDate%>">
2972&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>
2973        <input type="hidden" value="" name="sel_date_time">     
2974</tr>
2975<tr>
2976        <td nowrap class="<%=class_ho%>" align="right">Longitude</td>
2977        <td><input onChange=checkLongitude('<%=lonmin_file%>','<%=lonmax_file%>') type="text" name="lonmin" size="10" value="<%=lonmin%>" <%=dis_ho%>></td>
2978        <td class="normal" class="normal">to</td>
2979        <td><input onChange=checkLongitude('<%=lonmin_file%>','<%=lonmax_file%>') type="text" name="lonmax" size="10" value="<%=lonmax%>" <%=dis_ho%>>
2980        </td>
2981        <td colspan=2>&nbsp;</td>
2982        <td class="normal" colspan=3 valign="top">
2983        <%if (DSMinDate!="" && DSMinDate!=null) {%>
2984<span class="normal">Files time range :&nbsp;[&nbsp;<%=DSMinDate_file%>&nbsp;-&nbsp;<%=DSMaxDate_file%>&nbsp;]<br>
2985<%if (!exp_nrecouv.equals("-1")) {%>
2986Period of no data overlapping : <%=exp_nrecouv%> days<%}
2987else {%>
2988Period of no data overlapping : None
2989<%}%>
2990</span>
2991<%}
2992else {%>
2993&nbsp;
2994<%}%>
2995</td>
2996
2997</tr>
2998<%}
2999else {%>
3000<tr>
3001        <td nowrap class="<%=class_time%>" align="right" nowrap>Latitude</td>
3002        <td nowrap><input onChange=checkLatitude('<%=latmin_file%>','<%=latmax_file%>') type="text" name="latmin" size="10" value="<%=latmin%>" <%=dis_time%>>
3003</td>
3004        <td class="normal" nowrap>to</td>
3005        <td nowrap><input onChange=checkLatitude('<%=latmin_file%>','<%=latmax_file%>') type="text" name="latmax" size="10" value="<%=latmax%>" <%=dis_time%>></td>
3006        <td class="normal" width="10%">&nbsp;</td>
3007<td nowrap class="<%=class_time%>">Date</td>
3008        <td colspan=3 width="100%">
3009        <input type="text" onChange="checkDate2('<%=DSMinDate_file%>','<%=DSMaxDate_file%>')" name="sel_date_time" size="12" value="<%=sel_date_time%>" <%=dis_time%>>
3010        <input type="hidden" name="mindate" size="25" value="<%=DSMinDate%>">
3011        <input type="hidden" name="maxdate" size="25" value="<%=DSMaxDate%>">
3012        <%if (DSMinDate!="" && DSMinDate!=null) {%>
3013&nbsp;<span class="normal">Range :&nbsp;[&nbsp;<%=DSMinDate_file.substring(0,10)%>&nbsp;-&nbsp;<%=DSMaxDate_file.substring(0,10)%>&nbsp;]</span>
3014<%}%>
3015
3016</td>
3017</tr>
3018<tr>
3019        <td nowrap class="<%=class_time%>" align="right">Longitude</td>
3020        <td><input onChange=checkLongitude('<%=lonmin_file%>','<%=lonmax_file%>') type="text" name="lonmin" size="10" value="<%=lonmin%>" <%=dis_time%>>
3021        <td class="normal">to</td>
3022        <td><input onChange=checkLongitude('<%=lonmin_file%>','<%=lonmax_file%>') type="text" name="lonmax" size="10" value="<%=lonmax%>" <%=dis_time%>>
3023        <td colspan=2>&nbsp;</td>
3024</tr>
3025
3026<%}%>
3027</table>
3028</td>
3029</tr>
3030<%if (!file_type_abs.equals("densite")) {%>
3031<tr>
3032<td>
3033<table border="0" cellpadding="2" cellspacing="2" width="800">
3034<tr><td class='<%=class_location%>'><b>HEIGHT OBSERVATION</b>&nbsp;<%=heightTexte%></td></tr>
3035</table>
3036</td>
3037</tr>
3038
3039<table border="0" cellpadding="2" cellspacing="2" width="800">
3040<tr>
3041        <td nowrap class="<%=class_ho%>">Value</td>
3042        <td nowrap><input type="text" name="observation_height" size="10" value="<%=observation_height%>" onChange="updateTitle();updateOverview();" <%=dis_ho%>></td>
3043        <td class="normal" width="10%">&nbsp;</td>
3044        <td nowrap class="<%=class_ho%>">Vertical scale selected</td>
3045        <td nowrap><input type="text" name="par_observation_height" value="<%=par_observation_height%>" size="45" disabled></td>
3046        <td class="normal" width="10%">&nbsp;</td>
3047        <td nowrap class="<%=class_ho%>">Units selected</td>
3048        <td nowrap><input type="text" name="unit_observation_height" value="<%=sel_unit_ord%>" size="10" disabled></td>
3049</tr>
3050</table>
3051<%}
3052else {%>
3053<input type="hidden" name="par_observation_height" value="">
3054<input type="hidden" name="observation_height" value="">
3055<input type="hidden" name="unit_observation_height" value="">
3056<%}%>
3057
3058<tr><td>&nbsp;</td></tr>
3059<tr>
3060<td>
3061<table border="0" cellpadding="2" cellspacing="2" width="800">
3062<tr><td class='titreN'><b>GRAPHIC SETTINGS</b></td></tr>
3063<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>
3064</tr>
3065</table>
3066</td>
3067</tr>
3068<tr>
3069<td>
3070<table border="0" cellpadding="2" cellspacing="2" width="800">
3071<tr><td class='rubrique'><b>GEOGRAPHIC PROJECTION</b></td></tr>
3072</table>
3073</td>
3074</tr>
3075<table border="0" cellpadding="2" cellspacing="2" width="800">
3076  <tr>
3077    <td nowrap><input type="radio" onClick="document.thisForm.hemisphere.disabled=true;" name="map_projection" value="0" <%if (map_projection.equals(
3078"0")) out.write("checked");%>></td>
3079        <td class="normal" nowrap>Standard (latitude/longitude grid)</td>
3080        <td width="40">&nbsp;</td>
3081    <td align="right"><input type="radio" onClick="document.thisForm.hemisphere.disabled=false;" name="map_projection" value="1" <%if (map_projection.equals
3082("1")) out.write("checked");%>></td>
3083        <td class="normal" nowrap align="left">Stereopolar (</td>
3084        <td nowrap>
3085        <select name="hemisphere" <%if (map_projection.equals("0")) {out.write("disabled");} else {out.write("");}%>>
3086        <option value="1" <%if (hemisphere.equals("1")) out.write("selected");%>>North</option>
3087        <option value="2" <%if (hemisphere.equals("2")) out.write("selected");%>>South</option>
3088        </select></td>
3089        <td class="normal" nowrap> Pole)</td>
3090        <td width="100%">&nbsp;</td>
3091        </tr>
3092        <%if ((!sel_tpl_name.equals("") && !sel_tpl_name.equals("null")) && (graph_sel.equals("") || graph_sel.equals("null"))) {%>
3093        <tr>
3094        <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>
3095
3096        </tr>
3097        <%}%>
3098</table>
3099</td>
3100</tr>
3101
3102
3103
3104<%if (graph_sel.equals("3")) {%>
3105<tr>
3106<td>
3107<table border="0" cellpadding="2" cellspacing="2" width="800">
3108<tr><td class='rubrique' colspan=3><b>DOT DISTRIBUTION PLOT SET-UP</b></td></tr>
3109<tr>
3110<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>
3111
3112
3113<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>
3114<td class="normal" align=right nowrap><img src="<%=imSelected%>" name="imSelected" width="40" height="40" border="1" align="absmiddle"></td>
3115
3116</tr>
3117</table>
3118</td>
3119</tr>
3120
3121<%}%>
3122
3123<%if (graph_sel.equals("13")) {%>
3124<tr>
3125<td>
3126<table border="0" cellpadding="2" cellspacing="2" width="800">
3127<tr><td colspan=10 class='rubrique'><b>CONTOUR PLOT SET-UP</b></td></tr>
3128<tr>
3129        <td nowrap align="right"><input type="radio" name="levels" value="0" <%if (levels.equals("0")) out.write("checked");%>></td>
3130        <td nowrap class="normal">Default levels</td>
3131        <td width="10%">&nbsp;</td>
3132        <td align="right" nowrap><input type="radio" name="levels" value="1" <%if (levels.equals("1")) out.write("checked");%>></td>
3133        <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>
3134        <td width="10%">&nbsp;</td>
3135        <td class="ssrubrique" nowrap height=5 align="right">Number of Default levels</td>
3136        <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>
3137        <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>
3138<td class="normal" align=right rowspan=2 nowrap><img src="<%=imSelected%>" name="imSelected" width="40" height="40" border="1" align="absmiddle"></td>
3139
3140</tr>
3141<tr>
3142    <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>
3143</tr>
3144</table>
3145</td>
3146</tr>
3147<%}%>
3148
3149<tr>
3150<td>
3151<table border="0" cellpadding="2" cellspacing="2" width="800">
3152<tr><td colspan=3 class='rubrique'><b>LEGENDS SET-UP</b></td></tr>
3153<tr>
3154        <td class="ssrubrique" nowrap align="right">Title</td>
3155        <td nowrap><input type="text" name="ftitle" size="80" maxsize="300" value="<%=ftitle%>" onChange="updateOverview();"></td>
3156        <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>
3157
3158</tr>
3159<tr>
3160        <td class="ssrubrique" nowrap align="left">Colour Bar Legend</td>
3161        <td colspan=2 width="100%"><input type="text" name="colour_bar_title" size="80" maxsize="150" value="<%=colour_bar_title%>"></td>
3162</tr>
3163</table>
3164</td>
3165</tr>
3166</table>
3167</form>
3168</body>
3169</html>
3170
Note: See TracBrowser for help on using the repository browser.