Line 3... |
Line 3... |
3 |
import org.tela_botanica.del.client.config.Config;
|
3 |
import org.tela_botanica.del.client.config.Config;
|
4 |
import org.tela_botanica.del.client.modeles.InformationsRecherche;
|
4 |
import org.tela_botanica.del.client.modeles.InformationsRecherche;
|
5 |
import org.tela_botanica.del.client.services.rest.async.ObservationsCallback;
|
5 |
import org.tela_botanica.del.client.services.rest.async.ObservationsCallback;
|
6 |
import org.tela_botanica.del.client.services.rest.async.PHPCallback.ModeRequete;
|
6 |
import org.tela_botanica.del.client.services.rest.async.PHPCallback.ModeRequete;
|
Line 7... |
Line 7... |
7 |
|
7 |
|
Line 8... |
Line 8... |
8 |
import com.google.gwt.http.client.RequestBuilder;
|
8 |
import org.tela_botanica.del.client.services.RequestBuilderWithCredentials;
|
Line 9... |
Line 9... |
9 |
|
9 |
|
Line 20... |
Line 20... |
20 |
this.baseUrl = config.getServiceBaseUrl();
|
20 |
this.baseUrl = config.getServiceBaseUrl();
|
21 |
}
|
21 |
}
|
Line 22... |
Line 22... |
22 |
|
22 |
|
23 |
@Override
|
23 |
@Override
|
24 |
public void getObservations(InformationsRecherche infos, int debut, int fin, String statut, ObservationsCallback callback) {
|
24 |
public void getObservations(InformationsRecherche infos, int debut, int fin, String statut, ObservationsCallback callback) {
|
25 |
RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, baseUrl + "observations" + assemblerChaineRequete(infos, debut, fin, statut));
|
25 |
RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.GET, baseUrl + "observations" + assemblerChaineRequete(infos, debut, fin, statut));
|
26 |
callback.setMode(ModeRequete.LECTURE);
|
26 |
callback.setMode(ModeRequete.LECTURE);
|
27 |
try {
|
27 |
try {
|
28 |
rb.sendRequest(null, callback);
|
28 |
rb.sendRequest(null, callback);
|
29 |
} catch (Exception e) {
|
29 |
} catch (Exception e) {
|
Line 43... |
Line 43... |
43 |
}
|
43 |
}
|
Line 44... |
Line 44... |
44 |
|
44 |
|
45 |
@Override
|
45 |
@Override
|
46 |
public void getObservation(String idObservation,
|
46 |
public void getObservation(String idObservation,
|
47 |
ObservationsCallback callback) {
|
47 |
ObservationsCallback callback) {
|
48 |
RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, baseUrl + "observations/"+idObservation);
|
48 |
RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.GET, baseUrl + "observations/"+idObservation);
|
49 |
callback.setMode(ModeRequete.LECTURE);
|
49 |
callback.setMode(ModeRequete.LECTURE);
|
50 |
try {
|
50 |
try {
|
51 |
rb.sendRequest(null, callback);
|
51 |
rb.sendRequest(null, callback);
|
52 |
} catch (Exception e) {
|
52 |
} catch (Exception e) {
|