Subversion Repositories eFlore/Applications.del

Rev

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

Rev 500 Rev 769
Line 8... Line 8...
8
 
8
 
9
import com.google.gwt.i18n.client.DateTimeFormat;
9
import com.google.gwt.i18n.client.DateTimeFormat;
10
import com.google.gwt.json.client.JSONArray;
10
import com.google.gwt.json.client.JSONArray;
11
import com.google.gwt.json.client.JSONObject;
11
import com.google.gwt.json.client.JSONObject;
-
 
12
import com.google.gwt.json.client.JSONValue;
Line 12... Line 13...
12
import com.google.gwt.json.client.JSONValue;
13
import com.google.gwt.user.client.Window;
Line 13... Line 14...
13
 
14
 
Line 14... Line 15...
14
public class ObservationServiceResultat {
15
public class ObservationServiceResultat {
Line 15... Line 16...
15
	
16
	
16
	private List<Observation> observations;
17
	private List<Observation> observations;
-
 
18
	
17
	
19
	private int nbTotalObservationsPourLaRecherche;
18
	private int nbTotalObservationsPourLaRecherche;
20
 
19
 
21
	public ObservationServiceResultat(JSONValue retourJson) {
Line 20... Line 22...
20
	public ObservationServiceResultat(JSONValue retourJson) {
22
		//TODO ajouter vérifications plus précises
Line 21... Line 23...
21
		//TODO ajouter vérifications plus précises
23
		Window.alert(retourJson.isObject().get("entete").isObject().get("total")+"");
22
		double total = retourJson.isObject().get("total").isNumber().doubleValue();
24
		double total = retourJson.isObject().get("entete").isObject().get("total").isNumber().doubleValue();
Line 23... Line 25...
23
		nbTotalObservationsPourLaRecherche = (int) total;
25
		nbTotalObservationsPourLaRecherche = (int) total;
24
		JSONArray tableauObs = retourJson.isObject().get("contenu").isArray();
26
		JSONObject tableauObs = retourJson.isObject().get("resultats").isObject();
Line 25... Line 27...
25
		
27
		
26
		observations = new ArrayList<Observation>();
28
		observations = new ArrayList<Observation>();