| 147 |
gduche |
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 Projet extends aDonnee {
|
| 748 |
jpm |
9 |
|
|
|
10 |
private static final long serialVersionUID = 6733053168274995082L;
|
|
|
11 |
|
|
|
12 |
private static final String PREFIXE = "cpr";
|
|
|
13 |
|
| 147 |
gduche |
14 |
public Projet() {
|
|
|
15 |
this.set("mark_contact", false);
|
|
|
16 |
}
|
|
|
17 |
|
|
|
18 |
public Projet(JSONObject liste) {
|
|
|
19 |
// l'objet JSON est une table de hachage
|
|
|
20 |
Set<String> im = liste.keySet();
|
|
|
21 |
|
|
|
22 |
// Parcourt pour chaque clé
|
|
|
23 |
for (Iterator<String> it = im.iterator(); it.hasNext();) {
|
|
|
24 |
// Si elle est associée à une valeur, nous l'ajoutons
|
|
|
25 |
String cle = it.next();
|
|
|
26 |
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
|
| 748 |
jpm |
27 |
String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
|
| 147 |
gduche |
28 |
if (liste.get(cle).isString() != null) {
|
|
|
29 |
String valeur = liste.get(cle).isString().stringValue();
|
|
|
30 |
this.set(cleObjet, valeur);
|
|
|
31 |
} else {
|
|
|
32 |
// Sinon, nous ajoutons la clé avec une valeur vide
|
|
|
33 |
String valeur = " ";
|
|
|
34 |
this.set(cleObjet, valeur);
|
|
|
35 |
}
|
|
|
36 |
}
|
|
|
37 |
}
|
|
|
38 |
|
| 748 |
jpm |
39 |
@Override
|
|
|
40 |
protected String getPrefixe() {
|
|
|
41 |
return PREFIXE;
|
|
|
42 |
}
|
| 147 |
gduche |
43 |
|
|
|
44 |
public String getId() {
|
| 804 |
jpm |
45 |
return renvoyerValeurCorrecte("id_projet");
|
| 147 |
gduche |
46 |
}
|
|
|
47 |
|
|
|
48 |
public String getNom() {
|
| 804 |
jpm |
49 |
return renvoyerValeurCorrecte("nom");
|
| 147 |
gduche |
50 |
}
|
| 804 |
jpm |
51 |
|
|
|
52 |
public String getAbreviation() {
|
|
|
53 |
return renvoyerValeurCorrecte("abreviation");
|
|
|
54 |
}
|
| 838 |
aurelien |
55 |
|
|
|
56 |
public String getResume() {
|
|
|
57 |
return renvoyerValeurCorrecte("resume");
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
public String getDescription() {
|
|
|
61 |
return renvoyerValeurCorrecte("description");
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
public String getUrl() {
|
|
|
65 |
return renvoyerValeurCorrecte("url");
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
public String getMotsCles() {
|
|
|
69 |
return renvoyerValeurCorrecte("mot_cles ");
|
|
|
70 |
}
|
|
|
71 |
|
|
|
72 |
public String getCitation() {
|
|
|
73 |
return renvoyerValeurCorrecte("citation ");
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
public String getLicence() {
|
|
|
77 |
return renvoyerValeurCorrecte("licence ");
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
public String getLangue() {
|
|
|
81 |
return renvoyerValeurCorrecte("ce_langue ");
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
public String getIndexationHeure() {
|
|
|
85 |
return renvoyerValeurCorrecte("indexation_heure ");
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
public String getIndexationDuree() {
|
|
|
89 |
return renvoyerValeurCorrecte("ce_indexation_duree ");
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
public String getIndexationFreq() {
|
|
|
93 |
return renvoyerValeurCorrecte("ce_indexation_freq ");
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
public String getMarkPublic() {
|
|
|
97 |
return renvoyerValeurCorrecte("mark_public ");
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
public String getMeta() {
|
|
|
101 |
return renvoyerValeurCorrecte("ce_meta ");
|
|
|
102 |
}
|
| 147 |
gduche |
103 |
|
| 877 |
aurelien |
104 |
public void setId(String projetId) {
|
|
|
105 |
set("id_projet", projetId);
|
|
|
106 |
}
|
|
|
107 |
|
| 147 |
gduche |
108 |
}
|