Subversion Repositories eFlore/Applications.coel

Rev

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

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