Subversion Repositories eFlore/Applications.coel

Rev

Rev 1135 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
935 jpm 1
package org.tela_botanica.client.modeles.projet;
838 aurelien 2
 
3
import java.util.Iterator;
4
import java.util.Set;
5
 
935 jpm 6
import org.tela_botanica.client.modeles.aDonnee;
7
 
838 aurelien 8
import com.google.gwt.json.client.JSONObject;
9
 
10
public class ProjetVersion extends aDonnee {
11
 
12
	/**
13
	 *
14
	 */
15
	private static final long serialVersionUID = 1L;
16
 
17
	private static final String PREFIXE = "cprv";
18
 
19
	public ProjetVersion() {
20
		//this.set("mark_contact", false);
21
		super();
22
	}
23
 
24
	public ProjetVersion(JSONObject liste) {
25
		// l'objet JSON est une table de hachage
26
		Set<String> im = liste.keySet();
27
 
28
		// Parcourt pour chaque clé
29
		for (Iterator<String> it = im.iterator(); it.hasNext();) {
30
			// Si elle est associée à une valeur, nous l'ajoutons
31
			String cle = it.next();
32
			// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
33
			String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
34
			if (liste.get(cle).isString() != null) {
35
				String valeur = liste.get(cle).isString().stringValue();
36
				this.set(cleObjet, valeur);
37
			} else {
38
				// Sinon, nous ajoutons la clé avec une valeur vide
39
				String valeur = " ";
40
				this.set(cleObjet, valeur);
41
			}
42
		}
43
	}
44
 
45
	@Override
46
	protected String getPrefixe() {
47
		return PREFIXE;
48
	}
49
 
50
	public String getIdVersion() {
51
		return renvoyerValeurCorrecte("id_version");
52
	}
53
 
54
	public String getIdProjet() {
55
		return renvoyerValeurCorrecte("id_projet");
56
	}
57
 
58
	public String getNom() {
59
		return renvoyerValeurCorrecte("nom");
60
	}
61
 
62
	public String getCode() {
63
		return renvoyerValeurCorrecte("code");
64
	}
65
 
66
	public String getDateDebut() {
67
		return renvoyerValeurCorrecte("date_debut");
68
	}
69
 
70
	public String getDateFin() {
71
		return renvoyerValeurCorrecte("date_fin");
72
	}
73
 
74
	public String getMeta() {
75
		return renvoyerValeurCorrecte("ce_meta ");
76
	}
77
 
78
 
79
}