Subversion Repositories eFlore/Applications.cel

Rev

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

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