Subversion Repositories eFlore/Applications.del

Rev

Rev 765 | Rev 1496 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 765 Rev 939
Line 1... Line 1...
1
package org.tela_botanica.del.client.services.rest;
1
package org.tela_botanica.del.client.services.rest;
Line 2... Line 2...
2
 
2
 
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.ImagesParTaxonCallback;
Line 5... Line 6...
5
import org.tela_botanica.del.client.services.rest.async.ImagesParTaxonCallback;
6
import org.tela_botanica.del.client.services.rest.async.PHPCallback.ModeRequete;
Line 6... Line 7...
6
 
7
 
Line 25... Line 26...
25
		// RequestBuilder rb = new RequestBuilder(RequestBuilder.GET,
26
		// RequestBuilder rb = new RequestBuilder(RequestBuilder.GET,
26
		// serverUrl+"ImagesEflore");
27
		// serverUrl+"ImagesEflore");
27
		// adresse ajoutee temporairement le temps de faire fonctionner le
28
		// adresse ajoutee temporairement le temps de faire fonctionner le
28
		// service d'images eflore
29
		// service d'images eflore
29
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, baseUrl + "images?nom_taxon=" + taxon);
30
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, baseUrl + "images?nom_taxon=" + taxon);
-
 
31
		callback.setMode(ModeRequete.LECTURE);
30
		try {
32
		try {
31
			rb.sendRequest(null, callback);
33
			rb.sendRequest(null, callback);
32
		} catch (Exception e) {
34
		} catch (Exception e) {
33
			// TODO: handle exception
35
			// TODO: handle exception
34
		}
36
		}
35
	}
37
	}
Line 36... Line 38...
36
 
38
 
37
	@Override
39
	@Override
38
	public void getImagesParTaxon(InformationsRecherche infos, int debut, int fin, ImagesParTaxonCallback callback) {
40
	public void getImagesParTaxon(InformationsRecherche infos, int debut, int fin, ImagesParTaxonCallback callback) {
-
 
41
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, baseUrl + "images" + assemblerChaineRequete(infos, debut, fin));
39
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, baseUrl + "images" + assemblerChaineRequete(infos, debut, fin));
42
		callback.setMode(ModeRequete.LECTURE);
40
		try {
43
		try {
41
			rb.sendRequest(null, callback);
44
			rb.sendRequest(null, callback);
42
		} catch (Exception e) {
45
		} catch (Exception e) {
43
			// TODO: handle exception
46
			// TODO: handle exception
44
		}
47
		}
Line 45... Line 48...
45
	}
48
	}
46
 
49
 
47
	public void getImagesParObservation(String observationId, ImagesParTaxonCallback callback) {
50
	public void getImagesParObservation(String observationId, ImagesParTaxonCallback callback) {
-
 
51
		// TODO implementer avec une methode realiste
48
		// TODO implementer avec une methode realiste
52
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, baseUrl + "observations/"+observationId);
49
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, baseUrl + "observations/"+observationId);
53
		callback.setMode(ModeRequete.LECTURE);
50
		try {
54
		try {
51
			rb.sendRequest(null, callback);
55
			rb.sendRequest(null, callback);
52
		} catch (Exception e) {
56
		} catch (Exception e) {