Line 89... |
Line 89... |
89 |
observation.setLieuDit(getValeurOuVide(observationJson, "lieudit"));
|
89 |
observation.setLieuDit(getValeurOuVide(observationJson, "lieudit"));
|
90 |
observation.setStation(getValeurOuVide(observationJson, "station"));
|
90 |
observation.setStation(getValeurOuVide(observationJson, "station"));
|
91 |
observation.setCommentaire(getValeurOuVide(observationJson, "commentaire"));
|
91 |
observation.setCommentaire(getValeurOuVide(observationJson, "commentaire"));
|
92 |
observation.setNumNomenclatural(getValeurOuVide(observationJson, "determination.nn"));
|
92 |
observation.setNumNomenclatural(getValeurOuVide(observationJson, "determination.nn"));
|
93 |
observation.setReferentiel(getValeurOuVide(observationJson, "determination.referentiel"));
|
93 |
observation.setReferentiel(getValeurOuVide(observationJson, "determination.referentiel"));
|
- |
|
94 |
String nbCom = getValeurOuVide(observationJson, "nb_commentaires");
|
- |
|
95 |
nbCom = nbCom.equals("") ? "0" : nbCom;
|
- |
|
96 |
observation.setNbCommentaires(nbCom);
|
94 |
observation.setMotsClefs(parserMotsCles(UtilitairesServiceResultat.getValeurOuVide(observationJson, "mots_cles_texte")));
|
97 |
observation.setMotsClefs(parserMotsCles(UtilitairesServiceResultat.getValeurOuVide(observationJson, "mots_cles_texte")));
|
95 |
JSONValue propositions = observationJson.get("commentaires");
|
98 |
JSONValue propositions = observationJson.get("commentaires");
|
Line 96... |
Line 99... |
96 |
|
99 |
|
97 |
boolean creerPropositionAPartirObs = true;
|
100 |
boolean creerPropositionAPartirObs = true;
|
Line 624... |
Line 627... |
624 |
|
627 |
|
625 |
if (retourJson.isObject().get("entete") != null) {
|
628 |
if (retourJson.isObject().get("entete") != null) {
|
626 |
// TODO ajouter vérifications plus précises
|
629 |
// TODO ajouter vérifications plus précises
|
627 |
double total = retourJson.isObject().get("entete").isObject().get("total").isNumber().doubleValue();
|
630 |
double total = retourJson.isObject().get("entete").isObject().get("total").isNumber().doubleValue();
|
628 |
nbTotalObservationsPourLaRecherche = (int) total;
|
631 |
nbTotalObservationsPourLaRecherche = (int) total;
|
Line 629... |
Line 632... |
629 |
JSONObject tableauObs = retourJson.isObject().get("resultats").isObject();
|
632 |
JSONArray tableauObs = retourJson.isObject().get("resultats").isArray();
|
630 |
|
633 |
|
631 |
if (tableauObs != null) {
|
- |
|
632 |
java.util.Iterator<String> it = tableauObs.keySet().iterator();
|
634 |
if (tableauObs != null) {
|
633 |
while (it.hasNext()) {
|
635 |
for(int i = 0; i < tableauObs.size(); i++) {
|
634 |
JSONObject observationJson = tableauObs.get(it.next()).isObject();
|
636 |
JSONObject observationJson = tableauObs.get(i).isObject();
|
635 |
Observation observation = analyserObservation(observationJson);
|
637 |
Observation observation = analyserObservation(observationJson);
|
636 |
observations.add(observation);
|
638 |
observations.add(observation);
|
637 |
}
|
639 |
}
|