Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1234 Rev 1314
1
package org.tela_botanica.del.client.cache;
1
package org.tela_botanica.del.client.cache;
2
 
2
 
3
import java.util.List;
3
import java.util.List;
4
 
4
 
5
import org.tela_botanica.del.client.gestionhistorique.ConstantesNavigation;
5
import org.tela_botanica.del.client.gestionhistorique.ConstantesNavigation;
6
import org.tela_botanica.del.client.modeles.Image;
6
import org.tela_botanica.del.client.modeles.Image;
7
import org.tela_botanica.del.client.modeles.InformationsRecherche;
7
import org.tela_botanica.del.client.modeles.InformationsRecherche;
8
import org.tela_botanica.del.client.modeles.Observation;
8
import org.tela_botanica.del.client.modeles.Observation;
9
import org.tela_botanica.del.client.modeles.Protocole;
9
import org.tela_botanica.del.client.modeles.Protocole;
10
import org.tela_botanica.del.client.modeles.Utilisateur;
10
import org.tela_botanica.del.client.modeles.Utilisateur;
11
 
-
 
12
import com.google.gwt.user.client.Window;
11
 
13
import com.google.gwt.user.client.Window.Location;
12
import com.google.gwt.user.client.Window.Location;
14
 
13
 
15
public class CacheClient {
14
public class CacheClient {
16
 
15
 
17
	private List<Protocole> listeProtocoles;
16
	private List<Protocole> listeProtocoles;
18
	
17
	
19
	private String home = ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS;
18
	private String home = ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS;
20
	private Observation observationCourante;
19
	private Observation observationCourante;
21
	private Image imageCourante;
20
	private Image imageCourante;
22
	private String taxonPourRechercheEflore;
21
	private String taxonPourRechercheEflore;
23
	private Protocole protocoleCourant;
22
	private Protocole protocoleCourant;
24
	private int numPageRechercheImage = 0;
23
	private int numPageRechercheImage = 0;
25
	private int nbTotalImagesRecherchees = 0;
24
	private int nbTotalImagesRecherchees = 0;
26
 
25
 
27
	private int pasPagination = 12;
26
	private int pasPagination = 12;
28
	private int pageCouranteRechercheImage = 1;
27
	private int pageCouranteRechercheImage = 1;
29
	private int pageCouranteRechercheObservations = 1;
28
	private int pageCouranteRechercheObservations = 1;
30
	private InformationsRecherche informationsRechercheImage;
29
	private InformationsRecherche informationsRechercheImage;
31
	private InformationsRecherche informationsRechercheObservation;
30
	private InformationsRecherche informationsRechercheObservation;
32
	private Utilisateur utilisateur;
31
	private Utilisateur utilisateur;
33
	private String pageCourante = home;
32
	private String pageCourante = home;
34
	private String statut;
33
	private String statut;
35
	
34
	
36
	public void supprimerFiltreStatut() {
35
	public void supprimerFiltreStatut() {
37
		this.statut = null;
36
		this.statut = null;
38
	}
37
	}
39
	
38
	
40
	public void setFiltreStatut(String statut) {
39
	public void setFiltreStatut(String statut) {
41
		this.statut = statut;
40
		this.statut = statut;
42
	}
41
	}
43
	
42
	
44
	public String getFiltreStatut() {
43
	public String getFiltreStatut() {
45
		return this.statut;
44
		return this.statut;
46
	}
45
	}
47
	
46
	
48
	public String getPageCourante() {
47
	public String getPageCourante() {
49
		return pageCourante;
48
		return pageCourante;
50
	}
49
	}
51
 
50
 
52
	public void setPageCourante(String pageCourante) {
51
	public void setPageCourante(String pageCourante) {
53
		this.pageCourante = pageCourante;
52
		this.pageCourante = pageCourante;
54
	}
53
	}
55
 
54
 
56
	private static CacheClient instance;
55
	private static CacheClient instance;
57
 
56
 
58
	private CacheClient() {
57
	private CacheClient() {
59
		instance = this;
58
		instance = this;
60
	}
59
	}
61
 
60
 
62
	public void initialiserAvecParametres() {
61
	public void initialiserAvecParametres() {
63
		String rechercheLibre = Location.getParameter("masque");
62
		String rechercheLibre = Location.getParameter("masque");
64
		String famille = Location.getParameter("masque.famille");
63
		String famille = Location.getParameter("masque.famille");
65
		String taxon = Location.getParameter("masque.ns");
64
		String taxon = Location.getParameter("masque.ns");
66
		String genre = Location.getParameter("masque.genre");
65
		String genre = Location.getParameter("masque.genre");
67
		String commune = Location.getParameter("masque.commune");
66
		String commune = Location.getParameter("masque.commune");
68
		String dept = Location.getParameter("masque.departement");
67
		String dept = Location.getParameter("masque.departement");
69
		String auteur = Location.getParameter("masque.auteur");
68
		String auteur = Location.getParameter("masque.auteur");
70
		String date = Location.getParameter("masque.date");
69
		String date = Location.getParameter("masque.date");
71
		String tag = Location.getParameter("masque.tag");
70
		String tag = Location.getParameter("masque.tag");
72
		
71
		
73
		InformationsRecherche rechercheParArguments = new InformationsRecherche();
72
		InformationsRecherche rechercheParArguments = new InformationsRecherche();
74
		rechercheParArguments.setRechercheLibre(rechercheLibre);
73
		rechercheParArguments.setRechercheLibre(rechercheLibre);
75
		rechercheParArguments.setFamille(famille);
74
		rechercheParArguments.setFamille(famille);
76
		rechercheParArguments.setTaxon(taxon);
75
		rechercheParArguments.setTaxon(taxon);
77
		rechercheParArguments.setGenre(genre);
76
		rechercheParArguments.setGenre(genre);
78
		rechercheParArguments.setCommune(commune);
77
		rechercheParArguments.setCommune(commune);
79
		rechercheParArguments.setDepartement(dept);
78
		rechercheParArguments.setDepartement(dept);
80
		rechercheParArguments.setAuteur(auteur);
79
		rechercheParArguments.setAuteur(auteur);
81
		rechercheParArguments.setDate(date);
80
		rechercheParArguments.setDate(date);
82
		rechercheParArguments.setTag(tag);
81
		rechercheParArguments.setTag(tag);
83
		rechercheParArguments.setMotClef(tag);
82
		rechercheParArguments.setMotClef(tag);
84
		
83
		
85
		informationsRechercheImage = rechercheParArguments;
84
		informationsRechercheImage = rechercheParArguments;
86
		informationsRechercheObservation = rechercheParArguments;
85
		informationsRechercheObservation = rechercheParArguments;
87
	}
86
	}
88
	
87
	
89
	public Utilisateur getUtilisateur() {
88
	public Utilisateur getUtilisateur() {
90
		if (this.utilisateur == null) {
89
		if (this.utilisateur == null) {
91
			this.utilisateur = new Utilisateur(null);
90
			this.utilisateur = new Utilisateur(null);
92
		}
91
		}
93
		return this.utilisateur;
92
		return this.utilisateur;
94
	}
93
	}
95
	
94
	
96
	public void setUtilisateur(Utilisateur utilisateur) {
95
	public void setUtilisateur(Utilisateur utilisateur) {
97
		this.utilisateur = utilisateur; 
96
		this.utilisateur = utilisateur; 
98
	}
97
	}
99
	
98
	
100
	public void setHome(String home) {
99
	public void setHome(String home) {
101
		this.home = home;
100
		this.home = home;
102
		setPageCourante(home);
101
		setPageCourante(home);
103
	}
102
	}
104
	
103
	
105
	public String getHome() {
104
	public String getHome() {
106
		return home;
105
		return home;
107
	}
106
	}
108
	
107
	
109
	public Observation getObservationCourante() {
108
	public Observation getObservationCourante() {
110
		return observationCourante;
109
		return observationCourante;
111
	}
110
	}
112
 
111
 
113
	public void setObservationCourante(Observation observationCourante) {
112
	public void setObservationCourante(Observation observationCourante) {
114
		this.observationCourante = observationCourante;
113
		this.observationCourante = observationCourante;
115
	}
114
	}
116
 
115
 
117
	public static CacheClient getInstance() {
116
	public static CacheClient getInstance() {
118
		if (instance == null) {
117
		if (instance == null) {
119
			instance = new CacheClient();
118
			instance = new CacheClient();
120
		}
119
		}
121
		return instance;
120
		return instance;
122
	}
121
	}
123
 
122
 
124
	public String getTaxonPourRechercheEflore() {
123
	public String getTaxonPourRechercheEflore() {
125
		return taxonPourRechercheEflore;
124
		return taxonPourRechercheEflore;
126
	}
125
	}
127
 
126
 
128
	public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
127
	public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
129
		this.taxonPourRechercheEflore = taxonPourRechercheEflore;
128
		this.taxonPourRechercheEflore = taxonPourRechercheEflore;
130
	}
129
	}
131
 
130
 
132
	public int getNumPageRechercheImage() {
131
	public int getNumPageRechercheImage() {
133
		return numPageRechercheImage;
132
		return numPageRechercheImage;
134
	}
133
	}
135
 
134
 
136
	// Pour la recherche :
135
	// Pour la recherche :
137
	public int getPasPagination() {
136
	public int getPasPagination() {
138
		return pasPagination;
137
		return pasPagination;
139
	}
138
	}
140
 
139
 
141
	public void setPasPagination(int pasPagination) {
140
	public void setPasPagination(int pasPagination) {
142
		this.pasPagination = pasPagination;
141
		this.pasPagination = pasPagination;
143
	}
142
	}
144
 
143
 
145
	public void setPageCouranteRechercheImages(int pageCouranteRecherche) {
144
	public void setPageCouranteRechercheImages(int pageCouranteRecherche) {
146
		this.pageCouranteRechercheImage = pageCouranteRecherche;
145
		this.pageCouranteRechercheImage = pageCouranteRecherche;
147
	}
146
	}
148
 
147
 
149
	public int getPageCouranteRechercheImage() {
148
	public int getPageCouranteRechercheImage() {
150
		return this.pageCouranteRechercheImage;
149
		return this.pageCouranteRechercheImage;
151
	}
150
	}
152
 
151
 
153
	public void setNbTotalImagesRecherchees(int nbTotalImagesRecherchees) {
152
	public void setNbTotalImagesRecherchees(int nbTotalImagesRecherchees) {
154
		this.nbTotalImagesRecherchees = nbTotalImagesRecherchees;
153
		this.nbTotalImagesRecherchees = nbTotalImagesRecherchees;
155
	}
154
	}
156
 
155
 
157
	public int getNbTotalImagesRecherchees() {
156
	public int getNbTotalImagesRecherchees() {
158
		return this.nbTotalImagesRecherchees;
157
		return this.nbTotalImagesRecherchees;
159
	}
158
	}
160
 
159
 
161
	public Image getImageCourante() {
160
	public Image getImageCourante() {
162
		return imageCourante;
161
		return imageCourante;
163
	}
162
	}
164
 
163
 
165
	public void setImageCourante(Image imageCourante) {
164
	public void setImageCourante(Image imageCourante) {
166
		this.imageCourante = imageCourante;
165
		this.imageCourante = imageCourante;
167
	}
166
	}
168
	
167
	
169
	public void setListeProtocoles(List<Protocole> listeProtocole) {
168
	public void setListeProtocoles(List<Protocole> listeProtocole) {
170
		this.listeProtocoles = listeProtocole;
169
		this.listeProtocoles = listeProtocole;
171
	}
170
	}
172
	
171
	
173
	public List<Protocole> getListeProtocoles() {
172
	public List<Protocole> getListeProtocoles() {
174
		return this.listeProtocoles;
173
		return this.listeProtocoles;
175
	}
174
	}
176
 
175
 
177
	public Protocole getProtocoleCourant() {
176
	public Protocole getProtocoleCourant() {
178
		return protocoleCourant;
177
		return protocoleCourant;
179
	}
178
	}
180
 
179
 
181
	public void setProtocoleCourant(Protocole protocoleCourant) {
180
	public void setProtocoleCourant(Protocole protocoleCourant) {
182
		this.protocoleCourant = protocoleCourant;
181
		this.protocoleCourant = protocoleCourant;
183
	}
182
	}
184
 
183
 
185
	public InformationsRecherche getInformationsRechercheImage() {
184
	public InformationsRecherche getInformationsRechercheImage() {
186
		if(informationsRechercheImage == null) {
185
		if(informationsRechercheImage == null) {
187
			informationsRechercheImage = new InformationsRecherche();
186
			informationsRechercheImage = new InformationsRecherche();
188
		}
187
		}
189
		return informationsRechercheImage;
188
		return informationsRechercheImage;
190
	}
189
	}
191
 
190
 
192
	public InformationsRecherche getInformationsRechercheObservation() {
191
	public InformationsRecherche getInformationsRechercheObservation() {
193
		if(informationsRechercheObservation == null) {
192
		if(informationsRechercheObservation == null) {
194
			informationsRechercheObservation = new InformationsRecherche();
193
			informationsRechercheObservation = new InformationsRecherche();
195
		}
194
		}
196
		return informationsRechercheObservation;
195
		return informationsRechercheObservation;
197
	}
196
	}
198
 
197
 
199
	public void setInformationsRechercheImage(InformationsRecherche informationsRechercheImage) {
198
	public void setInformationsRechercheImage(InformationsRecherche informationsRechercheImage) {
200
		this.informationsRechercheImage = informationsRechercheImage;
199
		this.informationsRechercheImage = informationsRechercheImage;
201
	}
200
	}
202
 
201
 
203
	public void setInformationsRechercheObservation(InformationsRecherche informationsRechercheObservation) {
202
	public void setInformationsRechercheObservation(InformationsRecherche informationsRechercheObservation) {
204
		this.informationsRechercheObservation = informationsRechercheObservation;
203
		this.informationsRechercheObservation = informationsRechercheObservation;
205
	}
204
	}
206
 
205
 
207
	public int getPageCouranteRechercheObservations() {
206
	public int getPageCouranteRechercheObservations() {
208
		return pageCouranteRechercheObservations;
207
		return pageCouranteRechercheObservations;
209
	}
208
	}
210
 
209
 
211
	public void setPageCouranteRechercheObservations(int pageCouranteRechercheObservations) {
210
	public void setPageCouranteRechercheObservations(int pageCouranteRechercheObservations) {
212
		this.pageCouranteRechercheObservations = pageCouranteRechercheObservations;
211
		this.pageCouranteRechercheObservations = pageCouranteRechercheObservations;
213
	}
212
	}
214
 
213
 
215
}
214
}