Line 106... |
Line 106... |
106 |
|
106 |
|
Line 107... |
Line 107... |
107 |
for (int i = 0; i < taillemax; i++) {
|
107 |
for (int i = 0; i < taillemax; i++) {
|
Line 108... |
Line -... |
108 |
|
- |
|
109 |
if ((observation=reponse.get(i).isObject()) != null) {
|
- |
|
110 |
|
- |
|
111 |
String transmis=((JSONString) observation.get("transmission")).stringValue();
|
- |
|
112 |
String identifiantLocalite=((JSONString) observation.get("ce_zone_geo")).toString();
|
- |
|
113 |
String nomSaisi=Util.toCelString(((JSONString) observation.get("nom_sel")).toString());
|
- |
|
114 |
String nomRetenu=Util.toCelString(((JSONString) observation.get("nom_ret")).toString());
|
- |
|
115 |
String numeroNomenclaturalSaisi=((JSONString) observation.get("nom_sel_nn")).stringValue();
|
- |
|
116 |
String numeroNomenclaturalRetenu=((JSONString) observation.get("nom_ret_nn")).stringValue();
|
- |
|
117 |
String numeroTaxonomique=((JSONString) observation.get("nt")).stringValue();
|
- |
|
118 |
String famille=Util.toCelString(((JSONString) observation .get("famille")).toString());
|
- |
|
119 |
String localite=Util.toCelString(((JSONString) observation .get("zone_geo")).toString());
|
- |
|
120 |
String lieudit=Util.toCelString(((JSONString) observation .get("lieudit")).toString());
|
- |
|
121 |
String station=Util.toCelString(((JSONString) observation .get("station")).toString());
|
- |
|
122 |
String milieu=Util.toCelString(((JSONString) observation .get("milieu")).toString());
|
- |
|
123 |
String commentaire=Util.toCelString(((JSONString) observation .get("commentaire")).toString());
|
- |
|
124 |
String date=((JSONString) observation .get("date_observation")).stringValue();
|
- |
|
125 |
String numeroOrdre=((JSONString) observation.get("ordre")).stringValue();
|
- |
|
126 |
String numeroId=((JSONString) observation.get("id_observation")).stringValue();
|
- |
|
127 |
String coordX=((JSONString) observation.get("latitude")).stringValue();
|
- |
|
128 |
String coordY=((JSONString) observation.get("longitude")).stringValue();
|
108 |
|
129 |
String motsCles=((JSONString) observation.get("mots_cles")).stringValue();
|
- |
|
130 |
|
- |
|
131 |
Observation obs=new Observation(transmis, nomSaisi, nomRetenu, numeroNomenclaturalSaisi, numeroNomenclaturalRetenu ,numeroTaxonomique, famille, localite, identifiantLocalite, lieudit, station, milieu, commentaire, date, numeroOrdre/*, motsCles*/);
|
- |
|
132 |
obs.setCoordonneeX(coordX);
|
- |
|
133 |
obs.setCoordonneeY(coordY);
|
109 |
if ((observation=reponse.get(i).isObject()) != null) {
|
134 |
obs.setId(numeroId);
|
110 |
|
135 |
obs.setMotsCles(motsCles);
|
111 |
Observation obs = new Observation(observation);
|
136 |
observationData.put(obs.getNumeroOrdre(),obs);
|
112 |
observationData.put(obs.getNumeroOrdre(),obs);
|
Line 137... |
Line 113... |
137 |
}
|
113 |
}
|
Line 158... |
Line 134... |
158 |
public void modifierEnMasse(final Rafraichissable r, String identifiant,
|
134 |
public void modifierEnMasse(final Rafraichissable r, String identifiant,
|
159 |
final Observation obs) {
|
135 |
final Observation obs) {
|
Line 160... |
Line 136... |
160 |
|
136 |
|
Line 161... |
Line 137... |
161 |
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST,Configuration.getServiceBaseUrl()+ "/InventoryObservationList/" + identifiant + "/" + obs.getNumeroOrdre()+ "/") ;
|
137 |
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST,Configuration.getServiceBaseUrl()+ "/InventoryObservationList/" + identifiant + "/" + obs.getNumeroOrdre()+ "/") ;
|
162 |
|
138 |
|
163 |
String postData = "identifiant="
|
139 |
String postData = "ce_utilisateur="
|
164 |
+ identifiant ;
|
140 |
+ identifiant ;
|
165 |
if(obs.getNomSaisi() != null) {
|
141 |
if(obs.getNomSaisi() != null) {
|
166 |
postData += "&nom_sel=" + URL.encodeComponent(obs.getNomSaisi());
|
142 |
postData += "&nom_sel=" + URL.encodeComponent(obs.getNomSaisi());
|
167 |
}
|
143 |
}
|
168 |
if(obs.getNumeroNomenclaturalSaisi() != null) {
|
144 |
if(obs.getNumeroNomenclaturalSaisi() != null) {
|
Line 169... |
Line 145... |
169 |
postData += "&num_nom_sel=" + obs.getNumeroNomenclaturalSaisi();
|
145 |
postData += "&nom_sel_nn=" + obs.getNumeroNomenclaturalSaisi();
|
170 |
}
|
146 |
}
|
171 |
|
147 |
|
Line 172... |
Line 148... |
172 |
if(obs.getIdentifiantLocalite() != null) {
|
148 |
if(obs.getIdentifiantLocalite() != null) {
|
173 |
postData += "&id_location=" + obs.getIdentifiantLocalite();
|
149 |
postData += "&ce_zone_geo=" + obs.getIdentifiantLocalite();
|
174 |
}
|
150 |
}
|
Line 175... |
Line 151... |
175 |
|
151 |
|
176 |
if(obs.getLocalite() != null) {
|
152 |
if(obs.getLocalite() != null) {
|
177 |
postData += "&location=" + URL.encodeComponent(obs.getLocalite());
|
153 |
postData += "&zone_geo=" + URL.encodeComponent(obs.getLocalite());
|
Line 196... |
Line 172... |
196 |
if(obs.getCommentaire() != null) {
|
172 |
if(obs.getCommentaire() != null) {
|
197 |
postData += "&commentaire="+obs.getCommentaire();
|
173 |
postData += "&commentaire="+obs.getCommentaire();
|
198 |
}
|
174 |
}
|
Line 199... |
Line 175... |
199 |
|
175 |
|
200 |
if(obs.getLatitude() != null ) {
|
176 |
if(obs.getLatitude() != null ) {
|
201 |
postData += "&coord_x="+URL.encodeComponent(""+obs.getLatitude());
|
177 |
postData += "&latitude="+URL.encodeComponent(""+obs.getLatitude());
|
Line 202... |
Line 178... |
202 |
}
|
178 |
}
|
203 |
|
179 |
|
204 |
if(obs.getLongitude() != null) {
|
180 |
if(obs.getLongitude() != null) {
|
Line 205... |
Line 181... |
205 |
postData += "&coord_y="+URL.encodeComponent(""+obs.getLongitude());
|
181 |
postData += "&longitude="+URL.encodeComponent(""+obs.getLongitude());
|
Line 206... |
Line 182... |
206 |
}
|
182 |
}
|