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

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

ajout V3

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