Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 292 Rev 299
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.RegistreId;
3
import org.tela_botanica.client.RegistreId;
-
 
4
import org.tela_botanica.client.interfaces.Rafraichissable;
Line 4... Line -...
4
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
5
 
-
 
6
import com.extjs.gxt.ui.client.Registry;
5
import org.tela_botanica.client.util.UtilDAO;
7
import com.google.gwt.core.client.GWT;
6
 
8
import com.google.gwt.http.client.Request;
7
import com.google.gwt.http.client.Request;
9
import com.google.gwt.http.client.RequestBuilder;
8
import com.google.gwt.http.client.RequestBuilder;
10
import com.google.gwt.http.client.RequestCallback;
9
import com.google.gwt.http.client.RequestCallback;
Line 16... Line 15...
16
import com.google.gwt.json.client.JSONString;
15
import com.google.gwt.json.client.JSONString;
17
import com.google.gwt.json.client.JSONValue;
16
import com.google.gwt.json.client.JSONValue;
Line 18... Line 17...
18
 
17
 
19
public class ValeurListeAsyncDao {
18
public class ValeurListeAsyncDao {
20
	private static final String SERVICE_NOM = "CoelValeurListe";
-
 
21
	private String strPays;
-
 
Line 22... Line 19...
22
	
19
	private static final String SERVICE_NOM = "CoelValeurListe";
Line 23... Line 20...
23
	
20
	
24
	private Rafraichissable vue = null;
21
	private Rafraichissable vue = null;
Line 29... Line 26...
29
	
26
	
30
	public ValeurListeAsyncDao(Rafraichissable vueARafraichir) {
27
	public ValeurListeAsyncDao(Rafraichissable vueARafraichir) {
31
		vue = vueARafraichir;
28
		vue = vueARafraichir;
Line 32... Line 29...
32
	}
29
	}
33
	
-
 
34
	public ValeurListeAsyncDao(Rafraichissable vueARafraichir, String strPays) {
30
	
35
		vue = vueARafraichir;
31
	public void obtenirListe(Integer cle)	{
Line 36... Line 32...
36
		this.strPays = strPays;
32
		selectionner("id", cle, "*");
37
	}
33
	}
38
	
34
	
-
 
35
	public void selectionner(String type, Integer cle, String abv) {
-
 
36
		// Demande de toutes les structures
-
 
37
    	//String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
39
	public void obtenirListe(Integer cle) {
38
    	
-
 
39
    	// Ajout des paramètres et données à selectionner dans l'URL
40
		// Demande de toutes les structures
40
		String[] parametres = new String[3];
41
    	String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
41
		parametres[0] = type;
42
    	if (strPays != null)	{
42
		
-
 
43
    	if (type.equals("id"))	{
43
    		url = url + SERVICE_NOM + "/abv/" + strPays + "/" + cle.toString();
44
    		parametres[1] = cle.toString();
44
    		System.out.println(url);
45
    	} else {
-
 
46
    		parametres[1] = abv;
-
 
47
    		parametres[2] = cle.toString();
-
 
48
    	}
45
    	}	else {
49
    	
46
    		url = url + SERVICE_NOM + "/id/" + cle.toString();
50
    	RequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres);
47
    	}
51
		
48
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);
52
    	//RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);
Line 49... Line 53...
49
		//GWT.log(url, null);
53
		//GWT.log(url, null);