Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1162 Rev 1496
Line 5... Line 5...
5
import org.tela_botanica.del.client.services.rest.async.AjoutMotsClesImageCallback;
5
import org.tela_botanica.del.client.services.rest.async.AjoutMotsClesImageCallback;
6
import org.tela_botanica.del.client.services.rest.async.ListeMotsClesImageCallBack;
6
import org.tela_botanica.del.client.services.rest.async.ListeMotsClesImageCallBack;
7
import org.tela_botanica.del.client.services.rest.async.PHPCallback.ModeRequete;
7
import org.tela_botanica.del.client.services.rest.async.PHPCallback.ModeRequete;
8
import org.tela_botanica.del.client.services.rest.async.SuppressionMotCleImageCallback;
8
import org.tela_botanica.del.client.services.rest.async.SuppressionMotCleImageCallback;
Line 9... Line 9...
9
 
9
 
10
import com.google.gwt.http.client.RequestBuilder;
10
import org.tela_botanica.del.client.services.RequestBuilderWithCredentials;
Line 11... Line 11...
11
import com.google.gwt.http.client.URL;
11
import com.google.gwt.http.client.URL;
Line 12... Line 12...
12
 
12
 
Line 24... Line 24...
24
	}
24
	}
Line 25... Line 25...
25
	
25
	
26
	@Override
26
	@Override
27
	public void getMotsClesImage(String idImage,
27
	public void getMotsClesImage(String idImage,
28
			ListeMotsClesImageCallBack callback) {
28
			ListeMotsClesImageCallBack callback) {
29
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, baseUrl + "mots-cles" + assemblerChaineRequete(idImage));
29
		RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.GET, baseUrl + "mots-cles" + assemblerChaineRequete(idImage));
30
		callback.setMode(ModeRequete.LECTURE);
30
		callback.setMode(ModeRequete.LECTURE);
31
		try {
31
		try {
32
			rb.sendRequest(null, callback);
32
			rb.sendRequest(null, callback);
33
		} catch (Exception e) {
33
		} catch (Exception e) {
Line 42... Line 42...
42
 
42
 
43
	@Override
43
	@Override
44
	public void ajouterMotCleImage(String idImage, String motCle,
44
	public void ajouterMotCleImage(String idImage, String motCle,
45
			AjoutMotsClesImageCallback callback) {
45
			AjoutMotsClesImageCallback callback) {
46
		String urlService = baseUrl+"mots-cles/";
46
		String urlService = baseUrl+"mots-cles/";
Line 47... Line 47...
47
		RequestBuilder rb = new RequestBuilder(RequestBuilder.PUT, urlService);
47
		RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.PUT, urlService);
48
		
48
		
49
		callback.setMode(ModeRequete.AJOUT);
49
		callback.setMode(ModeRequete.AJOUT);
50
		String chainePost = assemblerChaineRequeteAjout(idImage, motCle);
50
		String chainePost = assemblerChaineRequeteAjout(idImage, motCle);
Line 63... Line 63...
63
	}
63
	}
Line 64... Line 64...
64
 
64
 
65
	@Override
65
	@Override
66
	public void supprimerMotCleImage(String idMotCle, SuppressionMotCleImageCallback callback) {
66
	public void supprimerMotCleImage(String idMotCle, SuppressionMotCleImageCallback callback) {
67
		String urlService = baseUrl+"mots-cles/"+idMotCle;
67
		String urlService = baseUrl+"mots-cles/"+idMotCle;
Line 68... Line 68...
68
		RequestBuilder rb = new RequestBuilder(RequestBuilder.DELETE, urlService);
68
		RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.DELETE, urlService);
69
		
69
		
70
		callback.setMode(ModeRequete.SUPPRESSION);
70
		callback.setMode(ModeRequete.SUPPRESSION);
71
		try {
71
		try {