Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1383 Rev 1485
Line 5... Line 5...
5
import java.util.Map;
5
import java.util.Map;
6
import java.util.Set;
6
import java.util.Set;
Line 7... Line 7...
7
 
7
 
8
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.Mediateur;
-
 
9
import org.tela_botanica.client.modeles.aDonnee;
9
import org.tela_botanica.client.modeles.aDonnee;
10
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
10
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
11
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
11
import org.tela_botanica.client.util.Debug;
12
import org.tela_botanica.client.util.Debug;
Line 12... Line 13...
12
import org.tela_botanica.client.util.UtilString;
13
import org.tela_botanica.client.util.UtilString;
Line 19... Line 20...
19
public class Personne extends aDonnee {
20
public class Personne extends aDonnee {
Line 20... Line 21...
20
 
21
 
Line 21... Line 22...
21
	private static final long serialVersionUID = -6974716696155349332L;
22
	private static final long serialVersionUID = -6974716696155349332L;
-
 
23
 
22
 
24
	public static final String PREFIXE = "cp";
23
	public static final String PREFIXE = "cp";
25
	private boolean removePrefix = true;
24
	public static final String TELEPHONE_FIXE = "FIX";
26
	public static final String TELEPHONE_FIXE = "FIX";
25
	public static final String TELEPHONE_GSM = "GSM";
27
	public static final String TELEPHONE_GSM = "GSM";
26
	public static final String TELEPHONE_FAX = "FAX";
28
	public static final String TELEPHONE_FAX = "FAX";
Line 31... Line 33...
31
	private PublicationAPersonneListe publicationsLiees= null;
33
	private PublicationAPersonneListe publicationsLiees= null;
Line 32... Line 34...
32
	
34
	
33
	public Personne() {
35
	public Personne() {
Line 34... Line 36...
34
	}
36
	}
-
 
37
 
-
 
38
	public Personne(ModelData model) {
-
 
39
		creerPersonne(model, false);
-
 
40
	}
-
 
41
	
35
 
42
	public Personne(ModelData model, boolean removePrefix) {
-
 
43
		creerPersonne(model, removePrefix);
-
 
44
	}
-
 
45
	
-
 
46
	private void creerPersonne(ModelData model, boolean removePrefix) {
-
 
47
		
36
	public Personne(ModelData model)
48
		this.removePrefix = removePrefix;
Line 37... Line 49...
37
	{
49
		
38
		Map<String, Object> a = model.getProperties();
50
		Map<String, Object> a = model.getProperties();
39
 
51
 
40
		Set<String> cles = a.keySet();
52
		Set<String> cles = a.keySet();
41
		Iterator<String> it = cles.iterator();
53
		Iterator<String> it = cles.iterator();
-
 
54
		while (it.hasNext()) {
-
 
55
			String cle = it.next();			
42
		while (it.hasNext()) {
56
			if (a.get(cle) != null) {
-
 
57
				String cleObjet = "";
-
 
58
				if (removePrefix) {
-
 
59
					cleObjet = cleObjet.replaceFirst("^"+PREFIXE+"_", "");
-
 
60
				}
43
			String cle = it.next();			
61
				else {
44
			if (a.get(cle) != null) {
62
					cleObjet = cle;
45
				String cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
63
				}
46
				this.set(cleObjet, a.get(cle));
64
				this.set(cleObjet, a.get(cle));
Line 47... Line 65...
47
			}
65
			}
48
		}
66
		}
49
	}	
67
	}
50
	
68