Subversion Repositories eFlore/Applications.cel

Rev

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

Rev Author Line No. Line
989 aurelien 1
package org.tela_botanica.client.modeles.dao;
140 aurelien 2
 
989 aurelien 3
import org.tela_botanica.client.modeles.objets.Configuration;
4
import org.tela_botanica.client.modeles.objets.Utilisateur;
157 aurelien 5
import org.tela_botanica.client.observation.ObservationModele;
140 aurelien 6
 
7
import com.google.gwt.http.client.Request;
8
import com.google.gwt.http.client.RequestBuilder;
9
import com.google.gwt.http.client.RequestCallback;
10
import com.google.gwt.http.client.RequestException;
11
import com.google.gwt.http.client.Response;
12
 
13
public class ImportObservationAsynchroneDAO {
14
 
15
	private ObservationModele oModele = null ;
16
 
17
	public ImportObservationAsynchroneDAO(ObservationModele observationModele) {
18
		oModele = observationModele;
19
	}
20
 
21
	public void importerObservations() {
22
 
23
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()
937 aurelien 24
				+ "/InventoryImport/" + Utilisateur.getInstance().getIdentifiantUtilisateurConsulte());
140 aurelien 25
 
26
		try {
27
			rb.sendRequest(null, new RequestCallback() {
28
 
29
				public void onError(Request request, Throwable exception) {
30
					// TODO Auto-generated method stub
31
 
32
				}
33
 
34
				public void onResponseReceived(Request request,
35
						Response response) {
36
 
37
					if(response.getText().equals("OK")) {
647 aurelien 38
						oModele.obtenirNombreObservation(null);
140 aurelien 39
					}
40
					else
41
					{
42
 
43
					}
44
 
45
				}
46
 
47
			});
48
		} catch (RequestException e) {
49
			// TODO Auto-generated catch block
50
			e.printStackTrace();
51
		}
52
 
53
	}
54
 
55
}