10,7 → 10,6 |
import com.google.gwt.json.client.JSONArray; |
import com.google.gwt.json.client.JSONObject; |
import com.google.gwt.json.client.JSONValue; |
import com.google.gwt.user.client.Window; |
|
public class ObservationServiceResultat { |
|
20,17 → 19,16 |
|
public ObservationServiceResultat(JSONValue retourJson) { |
//TODO ajouter vérifications plus précises |
Window.alert(retourJson.isObject().get("entete").isObject().get("total")+""); |
double total = retourJson.isObject().get("entete").isObject().get("total").isNumber().doubleValue(); |
double total = retourJson.isObject().get("total").isNumber().doubleValue(); |
nbTotalObservationsPourLaRecherche = (int) total; |
JSONObject tableauObs = retourJson.isObject().get("resultats").isObject(); |
JSONArray tableauObs = retourJson.isObject().get("contenu").isArray(); |
|
observations = new ArrayList<Observation>(); |
|
java.util.Iterator<String> it = tableauObs.keySet().iterator(); |
while (it.hasNext()) { |
int nbResultats = tableauObs.size(); |
for (int i = 0; i < nbResultats; i++) { |
|
JSONObject observationJson = tableauObs.get(it.next()).isObject(); |
JSONObject observationJson = tableauObs.get(i).isObject(); |
Observation observation = UtilitairesServiceResultat.parserObservationEtCreerPropositionDetermination(observationJson); |
|
JSONArray tableauImagesObs = observationJson.get("images").isArray(); |