Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 119 Rev 132
Line 1... Line 1...
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
Line -... Line 2...
-
 
2
 
2
 
3
import java.util.Collection;
3
import java.util.Iterator;
4
import java.util.Iterator;
Line 4... Line 5...
4
import java.util.Set;
5
import java.util.Set;
Line 5... Line 6...
5
 
6
 
Line 6... Line 7...
6
import com.google.gwt.json.client.JSONObject;
7
import com.google.gwt.json.client.JSONObject;
7
 
8
 
8
public class Utilisateur extends aDonnee {
9
public class Utilisateur extends aDonnee {
9
 
10
 
Line 10... Line 11...
10
	public Utilisateur(String login, boolean identifie) {
11
	public Utilisateur(String id, boolean identifie) {
11
		set("login", login);
12
		set("id_personne", id);
Line 36... Line 37...
36
				this.set(cleObjet, valeur);
37
				this.set(cleObjet, valeur);
37
			}
38
			}
38
		}
39
		}
39
	}
40
	}
Line 40... Line 41...
40
	
41
	
41
	public void setNom(String nom) {
42
	public void setId(String id) {
42
		set("nom", nom);
43
		set("id_personne", id);
Line -... Line 44...
-
 
44
	}
-
 
45
	
-
 
46
	public void setNomComplet(String nom_complet) {
-
 
47
		set("fmt_nom_complet", nom_complet);
43
	}
48
	}
44
	
49
 
45
	public void setPrenom(String prenom) {
50
	public void setPrenom(String prenom) {
Line -... Line 51...
-
 
51
		set("prenom", prenom);
-
 
52
	}
-
 
53
	
-
 
54
	public void setNom(String nom) {
46
		set("prenom", prenom);
55
		set("nom", nom);
47
	}
56
	}
48
	
57
	
Line 49... Line 58...
49
	public void setIdentifie(Boolean bool) {
58
	public void setIdentifie(Boolean bool) {
Line 55... Line 64...
55
	}
64
	}
Line 56... Line 65...
56
	
65
	
57
	public void setMotDePasse(String mdp) {
66
	public void setMotDePasse(String mdp) {
58
		set("mot_de_passe", mdp);
67
		set("mot_de_passe", mdp);
59
	}
68
	}
60
 
69
	
61
	/**
70
	/**
62
	 * Retourne l'id de l'utilisateur ou l'identifiant de session si la personne n'est pas identifiée.
71
	 * Retourne l'id de l'utilisateur ou l'identifiant de session si la personne n'est pas identifiée.
63
	 * @return String id de l'utilisateur
72
	 * @return String id de l'utilisateur
64
	 */
73
	 */
65
	public String getId() {
74
	public String getId() {
66
		return get("id_personne");
75
		return get("id_personne");
-
 
76
	}
-
 
77
 
-
 
78
	/**
-
 
79
	 * Retourne le nom complet et formaté de l'utilisateur
-
 
80
	 * @return String nom complet
-
 
81
	 */
-
 
82
	public String getNomComplet() {
-
 
83
		return get("fmt_nom_complet");
-
 
84
	}
-
 
85
 
-
 
86
	/**
-
 
87
	 * Retourne le prénom de l'utilisateur
-
 
88
	 * @return String prénom
-
 
89
	 */
-
 
90
	public String getPrenom() {
-
 
91
		return get("prenom");
-
 
92
	}
-
 
93
	
-
 
94
	/**
-
 
95
	 * Retourne le nom de l'utilisateur
-
 
96
	 * @return String nom
-
 
97
	 */
-
 
98
	public String getNom() {
-
 
99
		return get("nom");
Line 67... Line 100...
67
	}
100
	}
68
	
101
	
69
	/**
102
	/**
70
	 * Retourne le login de l'utilisateur ou l'identifiant de session si la personne n'est pas identifiée.
103
	 * Retourne le login de l'utilisateur ou l'identifiant de session si la personne n'est pas identifiée.
Line 88... Line 121...
88
	 */
121
	 */
89
	public boolean isIdentifie() {
122
	public boolean isIdentifie() {
90
		return get("identifie");
123
		return get("identifie");
91
	}
124
	}
Line -... Line 125...
-
 
125
	
-
 
126
	public String toString() {
-
 
127
		String chaine = new String();
-
 
128
		for (Iterator<String> it = this.getPropertyNames().iterator(); it.hasNext();) {
-
 
129
			// Si elle est associée à une valeur, nous l'ajoutons
-
 
130
			String cle = it.next();
-
 
131
		
-
 
132
			// GXT ne prend pas en compte /n ou /r/n...
-
 
133
			chaine += cle+" : "+get(cle)+"\n";
-
 
134
		}
-
 
135
		return chaine;
-
 
136
	}
92
	
137