Subversion Repositories eFlore/Applications.coel

Rev

Rev 1136 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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