Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2042 Rev 2062
Line 21... Line 21...
21
import org.tela_botanica.client.modeles.objets.ListeObservation;
21
import org.tela_botanica.client.modeles.objets.ListeObservation;
22
import org.tela_botanica.client.modeles.objets.Utilisateur;
22
import org.tela_botanica.client.modeles.objets.Utilisateur;
23
import org.tela_botanica.client.util.MotsClesUtilitaire;
23
import org.tela_botanica.client.util.MotsClesUtilitaire;
Line 24... Line 24...
24
 
24
 
25
import com.google.gwt.json.client.JSONArray;
25
import com.google.gwt.json.client.JSONArray;
26
import com.google.gwt.json.client.JSONObject;
26
import com.google.gwt.user.client.Window;
27
import com.gwtext.client.data.ArrayReader;
27
import com.gwtext.client.data.ArrayReader;
28
import com.gwtext.client.data.FieldDef;
28
import com.gwtext.client.data.FieldDef;
29
import com.gwtext.client.data.IntegerFieldDef;
29
import com.gwtext.client.data.IntegerFieldDef;
30
import com.gwtext.client.data.MemoryProxy;
-
 
31
import com.gwtext.client.data.Node;
30
import com.gwtext.client.data.MemoryProxy;
32
import com.gwtext.client.data.RecordDef;
31
import com.gwtext.client.data.RecordDef;
33
import com.gwtext.client.data.Store;
32
import com.gwtext.client.data.Store;
34
import com.gwtext.client.data.StringFieldDef;
33
import com.gwtext.client.data.StringFieldDef;
35
import com.gwtext.client.data.Tree;
34
import com.gwtext.client.data.Tree;
Line 484... Line 483...
484
		// si on reçoit un tableau JSON
483
		// si on reçoit un tableau JSON
485
		if (nouvelleDonnees instanceof JSONArray) {
484
		if (nouvelleDonnees instanceof JSONArray) {
486
			// alors on a reçu les informations sur les mots clés			
485
			// alors on a reçu les informations sur les mots clés			
487
			JSONArray donneesArbre = (JSONArray)nouvelleDonnees;
486
			JSONArray donneesArbre = (JSONArray)nouvelleDonnees;
Line 488... Line 487...
488
			
487
			
Line 489... Line 488...
489
			Object[] arbreEtCorrespondancesIds = MotsClesUtilitaire.construireArbre("Tags", "racine", donneesArbre);
488
			Object[] arbreEtCorrespondancesIds = MotsClesUtilitaire.construireArbre("Tags", "racine", donneesArbre, false);
490
			
489
			
Line 491... Line 490...
491
			arbreMotsCles = (Tree)arbreEtCorrespondancesIds[0];
490
			arbreMotsCles = (Tree)arbreEtCorrespondancesIds[0];
Line 611... Line 610...
611
		String id = usObj[1];
610
		String id = usObj[1];
612
		String parentId = "";
611
		String parentId = "";
Line 613... Line 612...
613
 
612
 
614
		if (!id.equals("racine")) {
613
		if (!id.equals("racine")) {
-
 
614
			String[] parentUsObj = (String[]) n.getParentNode().getUserObject();
615
			String[] parentUsObj = (String[]) n.getParentNode().getUserObject();
615
			if(!parentUsObj[1].equals("racine")) {
616
			parentId = parentUsObj[1];
616
				parentId = parentUsObj[1];
617
		} else {
-
 
618
			parentId = "racine";
617
			}
Line 619... Line 618...
619
		}
618
		}
620
 
619
 
Line 633... Line 632...
633
	 * @param n
632
	 * @param n
634
	 *            le noeud à supprimer
633
	 *            le noeud à supprimer
635
	 * @param arbreMC
634
	 * @param arbreMC
636
	 *            l'arbre des mots clés en cours
635
	 *            l'arbre des mots clés en cours
637
	 */
636
	 */
638
	public void supprimerMotCleDansArbre(TreeNode n, Tree arbreMC) {
637
	public void supprimerMotCleDansArbre(TreeNode n, Tree arbreMC, Rafraichissable r) {
Line 639... Line 638...
639
 
638
 
Line 640... Line 639...
640
		MotsClesAsynchroneDAO MCDao = new MotsClesAsynchroneDAO("images");
639
		MotsClesAsynchroneDAO MCDao = new MotsClesAsynchroneDAO("images");
641
 
640
 
Line 642... Line 641...
642
		String[] usObj = (String[]) n.getUserObject();
641
		String[] usObj = (String[]) n.getUserObject();
Line 643... Line 642...
643
		String id = usObj[1];
642
		String id = usObj[1];
Line 644... Line 643...
644
 
643
 
645
		MCDao.supprimerBaseDeDonnees(id);
644
		MCDao.supprimerBaseDeDonnees(id, r);
Line 664... Line 663...
664
		String id = usObj[1];
663
		String id = usObj[1];
665
		String parentId = "";
664
		String parentId = "";
Line 666... Line 665...
666
 
665
 
667
		if (!id.equals("racine")) {
666
		if (!id.equals("racine")) {
-
 
667
			String[] parentUsObj = (String[]) n.getParentNode().getUserObject();
668
			String[] parentUsObj = (String[]) n.getParentNode().getUserObject();
668
			if(!parentUsObj[1].equals("racine")) {
669
			parentId = parentUsObj[1];
669
				parentId = parentUsObj[1];
670
		} else {
-
 
671
			parentId = "racine";
670
			}
Line 672... Line 671...
672
		}
671
		}
Line 673... Line 672...
673
 
672
 
Line 693... Line 692...
693
 
692
 
694
		String[] usObj = (String[]) n.getUserObject();
693
		String[] usObj = (String[]) n.getUserObject();
695
		String motCle = usObj[0];
694
		String motCle = usObj[0];
696
		String id = usObj[1];
695
		String id = usObj[1];
-
 
696
		String parentId = "";
697
		String parentId = "";
697
		
698
		if (!id.equals("racine")) {
698
		if (!id.equals("racine")) {
-
 
699
			String[] parentUsObj = (String[]) n.getParentNode().getUserObject();
699
			String[] parentUsObj = (String[]) n.getParentNode().getUserObject();
700
			if(!parentUsObj[1].equals("racine")) {
700
			parentId = parentUsObj[1];
701
				parentId = parentUsObj[1];
701
		} else {
-
 
702
			parentId = "racine";
702
			}
Line 703... Line 703...
703
		}
703
		}
Line 704... Line 704...
704
 
704