Subversion Repositories eFlore/Applications.del

Rev

Rev 1129 | Rev 1314 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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