source: ether_visual/trunk/save_form/formulaire2306.jsp @ 678

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

ajout V3

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