Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 325 Rev 342
Line 404... Line 404...
404
			// si le tableau est vide
404
			// si le tableau est vide
405
			if (taillemax == 0) {
405
			if (taillemax == 0) {
406
				// on crée un arbre vide
406
				// on crée un arbre vide
407
				TreeNode root = new TreeNode();
407
				TreeNode root = new TreeNode();
408
				root.setId("racine_obs");
408
				root.setId("racine_obs");
409
				root.setText("Tags");
409
				root.setText("Projets");
410
				String[] usObj = { "Tags", "racine_obs" };
410
				String[] usObj = { "Projets", "racine_obs" };
411
				root.setUserObject(usObj);
411
				root.setUserObject(usObj);
412
				arbreMotsCles.setRootNode(root);
412
				arbreMotsCles.setRootNode(root);
-
 
413
				
413
			}
414
			}
Line 414... Line 415...
414
 
415
 
415
			// pour chacun des élements du tableau
416
			// pour chacun des élements du tableau
416
			for (int j = 0; j < taillemax; j++) {
417
			for (int j = 0; j < taillemax; j++) {
Line 443... Line 444...
443
						node.setId(id_noeud);
444
						node.setId(id_noeud);
444
						node.setText(mot_cle);
445
						node.setText(mot_cle);
445
						node.setChecked(false);
446
						node.setChecked(false);
446
						Node parentNode = arbreMotsCles.getNodeById(parent);
447
						Node parentNode = arbreMotsCles.getNodeById(parent);
447
						node.setUserObject(usObj);
448
						node.setUserObject(usObj);
-
 
449
						
448
						parentNode.appendChild(node);
450
						parentNode.appendChild(node);
449
					}
451
					}
450
				}
452
				}
451
			}
453
			}
Line 455... Line 457...
455
			// et on notifie le médiateur de la mise à jour en lui passant une
457
			// et on notifie le médiateur de la mise à jour en lui passant une
456
			// copie des données
458
			// copie des données
457
			observationMediateur.rafraichirArbreMotsCles(arbreMotsCles);
459
			observationMediateur.rafraichirArbreMotsCles(arbreMotsCles);
458
		}
460
		}
Line -... Line 461...
-
 
461
		
-
 
462
		if(nouvelleDonnees instanceof Observation) {
-
 
463
			observationMediateur.obtenirNombreObservation();
-
 
464
		}
459
		
465
		
Line 460... Line 466...
460
	}
466
	}
461
 
467
 
462
	/**
468
	/**
Line 497... Line 503...
497
		String[] motsClesIdTab = motsClesId.split(",");
503
		String[] motsClesIdTab = motsClesId.split(",");
498
		r.rafraichir(motsClesIdTab, false);
504
		r.rafraichir(motsClesIdTab, false);
499
	}
505
	}
Line 500... Line 506...
500
	
506
	
501
	/**
507
	/**
502
	 * Met à jour les mots clés associés à une image et appelle le DAO pour
508
	 * Met à jour les mots clés associés à une obs et appelle le DAO pour
503
	 * synchroniser la base de données
509
	 * synchroniser la base de données
504
	 * 
510
	 * 
505
	 * @param ids
511
	 * @param ids
506
	 *            les identifiants des images selectionnées
512
	 *            les identifiants des images selectionnées
Line 511... Line 517...
511
	 */
517
	 */
512
	public void mettreAjourMotsCles(String motsClesEnCours, String[] idsObsALier) {
518
	public void mettreAjourMotsCles(String motsClesEnCours, String[] idsObsALier) {
513
		for (int i = 0; i < idsObsALier.length; i++) {
519
		for (int i = 0; i < idsObsALier.length; i++) {
514
			if (cacheObservation.containsKey(idsObsALier[i])) {
520
			if (cacheObservation.containsKey(idsObsALier[i])) {
515
				Observation o = (Observation) cacheObservation.get(idsObsALier[i]);
521
				Observation o = (Observation) cacheObservation.get(idsObsALier[i]);
-
 
522
				
-
 
523
				String motsCles = o.getMotsCles();
-
 
524
				
-
 
525
				if(!motsClesEnCours.endsWith(";") && !motsClesEnCours.startsWith(";")) {
-
 
526
					motsCles += ";";
-
 
527
				}
-
 
528
				motsCles += motsClesEnCours;
-
 
529
				
516
				o.setMotsCles(motsClesEnCours);
530
				o.setMotsCles(motsCles);
Line 517... Line 531...
517
 
531
 
518
				ObservationAsynchroneDAO oDao = new ObservationAsynchroneDAO(this);
532
				ObservationAsynchroneDAO oDao = new ObservationAsynchroneDAO(this);
519
				oDao.modifier(this,observationMediateur.getIdentifiant(),o);
533
				oDao.modifier(this,observationMediateur.getIdentifiant(),o);
520
			}
534
			}
Line 537... Line 551...
537
		String[] usObj = (String[]) n.getUserObject();
551
		String[] usObj = (String[]) n.getUserObject();
538
		String motCle = usObj[0];
552
		String motCle = usObj[0];
539
		String id = usObj[1];
553
		String id = usObj[1];
540
		String parentId = "";
554
		String parentId = "";
Line 541... Line 555...
541
 
555
 
542
		if (!id.equals("racine")) {
556
		if (!id.equals("racine_obs")) {
543
			String[] parentUsObj = (String[]) n.getParentNode().getUserObject();
557
			String[] parentUsObj = (String[]) n.getParentNode().getUserObject();
544
			parentId = parentUsObj[1];
558
			parentId = parentUsObj[1];
545
		} else {
559
		} else {
546
			parentId = "racine";
560
			parentId = "racine_obs";
Line 547... Line 561...
547
		}
561
		}
Line 548... Line 562...
548
		
562
		
Line 622... Line 636...
622
 
636
 
623
		String[] usObj = (String[]) n.getUserObject();
637
		String[] usObj = (String[]) n.getUserObject();
624
		String motCle = usObj[0];
638
		String motCle = usObj[0];
625
		String id = usObj[1];
639
		String id = usObj[1];
626
		String parentId = "";
640
		String parentId = "";
627
		if (!id.equals("racine")) {
641
		if (!id.equals("racine_obs")) {
628
			String[] parentUsObj = (String[]) n.getParentNode().getUserObject();
642
			String[] parentUsObj = (String[]) n.getParentNode().getUserObject();
629
			parentId = parentUsObj[1];
643
			parentId = parentUsObj[1];
630
		} else {
644
		} else {
631
			parentId = "racine";
645
			parentId = "racine_obs";
Line 632... Line 646...
632
		}
646
		}
Line 633... Line 647...
633
		
647