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