Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 26 Rev 27
Line 289... Line 289...
289
									JSONArray jsonArray;
289
									JSONArray jsonArray;
Line 290... Line 290...
290
		
290
		
291
									if ((jsonArray = jsonValue.isArray()) != null) {
291
									if ((jsonArray = jsonValue.isArray()) != null) {
292
										// Nom retenu, Num Nomen nom retenu, Num Taxon,  Famille
292
										// Nom retenu, Num Nomen nom retenu, Num Taxon,  Famille
293
										updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), inventoryItem.getNomenclaturalNumber(),
293
										updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), inventoryItem.getNomenclaturalNumber(),
294
												((JSONString) jsonArray.get(0))
294
												Util.toCelString(((JSONString) jsonArray.get(0))
295
														.stringValue(),
295
														.toString()),
296
												((JSONString) jsonArray.get(1))
296
												((JSONString) jsonArray.get(1))
297
														.stringValue(),
297
														.stringValue(),
298
												((JSONString) jsonArray.get(2))
298
												((JSONString) jsonArray.get(2))
299
														.stringValue(),
299
														.stringValue(),
300
												((JSONString) jsonArray.get(3))
300
												Util.toCelString(((JSONString) jsonArray.get(3))
301
														.stringValue(),
301
														.toString()),
302
														inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment());
302
														inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getMilieu(),inventoryItem.getComment());
303
									}
303
									}
Line 304... Line 304...
304
								}
304
								}
305
		
305
		
306
							});
306
							});
307
				}
307
				}
308
				//  Modification d'un nom ne faisant pas parti du referentiel (saisie libre)
308
				//  Modification d'un nom ne faisant pas parti du referentiel (saisie libre)
309
				else {
309
				else {
Line 310... Line 310...
310
					updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment());
310
					updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getMilieu(),inventoryItem.getComment());
311
				}
311
				}
312
			
312
			
Line 347... Line 347...
347
		
347
		
348
									if ((jsonArray = jsonValue.isArray()) != null) {
348
									if ((jsonArray = jsonValue.isArray()) != null) {
349
										// Nom retenu, Num Nomen nom retenu, Num Taxon,
349
										// Nom retenu, Num Nomen nom retenu, Num Taxon,
350
										// Famille
350
										// Famille
351
										addElement(inventoryItem.getName(), inventoryItem.getNomenclaturalNumber(),
351
										addElement(inventoryItem.getName(), inventoryItem.getNomenclaturalNumber(),
352
												((JSONString) jsonArray.get(0))
352
												Util.toCelString(((JSONString) jsonArray.get(0))
353
														.stringValue(),
353
														.toString()),
354
												((JSONString) jsonArray.get(1))
354
												((JSONString) jsonArray.get(1))
355
														.stringValue(),
355
														.stringValue(),
356
												((JSONString) jsonArray.get(2))
356
												((JSONString) jsonArray.get(2))
357
														.stringValue(),
357
														.stringValue(),
358
												((JSONString) jsonArray.get(3))
358
												Util.toCelString(((JSONString) jsonArray.get(3))
359
														.stringValue(),
359
														.toString()),
360
														inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment());
360
														inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getMilieu(),inventoryItem.getComment());
361
									}
361
									}
Line 362... Line 362...
362
								}
362
								}
363
		
363
		
364
							});
364
							});
365
				}
365
				}
366
				// Saisie libre
366
				// Saisie libre
367
				else {
367
				else {
Line 368... Line 368...
368
					addElement(inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment());
368
					addElement(inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getMilieu(),inventoryItem.getComment());
369
				}
369
				}
370
			
370
			
Line 393... Line 393...
393
	 * @param famille :
393
	 * @param famille :
394
	 *            famille
394
	 *            famille
395
	 */
395
	 */
Line 396... Line 396...
396
 
396
 
397
	private void addElement(String nom_sel, String num_nom_sel, String nom_ret,
397
	private void addElement(String nom_sel, String num_nom_sel, String nom_ret,
Line 398... Line 398...
398
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String complementLocation, String comment) {
398
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String milieu, String comment) {
399
 
399
 
400
 
400
 
401
		count++;
401
		count++;
402
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/", "identifiant="
402
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/", "identifiant="
403
				+ user + "&nom_sel=" + nom_sel + "&num_nom_sel=" + num_nom_sel
403
				+ user + "&nom_sel=" + URL.encodeComponent(nom_sel) + "&num_nom_sel=" + num_nom_sel
Line 404... Line 404...
404
				+ "&nom_ret=" + nom_ret + "&num_nom_ret=" + num_nom_ret
404
				+ "&nom_ret=" + URL.encodeComponent(nom_ret) + "&num_nom_ret=" + num_nom_ret
Line 405... Line 405...
405
				+ "&num_taxon=" + num_taxon + "&famille=" + famille + "&location=" + loc + "&id_location=" + id_location + "&date_observation=" + dat
405
				+ "&num_taxon=" + num_taxon + "&famille=" + URL.encodeComponent(famille) + "&location=" + URL.encodeComponent(loc) + "&id_location=" + id_location + "&date_observation=" + dat
406
				+ "&station="+ complementLocation + "&commentaire="+ comment,
406
				+ "&station="+ URL.encodeComponent(milieu) + "&commentaire="+ URL.encodeComponent(comment),
Line 436... Line 436...
436
	 * @param famille :
436
	 * @param famille :
437
	 *            famille
437
	 *            famille
438
	 */
438
	 */
Line 439... Line 439...
439
 
439
 
440
	private void updateElement(String ordre, String nom_sel, String num_nom_sel, String nom_ret,
440
	private void updateElement(String ordre, String nom_sel, String num_nom_sel, String nom_ret,
Line 441... Line 441...
441
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String complementLocation, String comment) {
441
			String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String milieu, String comment) {
442
 
442
 
443
 
443
 
444
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user + "/" +ordre + "/",
444
		HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user + "/" +ordre + "/",
445
				 "&nom_sel=" + nom_sel + "&num_nom_sel=" + num_nom_sel
445
				 "&nom_sel=" + URL.encodeComponent(nom_sel) + "&num_nom_sel=" + num_nom_sel
Line 446... Line 446...
446
				+ "&nom_ret=" + nom_ret + "&num_nom_ret=" + num_nom_ret
446
				+ "&nom_ret=" + URL.encodeComponent(nom_ret) + "&num_nom_ret=" + num_nom_ret
Line 447... Line 447...
447
				+ "&num_taxon=" + num_taxon + "&famille=" + famille + "&location=" + loc + "&id_location=" + id_location + "&date_observation=" + dat
447
				+ "&num_taxon=" + num_taxon + "&famille=" + URL.encodeComponent(famille) + "&location=" + URL.encodeComponent(loc) + "&id_location=" + id_location + "&date_observation=" + dat
448
				+ "&station="+ complementLocation + "&commentaire="+ comment,
448
				+ "&station="+ URL.encodeComponent(milieu) + "&commentaire="+ URL.encodeComponent(comment),
Line 629... Line 629...
629
		String adate="all";
629
		String adate="all";
630
		if (date.compareTo("all")!=0) {
630
		if (date.compareTo("all")!=0) {
631
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
631
			adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00";
632
		}
632
		}
Line 633... Line 633...
633
 
633
 
634
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + URL.encodeComponent(location) +"/" + adate + "/" + search + "/" + URL.encodeComponent(station) + "/"
634
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + URL.encodeComponent(location) +"/" + adate + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(station) + "/"
Line 635... Line 635...
635
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
635
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
Line 636... Line 636...
636
 
636
 
Line 653... Line 653...
653
 
653
 
Line 654... Line 654...
654
					int arraySize = jsonArray.size();
654
					int arraySize = jsonArray.size();
655
					
655
					
-
 
656
					for (i = 0; i < arraySize; ++i) {
656
					for (i = 0; i < arraySize; ++i) {
657
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
657
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
658
							// Optimisation
658
							if (i>=table.getRowCount()) {
659
							if (i>=table.getRowCount()) {
659
								 row = table.insertRow(table.getRowCount());
660
								 row = table.insertRow(table.getRowCount());
660
							}
661
							}
Line 668... Line 669...
668
							
669
							
669
							// Case a cocher
670
							// Case a cocher
Line 670... Line 671...
670
							table.setWidget(row, 0, new CheckBox());
671
							table.setWidget(row, 0, new CheckBox());
Line 671... Line 672...
671
							
672
							
Line 672... Line 673...
672
							
673
							
673
							// Observation transmise
674
							// Statut Observation transmise ?
674
							
675
							
675
							
676
							
676
							String atransmit=((JSONString) jsonArrayNested .get(11)).stringValue();
677
							String atransmit=((JSONString) jsonArrayNested .get(11)).stringValue();
677
							
678
							
-
 
679
							if (atransmit.compareTo("1")==0) {
-
 
680
								table.setWidget(row,1,new Image("tela.gif"));
Line 678... Line 681...
678
							if (atransmit.compareTo("1")==0) {
681
							}
Line 679... Line 682...
679
								table.setWidget(row,1,new Image("tela.gif"));
682
							else {
680
							}
683
								table.setWidget(row,1,new HTML("&nbsp;"));
Line 681... Line 684...
681
							else {
684
							}
682
								table.setWidget(row,1,new HTML("&nbsp;"));
685
						
683
							}
686
							// Nom saisi
684
							
687
							
Line 714... Line 717...
714
							else {
717
							else {
715
								center.append("0, ");
718
								center.append("0, ");
716
							}
719
							}
Line 717... Line 720...
717
 
720
 
718
							// Famille
721
							// Famille
Line 719... Line 722...
719
							String afamily=((JSONString) jsonArrayNested .get(5)).stringValue();
722
							String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString());
720
							
723
							
721
							if (afamily.compareTo("null")==0) {
724
							if (afamily.compareTo("null")==0) {
722
								//
725
								//
723
							}
726
							}
724
							else {
727
							else {
Line 725... Line 728...
725
								center.append(afamily+", ");
728
								center.append(afamily+", ");
726
							}
729
							}
Line 727... Line 730...
727
 
730
 
728
							
731
							
729
							String aloc=((JSONString) jsonArrayNested .get(6)).stringValue();
732
							String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString());
Line 746... Line 749...
746
									}
749
									}
Line 747... Line 750...
747
										
750
										
Line 748... Line 751...
748
								}
751
								}
Line 749... Line 752...
749
							
752
							
Line 750... Line 753...
750
								
753
								
751
								String alieudit=((JSONString) jsonArrayNested .get(9)).stringValue();
754
								String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString());
752
							
755
							
Line 753... Line 756...
753
//								Localisation - Lieu dit
756
//								Localisation - Lieu dit
754
								
757
								
Line 755... Line 758...
755
								if (alieudit.compareTo("000null")!=0) {
758
								if (alieudit.compareTo("000null")!=0) {
756
									center.append(", "+alieudit);
759
									center.append(", "+alieudit);
757
								}
760
								}
Line 1055... Line 1058...
1055
 
1058
 
Line 1056... Line 1059...
1056
 
1059
 
1057
}
1060
}
-
 
1061
 
-
 
1062
/* +--Fin du code ---------------------------------------------------------------------------------------+
-
 
1063
* $Log$
1058
 
1064
* Revision 1.7  2007-09-17 19:25:34  ddelon
1059
/* +--Fin du code ---------------------------------------------------------------------------------------+
1065
* Documentation