Subversion Repositories eFlore/Applications.cel

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
101 jpm 1
package org.tela_botanica.client.modeles;
2
 
3
import org.tela_botanica.client.observation.ObservationModele;
204 david 4
 
5
import com.google.gwt.http.client.URL;
101 jpm 6
import com.google.gwt.user.client.Window;
7
 
8
public class ExportObservationsDAO {
9
 
10
	ObservationModele om = null ;
11
 
12
	public ExportObservationsDAO(ObservationModele observationModele) {
13
		om = observationModele ;
14
	}
15
 
16
	public void exporterObservations(String identifiant, String[][] criteres) {
17
 
18
		String requete = "" ;
19
 
20
		if(criteres != null)
21
		{
22
			// on construit les paramètres du get avec les critères (&critere1=valeur1&critere2=valeur2 etc...)
23
			for (int i = 0; i < criteres.length; i++) {
24
 
25
				if(!criteres[i][1].equals(""))
26
				{
27
					if(i!= 0)
28
					{
29
						requete += "&";
30
					}
104 jpm 31
 
204 david 32
					requete += criteres[i][0]+"="+URL.encodeComponent(criteres[i][1]) ;
101 jpm 33
				}
34
			}
35
		}
36
 
103 jpm 37
		Window.open(Configuration.getServiceBaseUrl()+"/InventoryExport/"+identifiant+"/"+requete,"Export",null) ;
101 jpm 38
 
39
	}
40
 
41
 
42
 
43
}