Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1417 Rev 1428
Line 1... Line 1...
1
package org.tela_botanica.client.modeles.publication;
1
package org.tela_botanica.client.modeles.publication;
Line 2... Line 2...
2
 
2
 
-
 
3
import java.util.Iterator;
3
import java.util.Iterator;
4
import java.util.Map;
Line 4... Line 5...
4
import java.util.Set;
5
import java.util.Set;
5
 
6
 
-
 
7
import org.tela_botanica.client.modeles.aDonnee;
Line 6... Line 8...
6
import org.tela_botanica.client.modeles.aDonnee;
8
import org.tela_botanica.client.modeles.personne.Personne;
Line 7... Line 9...
7
import org.tela_botanica.client.modeles.personne.Personne;
9
import org.tela_botanica.client.util.Debug;
Line 24... Line 26...
24
	public PublicationAPersonne() {
26
	public PublicationAPersonne() {
25
		new PublicationAPersonne(new JSONObject());
27
		new PublicationAPersonne(new JSONObject());
26
	}
28
	}
Line 27... Line 29...
27
	
29
	
28
	public PublicationAPersonne(JSONObject pubAPersListe) {
30
	public PublicationAPersonne(JSONObject pubAPersListe) {
-
 
31
		Personne personne = new Personne(pubAPersListe);
29
		personneLiee = new Personne(pubAPersListe);
32
		setPersonne(personne);
Line 30... Line 33...
30
		publicationLiee = new Publication(pubAPersListe);
33
		publicationLiee = new Publication(pubAPersListe);
31
		
34
		
Line 81... Line 84...
81
	public void setPersonne(Personne personne) {
84
	public void setPersonne(Personne personne) {
82
		personneLiee = personne;
85
		personneLiee = personne;
83
		if (personne != null) {
86
		if (personne != null) {
84
			setIdPersonne(personne.getId());
87
			setIdPersonne(personne.getId());
85
		}
88
		}
-
 
89
		
-
 
90
		Map<String, Object> a = personne.getProperties();
-
 
91
 
-
 
92
		Set<String> cles = a.keySet();
-
 
93
		Iterator<String> it = cles.iterator();
-
 
94
		while (it.hasNext()) {
-
 
95
			String cle = it.next();			
-
 
96
			if (a.get(cle) != null) {
-
 
97
				String cleObjet = cle.replaceFirst("^"+Personne.PREFIXE+"_", "");
-
 
98
				this.set(cleObjet, a.get(cle));
-
 
99
			}
-
 
100
		}
86
	}
101
	}
Line 87... Line 102...
87
	
102
	
88
	// ID
103
	// ID
89
	public String getId() {
104
	public String getId() {
Line 150... Line 165...
150
		set("ce_truk_type", type);
165
		set("ce_truk_type", type);
151
	}
166
	}
152
	public void setFonction(String type, String valeur) {
167
	public void setFonction(String type, String valeur) {
153
		setChaineDenormaliseUnique("ce_truk_type", type, valeur);
168
		setChaineDenormaliseUnique("ce_truk_type", type, valeur);
154
	}
169
	}
-
 
170
	
-
 
171
	// ORDRE DES AUTEURS
-
 
172
	public String getOrdreAuteurs() {
-
 
173
		return renvoyerValeurCorrecte("ordre");
-
 
174
	}
-
 
175
	public void setOrdreAuteurs(String ordre) {
-
 
176
		if (ordre.matches("[0-9]+")) {
-
 
177
			this.set("ordre", ordre);
-
 
178
		}
-
 
179
	}
155
}
180
}
156
181