Subversion Repositories eFlore/Applications.del

Rev

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