<%@ page import="fr.acri.norm.*" %> <%@ page import="java.io.*" %> <%@ page import="java.util.*" %> <%@ page import="java.lang.*" %> <% send_request req = new send_request(); /***************************DEFINITIONS************************************/ String graph_sel="", sel_tpl_name="", sel_exp_id="", sel_version="", sel_level="", sel_sublevel="", sel_format="", sel_tpl_id="", sel_tpl="", sql="", sql2=""; String file_par_abs="", file_unit_abs="", file_nature_abs="", file_type_abs="", sel_par_abs="", error_msg="", param0="", param="", varY=""; String selected="", svalue="", par_options_abs="", par_options_abs0="", exp_options="", par_options_ord="", unit_options_ord="", unit_options_abs=""; String sspar_options="", sel_par="", DSMinDate="", DSMaxDate="", lonmin="", lonmax="", latmin="", latmax="", sel_sspar_abs="", sel_unit_ord="", from=""; String file_par_ord="", file_sspar_ord="", file_unit_ord="", file_nature_ord="", sel_unit_abs="", display_type="", lang="en", sel_par_ord="", lance=""; String file_par_aux="", file_unit_aux="", file_nature_aux="", file_par_aux1="", file_unit_aux1="", file_nature_aux1="", file_trf_id="", file_par_orig=""; String file_unit_orig="", file_nature_orig="", DSMinDate_file="", DSMaxDate_file="", sel_sspar_ord="", ids="", trf_id="",cnv_id="", result=""; String TRANSFO="",AUX0transfo="",AUX1transfo="", more_varid="", ordonnee="", sspar_ordonnee="", auxiliary1="", auxiliary_nature1="", auxiliary_nature=""; String AUY0transfo="",AUY1transfo="",Xtransfo="",Ytransfo="", auxiliary="", origin="", origin_unit="",origin_nature="", nature_auxiliary="", nature_ord=""; String sel_mindate="",sel_maxdate="",sel_file="",files="",reader="",infofile="", tab_file_name="", nomfile="", nomvariable="",lib_param="",lib_tpl_id=""; String nomsubvariable="", src="", tab_paux="", varid="", auxstruct="", typeOrdonnee="",afficheTrace="",par_observation_height="", meta_type=""; String form_par_abs="",form_sspar_abs="",form_par_id="",userLevels="",levels="",form_legend="", form_par_ord="",lonmin_file="",lonmax_file="",latmin_file="",latmax_file="", colour_bar_title=""; String dot_plot_dot_style="0", dot_plot_colour_flag="1", dot_plot_dotcolour="0,0,0", dot_plot_dotsize="1", lib_meta_type="",email="", cemail="",modeTexte="",rightTexte=""; //parametres XML String id_session="",mode="", uniqueid="",private_data_flag="1", download_auth="0", flag_extrapolate_auth="1", densite="0", reader_param_varid=""; String _1d_interpolator_method="", _1d_spacing="",_1d_Nmax="",_1d_Nmin="",irreg_grid_method="",reg_grid_method="",_2d_xspacing="",_2d_yspacing=""; String _2d_NXmax="", _2d_NXmin="", _2d_NYmax="", _2d_NYmin="", flag_validity_mask="", observation_height="", map_projection="", hemisphere="", ftitle=""; String contour_display_mode="", contour_default_colour_flag="", contour_default_colour="", contour_default_linestyle="", contour_default_line_thickness=""; String sel_exp_public="", is_batch="0", is_private="0", login="",passu="",modei="none", droit="0",userid="",group="", continuer="0",onlydata="0"; String exp_alt_min="", exp_alt_max="", heightTexte="", pageMode="", chainePageMode="", name="", first_name="", contour_default_label_flag="0"; String val_min_bd="", val_max_bd="", unite_bd="", imported_colour_table="", idl_colour_table_id=""; String map_information_level="", map_filling="" ,map_axes_type="", grid_linestyle="", latitude_posting="", longitude_posting="", colour_bar_grid=""; String colour_bar_nb_value=""; String[] par_columns={"par_name", "unit_acronym", "par_acronym", "src_acronym", "dcp_id", "par_en_name", "dcp_type"}, nassoc=null, filename=null; String[] 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"}; String[] batch_columns={"is_batch"}; String[] 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"}; String[] color_columns={"par_name", "tc_id_idl", "tc_fichier_couleur", "pc_val_mini", "pc_val_max", "pc_unite"}, mode_columns={"is_batch"}; String[] sspar_columns1={"set_first_date", "set_last_date","set_lon_min", "set_lon_max", "set_lat_min", "set_lat_max"}, auxfile=null, assoc=null; String[] unit_columns={"unit_acronym"}, spl=null, cols={"mindate", "maxdate", "lonmin", "lonmax", "latmin", "latmax" }, tt=null, filname=null, reponse=null; String[] priv_columns={"id"}, group_columns={"eri_group_id"}, user_columns={"id","email","name","first_name"}; int nreq=0, k=0, i=0, nunit_ord=-1, nunit_abs=-1, count=0, numY_aux0=0, numY_aux1=0, nfile=0, nXnature=0, nXtransfo=0, len=0; long mindate_ms=0, maxdate_ms=0,nb_visu_session=1; boolean isParAbs=true, isSspar=true, isFile=true, isParOrd=true, isUnitOrd=true, isUnitAbs=true, issel=false, isTransform=false,isParamaux=true; ArrayList 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,batch_list=null, user_list=null,priv_list=null,group_list=null; Transform TRF=null; /****************************************************************/ /***************************AFFECTATIONS*************************************/ //parametres XML uniqueid=request.getParameter("uniqueid"); if (uniqueid==null || uniqueid.equals("") || uniqueid.equals("null")) { nb_visu_session=0; } else nb_visu_session=Long.parseLong(uniqueid)+1; meta_type=request.getParameter("meta_type"); if (meta_type==null || meta_type.equals("") || meta_type.equals("null")) { meta_type=""; } else { sql="SELECT mt_id "; sql+="FROM sil_type_trace WHERE tt_id="+graph_sel; file_list=null; file_list=req.get_list(sql,metat_columns); if (file_list==null || file_list.size()==0) { }else{ nfile=file_list.size()/metat_columns.length; if (nfile>0) { k=0; lib_meta_type=file_list.get(k).toString(); } } } //out.write(String.valueOf(nb_visu_session).toString()); id_session=request.getParameter("id_session"); if (id_session=="" || id_session==null || id_session.equals("") || id_session.equals("null")) { //id_session=""+Math.abs((new Random()).nextInt()); //id_session=session_temp.toString(); HttpSession session_temp = request.getSession(); id_session=(new stringSplit()).split(session_temp.toString(),"@")[1]; } //else nb_visu_session=nb_visu_session+1; uniqueid=String.valueOf(nb_visu_session).toString(); /*pageMode=request.getParameter("pageMode"); if (pageMode==null || pageMode.equals("") || pageMode.equals("null")) { pageMode=""; }*/ email=request.getParameter("email"); if (email==null || email.equals("") || email.equals("null")) { email=""; } cemail=request.getParameter("cemail"); if (cemail==null || cemail.equals("") || cemail.equals("null")) { cemail=""; } login=request.getParameter("login"); if (login==null || login.equals("") || login.equals("null")) { login=""; } name=request.getParameter("name"); if (name==null || name.equals("") || name.equals("null")) { name=""; } first_name=request.getParameter("first_name"); if (first_name==null || first_name.equals("") || first_name.equals("null")) { first_name=""; } passu=request.getParameter("passu"); if (passu==null || passu.equals("") || passu.equals("null")) { passu=""; } lance=request.getParameter("lance"); if (lance==null || lance.equals("") || lance.equals("null")) { lance=""; } continuer=request.getParameter("continuer"); if (continuer==null || continuer.equals("") || continuer.equals("null")) { continuer="0"; } onlydata=request.getParameter("onlydata"); if (onlydata==null || onlydata.equals("") || onlydata.equals("null")) { onlydata="0"; } colour_bar_title=request.getParameter("colour_bar_title"); if (colour_bar_title==null || colour_bar_title.equals("") || colour_bar_title.equals("null")) { colour_bar_title=""; } contour_display_mode=request.getParameter("contour_display_mode"); if (contour_display_mode==null || contour_display_mode.equals("") || contour_display_mode.equals("null")) { contour_display_mode="1"; } contour_default_label_flag=request.getParameter("contour_default_label_flag"); if (contour_default_label_flag==null || contour_default_label_flag.equals("") || contour_default_label_flag.equals("null")) { contour_default_label_flag="0"; } contour_default_colour_flag=request.getParameter("contour_default_colour_flag"); if (contour_default_colour_flag==null || contour_default_colour_flag.equals("") || contour_default_colour_flag.equals("null")) { contour_default_colour_flag="1"; } contour_default_colour=request.getParameter("contour_default_colour"); if (contour_default_colour==null || contour_default_colour.equals("") || contour_default_colour.equals("null")) { contour_default_colour="0,0,0"; } contour_default_linestyle=request.getParameter("contour_default_linestyle"); if (contour_default_linestyle==null || contour_default_linestyle.equals("") || contour_default_linestyle.equals("null")) { contour_default_linestyle="0"; } contour_default_line_thickness=request.getParameter("contour_default_line_thickness"); if (contour_default_line_thickness==null || contour_default_line_thickness.equals("") || contour_default_line_thickness.equals("null")) { contour_default_line_thickness="1"; } dot_plot_dot_style=request.getParameter("dot_plot_dot_style"); if (dot_plot_dot_style==null || dot_plot_dot_style.equals("") || dot_plot_dot_style.equals("null")) { dot_plot_dot_style="0"; } dot_plot_colour_flag=request.getParameter("dot_plot_colour_flag"); if (dot_plot_colour_flag==null || dot_plot_colour_flag.equals("") || dot_plot_colour_flag.equals("null")) { dot_plot_colour_flag="1"; } dot_plot_dotcolour=request.getParameter("dot_plot_dotcolour"); if (dot_plot_dotcolour==null || dot_plot_dotcolour.equals("") || dot_plot_dotcolour.equals("null")) { dot_plot_dotcolour="0,0,0"; } dot_plot_dotsize=request.getParameter("dot_plot_dotsize"); if (dot_plot_dotsize==null || dot_plot_dotsize.equals("") || dot_plot_dotsize.equals("null")) { dot_plot_dotsize="1"; } /*private_data_flag=request.getParameter("private_data_flag"); if (private_data_flag==null || private_data_flag.equals("") || private_data_flag.equals("null")) { private_data_flag="0"; }*/ download_auth=request.getParameter("download_auth"); if (download_auth==null || download_auth.equals("") || download_auth.equals("null")) { download_auth="1"; } flag_extrapolate_auth=request.getParameter("flag_extrapolate_auth"); if (flag_extrapolate_auth==null || flag_extrapolate_auth.equals("") || flag_extrapolate_auth.equals("null")) { flag_extrapolate_auth="1"; } userLevels=request.getParameter("userLevels"); if (userLevels==null || userLevels.equals("") || userLevels.equals("null")) { userLevels=""; } levels=request.getParameter("levels"); if (levels=="" || levels==null || levels.equals("") || levels.equals("null") || levels.equals("0")) { userLevels=""; levels="0"; } map_information_level=request.getParameter("map_information_level"); if (map_information_level=="" || map_information_level==null || map_information_level.equals("") || map_information_level.equals("null")) { map_information_level="0"; } map_filling=request.getParameter("map_filling"); if (map_filling=="" || map_filling==null || map_filling.equals("") || map_filling.equals("null")) { map_filling="0"; } map_axes_type=request.getParameter("map_axes_type"); if (map_axes_type=="" || map_axes_type==null || map_axes_type.equals("") || map_axes_type.equals("null")) { map_axes_type="2"; } grid_linestyle=request.getParameter("grid_linestyle"); if (grid_linestyle=="" || grid_linestyle==null || grid_linestyle.equals("") || grid_linestyle.equals("null")) { grid_linestyle="0"; } longitude_posting=request.getParameter("longitude_posting"); if (longitude_posting=="" || longitude_posting==null || longitude_posting.equals("") || longitude_posting.equals("null")) { longitude_posting="30"; } latitude_posting=request.getParameter("latitude_posting"); if (latitude_posting=="" || latitude_posting==null || latitude_posting.equals("") || latitude_posting.equals("null")) { latitude_posting="30"; } colour_bar_nb_value=request.getParameter("colour_bar_nb_value"); if (colour_bar_nb_value=="" || colour_bar_nb_value==null || colour_bar_nb_value.equals("") || colour_bar_nb_value.equals("null")) { colour_bar_nb_value="2"; } colour_bar_grid=request.getParameter("colour_bar_grid"); if (colour_bar_grid=="" || colour_bar_grid==null || colour_bar_grid.equals("") || colour_bar_grid.equals("null")) { colour_bar_grid="1"; } //advances setting _1d_interpolator_method=request.getParameter("interpolatormethod1d"); _1d_spacing=request.getParameter("spacing1d"); _1d_Nmax=request.getParameter("nmax1d"); _1d_Nmin=request.getParameter("nmin1d"); irreg_grid_method=request.getParameter("irreg_grid_method"); reg_grid_method=request.getParameter("reg_grid_method"); _2d_xspacing=request.getParameter("xspacing2d"); _2d_yspacing=request.getParameter("yspacing2d"); _2d_NXmax=request.getParameter("nxmax2d"); _2d_NXmin=request.getParameter("nxmin2d"); _2d_NYmax=request.getParameter("nymax2d"); _2d_NYmin=request.getParameter("nymin2d"); flag_validity_mask=request.getParameter("flag_validity_mask"); graph_sel=request.getParameter("graph_sel"); if (graph_sel=="" || graph_sel==null || graph_sel.equals("") || graph_sel.equals("null")) graph_sel=""; map_projection=request.getParameter("map_projection"); if (map_projection=="" || map_projection==null || map_projection.equals("") || map_projection.equals("null")) map_projection="0"; hemisphere=request.getParameter("hemisphere"); if (hemisphere=="" || hemisphere==null || hemisphere.equals("") || hemisphere.equals("null")) hemisphere="1"; sel_tpl_name=request.getParameter("sel_tpl_name"); if (sel_tpl_name=="" || sel_tpl_name==null || sel_tpl_name.equals("") || sel_tpl_name.equals("null")) sel_tpl_name=""; sel_par_abs=request.getParameter("sel_par_abs"); afficheTrace=request.getParameter("afficheTrace"); if (afficheTrace==null || afficheTrace.equals("") || afficheTrace.equals("null")) afficheTrace="0"; observation_height=request.getParameter("observation_height"); if (observation_height==null || observation_height.equals("") || observation_height.equals("null")) observation_height=""; DSMinDate_file=request.getParameter("DSMinDate_file"); DSMaxDate_file=request.getParameter("DSMaxDate_file"); sel_mindate=request.getParameter("mindate"); sel_maxdate=request.getParameter("maxdate"); sel_unit_ord=request.getParameter("sel_unit_ord"); if (sel_unit_ord==null || sel_unit_ord.equals("") || sel_unit_ord.equals("null")) sel_unit_ord=""; ftitle=request.getParameter("ftitle"); sel_exp_id=request.getParameter("sel_exp_id"); sel_version=request.getParameter("sel_version"); sel_level=request.getParameter("sel_level"); sel_sublevel=request.getParameter("sel_sublevel"); sel_format=request.getParameter("sel_format"); sel_tpl_id=request.getParameter("sel_tpl_id"); if (sel_tpl_id==null || sel_tpl_id.equals("") || sel_tpl_id.equals("null")) sel_tpl_id=""; lonmin_file=request.getParameter("lonmin_file"); lonmax_file=request.getParameter("lonmax_file"); latmin_file=request.getParameter("latmin_file"); latmax_file=request.getParameter("latmax_file"); file_type_abs=request.getParameter("file_type_abs"); sel_par_abs=request.getParameter("sel_par_abs"); if (sel_par_abs==null || sel_par_abs.equals("") || sel_par_abs.equals("null")) sel_par_abs=""; sel_sspar_abs=request.getParameter("sel_sspar_abs"); sel_unit_abs=request.getParameter("sel_unit_abs"); sel_par_ord=request.getParameter("sel_par_ord"); if (sel_par_ord==null || sel_par_ord.equals("") || sel_par_ord.equals("null")) sel_par_ord=""; sel_sspar_ord=request.getParameter("sel_sspar_ord"); file_unit_ord=request.getParameter("file_unit_ord"); file_sspar_ord=request.getParameter("file_sspar_ord"); file_par_ord=request.getParameter("file_par_ord"); file_nature_ord=request.getParameter("file_nature_ord"); display_type=request.getParameter("display_type"); file_par_aux=request.getParameter("file_par_aux"); file_unit_aux=request.getParameter("file_unit_aux"); file_nature_aux=request.getParameter("file_nature_aux"); file_par_aux1=request.getParameter("file_par_aux1"); file_unit_aux1=request.getParameter("file_unit_aux1"); file_nature_aux1=request.getParameter("file_nature_aux1"); file_trf_id=request.getParameter("file_trf_id"); file_par_orig=request.getParameter("file_par_orig"); file_unit_orig=request.getParameter("file_unit_orig"); file_nature_orig=request.getParameter("file_nature_orig"); lonmin=request.getParameter("lonmin"); lonmax=request.getParameter("lonmax"); latmin=request.getParameter("latmin"); latmax=request.getParameter("latmax"); if (lonmin==null) lonmin=""; if (lonmax==null) lonmax=""; if (latmin==null) latmin=""; if (latmax==null) latmax=""; if( sel_par_abs==null || sel_par_abs.equals("") || sel_par_abs.equals("-1")) isParAbs=false; if( sel_sspar_abs==null || sel_sspar_abs.equals("") ) isSspar=false; /*******************************************************************************************/ /*******************************REQUETES FORMULAIRE*******************************************/ //liste des differentes version et niveaux de l'experience choisie sql="SELECT distinct ether_experiment.exp_id,exp_name,exp_mission,set_dataset_version,set_ceos_level,set_ceos_sublevel,set_format"; sql+=",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 "; sql+="WHERE ether_experiment.exp_id=dcp_file_class.exp_id and dcp_descripteur.tpl_id=dcp_file_class.tpl_id "; sql+="and dcp_parameter.par_acronym = ether.dcp_descripteur.par_acronym and (isord=0 or isord=2) and associate=-1 "; sql+="and dcp_file_class.tpl_id NOT IN (1332,1333,1331) "; sql+="and dcp_file_class.tpl_id in (select dcp_file_class.tpl_id from ether.ether_experiment, ether.dcp_file_class "; sql+="where ether_experiment.exp_id=dcp_file_class.exp_id and exp_name='"+sel_tpl_name+"') "; sql+="ORDER BY exp_name, set_dataset_version"; nreq=-1; exp_list=req.get_list(sql,exp_columns); if (exp_list==null || exp_list.size()==0) { error_msg="No file class found in the database"; } else{ nreq=exp_list.size()/exp_columns.length; exp_options=""; if (nreq>0) { k=0; sel_tpl=""; for (i=0 ; i < nreq ; i++) { if ((selected.equals("") || selected.equals("null")) && (sel_tpl_id.equals("") || sel_tpl_id.equals("null"))) { sel_tpl_id=exp_list.get(k+7).toString(); } if(exp_list.get(k+7).toString().equals(sel_tpl_id) ){ selected="selected"; sel_tpl=exp_list.get(k+7).toString(); sel_exp_id=exp_list.get(k).toString(); sel_version=exp_list.get(k+3).toString(); sel_level=exp_list.get(k+4).toString(); sel_sublevel=exp_list.get(k+5).toString(); sel_format=exp_list.get(k+6).toString(); sel_exp_public=exp_list.get(k+8).toString(); exp_alt_min=exp_list.get(k+9).toString(); exp_alt_max=exp_list.get(k+10).toString(); heightTexte="(Between "+exp_alt_min+" km and "+exp_alt_max+" km)"; lib_tpl_id=exp_list.get(k+2).toString()+" - "+exp_list.get(k+3).toString()+" - "+exp_list.get(k+4).toString()+" - "+exp_list.get(k+5).toString()+" - "+exp_list.get(k+6).toString(); } else selected=""; exp_options+=""; k+=exp_columns.length; } } } //requete de recuperation des especes mesurees sql="SELECT distinct par_name, unit_acronym, param.par_acronym, src_acronym, dcp_id, subvariable, par_en_name, dcp_type "; sql+="FROM ether.dcp_descripteur, ether.dcp_parameter param, ether.dcp_unit unit, ether.ether_dataset ds "; sql+="WHERE param.par_acronym=dcp_descripteur.par_acronym and unit.unit_id=dcp_descripteur.unit_id "; sql+="and ds.set_parameter=dcp_descripteur.par_acronym"; sql+=" and (ds.set_id_experiment="+sel_exp_id+" or ds.set_id_experiment= (select exp_id from ether.dcp_file_class where associate="; sql+=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 "; sql+="WHERE associate= "+sel_tpl_id+")) "; selected=""; par_list=req.get_list(sql,par_columns); nreq=-1; if( par_list==null || par_list.size()==0 ){ isParAbs=false; error_msg="No parameter found in the database for the selected file class"; } else { isParAbs=true; nreq=par_list.size()/par_columns.length; par_options_abs=""; if( nreq>0 ){ k=0; param0=""+par_list.get(2)+par_list.get(1)+par_list.get(3)+par_list.get(6); param=""; for(i=0;i"+par_list.get(k+5)+" ("; par_options_abs+=par_list.get(k+1)+") - "+par_list.get(k+3)+""; } param=""+par_list.get(k+2)+par_list.get(k+1)+par_list.get(k+3)+par_list.get(k+6); k+=par_columns.length; if( k0 ){ k=0; idl_colour_table_id=file_list.get(k+1).toString(); if (!file_list.get(k+2).toString().equals("") && !file_list.get(k+2).toString().equals("null")) { imported_colour_table=file_list.get(k+1).toString(); } val_min_bd=file_list.get(k+3).toString(); val_max_bd=file_list.get(k+4).toString(); unite_bd=file_list.get(k+5).toString(); } } } } /* LISTE DES SOUS-PARAMETRES ABSCISSE */ if(isParAbs) { nreq=-1; sel_par=""; if (sel_par_abs!=null) sel_par=(new stringSplit()).split(sel_par_abs,"%")[0]; // BORNES DE DATES sql="SELECT DISTINCT set_first_date,set_last_date,set_lon_min,set_lon_max,set_lat_min,set_lat_max "; sql+="FROM ether.ether_dataset,ether.dcp_file_class,set_parameter=par_acronym and set_id_experiment=exp_id and "; 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='"; sql+=sel_par+"' and ether_dataset.set_dataset_version='"+sel_version+"' "+ " and ether_dataset.set_ceos_level='"+sel_level+"' "; sql+=" and ether_dataset.set_ceos_sublevel='"+sel_sublevel+"' "+" and ether_dataset.set_format='"+sel_format+"' "; sspar_list=req.get_list(sql,sspar_columns1); if (sspar_list!=null && sspar_list.size()>0) { mindate_ms=Long.parseLong(sspar_list.get(0).toString()); maxdate_ms=Long.parseLong(sspar_list.get(1).toString()); DSMinDate=(new calDate(mindate_ms)).date_cal; DSMaxDate=(new calDate(maxdate_ms)).date_cal; lonmin=sspar_list.get(2).toString(); lonmax=sspar_list.get(3).toString(); latmin=sspar_list.get(4).toString(); latmax=sspar_list.get(5).toString(); } // LISTE DES SOUS-PARAMETRES PROPREMENT DIT sql="select distinct subvariable from ether.dcp_descripteur, ether.dcp_file_class where par_acronym='"+sel_par+"'"; 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; sql+=" or exp_id=( select exp_id from ether.dcp_file_class where associate= "+sel_tpl_id+"))"; sspar_list=req.get_list(sql,sspar_columns); if (sspar_list==null || sspar_list.size()==0) isSspar=false; else { isSspar=true; nreq=sspar_list.size()/sspar_columns.length; sspar_options=""; if (nreq>0) { k=0; 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(); for (i=0;i"; if (sspar_list.get(k).toString().equals(".")) sspar_options+="None"; else sspar_options+=sspar_list.get(k); sspar_options+=""; form_sspar_abs=sspar_list.get(k).toString(); k+=sspar_columns.length; } } } } /*LISTE DES PARAMETRES EN ORDONNEES*/ if( isFile && isParAbs && sel_par_abs!=null && !sel_par_abs.equals("null") && !sel_par_abs.equals("")){ from=" from "; TRF=new Transform(sel_tpl_id, sel_exp_id,lang, file_type_abs); isParOrd=TRF.isPar; par_options_ord=""; if( !isParOrd ) error_msg=""; else{ _parameters=new ArrayList(); for(i=0;i"+TRF.parameter[i]+" - "+TRF.nature[i]; par_options_ord+=" - "+TRF.ssparameter[i]+""; if (selected.equals("selected")) par_observation_height=TRF.parameter[i]+" - "+TRF.nature[i]+" - "+TRF.ssparameter[i]; _parameters.add(TRF.par_acr[i]); } // PARAMETRES OBTENUS PAR TRANSFORMATIONS SIMPLES if( file_type_abs.equals("profil") && TRF.cal_parameter!=null ) { for(i=0;i"; par_options_ord+=TRF.cal_parameter[i]+from+TRF.cal_parameter_orig[i]+" - Cal"; if (selected.equals("selected")) par_observation_height=TRF.cal_parameter[i]+from+TRF.cal_parameter_orig[i]+" - Cal"; } _parameters.add(TRF.cal_par_acr[i]); } } // PARAMETRES OBTENUS PAR TRANSFORMATIONS COMBINEES if( file_type_abs.equals("profil") && TRF.cbn_parameter!=null ){ for(i=0;i"; par_options_ord+=TRF.cbn_parameter[i][TRF.cbn_parameter[i].length-1]+from; par_options_ord+=TRF.cbn_parameter_orig[i][0]; par_options_ord+=" - Cal"; if (selected.equals("selected")) par_observation_height=TRF.cbn_parameter[i][TRF.cbn_parameter[i].length-1]+from+TRF.cbn_parameter_orig[i][0]+" - Cal"; _parameters.add(TRF.cbn_par_acr[i][TRF.cbn_parameter[i].length-1]); } } } } } //UNITES nunit_abs=-1; nunit_ord=-1; if (isFile) { sql="select unit2.unit_acronym from ether.dcp_unit,ether.dcp_parameter,ether.dcp_unit unit2,ether.dcp_conversion "; sql+="where par_acronym = '"+file_par_abs+"' and dcp_unit.unit_acronym = '"+file_unit_abs+"'"; sql+="and dcp_parameter.cls_acronym = dcp_unit.cls_acronym "; sql+="and dcp_unit.unit_id = dcp_conversion.unit_orig and dcp_conversion.unit_final = unit2.unit_id"; unit_list_abs=req.get_list(sql,unit_columns); isUnitAbs=true; Object obs1=new Object(); obs1=file_unit_abs; unit_list_abs.add(0,obs1); nunit_abs=unit_list_abs.size()/unit_columns.length; unit_options_abs=""; if( nunit_abs>0 ){ k=0; if (!(sel_unit_abs!=null && !sel_unit_abs.equals("")) && sel_par_abs!=null && !sel_par_abs.equals("")) sel_unit_abs=unit_list_abs.get(0).toString(); for(i=0;i"+unit_list_abs.get(k)+""; k+=unit_columns.length; } } if( isParOrd && file_par_ord!=null && !file_par_ord.equals("null") && file_unit_ord!=null && !file_unit_ord.equals("null") && !file_unit_ord.equals("") ) { sql="select unit2.unit_acronym from ether.dcp_unit, ether.dcp_parameter, ether.dcp_unit unit2,"; sql+="ether.dcp_conversion where par_acronym = '"+file_par_ord+"' and dcp_unit.unit_acronym = '"+file_unit_ord+"' "; sql+="and dcp_parameter.cls_acronym = dcp_unit.cls_acronym and dcp_unit.unit_id = dcp_conversion.unit_orig "; sql+="and dcp_conversion.unit_final = unit2.unit_id"; unit_list_ord=req.get_list(sql,unit_columns); // RAJOUT DE L'UNITE DU FICHIER Object obs=new Object(); obs=file_unit_ord; unit_list_ord.add(0,obs); isUnitOrd=true; nunit_ord=unit_list_ord.size()/unit_columns.length; unit_options_ord=""; if( nunit_ord>0 ){ k=0; // ON FORCE LA SELECTION DE L'UNITE EN ORDONNEE A CELLE DU FICHIER PAR DEFAUT issel=false; for(i=0;i"; unit_options_ord+=unit_list_ord.get(k)+""; k+=unit_columns.length; } } } } if (!afficheTrace.equals("null") && afficheTrace.equals("1")) { count=1; //UNITE DIFFERENTE //POUR L'ABSCISSE if( sel_unit_abs!=null && !sel_unit_abs.equals("") && !file_unit_abs.equals(sel_unit_abs) ){ ids=get_conv("acr", file_unit_abs, sel_unit_abs,req); cnv_id=(new stringSplit()).split(ids,"%")[0]; trf_id=(new stringSplit()).split(ids,"%")[1]; // EST-CE UNE CONVERSION OU/ET UNE TRANSFORMATION (EN ABSCISSE SEULE UNE TRANFO NON COMBINEE PEUT AVOIR LIEU if( !trf_id.equals("999") ){ // LA CONVERSION POINTE VERS UNE TRANSFORMATION: ATTENTION DANS CE CAS LA VARIABLE N'EST PAS TRANSFORMEE // CELA RESTE UN CHANGEMENT D'UNITE // DONC LA VARIABLE A LIRE RESTE LA MEME (CONTRAIREMENT A L'ORDONNEE OU CELLE A LIRE EST // LA VARIABLE ORIGINE DE LA TRANSFORMATION ET NON PAS LA VARIABLE CHOISIE PAR L'UTILISATEUR // QUI N'EXISTE PAS DANS LE FICHIER DE MESURE PUISQUE CALCULEE) result=treat_trf(trf_id, sel_tpl_id, count,"",sel_unit_abs,false,true,req); spl=(new stringSplit()).split(result,"%"); Xtransfo=spl[1]; AUX0transfo=spl[2]; AUX1transfo=spl[3]; count=Integer.parseInt(spl[4]); more_varid+=spl[5]; } else if( !cnv_id.equals("-1") ){ // C'EST UNE CONVERSION SIMPLE Xtransfo="conv"+cnv_id+",999,999"; } else{ sel_unit_abs=file_unit_abs; Xtransfo="t999,999,999"; } } else{ Xtransfo="t999,999,999"; } //POUR ORDONNEE if(sel_unit_ord!=null && !sel_unit_ord.equals("") && !file_unit_ord.equals(sel_unit_abs) ){ ordonnee=file_par_ord; sspar_ordonnee=file_sspar_ord; numY_aux0=999; numY_aux1=999; isTransform=false; // LA VARIABLE DEMANDEE EN ORDONNEE N'EST PAS DISPONIBLE DANS LE FICHIER // ON CREE DE LA DONNEE VIA UNE TRANSFORMATION DE VARIABLE if( !display_type.equals("available") ){ isTransform=true; auxiliary=file_par_aux; auxiliary_nature=file_nature_aux; auxiliary1=file_par_aux1; auxiliary_nature1="file_nature_aux1"; origin="file_par_orig"; origin_unit=file_unit_orig; origin_nature=file_nature_orig; // 2 POSSIBILITES : // 1/ ON TRANSFORME LA VARIABLE INITIALE PAR UNE TRANSFORMATION SIMPLE if( display_type.equals("transformed") ){ if( !file_trf_id.equals("999") ){ //LA CONVERSION POINTE VERS UNE TRANSFORMATION result=treat_trf(file_trf_id, sel_tpl_id, count,origin_unit,sel_unit_ord,true,true,req); spl=(new stringSplit()).split(result,"%"); varY=spl[0]; Ytransfo=spl[1]; AUY0transfo=spl[2]; //AUY0transfo=spl[2]; AUY1transfo=spl[3]; count=Integer.parseInt(spl[4]); more_varid+=spl[5]; }else{ sel_unit_ord=file_unit_ord; Ytransfo="t999,999,999"; } // 2/ ON TRANSFORME LA VARIABLE INITIALE PAR UNE TRANSFORMATION COMBINEE } else if( display_type.equals("combined") ){ if( !file_trf_id.equals("999") ){ //La conversion pointe vers une transformation result=treat_cbn(file_trf_id, sel_tpl_id, count,origin_unit,sel_unit_ord,req); spl=(new stringSplit()).split(result,"%"); varY=spl[0]; Ytransfo=spl[1]; AUY0transfo=spl[2]; AUY1transfo=spl[3]; count=Integer.parseInt(spl[4]); more_varid+=spl[5]; }else { sel_unit_ord=file_unit_ord; Ytransfo="t999,999,999"; } } }else{ // PAS DE TRANSFORMATION MAIS PEUT-ETRE UNE CONVERSION nature_ord=file_nature_ord; //varY=",{variable:'"+ordonnee+"', nature:'"+nature_ord+"', subvariable:'"+sspar_ordonnee+"', unite:'"+sel_unit_ord+"'}"; varY=ordonnee+","+nature_ord+","+sspar_ordonnee+","+sel_unit_ord; if( !file_unit_ord.equals(sel_unit_ord) ){ ids=get_conv("acr", file_unit_ord, sel_unit_ord,req); cnv_id=(new stringSplit()).split(ids,"%")[0]; trf_id=(new stringSplit()).split(ids,"%")[1]; //EST-CE UNE CONVERSION OU/ET UNE TRANSFORMATION (EN ORDONNEE TRANFO OU COMBINEE PEUVENT //AVOIR LIEU if( !trf_id.equals("999") ){ //LA CONVERSION POINTE VERS UNE TRANSFORMATION result=treat_trf(trf_id, sel_tpl_id, count, "", sel_unit_ord,false,true,req); spl=(new stringSplit()).split(result,"%"); varY=spl[0]; Ytransfo=spl[1]; AUY0transfo=spl[2]; AUY1transfo=spl[3]; count=Integer.parseInt(spl[4]); more_varid+=spl[5]; } else if( !cnv_id.equals("-1") ){ //C'EST UNE CONVERSION SIMPLE Ytransfo="conv"+cnv_id+",999,999"; }else{ sel_unit_ord=file_unit_ord; Ytransfo="t999,999,999"; } }else{ Ytransfo="t999,999,999"; } } } TRANSFO=""; TRANSFO+=Xtransfo+"&"+Ytransfo; if( !AUX0transfo.equals("") )TRANSFO+="&"+AUX0transfo; if( !AUX1transfo.equals("") )TRANSFO+="&"+AUX1transfo; if( !AUY0transfo.equals("") )TRANSFO+="&"+AUY0transfo; if( !AUY1transfo.equals("") )TRANSFO+="&"+AUY1transfo; } //if (!afficheTrace.equals("null") && afficheTrace.equals("1")) { nfile=-1; if (isParAbs && sel_par_abs!=null) { sel_par=""; if (sel_par_abs!=null) sel_par=(new stringSplit()).split(sel_par_abs,"%")[0]; //DETERMINATION DES BORNES SPATIO-TEMPROELLES if ((sel_mindate==null || sel_mindate.equals("") || sel_mindate.equals("null") || sel_maxdate==null || sel_maxdate.equals("") || sel_maxdate.equals("null") || lonmin==null || lonmin.equals("") || lonmin.equals("null") || lonmax==null || lonmax.equals("") || lonmax.equals("null") || latmin==null || latmin.equals("") || latmin.equals("null") || latmax==null || latmax.equals("") || latmax.equals("null")) && sel_exp_id!=null && sel_sspar_abs!=null) { sql="SELECT min(eth_first_date) as mindate, max(eth_last_date) as maxdate,min(eth_lon_min) as lonmin"; sql+=",max(eth_lon_max) as lonmax,min(eth_lat_min) as latmin, max(eth_lat_max) as latmax "; sql+="FROM ether.ether_file where (eth_id_experiment="+sel_exp_id; sql+=" or eth_id_experiment=(select exp_id from ether.dcp_file_class where associate="+sel_tpl_id+")) "; sql+=" and (eth_subparameter='"+sel_sspar_abs+"' or eth_subparameter='.') and eth_parameter='"+sel_par+"'"; al1=req.get_list(sql,cols); if(al1!=null && al1.size()>0) { if (sel_mindate==null || sel_mindate.equals("") || sel_mindate.equals("null")) { mindate_ms=Long.parseLong(al1.get(0).toString()); DSMinDate=(new calDate(mindate_ms)).date_cal; } else { DSMinDate=sel_mindate; mindate_ms=(new calDate()).invers(sel_mindate); } if (sel_maxdate==null || sel_maxdate.equals("") || sel_maxdate.equals("null")) { maxdate_ms=Long.parseLong(al1.get(1).toString()); DSMaxDate=(new calDate(maxdate_ms)).date_cal; } else { DSMaxDate=sel_maxdate; maxdate_ms=(new calDate()).invers(sel_maxdate); } if (lonmin==null || lonmin.equals("") || lonmin.equals("null")) lonmin=al1.get(2).toString(); if (lonmax==null || lonmax.equals("") || lonmax.equals("null")) lonmax=al1.get(3).toString(); if (latmin==null || latmin.equals("") || latmin.equals("null")) latmin=al1.get(4).toString(); if (latmax==null || latmax.equals("") || latmax.equals("null")) latmax=al1.get(5).toString(); DSMinDate_file=DSMinDate; DSMaxDate_file=DSMaxDate; lonmin_file=lonmin; lonmax_file=lonmax; latmin_file=latmin; latmax_file=latmax; } } else if (sel_mindate!=null && sel_maxdate!=null) { DSMinDate=sel_mindate; DSMaxDate=sel_maxdate; mindate_ms=(new calDate()).invers(sel_mindate); maxdate_ms=(new calDate()).invers(sel_maxdate); } } sel_file=""; // LISTE DES FICHIERS disponibles file_list=null; nfile=0; sql="select is_batch from sil_experiment_attribut where exp_id='"+sel_exp_id+"'"; batch_list=req.get_list(sql,batch_columns); //mode batch if (batch_list==null || batch_list.size()==0) is_batch="0"; else { nreq=batch_list.size()/batch_columns.length; if( nreq>0 ){ k=0; is_batch=batch_list.get(k).toString(); } } if (sel_exp_public.equals("1")) { is_private="1"; private_data_flag="1"; } else { is_private="0"; private_data_flag="0"; } if (is_private.equals("1")) { if (is_batch.equals("0")) { droit="1"; modei="none"; } else { modei="email"; if (cemail.equals("") || cemail.equals("null")) droit="0"; else droit="1"; } download_auth="0"; } if (is_private.equals("0")) { modei="loginu"; if (onlydata.equals("1")) { //out.write("onlydata
"); download_auth="1"; droit="1"; rightTexte="Only data"; } else { if (is_batch.equals("1")) { //out.write("mode _batch
"); if (!cemail.equals("") && !cemail.equals("null")) { download_auth="1"; email=cemail; droit="1"; continuer="0"; //out.write("email seul
"); } else continuer="1"; } else continuer="1"; if (continuer.equals("1")) { //out.write("continuer
"); if (!login.equals("") && !passu.equals("")) { //out.write("auth
"); //recherche donnees utilisateur sql="select id,email,name,first_name from ether_user where login='"+login+"' and password='"+passu+"'"; user_list=req.get_list(sql,user_columns); if (user_list==null || user_list.size()==0) { droit="0"; //out.write("personne dans la base
"); login=""; passu=""; lance="0"; name="Login non-existent in Ether base"; modei="err"; //email=""; //first_name=""; } else{ //out.write("ok1
"); nreq=user_list.size()/user_columns.length; if( nreq>0 ){ k=0; //out.write("ok2
"); userid=user_list.get(k).toString(); email=user_list.get(k+1).toString(); name=user_list.get(k+2).toString(); first_name=user_list.get(k+3).toString(); //if (email.equals("") || email.equals("null")) email=group_list.get(k+1).toString(); //out.write("email base= "+email+"
"); } } //recherche group_id de l'experience sql="select eri_group_id from ether_experiment_right where eri_experiment_id='"+sel_exp_id+"'"; group_list=req.get_list(sql,group_columns); if (group_list==null || group_list.size()==0) { //out.write("impossible recup group
"); } else{ nreq=group_list.size()/group_columns.length; if( nreq>0 ){ k=0; group=group_list.get(k).toString(); //out.write("group exp="+group+"
"); } } //recherche droit utilisateur sql="select id from ether_group_user where user_id='"+userid+"' and group_id='"+group+"'"; priv_list=req.get_list(sql,priv_columns); if (priv_list==null || priv_list.size()==0) { download_auth="1"; //out.write("pas droit pour l'utilis. sur ce groupe"); login=""; passu=""; //name=""; //first_name=""; } else{ nreq=priv_list.size()/priv_columns.length; if( nreq>0 ){ droit="1"; download_auth="0"; //out.write("droit OK pour l'utilis. sur ce groupe"); } else { download_auth="1"; // out.write("no download"); } } } droit="1"; } if (download_auth.equals("0")) rightTexte="Data and download"; else rightTexte="Only data"; } } if (download_auth.equals("0")) rightTexte="Data and download"; else rightTexte="Only data"; if (is_batch.equals("1")) modeTexte="BATCH"; else modeTexte="DIRECT"; if (ftitle==null || ftitle.equals("") || ftitle.equals("null")) { ftitle=sel_tpl_name; if (!observation_height.equals("")) ftitle+=" - "+observation_height+" "+sel_unit_ord+" ("+par_observation_height+")"; } if (colour_bar_title==null || colour_bar_title.equals("") || colour_bar_title.equals("null")) { colour_bar_title=form_legend; } if (droit.equals("1") && !afficheTrace.equals("null") && afficheTrace.equals("1")) { //out.write("droit="+droit); // if (is_batch.equals("1")) mode="BATCH"; // else mode="DIRECT"; sql="select * from ether.ether_file,ether.dcp_file_class file_class "; sql+="where eth_id_experiment=exp_id "; sql+="and eth_dataset_version=set_dataset_version "; sql+="and eth_ceos_level=set_ceos_level "; sql+="and eth_ceos_sublevel=set_ceos_sublevel "; sql+="and eth_format=set_format and "; sql+="eth_id_experiment=exp_id and eth_id_experiment="+sel_exp_id; sql+=" and (eth_subparameter='"+sel_sspar_abs+"' "; sql+=" or eth_subparameter='.') "; sql+=" and eth_parameter='"+file_par_abs+"' and associate=-1 "; sql+=" and eth_dataset_version='"+sel_version+"' "; sql+=" and eth_ceos_level='"+sel_level+"' "; sql+=" and eth_ceos_sublevel='"+sel_sublevel+"' "; sql+=" and eth_format='"+sel_format+"' and "; sql+=" (eth_last_date>="+mindate_ms+" and eth_first_date<="+maxdate_ms+") "; sql+="and (eth_lon_max>="+lonmin+" and eth_lon_min<="+lonmax+") and (eth_lat_max>="+latmin+" and eth_lat_min<="+latmax+") "; file_list=req.get_list(sql,file_columns2); if (file_list==null || file_list.size()==0) { out.write(""); isFile=false; }else{ isFile=true; nfile=file_list.size()/file_columns2.length; if( nfile>0 ){ if (is_batch.equals("1")) mode="BATCH"; else mode="DIRECT"; k=0; for(i=0;i0 ){ infofile+=assoc[0]; }else{ infofile+="none"; } if (i0 ){ //out.write("load"); for(int p=0;p0) tab_paux+=",nominfo:'"+nassoc[0]+"'"; tab_paux+="}"; auxstruct+=tab_paux; if( p0) tab_paux+=","+nassoc[0]; else tab_paux+=",."; auxstruct+=tab_paux; if( pdefinition couleur"); docXML.idl_colour_table_id=idl_colour_table_id; if (!imported_colour_table.equals("") && !imported_colour_table.equals("null") && imported_colour_table!="" && imported_colour_table!=null) { docXML.imported_colour_table=imported_colour_table; } docXML.val_min_bd=val_min_bd; docXML.val_max_bd=val_max_bd; docXML.unite_bd=unite_bd; } sql="SELECT mt_id "; sql+="FROM sil_type_trace WHERE tt_id="+graph_sel; file_list=null; file_list=req.get_list(sql,metat_columns); if (file_list==null || file_list.size()==0) { }else{ nfile=file_list.size()/metat_columns.length; if (nfile>0) { k=0; docXML.meta_type=file_list.get(k).toString(); } } docXML.transfo=TRANSFO; docXML.dot_plot_dot_style=dot_plot_dot_style; if (dot_plot_colour_flag.equals("0")) docXML.dot_plot_colour_flag="1"; else docXML.dot_plot_colour_flag=dot_plot_colour_flag; docXML.dot_plot_dotcolour=dot_plot_dotcolour; docXML.dot_plot_dotsize=dot_plot_dotsize; if (levels.equals("1") && !userLevels.equals("") && !userLevels.equals("null")) { docXML.userLevels=userLevels; docXML.contour_level_setting_mode=levels; } else { docXML.userLevels=""; docXML.contour_level_setting_mode="0"; } String ret=docXML.generate(); if (mode.equals("BATCH")) { pageMode="lanceEnTacheDeFond.jsp"; if (!login.equals("") && !passu.equals("")) { chainePageMode="?id="+id_session+"&uniqueid="+uniqueid+"&mode="+mode+"&email="+email; } else { chainePageMode="?id="+id_session+"&uniqueid="+uniqueid+"&mode="+mode+"&email="+cemail; } } else { pageMode="lanceAppletEtherVisu.html"; chainePageMode="?id="+id_session+"&uniqueid="+uniqueid+"&mode="+mode+"&email="; } } } par_options_abs=""+par_options_abs; par_options_abs0+=""; par_options_ord=""+par_options_ord; unit_options_abs=""+unit_options_abs; //if (sspar_options.equals("") || sspar_options.equals("null") || sspar_options=="" || sspar_options==null) sspar_options=""; sspar_options+=""; unit_options_ord+=""; req.close_connection(); %> Visualisation V3 <%! boolean isUnitIdentique(String param1, String param2, String isord,send_request req) { String list=""; String[] cols1={"cls_acronym"}; ArrayList _list1=req.get_list("select cls_acronym from ether.dcp_parameter where par_acronym='"+param1+"' and (isord=2 or isord=1)",cols1); if( _list1==null || _list1.size()<1 ) return false; else { String[] cols2={"cls_acronym"}; ArrayList _list2=req.get_list("select cls_acronym from ether.dcp_parameter where par_acronym='"+param2+"' and (isord=2 or isord=1)",cols2); if( _list2==null || _list2.size()<1 ) return false; else { if (_list1.get(0).equals(_list2.get(0))) return true; else return false; } } } String getTransform(String trf_id,send_request req){ String list=""; 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"}; ArrayList _list=req.get_list( "select "+ "par_orig, "+ "param0.par_acronym as par_acr_orig, "+ "unit_orig, "+ "unit0.unit_acronym as unit_acr_orig, "+ "par_final, "+ "param3.par_acronym as par_acr_final, "+ "unit_final, "+ "unit3.unit_acronym as unit_acr_final, "+ "par_aux0, "+ "param1.par_acronym as par_acr_aux0, "+ "unit_aux0, "+ "unit1.unit_acronym as unit_acr_aux0, "+ "par_aux1, "+ "param2.par_acronym as par_acr_aux1, "+ "unit_aux1, "+ "unit2.unit_acronym as unit_acr_aux1 "+ "from "+ "ether.dcp_transformation, "+ "ether.dcp_parameter param0, "+ "ether.dcp_parameter param1, "+ "ether.dcp_parameter param2, "+ "ether.dcp_unit unit0, "+ "ether.dcp_unit unit1, "+ "ether.dcp_parameter param3, "+ "ether.dcp_unit unit2, "+ "ether.dcp_unit unit3 "+ "where "+ "param0.par_id = dcp_transformation.par_orig "+ "and param3.par_id=dcp_transformation.par_final "+ "and param1.par_id=dcp_transformation.par_aux0 "+ "and unit0.unit_id=dcp_transformation.unit_orig "+ "and unit3.unit_id=dcp_transformation.unit_final "+ "and unit1.unit_id=dcp_transformation.unit_aux0 "+ "and unit2.unit_id=dcp_transformation.unit_aux1 "+ "and param2.par_id=dcp_transformation.par_aux1 "+ "and trf_id= "+trf_id, columns); if( _list==null || _list.size()<1 ){ return "-1"; }else{ for(int i=0;i<_list.size();i++) list+=_list.get(i).toString()+"%"; } return list; } String getCombin(String combin_id,send_request req){ String list=""; String[] cols1={"trf_id"}; ArrayList _list=req.get_list( "select trf_id from ether.dcp_transf_comb where id="+combin_id+" order by trf_order", cols1); if( _list==null || _list.size()<1 ){ return "999"; }else{ for(int i=0;i<_list.size();i++) list+=_list.get(i).toString()+"%"; } return list; } /******************************************************/ String convert(String date){ String[] ddt=(new stringSplit()).split(date,"-"); String[] dates=(new stringSplit()).split(ddt[0],"/"); String[] times=(new stringSplit()).split(ddt[1],":"); return dates[0]+dates[1]+dates[2]+times[0]+times[1]+times[2]; } /*******************************************************/ // Traitement des combinaisons de transformations unitaires String treat_cbn(String cbn_id, String sel_tpl_id, int count, String origin_unit, String selected_unit,send_request req){ String varX="", more_varid="", Xtransfo="", AUX0transfo="", AUX1transfo=""; int num_aux0=999, num_aux1=999; // Liste des transformations unitaires \340 appliquer String list=getCombin(cbn_id,req); System.err.println(" LIST CBN : "+list); String[] cblist=(new stringSplit()).split(list,"%"); int len=cblist.length; if( cblist[cblist.length-1].equals("") )len=len-1; for(int i=0;i0 ){ Xtransfo=Xtransfo.substring(0,Xtransfo.length()-2)+","; spl[1]=spl[1].substring(9); } Xtransfo+=spl[1]; AUX0transfo=spl[2]; AUX1transfo=spl[3]; count=Integer.parseInt(spl[4]); more_varid+=spl[5]; } return varX+"%"+Xtransfo+"%"+AUX0transfo+"%"+AUX1transfo+"%"+count+"%"+more_varid; } // Recherche des fichiers associ\351s au tuple tpl_id String[] scanAssociates(String type, String tpl_id, String file,send_request req){ String[] retour=null; String sfile=new File(file).getName(); // String columns[]={"type", "command"}; ArrayList _list=req.get_list( "select * from ether.dcp_associate "+ "where type='"+type+"' and tpl_id="+tpl_id, columns); if( _list==null || _list.size()<1 ){ return retour; }else{ int nrow=_list.size()/columns.length; retour=new String[nrow]; int k=0; for(int j=0;j=0 ){ zcount++; z+=search.length(); }else{ break; } } return zcount; } String treat_trf(String trf_id, String sel_tpl_id, int count, String origin_unit, String selected_unit, boolean testUnit0, boolean testUnit1 ,send_request req){ String more_varid="", Xtransfo="", AUX0transfo="", AUX1transfo=""; int num_aux0=999, num_aux1=999; String list=getTransform(trf_id,req); String[] tlist=(new stringSplit()).split(list,"%"); //(0:par_id,1:par_acr,2:unit_id,3:unit_acr) String natx=getField(sel_tpl_id,"src_acronym",tlist[1],req); // String varX=",{variable:'"+tlist[1]+"', nature:'"+natx+ // "', subvariable:'.', unite:'"+tlist[3]+"'}"; String varX=tlist[1]+","+natx+",.,"+tlist[3]; // V\351rification de l'unit\351 de la variable origine : est-ce la m\352me que celle requise par la transformation String before_trf=""; if( testUnit0 && !origin_unit.equals(tlist[3]) ){ String ids=get_conv("acr", origin_unit, tlist[3],req); String cnv_id=(new stringSplit()).split(ids,"%")[0]; before_trf="conv"+cnv_id+",999,999#"; } // V\351rification de l'unit\351 de la variable finale / s\351lectionn\351e String more_trf=""; if( testUnit1 && !selected_unit.equals(tlist[7]) ){ String ids=get_conv("acr", tlist[7], selected_unit,req); String cnv_id=(new stringSplit()).split(ids,"%")[0]; more_trf="#conv"+cnv_id+",999,999"; } // Il y a une variable auxiliaire (0) AUX0transfo=""; if( tlist.length>3 && !tlist[8].equals("999") ){ String nat=getField(sel_tpl_id,"src_acronym",tlist[9],req); String unit_id=getField(sel_tpl_id,"unit_id",tlist[9],req); more_varid+="&"+tlist[9]+","+nat+","+".,"+tlist[11]; count++; num_aux0=count; // Changement d'unit\351 pour la variable auxiliaire 0 if( !unit_id.equals("-1") && !unit_id.equals(tlist[10]) ){ String ids0=get_conv("id", unit_id, tlist[10],req); String cnv_id0=(new stringSplit()).split(ids0,"%")[0]; if( !Xtransfo.equals("") )Xtransfo+=","; AUX0transfo="conv"+cnv_id0+",999,999"; }else{ AUX0transfo="t999,999,999"; } } // Il y a une autre variable auxiliaire (1) AUX1transfo=""; if( tlist.length>7 && !tlist[12].equals("999") ){ String nat=getField(sel_tpl_id,"src_acronym",tlist[13],req); String unit_id=getField(sel_tpl_id,"unit_id",tlist[13],req); more_varid+="&"+tlist[13]+","+nat+","+".,"+tlist[15]; count++; num_aux1=count; // Changement d'unit\351 pour la variable auxiliaire 1 if( !unit_id.equals("-1") && !unit_id.equals(tlist[14]) ){ String ids1=get_conv("id", unit_id, tlist[14],req); String cnv_id1=(new stringSplit()).split(ids1,"%")[0]; AUX1transfo="conv"+cnv_id1+",999,999"; }else{ AUX1transfo="t999,999,999"; } } Xtransfo=before_trf+"t"+trf_id+","+num_aux0+","+num_aux1+more_trf; // return varX+"%"+Xtransfo+"%"+AUX0transfo+"%"+AUX1transfo+"%"+count+"%"+more_varid; } String getField(String tpl_id, String field, String parameter,send_request req){ String list=""; String columns[]={field}; ArrayList _list=req.get_list( "select "+field+" from ether.dcp_descripteur where (tpl_id="+tpl_id+ " or tpl_id=(select tpl_id from ether.dcp_file_class where associate="+tpl_id+ ")) and par_acronym='"+parameter+"'",columns); if( _list==null || _list.size()<1 ){ //_list="select "+field+" from ether.dcp_descripteur where (tpl_id="+tpl_id; //_list+=" or tpl_id=(select tpl_id from ether.dcp_file_class where associate="+tpl_id; //_list+=")) and par_acronym='"+parameter+"'"; return "-1"; }else{ list=_list.get(0).toString(); } return list; } String get_conv(String type, String unit_orig, String unit_final,send_request req){ String cnv_id="", trf_id=""; String unit_id_orig="", unit_id_final=""; ArrayList _list; if( type.equals("acr") ){ String columns[]={"unit_id"}; _list=req.get_list( "SELECT * FROM ether.dcp_unit where unit_acronym='"+unit_orig+"'",columns); if( _list==null || _list.size()!=1 ){ return "-1%-1"; } unit_id_orig=_list.get(0).toString(); _list=req.get_list( "SELECT * FROM ether.dcp_unit where unit_acronym='"+unit_final+"'",columns); if( _list==null || _list.size()!=1 ){ return "-1%-1"; } unit_id_final=_list.get(0).toString(); }else if( type.equals("id") ){ unit_id_orig=unit_orig; unit_id_final=unit_final; } String cols[]={"cnv_id", "trf_id"}; _list=req.get_list( "SELECT * FROM ether.dcp_conversion where unit_orig="+unit_id_orig+ " and unit_final="+unit_id_final,cols); if( _list==null || _list.size()!=cols.length ){ return "-1%-1"; }else{ cnv_id=_list.get(0).toString(); trf_id=_list.get(1).toString(); } return cnv_id+"%"+trf_id; } /**********************************/ String file_reader(String sel_tpl_id, send_request req) { String rd_function=""; String columns[]={"rd_function"}; ArrayList _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); if(_list==null || _list.size()<1 ) return "-1"; else rd_function=_list.get(0).toString(); return rd_function; } %>

 DATA SET SELECTION

Mission-Version-Level-Sublevel-File format Vizualisation mode : <%=modeTexte%>
<%if (!lance.equals("")) { %> <%if (rightTexte.equals("")) {//if ((email.equals("") && cemail.equals("")) || !(!rightTexte.equals(""))) %> <%} else {%> <% if (!name.equals("")) { %> <% } %> <% if (is_batch.equals("1")) { if (!email.equals("")) { %> <% } else if (!cemail.equals("")) { %> <% } else { %> <% } } %> <%}%>
 
Login <%=name%> <%=first_name%>
Email <%=email%>
Email <%=cemail%>
Email No email !
Rights <%=rightTexte%>
<% } else if (is_private.equals("1")){ %>
Rights : Data and download
<%}%>
 

 PARAMETERS SELECTION

 ATMOSPHERIC PARAMETER SELECTION

Available Parameters Data calculated come from ECMWF data or from a model
Mes = measured data
Cal = calculated data
Errtot_mes = Total measured error
Units
Sub-parameter
<%if (!file_type_abs.equals("densite")) {%>

 VERTICAL SCALE DEFINITION

Available parameters Units <%}else {%>

 NO VERTICAL SCALE DEFINITION (DENSITY DATA)

name="sel_par_ord"> name="sel_unit_ord"> <%}%> <% if (graph_sel.equals("13")) {%>

 CONTOUR PLOT SET-UP

> Use Default levels Number of Default levels
> Use User Defined levels    
    Advanced settings    
<%}%> <% if (graph_sel.equals("3")) {%>

DOT DISTRIBUTION PLOT SET-UP

Advanced Settings  

<%}%>

 GRAPHIC SET-UP

 GEOGRAPHIC PROJECTION

> Standard (latitude/longitude grid)   > Stereopolar ( Pole)

LOCALIZATION RANGE

Minimum Latitude ','<%=latmax_file%>') type="text" name="latmin" size="10" value="<%=latmin%>"> Maximum Latitude ','<%=latmax_file%>') type="text" name="latmax" size="10" value="<%=latmax%>">
Minimum Longitude ','<%=lonmax_file%>') type="text" name="lonmin" size="10" value="<%=lonmin%>"> Maximum Longitude ','<%=lonmax_file%>') type="text" name="lonmax" size="10" value="<%=lonmax%>">

TIME RANGE

Start Date ','<%=DSMaxDate_file%>') type="text" name="mindate" size="25" value="<%=DSMinDate%>"> End Date ','<%=DSMaxDate_file%>') type="text" name="maxdate" size="25" value="<%=DSMaxDate%>">
<%if (file_type_abs.equals("profil")) {%>

HEIGHT OBSERVATION <%=heightTexte%>

Select Vertical Scale Units Value
Fine Range Settings  
<%}%>

 LEGENDS SET-UP

 Title
 Colour Bar Legend
 Advanced Settings