Subversion Repositories eFlore/Applications.coel

Rev

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

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