Subversion Repositories eFlore/Applications.del

Rev

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

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