Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1329 Rev 1369
1
package org.tela_botanica.client.modeles.publication;
1
package org.tela_botanica.client.modeles.publication;
2
 
2
 
3
import org.tela_botanica.client.modeles.aDonnee;
3
import org.tela_botanica.client.modeles.aDonnee;
4
import org.tela_botanica.client.modeles.structure.Structure;
4
import org.tela_botanica.client.modeles.structure.Structure;
-
 
5
import org.tela_botanica.client.util.UtilString;
5
 
6
 
6
import com.google.gwt.json.client.JSONObject;
7
import com.google.gwt.json.client.JSONObject;
7
 
8
 
8
public class Publication extends aDonnee {
9
public class Publication extends aDonnee {
9
 
10
 
10
	private static final long serialVersionUID = 4142843068041690126L;
11
	private static final long serialVersionUID = 4142843068041690126L;
11
 
12
 
12
	private static final String PREFIXE = "cpu";
13
	private static final String PREFIXE = "cpu";
13
	private Structure editeur = null;
14
	private Structure editeur = null;
14
	public static String[] champsObligatoires = {"cpu_id_publication"};
15
	public static String[] champsObligatoires = {"cpu_id_publication"};
15
	
16
	
16
	public Publication() {	
17
	public Publication() {	
17
	}
18
	}
18
	
19
	
19
	public Publication(JSONObject publication) {
20
	public Publication(JSONObject publication) {
20
		initialiserModele(publication);
21
		initialiserModele(publication);
21
		editeur = new Structure(publication);
22
		editeur = new Structure(publication);
22
	}
23
	}
23
	
24
	
24
	@Override
25
	@Override
25
	protected String getPrefixe() {
26
	protected String getPrefixe() {
26
		return PREFIXE;
27
		return PREFIXE;
27
	}
28
	}
28
		
29
		
29
	protected String[] getChampsObligatoires()	{
30
	protected String[] getChampsObligatoires()	{
30
		return champsObligatoires;
31
		return champsObligatoires;
31
	}
32
	}
32
	
33
	
33
	public void setStructureEditeur(Structure structure) {
34
	public void setStructureEditeur(Structure structure) {
34
		editeur = structure;
35
		editeur = structure;
35
	}
36
	}
36
	
37
	
37
	public String getId() {
38
	public String getId() {
38
		return renvoyerValeurCorrecte("id_publication");
39
		return renvoyerValeurCorrecte("id_publication");
39
	}
40
	}
40
	public void setId(String idPublication) {
41
	public void setId(String idPublication) {
41
		this.set("id_publication", idPublication);
42
		this.set("id_publication", idPublication);
42
	}
43
	}
43
	
44
	
44
	public String getIdProjet() {
45
	public String getIdProjet() {
45
		return renvoyerValeurCorrecte("ce_projet");
46
		return renvoyerValeurCorrecte("ce_projet");
46
	}
47
	}
47
	public void setIdProjet(String idProjet) {
48
	public void setIdProjet(String idProjet) {
48
		this.set("ce_projet", idProjet);
49
		this.set("ce_projet", idProjet);
49
	}
50
	}
50
	
51
	
51
	public String getNomComplet() {
52
	public String getNomComplet() {
52
		return renvoyerValeurCorrecte("fmt_nom_complet");
53
		return renvoyerValeurCorrecte("fmt_nom_complet");
53
	}
54
	}
54
	public void setNomComplet(String nomComplet) {
55
	public void setNomComplet(String nomComplet) {
55
		this.set("fmt_nom_complet", nomComplet);
56
		this.set("fmt_nom_complet", nomComplet);
56
	}
57
	}
57
	
58
	
58
	public String getURI() {
59
	public String getURI() {
59
		return renvoyerValeurCorrecte("uri");
60
		return renvoyerValeurCorrecte("uri");
60
	}
61
	}
61
	public void setUri(String uri) {
62
	public void setUri(String uri) {
62
		this.set("uri", uri);
63
		this.set("uri", uri);
63
	}
64
	}
64
 
65
 
65
	public String getAuteur() {
66
	public String getAuteur() {
66
		return renvoyerValeurCorrecte("fmt_auteur");
67
		return renvoyerValeurCorrecte("fmt_auteur");
67
	}
68
	}
68
	public void setAuteur(String auteurFormate) {
69
	public void setAuteur(String auteurFormate) {
69
		this.set("fmt_auteur", auteurFormate);
70
		this.set("fmt_auteur", auteurFormate);
70
	}
71
	}
71
 
72
 
72
	public String getCollection() {
73
	public String getCollection() {
73
		return renvoyerValeurCorrecte("collection");
74
		return renvoyerValeurCorrecte("collection");
74
	}
75
	}
75
	public void setCollection(String collection) {
76
	public void setCollection(String collection) {
76
		this.set("collection", collection);
77
		this.set("collection", collection);
77
	}
78
	}
78
	
79
	
79
	public String getTitre() {
80
	public String getTitre() {
80
		return renvoyerValeurCorrecte("titre");
81
		return renvoyerValeurCorrecte("titre");
81
	}
82
	}
82
	public void setTitre(String titre) {
83
	public void setTitre(String titre) {
83
		this.set("titre", titre);
84
		this.set("titre", UtilString.ucFirst(titre));
84
	}
85
	}
85
 
86
 
86
	public String getNomEditeur() {
87
	public String getNomEditeur() {
87
		String editeurNom = getEditeur();
88
		String editeurNom = getEditeur();
88
		if (editeurNom.matches("[0-9]+")) {
89
		if (editeurNom.matches("[0-9]+")) {
89
			editeurNom = editeur.getNom();
90
			editeurNom = editeur.getNom();
90
		}
91
		}
91
		return editeurNom;
92
		return editeurNom;
92
	}
93
	}
93
	public String getEditeur() {
94
	public String getEditeur() {
94
		return getChaineDenormaliseUnique("ce_truk_editeur");
95
		return getChaineDenormaliseUnique("ce_truk_editeur");
95
	}
96
	}
96
	public void setEditeur(String editeur) {
97
	public void setEditeur(String editeur) {
97
		setChaineDenormaliseUnique("ce_truk_editeur", "AUTRE", editeur);
98
		setChaineDenormaliseUnique("ce_truk_editeur", "AUTRE", editeur);
98
	}
99
	}
99
 
100
 
100
	public String getAnneeParution() {
101
	public String getAnneeParution() {
101
		return renvoyerValeurCorrecte("date_parution").substring(0, 4);
102
		return renvoyerValeurCorrecte("date_parution").substring(0, 4);
102
	}
103
	}
103
	public String getDateParution() {
104
	public String getDateParution() {
104
		return renvoyerValeurCorrecte("date_parution");
105
		return renvoyerValeurCorrecte("date_parution");
105
	}
106
	}
106
	public void setDateParution(String date) {
107
	public void setDateParution(String date) {
107
		this.set("date_parution", date);
108
		this.set("date_parution", date);
108
	}
109
	}
109
 
110
 
110
	public String getIndicationNvt() {
111
	public String getIndicationNvt() {
111
		return renvoyerValeurCorrecte("indication_nvt");
112
		return renvoyerValeurCorrecte("indication_nvt");
112
	}
113
	}
113
	public void setIndicationNvt(String nvt) {
114
	public void setIndicationNvt(String nvt) {
114
		this.set("indication_nvt", nvt);
115
		this.set("indication_nvt", nvt);
115
	}
116
	}
116
	
117
	
117
	public String getFascicule() {
118
	public String getFascicule() {
118
		return renvoyerValeurCorrecte("fascicule");
119
		return renvoyerValeurCorrecte("fascicule");
119
	}
120
	}
120
	public void setFascicule(String fascicule) {
121
	public void setFascicule(String fascicule) {
121
		this.set("fascicule", fascicule);
122
		this.set("fascicule", fascicule);
122
	}
123
	}
123
	
124
	
124
	public String getPages() {
125
	public String getPages() {
125
		return renvoyerValeurCorrecte("truk_pages");
126
		return renvoyerValeurCorrecte("truk_pages");
126
	}
127
	}
127
	public void setPages(String pages) {
128
	public void setPages(String pages) {
128
		this.set("truk_pages", pages);
129
		this.set("truk_pages", pages);
129
	}
130
	}
130
	
131
	
131
}
132
}