Subversion Repositories eFlore/Applications.coel

Rev

Rev 242 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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