Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 28 Rev 29
Line 15... Line 15...
15
	private String name=null;
15
	private String name=null;
16
	private String nomenclaturalNumber=null;
16
	private String nomenclaturalNumber=null;
17
	private String location=null;
17
	private String location=null;
18
	private String location_id=null;
18
	private String location_id=null;
19
	private String date=null;
19
	private String date=null;
20
	private String milieu=null;
20
	private String lieudit=null;
-
 
21
	private String station=null;
21
	private String comment=null;
22
	private String comment=null;
22
	private String ordre=null;
23
	private String ordre=null;
Line 23... Line 24...
23
 
24
 
24
	private Mediator mediator = null;
25
	private Mediator mediator = null;
Line 41... Line 42...
41
	}
42
	}
Line 42... Line 43...
42
 
43
 
Line 43... Line 44...
43
	
44
	
Line 44... Line 45...
44
	// Alimentation contenu depuis saisie
45
	// Alimentation contenu depuis saisie
45
	
46
	
Line 57... Line 58...
57
		else {
58
		else {
58
			 this.location=location;
59
			 this.location=location;
59
		}
60
		}
Line 60... Line 61...
60
		 
61
		 
-
 
62
		this.location_id=location_id;
-
 
63
		if (location.compareTo("")==0) this.location_id="";
61
		this.location_id=location_id;
64
		if (location_id==null) this.location_id="";
62
		this.date=date;
65
		this.date=date;
-
 
66
		this.lieudit=lieudit;
63
		this.milieu=milieu;
67
		this.station=station;
64
		this.comment=comment;
68
		this.comment=comment;
Line 65... Line 69...
65
		this.ordre=ordre;
69
		this.ordre=ordre;
Line 113... Line 117...
113
														.stringValue(),
117
														.stringValue(),
114
												((JSONString) jsonArray.get(2))
118
												((JSONString) jsonArray.get(2))
115
														.stringValue(),
119
														.stringValue(),
116
												Util.toCelString(((JSONString) jsonArray.get(3))
120
												Util.toCelString(((JSONString) jsonArray.get(3))
117
														.toString()),
121
														.toString()),
118
														location,location_id,date,milieu,comment);
122
														location,location_id,date,lieudit,station,comment);
119
									}
123
									}
120
								}
124
								}
Line 121... Line 125...
121
		
125
		
122
							});
126
							});
123
				}
127
				}
124
				// Saisie libre
128
				// Saisie libre
125
				else {
129
				else {
126
					addElement(name, " ", " ", " ", " ", " ",location,location_id,date,milieu,comment);
130
					addElement(name, " ", " ", " ", " ", " ",location,location_id,date,lieudit,station,comment);
Line 127... Line 131...
127
				}
131
				}
128
			
132
			
129
		}
133
		}
Line 151... Line 155...
151
	 * @param famille :
155
	 * @param famille :
152
	 *            famille
156
	 *            famille
153
	 */
157
	 */
Line 154... Line 158...
154
 
158
 
155
	private void addElement(String nom_sel, String num_nom_sel, String nom_ret,
159
	private void addElement(String nom_sel, String num_nom_sel, String nom_ret,
Line 156... Line 160...
156
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String milieu, String comment) {
160
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String lieu, String sta, String comment) {
157
 
161
 
158
 
162
 
159
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/", "identifiant="
163
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/", "identifiant="
160
				+ mediator.getUser() + "&nom_sel=" + URL.encodeComponent(nom_sel) + "&num_nom_sel=" + num_nom_sel
164
				+ mediator.getUser() + "&nom_sel=" + URL.encodeComponent(nom_sel) + "&num_nom_sel=" + num_nom_sel
Line 161... Line 165...
161
				+ "&nom_ret=" + URL.encodeComponent(nom_ret) + "&num_nom_ret=" + num_nom_ret
165
				+ "&nom_ret=" + URL.encodeComponent(nom_ret) + "&num_nom_ret=" + num_nom_ret
Line 162... Line 166...
162
				+ "&num_taxon=" + num_taxon + "&famille=" + URL.encodeComponent(famille) + "&location=" + URL.encodeComponent(loc) + "&id_location=" + id_location + "&date_observation=" + dat
166
				+ "&num_taxon=" + num_taxon + "&famille=" + URL.encodeComponent(famille) + "&location=" + URL.encodeComponent(loc) + "&id_location=" + id_location + "&date_observation=" + dat
163
				+ "&station="+ URL.encodeComponent(milieu) + "&commentaire="+ URL.encodeComponent(comment),
167
				+ "&lieudit="+ URL.encodeComponent(lieu) + "&station="+ URL.encodeComponent(sta) + "&commentaire="+ URL.encodeComponent(comment),
164
 
168
 
165
		new ResponseTextHandler() {
169
		new ResponseTextHandler() {
166
 
170
 
Line 204... Line 208...
204
														.stringValue(),
208
														.stringValue(),
205
												((JSONString) jsonArray.get(2))
209
												((JSONString) jsonArray.get(2))
206
														.stringValue(),
210
														.stringValue(),
207
												Util.toCelString(((JSONString) jsonArray.get(3))
211
												Util.toCelString(((JSONString) jsonArray.get(3))
208
														.toString()),
212
														.toString()),
209
														location,location_id,date,milieu,comment);
213
														location,location_id,date,lieudit,station,comment);
210
									}
214
									}
211
								}
215
								}
Line 212... Line 216...
212
		
216
		
213
							});
217
							});
214
				}
218
				}
215
				//  Modification d'un nom ne faisant pas parti du referentiel (saisie libre)
219
				//  Modification d'un nom ne faisant pas parti du referentiel (saisie libre)
216
				else {
220
				else {
217
					updateElement(ordre,name, " ", " ", " ", " ", " ",location,location_id,date,milieu,comment);
221
					updateElement(ordre,name, " ", " ", " ", " ", " ",location,location_id,date,lieudit,station,comment);
Line 218... Line 222...
218
				}
222
				}
219
			
223
			
220
		}
224
		}
Line 245... Line 249...
245
	 * @param famille :
249
	 * @param famille :
246
	 *            famille
250
	 *            famille
247
	 */
251
	 */
Line 248... Line 252...
248
 
252
 
249
	private void updateElement(String ordre, String nom_sel, String num_nom_sel, String nom_ret,
253
	private void updateElement(String ordre, String nom_sel, String num_nom_sel, String nom_ret,
Line 250... Line 254...
250
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String milieu, String comment) {
254
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String lieu, String sta, String comment) {
251
 
255
 
252
 
256
 
253
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + mediator.getUser() + "/" +ordre + "/",
257
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + mediator.getUser() + "/" +ordre + "/",
254
				 "&nom_sel=" + URL.encodeComponent(nom_sel) + "&num_nom_sel=" + num_nom_sel
258
				 "&nom_sel=" + URL.encodeComponent(nom_sel) + "&num_nom_sel=" + num_nom_sel
Line 255... Line 259...
255
				+ "&nom_ret=" + URL.encodeComponent(nom_ret) + "&num_nom_ret=" + num_nom_ret
259
				+ "&nom_ret=" + URL.encodeComponent(nom_ret) + "&num_nom_ret=" + num_nom_ret
Line 256... Line 260...
256
				+ "&num_taxon=" + num_taxon + "&famille=" + URL.encodeComponent(famille) + "&location=" + URL.encodeComponent(loc) + "&id_location=" + id_location + "&date_observation=" + dat
260
				+ "&num_taxon=" + num_taxon + "&famille=" + URL.encodeComponent(famille) + "&location=" + URL.encodeComponent(loc) + "&id_location=" + id_location + "&date_observation=" + dat
257
				+ "&station="+ URL.encodeComponent(milieu) + "&commentaire="+ URL.encodeComponent(comment),
261
				+ "&lieudit="+ URL.encodeComponent(lieu) + "&station="+ URL.encodeComponent(sta) + "&commentaire="+ URL.encodeComponent(comment),
258
 
262
 
259
		new ResponseTextHandler() {
263
		new ResponseTextHandler() {
260
 
264