Subversion Repositories eFlore/Applications.cel

Rev

Rev 140 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 140 Rev 157
Line 1... Line 1...
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
Line 2... Line 2...
2
 
2
 
3
import org.tela_botanica.client.image.ImageModele;
3
import org.tela_botanica.client.image.ImageModele;
-
 
4
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
5
import org.tela_botanica.client.observation.ObservationMediateur;
-
 
6
import org.tela_botanica.client.observation.ObservationModele;
4
import org.tela_botanica.client.interfaces.Rafraichissable;
7
 
5
import com.google.gwt.http.client.Request;
8
import com.google.gwt.http.client.Request;
6
import com.google.gwt.http.client.RequestBuilder;
9
import com.google.gwt.http.client.RequestBuilder;
7
import com.google.gwt.http.client.RequestCallback;
10
import com.google.gwt.http.client.RequestCallback;
8
import com.google.gwt.http.client.RequestException;
11
import com.google.gwt.http.client.RequestException;
Line 22... Line 25...
22
 
25
 
23
	/**
26
	/**
24
	 * Le modele associé au DAO
27
	 * Le modele associé au DAO
25
	 */
28
	 */
-
 
29
	private ImageModele iModele = null;
-
 
30
	
-
 
31
	private ObservationModele oModele = null ;
-
 
32
	
Line 26... Line 33...
26
	private ImageModele iModele = null;
33
	private String identifiant = "" ;
27
 
34
 
-
 
35
	public MotsClesAsynchroneDAO(ImageModele im) {
-
 
36
		iModele = im;
-
 
37
		identifiant = im.getIdentifiant();
-
 
38
	}
-
 
39
	
-
 
40
	public MotsClesAsynchroneDAO(ObservationModele om) {
28
	public MotsClesAsynchroneDAO(ImageModele im) {
41
		oModele = om;
-
 
42
		identifiant = om.getIdentifiant();
-
 
43
	}
Line 29... Line 44...
29
		iModele = im;
44
	
30
	}
45
	
31
 
46
 
32
	/**
47
	/**
Line 46... Line 61...
46
	 *            le rafraichissable qui demande les données
61
	 *            le rafraichissable qui demande les données
47
	 */
62
	 */
48
	public void obtenirListeMotsCles(final Rafraichissable r) {
63
	public void obtenirListeMotsCles(final Rafraichissable r) {
49
		// on demande tous les mots clés associés à l'utilisateur
64
		// on demande tous les mots clés associés à l'utilisateur
50
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()
65
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()
51
				+ "/InventoryKeyWordList/" + iModele.getIdentifiant());
66
				+ "/InventoryKeyWordList/" + identifiant);
Line 52... Line 67...
52
 
67
 
53
		try {
68
		try {
Line 54... Line 69...
54
			rb.sendRequest(null, new RequestCallback() {
69
			rb.sendRequest(null, new RequestCallback() {
Line 133... Line 148...
133
			String postData = "";
148
			String postData = "";
134
			postData += "&action=DELETE";
149
			postData += "&action=DELETE";
Line 135... Line 150...
135
 
150
 
136
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
151
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
137
					+ "/InventoryKeyWordList/"
152
					+ "/InventoryKeyWordList/"
138
					+ iModele.getIdentifiant()
153
					+ identifiant
139
					+ "/"
154
					+ "/"
Line 140... Line 155...
140
					+ motcle);
155
					+ motcle);
141
 
156
 
Line 176... Line 191...
176
 
191
 
177
			String postData = "";
192
			String postData = "";
Line 178... Line 193...
178
			postData += "&action=modification" + motcle;
193
			postData += "&action=modification" + motcle;
179
 
194
 
180
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
195
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
181
					+ "/InventoryKeyWordList/" + iModele.getIdentifiant());
196
					+ "/InventoryKeyWordList/" + identifiant);
Line 182... Line 197...
182
			try {
197
			try {
183
				rb.sendRequest(postData, new RequestCallback() {
198
				rb.sendRequest(postData, new RequestCallback() {
Line 214... Line 229...
214
 
229
 
215
			String postData = "";
230
			String postData = "";
Line 216... Line 231...
216
			postData += "&action=deplacement" + motcle;
231
			postData += "&action=deplacement" + motcle;
217
 
232
 
218
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
233
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
219
					+ "/InventoryKeyWordList/" + iModele.getIdentifiant());
234
					+ "/InventoryKeyWordList/" + identifiant);
Line 220... Line 235...
220
			try {
235
			try {
221
				rb.sendRequest(postData, new RequestCallback() {
236
				rb.sendRequest(postData, new RequestCallback() {