Subversion Repositories eFlore/Applications.coel

Rev

Rev 194 | Rev 208 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
194 jp_milcent 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 StructureValorisation extends aDonnee {
9
 
10
	public static final String PREFIXE = "csv";
11
 
12
	/**
13
	 * Constructeur vide
14
	 *
15
	 */
16
	public StructureValorisation() {
17
 
18
	}
19
 
20
	/**
21
	 * Constructeur avec un objet JSON
22
	 *
23
	 * @param image
24
	 */
25
	public StructureValorisation(JSONObject valorisation) {
26
		// L'objet JSON est une table de hachage
27
		Set<String> im = valorisation.keySet();
28
 
29
		// Parcourt pour chaque clé
30
		for (Iterator<String> it = im.iterator(); it.hasNext();) {
31
			// Si elle est associée à une valeur, nous l'ajoutons
32
			String cle = it.next();
205 jp_milcent 33
			if (cle.startsWith(PREFIXE+"_")) {
34
				// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
35
				String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
36
				// Sinon, nous ajoutons la clé avec une valeur vide
37
				String valeur = "";
38
				if (valorisation.get(cle).isString() != null) {
39
					valeur = valorisation.get(cle).isString().stringValue();
40
				}
41
				this.set(cleObjet, valeur);
194 jp_milcent 42
			}
43
		}
44
	}
45
 
46
	// ACTION
47
	public String getAction() {
48
		return renvoyerValeurCorrecte("mark_action");
49
	}
50
	public void setAction(String a) {
51
		this.set("mark_action", a);
52
	}
53
 
54
	// ACTION INFO
55
	public String getActionInfo() {
56
		return renvoyerValeurCorrecte("truk_action");
57
	}
58
	public void setActionInfo(String a) {
59
		this.set("truk_action", a);
60
	}
61
	public void setActionInfo(String type, Object valeur) {
62
		setChaineDenormalise("truk_action", type, valeur);
63
	}
64
 
65
	// PUBLICATION
66
	public String getPublication() {
67
		return renvoyerValeurCorrecte("publication");
68
	}
69
	public void setPublication(String p) {
70
		this.set("publication", p);
71
	}
72
 
73
	// COLLECTION AUTRE
74
	public String getCollectionAutre() {
75
		return renvoyerValeurCorrecte("collection_autre");
76
	}
77
	public void setCollectionAutre(String ca) {
78
		this.set("collection_autre", ca);
79
	}
205 jp_milcent 80
	public void setCollectionAutre(String type, Object valeur) {
81
		setChaineDenormalise("collection_autre", type, valeur);
82
	}
194 jp_milcent 83
 
84
	// ACTION FUTURE
85
	public String getActionFuture() {
86
		return renvoyerValeurCorrecte("mark_action_future");
87
	}
88
	public void setActionFuture(String af) {
89
		this.set("mark_action_future", af);
90
	}
91
 
205 jp_milcent 92
	// ACTION FUTURE INFO
194 jp_milcent 93
	public String getActionFutureInfo() {
94
		return renvoyerValeurCorrecte("action_future");
95
	}
96
	public void setActionFutureInfo(String af) {
97
		this.set("action_future", af);
98
	}
205 jp_milcent 99
 
194 jp_milcent 100
 
205 jp_milcent 101
	// RECHERCHE
102
	public String getRecherche() {
103
		return renvoyerValeurCorrecte("mark_recherche");
104
	}
105
	public void setRecherche(String r) {
106
		this.set("mark_recherche", r);
107
	}
108
 
109
	// RECHERCHE PROVENANCE
110
	public String getRechercheProvenance() {
111
		return renvoyerValeurCorrecte("truk_recherche_provenance");
112
	}
113
	public void setRechercheProvenance(String rp) {
114
		this.set("truk_recherche_provenance", rp);
115
	}
116
	public void setRechercheProvenance(String type, Object valeur) {
117
		setChaineDenormalise("truk_recherche_provenance", type, valeur);
118
	}
119
 
120
	// RECHERCHE TYPE
121
	public String getRechercheType() {
122
		return renvoyerValeurCorrecte("truk_recherche_type");
123
	}
124
	public void setRechercheType(String rt) {
125
		this.set("truk_recherche_type", rt);
126
	}
127
	public void setRechercheType(String type, Object valeur) {
128
		setChaineDenormalise("truk_recherche_type", type, valeur);
129
	}
130
 
131
	// ACCES SANS MOTIF
132
	public String getAccesSansMotif() {
133
		return renvoyerValeurCorrecte("mark_acces_ss_motif");
134
	}
135
	public void setAccesSansMotif(String asm) {
136
		this.set("mark_acces_ss_motif", asm);
137
	}
138
 
139
	// ACCES SANS MOTIF INFO
140
	public String getAccesSansMotifInfo() {
141
		return renvoyerValeurCorrecte("acces_ss_motif");
142
	}
143
	public void setAccesSansMotifInfo(String asm) {
144
		this.set("acces_ss_motif", asm);
145
	}
146
 
147
	// VISITE AVEC MOTIF
148
	public String getVisiteAvecMotif() {
149
		return renvoyerValeurCorrecte("mark_visite_avec_motif");
150
	}
151
	public void setVisiteAvecMotif(String vam) {
152
		this.set("mark_visite_avec_motif", vam);
153
	}
154
 
155
	// VISITE AVEC MOTIF INFO
156
	public String getVisiteAvecMotifInfo() {
157
		return renvoyerValeurCorrecte("visite_avec_motif");
158
	}
159
	public void setVisiteAvecMotifInfo(String vam) {
160
		this.set("visite_avec_motif", vam);
161
	}
162
 
163
 
194 jp_milcent 164
}