Subversion Repositories eFlore/Applications.del

Rev

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

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