Subversion Repositories eFlore/Applications.coel

Rev

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