Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 113 Rev 268
Line 15... Line 15...
15
import com.google.gwt.json.client.JSONParser;
15
import com.google.gwt.json.client.JSONParser;
16
import com.google.gwt.json.client.JSONString;
16
import com.google.gwt.json.client.JSONString;
17
import com.google.gwt.json.client.JSONValue;
17
import com.google.gwt.json.client.JSONValue;
Line 18... Line 18...
18
 
18
 
-
 
19
public class ValeurListeAsyncDao {
Line 19... Line 20...
19
public class ValeurListeAsyncDao {
20
	private static final String SERVICE_NOM = "CoelValeurListe";
Line -... Line 21...
-
 
21
	
-
 
22
	private Rafraichissable vue = null;
-
 
23
	
-
 
24
	public ValeurListeAsyncDao() {
20
	
25
		// TODO Auto-generated constructor stub
21
	private Rafraichissable rafraichissement = null;
26
	}
22
	
27
	
Line 23... Line 28...
23
	public ValeurListeAsyncDao(Rafraichissable r) {
28
	public ValeurListeAsyncDao(Rafraichissable vueARafraichir) {
24
		rafraichissement = r;
29
		vue = vueARafraichir;
25
	}
30
	}
26
	
31
	
27
	public void obtenirListe(Integer cle) {
32
	public void obtenirListe(Integer cle) {
28
		// Demande de toutes les structures
33
		// Demande de toutes les structures
29
    	String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
34
    	String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
30
    	url = url+"CoelValeurListe/id/"+cle.toString();
35
    	url = url+SERVICE_NOM+"/id/"+cle.toString();
Line 49... Line 54...
49
							JSONString listeId = reponse.get("id").isString();
54
							JSONString listeId = reponse.get("id").isString();
50
							JSONArray listeValeurs = reponse.get("valeurs").isArray();
55
							JSONArray listeValeurs = reponse.get("valeurs").isArray();
51
							// Transformation du tableau JSON réponse en Liste
56
							// Transformation du tableau JSON réponse en Liste
52
							ValeurListe liste = new ValeurListe(listeId, listeValeurs);
57
							ValeurListe liste = new ValeurListe(listeId, listeValeurs);
53
							// et on met à jour le demandeur des données
58
							// et on met à jour le demandeur des données
54
							rafraichissement.rafraichir(liste);
59
							vue.rafraichir(liste);
55
						} catch (NullPointerException e) {
60
						} catch (NullPointerException e) {
56
							e.printStackTrace();
61
							e.printStackTrace();
57
						}
62
						}
58
					}
63
					}
Line 61... Line 66...
61
			});
66
			});
62
		} catch (RequestException e) {
67
		} catch (RequestException e) {
63
			e.printStackTrace();
68
			e.printStackTrace();
64
		}
69
		}
65
	}
70
	}
66
	public ValeurListeAsyncDao() {
-
 
67
		// TODO Auto-generated constructor stub
-
 
68
	}
-
 
69
 
-
 
70
}
71
}