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