Subversion Repositories eFlore/Applications.coel

Rev

Rev 756 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 756 Rev 783
Line 1... Line 1...
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
Line 2... Line -...
2
 
-
 
3
import java.util.Iterator;
-
 
4
import java.util.Set;
-
 
5
 
2
 
Line 6... Line 3...
6
import com.google.gwt.json.client.JSONObject;
3
import com.google.gwt.json.client.JSONObject;
Line 7... Line 4...
7
 
4
 
Line 13... Line 10...
13
	
10
	
14
	public Publication() {	
11
	public Publication() {	
Line 15... Line 12...
15
	}
12
	}
16
	
-
 
17
	public Publication(JSONObject publication) {
13
	
18
		// l'objet JSON est une table de hachage
-
 
19
		Set<String> im = publication.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();
-
 
25
			// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
-
 
26
			String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
-
 
27
			// Valeur vide par défaut
-
 
28
			String valeur = "";
-
 
29
			if (publication.get(cle).isString() != null) {
-
 
30
				valeur = publication.get(cle).isString().stringValue();
-
 
31
				this.set(cleObjet, valeur);
-
 
32
			} else {
-
 
33
				this.set(cleObjet, valeur);
-
 
34
			}
14
	public Publication(JSONObject publication) {
Line 35... Line 15...
35
		}
15
		initialiserModele(publication);
36
	}
16
	}
37
	
17
	
38
	@Override
18
	@Override
39
	protected String getPrefixe() {
19
	protected String getPrefixe() {
40
		return PREFIXE;
-
 
41
	}
-
 
42
	
-
 
43
	public Publication(String nom_complet, String uri, String auteur, String collection, String titre, String editeur,
-
 
44
			String dateParution, String indicationNvt, String fascicule, String pages) {
-
 
45
		this.set("fmt_nom_complet", nom_complet);
-
 
46
		this.set("ce_projet", "");
-
 
47
		this.set("uri", uri);
-
 
48
		this.set("fmt_auteur", auteur);
-
 
49
		this.set("collection", collection);
-
 
50
		this.set("titre", titre);
-
 
51
		this.set("ce_truk_editeur", editeur);
-
 
52
		this.set("date_parution", dateParution);
-
 
53
		this.set("indication_nvt", indicationNvt);
-
 
54
		this.set("fascicule", fascicule);
-
 
55
		this.set("truk_pages", pages);
-
 
56
		this.set("ce_meta", "");
-
 
57
	}
-
 
58
	
-
 
59
	public Publication(String idPublication,String idProjet, String nom_complet, String uri, String auteur, String collection, String titre, String editeur,
-
 
60
			String dateParution, String indicationNvt, String fascicule, String pages) {
-
 
61
		this.set("id_publication", idPublication);
-
 
62
		this.set("ce_projet", idProjet);
-
 
63
		this.set("fmt_nom_complet", nom_complet);
-
 
64
		this.set("uri", uri);
-
 
65
		this.set("fmt_auteur", auteur);
-
 
66
		this.set("collection", collection);
-
 
67
		this.set("titre", titre);
-
 
68
		this.set("ce_truk_editeur", editeur);
-
 
69
		this.set("date_parution", dateParution);
-
 
70
		this.set("indication_nvt", indicationNvt);
-
 
71
		this.set("fascicule", fascicule);
-
 
72
		this.set("truk_pages", pages);
-
 
73
		this.set("ce_meta", "");
20
		return PREFIXE;
74
	}
21
	}
75
	
22
		
Line 76... Line 23...
76
	public String getNomEditeur() {
23
	public String getNomEditeur() {
77
		return (String) renvoyerValeurCorrecte("cs_nom");
24
		return renvoyerValeurCorrecte("cs_nom");
-
 
25
	}
-
 
26
 
-
 
27
	public String getId() {
78
	}
28
		return renvoyerValeurCorrecte("id_publication");
Line 79... Line 29...
79
 
29
	}
80
	public String getId() {
30
	public void setId(String idPublication) {
-
 
31
		this.set("id_publication", idPublication);
-
 
32
	}
-
 
33
	
81
		return (String) renvoyerValeurCorrecte("id_publication");
34
	public String getIdProjet() {
Line 82... Line 35...
82
	}
35
		return renvoyerValeurCorrecte("ce_projet");
83
	
36
	}
-
 
37
	public void setIdProjet(String idProjet) {
-
 
38
		this.set("ce_projet", idProjet);
-
 
39
	}
84
	public String getProjet() {
40
	
Line 85... Line 41...
85
		return (String) renvoyerValeurCorrecte("ce_projet");
41
	public String getNomComplet() {
86
	}
42
		return renvoyerValeurCorrecte("fmt_nom_complet");
-
 
43
	}
-
 
44
	public void setNomComplet(String nomComplet) {
-
 
45
		this.set("fmt_nom_complet", nomComplet);
87
	
46
	}
Line 88... Line 47...
88
	public String getNomComplet() {
47
	
89
		return (String) renvoyerValeurCorrecte("fmt_nom_complet");
48
	public String getURI() {
-
 
49
		return renvoyerValeurCorrecte("uri");
-
 
50
	}
-
 
51
	public void setUri(String uri) {
90
	}
52
		this.set("uri", uri);
Line 91... Line 53...
91
	
53
	}
92
	public String getURI() {
54
 
-
 
55
	public String getAuteur() {
-
 
56
		return renvoyerValeurCorrecte("fmt_auteur");
-
 
57
	}
93
		return (String) renvoyerValeurCorrecte("uri");
58
	public void setAuteur(String auteurFormate) {
Line 94... Line 59...
94
	}
59
		this.set("fmt_auteur", auteurFormate);
95
 
60
	}
-
 
61
 
-
 
62
	public String getCollection() {
-
 
63
		return renvoyerValeurCorrecte("collection");
96
	public String getAuteur() {
64
	}
Line 97... Line 65...
97
		return (String) renvoyerValeurCorrecte("fmt_auteur");
65
	public void setCollection(String collection) {
98
	}
66
		this.set("collection", collection);
-
 
67
	}
-
 
68
	
-
 
69
	public String getTitre() {
99
 
70
		return renvoyerValeurCorrecte("titre");
Line 100... Line 71...
100
	public String getCollection() {
71
	}
101
		return (String) renvoyerValeurCorrecte("collection");
72
	public void setTitre(String titre) {
-
 
73
		this.set("titre", titre);
-
 
74
	}
-
 
75
 
102
	}
76
	public String getEditeur() {
Line 103... Line 77...
103
	
77
		return renvoyerValeurCorrecte("ce_truk_editeur");
104
	public String getTitre() {
78
	}
-
 
79
	public void setEditeur(String editeur) {
-
 
80
		this.set("ce_truk_editeur", editeur);
-
 
81
	}
105
		return (String) renvoyerValeurCorrecte("titre");
82
 
Line 106... Line 83...
106
	}
83
	public String getDateParution() {
107
 
84
		return renvoyerValeurCorrecte("date_parution");
-
 
85
	}
-
 
86
	public void setDateParution(String date) {
-
 
87
		this.set("date_parution", date);
108
	public String getEditeur() {
88
	}
Line 109... Line 89...
109
		return (String) renvoyerValeurCorrecte("ce_truk_editeur");
89
 
110
	}
90
	public String getIndicationNvt() {
111
 
91
		return renvoyerValeurCorrecte("indication_nvt");
112
	public String getDateParution() {
-
 
113
		return (String) renvoyerValeurCorrecte("date_parution");
92
	}
114
	}
93
	public void setIndicationNvt(String nvt) {
115
 
94
		this.set("indication_nvt", nvt);
-
 
95
	}
116
	public String getIndicationNvt() {
96
	
117
		return (String) renvoyerValeurCorrecte("indication_nvt");
97
	public String getFascicule() {