Subversion Repositories eFlore/Applications.del

Rev

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

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