Subversion Repositories eFlore/Applications.cel

Rev

Rev 989 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.client.modeles.dao;

import org.tela_botanica.client.modeles.objets.Configuration;
import org.tela_botanica.client.observation.ObservationModele;

import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.Window;

public class ExportObservationsDAO {

        ObservationModele om = null ;
        
        public ExportObservationsDAO(ObservationModele observationModele) {
                om = observationModele ;
        }

        public void exporterObservations(String identifiant, String[][] criteres) {
                
                String requete = "" ;
                
                if(criteres != null)
                {
                        // on construit les paramètres du get avec les critères (&critere1=valeur1&critere2=valeur2 etc...)
                        for (int i = 0; i < criteres.length; i++) {
                                
                                if(criteres[i] != null && criteres[i][1] != null && !criteres[i][1].equals(""))
                                {
                                        if(i!= 0)
                                        {
                                                requete += "&";
                                        }
                                        
                                        requete += criteres[i][0]+"="+URL.encodeComponent(criteres[i][1]) ;
                                }
                        }
                }
                
                Window.open(Configuration.getServiceBaseUrl()+"/InventoryExport/"+identifiant+"/?"+requete,"Export",null) ;
                
        }
        
        

}