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