Subversion Repositories eFlore/Applications.coel

Rev

Rev 748 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
741 aurelien 1
package org.tela_botanica.client.modeles;
2
 
3
import java.util.Iterator;
4
import java.util.Set;
5
 
6
import com.google.gwt.json.client.JSONObject;
7
 
8
public class PublicationAPersonne extends aDonnee {
9
 
10
	private static final long serialVersionUID = 7769105365939978129L;
11
 
12
	public PublicationAPersonne(JSONObject pubAPersListe) {
13
		// l'objet JSON est une table de hachage
14
		Set<String> im = pubAPersListe.keySet();
15
 
16
		// Parcourt pour chaque clé
17
		for (Iterator<String> it = im.iterator(); it.hasNext();) {
18
			// Si elle est associée à une valeur, nous l'ajoutons
19
			String cle = it.next();
20
			// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
21
			if (pubAPersListe.get(cle).isString() != null) {
22
				String valeur = pubAPersListe.get(cle).isString().stringValue();
23
				this.set(cle, valeur);
24
			} else {
25
				// Sinon, nous ajoutons la clé avec une valeur vide
26
				String valeur = " ";
27
				this.set(cle, valeur);
28
			}
29
		}
30
	}
31
 
32
	public String getNomCompletAuteur() {
33
		return renvoyerValeurCorrecte("cp_fmt_nom_complet");
34
	}
35
 
36
	public String getNomAuteur() {
37
		return renvoyerValeurCorrecte("cp_nom");
38
	}
39
 
40
	public String getPrenomAuteur() {
41
		return renvoyerValeurCorrecte("cp_prenom");
42
	}
43
 
44
	public String getIdAuteur() {
45
		return renvoyerValeurCorrecte("cp_id_personne");
46
	}
47
 
48
	public String getPublication() {
49
		return renvoyerValeurCorrecte("cpuap_id_publication");
50
	}
51
}