9 |
benjamin |
1 |
package org.tela_botanica.del.client.utils;
|
|
|
2 |
|
|
|
3 |
import java.util.ArrayList;
|
|
|
4 |
import java.util.Date;
|
55 |
gduche |
5 |
import java.util.HashMap;
|
|
|
6 |
import java.util.Iterator;
|
270 |
gduche |
7 |
import java.util.LinkedHashMap;
|
9 |
benjamin |
8 |
import java.util.List;
|
|
|
9 |
|
14 |
benjamin |
10 |
import org.tela_botanica.del.client.exceptions.ExceptionClient;
|
141 |
aurelien |
11 |
import org.tela_botanica.del.client.modeles.Commentaire;
|
154 |
benjamin |
12 |
import org.tela_botanica.del.client.modeles.Image;
|
335 |
benjamin |
13 |
import org.tela_botanica.del.client.modeles.InformationsRecherche;
|
9 |
benjamin |
14 |
import org.tela_botanica.del.client.modeles.Observation;
|
141 |
aurelien |
15 |
import org.tela_botanica.del.client.modeles.PropositionDetermination;
|
103 |
benjamin |
16 |
import org.tela_botanica.del.client.modeles.Protocole;
|
154 |
benjamin |
17 |
import org.tela_botanica.del.client.modeles.VoteDetermination;
|
115 |
benjamin |
18 |
import org.tela_botanica.del.client.modeles.VoteProtocole;
|
282 |
benjamin |
19 |
import org.tela_botanica.del.client.services.rest.ImageService;
|
|
|
20 |
import org.tela_botanica.del.client.services.rest.ObservationService;
|
|
|
21 |
import org.tela_botanica.del.client.services.rest.PropositionDeterminationService;
|
|
|
22 |
import org.tela_botanica.del.client.services.rest.ProtocoleService;
|
|
|
23 |
import org.tela_botanica.del.client.services.rest.VoteProtocoleService;
|
9 |
benjamin |
24 |
|
282 |
benjamin |
25 |
public class MockDatasource implements ObservationService, ImageService, ProtocoleService, VoteProtocoleService, PropositionDeterminationService {
|
56 |
benjamin |
26 |
|
9 |
benjamin |
27 |
static MockDatasource instance;
|
|
|
28 |
|
|
|
29 |
List<Observation> observations = new ArrayList<Observation>();
|
|
|
30 |
|
154 |
benjamin |
31 |
List<PropositionDetermination> observationValidationDatas = new ArrayList<PropositionDetermination>();
|
48 |
benjamin |
32 |
|
282 |
benjamin |
33 |
List<String> propositionsTaxonDatas = new ArrayList<String>();
|
115 |
benjamin |
34 |
|
107 |
benjamin |
35 |
List<Protocole> protocoles = new ArrayList<Protocole>();
|
159 |
benjamin |
36 |
|
154 |
benjamin |
37 |
List<Image> images = new ArrayList<Image>();
|
135 |
gduche |
38 |
|
9 |
benjamin |
39 |
private MockDatasource() {
|
|
|
40 |
|
270 |
gduche |
41 |
HashMap<String, String> auteurObs = new LinkedHashMap<String, String>();
|
|
|
42 |
auteurObs.put("01Juliette 1MOUREAU", "Tragopogon porrifolius subsp. australis (Jord.) Nyman");
|
|
|
43 |
auteurObs.put("02Robert 2LERAS", "Iris lutescens subsp. lutescens");
|
|
|
44 |
auteurObs.put("03Geneviève 3BOTTI", "Euphorbia dendroides L.");
|
|
|
45 |
auteurObs.put("04Robert 4LERAS", "Lonicera japonica Thunb. ex Murray");
|
|
|
46 |
auteurObs.put("05Juliette 5MOUREAU", "Lavatera arborea L.");
|
|
|
47 |
auteurObs.put("06Robert 6LERAS", "Lavatera arborea L.");
|
|
|
48 |
auteurObs.put("07Juliette 7MOUREAU", "Serapias vomeracea (Burm.f.) Briq. ");
|
|
|
49 |
auteurObs.put("08Benjamin 8LIENS", "Lonicera etrusca Santi");
|
|
|
50 |
auteurObs.put("09Aurélient 9PERONNET", "Ophrys scolopax Cav. ");
|
|
|
51 |
auteurObs.put("10Grégoire 10DUCHÉ", "Staehelina dubia L. ");
|
|
|
52 |
auteurObs.put("11Juliette 11MOUREAU", "Tragopogon porrifolius subsp. australis (Jord.) Nyman");
|
|
|
53 |
auteurObs.put("12Robert 12LERAS", "Iris lutescens subsp. lutescens");
|
|
|
54 |
auteurObs.put("13Geneviève 13BOTTI", "Euphorbia dendroides L.");
|
|
|
55 |
auteurObs.put("14Robert 14LERAS", "Lonicera japonica Thunb. ex Murray");
|
|
|
56 |
auteurObs.put("15Juliette 15MOUREAU", "Lavatera arborea L.");
|
|
|
57 |
auteurObs.put("16Robert 16LERAS", "Lavatera arborea L.");
|
|
|
58 |
auteurObs.put("17Juliette 17MOUREAU", "Serapias vomeracea (Burm.f.) Briq. ");
|
|
|
59 |
auteurObs.put("18Benjamin 18LIENS", "Lonicera etrusca Santi");
|
|
|
60 |
auteurObs.put("19Aurélient 19PERONNET", "Ophrys scolopax Cav. ");
|
|
|
61 |
auteurObs.put("20Grégoire 20DUCHÉ", "Staehelina dubia L. ");
|
55 |
gduche |
62 |
|
270 |
gduche |
63 |
auteurObs.put("21Juliette 1MOUREAU", "Tragopogon porrifolius subsp. australis (Jord.) Nyman");
|
|
|
64 |
auteurObs.put("22R2obert 2LERAS", "Iris lutescens subsp. lutescens");
|
|
|
65 |
auteurObs.put("23Ge3neviève 3BOTTI", "Euphorbia dendroides L.");
|
|
|
66 |
auteurObs.put("24Rob4ert 4LERAS", "Lonicera japonica Thunb. ex Murray");
|
|
|
67 |
auteurObs.put("25Jul5iette 5MOUREAU", "Lavatera arborea L.");
|
|
|
68 |
auteurObs.put("26Rob6ert 6LERAS", "Lavatera arborea L.");
|
|
|
69 |
auteurObs.put("27J6ul7iette 7MOUREAU", "Serapias vomeracea (Burm.f.) Briq. ");
|
|
|
70 |
auteurObs.put("28Ben8jamin 8LIENS", "Lonicera etrusca Santi");
|
|
|
71 |
auteurObs.put("29Auré9lient 9PERONNET", "Ophrys scolopax Cav. ");
|
|
|
72 |
auteurObs.put("30Gég10oire 10DUCHÉ", "Staehelina dubia L. ");
|
|
|
73 |
auteurObs.put("31Julie11tte 11MOUREAU", "Tragopogon porrifolius subsp. australis (Jord.) Nyman");
|
|
|
74 |
auteurObs.put("32Rober12t 12LERAS", "Iris lutescens subsp. lutescens");
|
|
|
75 |
auteurObs.put("33Genev13iève 13BOTTI", "Euphorbia dendroides L.");
|
|
|
76 |
auteurObs.put("34Robe14rt 14LERAS", "Lonicera japonica Thunb. ex Murray");
|
|
|
77 |
auteurObs.put("35Julie15tte 15MOUREAU", "Lavatera arborea L.");
|
|
|
78 |
auteurObs.put("36Robe16rt 16LERAS", "Lavatera arborea L.");
|
|
|
79 |
auteurObs.put("37Julie17tte 17MOUREAU", "Serapias vomeracea (Burm.f.) Briq. ");
|
|
|
80 |
auteurObs.put("38Benja1m11in 18LIENS", "Lonicera etrusca Santi");
|
|
|
81 |
auteurObs.put("39Auré1111lient 19PERONNET", "Ophrys scolopax Cav. ");
|
|
|
82 |
auteurObs.put("40Gr545égoire 20DUCHÉ", "Staehelina dubia L. ");
|
282 |
benjamin |
83 |
|
61 |
benjamin |
84 |
ArrayList<String> motsClefs = new ArrayList<String>();
|
|
|
85 |
motsClefs.add("plantnet");
|
|
|
86 |
motsClefs.add("fleur");
|
|
|
87 |
motsClefs.add("fruit");
|
|
|
88 |
|
55 |
gduche |
89 |
Iterator<String> auteurs = auteurObs.keySet().iterator();
|
|
|
90 |
|
103 |
benjamin |
91 |
Protocole protocol1 = new Protocole();
|
|
|
92 |
protocol1.setNom(Protocole.ESTHETISME);
|
100 |
benjamin |
93 |
protocol1.setId(1);
|
|
|
94 |
|
103 |
benjamin |
95 |
Protocole protocol2 = new Protocole();
|
|
|
96 |
protocol2.setNom(Protocole.IDENTIFICATION_AUTOMATIQUE);
|
100 |
benjamin |
97 |
protocol2.setId(2);
|
115 |
benjamin |
98 |
|
107 |
benjamin |
99 |
protocoles.add(protocol1);
|
|
|
100 |
protocoles.add(protocol2);
|
100 |
benjamin |
101 |
|
154 |
benjamin |
102 |
VoteDetermination voteDetermination = new VoteDetermination();
|
167 |
aurelien |
103 |
voteDetermination.setVote(1);
|
154 |
benjamin |
104 |
voteDetermination.setDate(new Date());
|
|
|
105 |
voteDetermination.setContributeur("benjamin");
|
9 |
benjamin |
106 |
|
154 |
benjamin |
107 |
PropositionDetermination observationValidationData = new PropositionDetermination();
|
|
|
108 |
observationValidationData.setEspece("Iris lutescens subsp. lutescens");
|
|
|
109 |
observationValidationData.setContributeur("contributeur test");
|
|
|
110 |
observationValidationData.setId("1");
|
48 |
benjamin |
111 |
|
227 |
aurelien |
112 |
observationValidationData.ajouterVoteDetermination(voteDetermination);
|
154 |
benjamin |
113 |
observationValidationData.setDate(new Date());
|
|
|
114 |
observationValidationDatas.add(observationValidationData);
|
48 |
benjamin |
115 |
|
154 |
benjamin |
116 |
PropositionDetermination observationValidationData2 = new PropositionDetermination();
|
|
|
117 |
observationValidationData2.setContributeur("contributeur test 2");
|
|
|
118 |
observationValidationData2.setEspece("Lavatera arborea L.");
|
|
|
119 |
observationValidationData2.setId("2");
|
227 |
aurelien |
120 |
observationValidationData2.ajouterVoteDetermination(voteDetermination);
|
154 |
benjamin |
121 |
observationValidationData2.setDate(new Date());
|
|
|
122 |
observationValidationDatas.add(observationValidationData2);
|
48 |
benjamin |
123 |
|
154 |
benjamin |
124 |
PropositionDetermination observationValidationData3 = new PropositionDetermination();
|
|
|
125 |
observationValidationData3.setEspece("Acer monsp. L.");
|
|
|
126 |
observationValidationData3.setContributeur("Léo Ferré");
|
159 |
benjamin |
127 |
Commentaire commentaire = new Commentaire("Greg", new Date(), "Avec le temps...");
|
|
|
128 |
Commentaire commentaireBis = new Commentaire("Benj", new Date(), "Pas d'accord avec Greg!");
|
|
|
129 |
commentaire.getListeCommentaires().add(commentaireBis);
|
306 |
aurelien |
130 |
observationValidationData3.ajouterCommentaire(commentaire);
|
247 |
aurelien |
131 |
observationValidationData3.setId("3");
|
227 |
aurelien |
132 |
observationValidationData2.ajouterVoteDetermination(voteDetermination);
|
154 |
benjamin |
133 |
observationValidationData3.setDate(new Date());
|
|
|
134 |
observationValidationDatas.add(observationValidationData3);
|
115 |
benjamin |
135 |
|
154 |
benjamin |
136 |
PropositionDetermination observationValidationData4 = new PropositionDetermination();
|
|
|
137 |
observationValidationData4.setEspece("Acer aceras aus.");
|
|
|
138 |
observationValidationData4.setContributeur("Pierre Desproges");
|
159 |
benjamin |
139 |
Commentaire commentaire2 = new Commentaire("Greg", new Date(), "Public chéri mon amour...");
|
306 |
aurelien |
140 |
observationValidationData4.ajouterCommentaire(commentaire2);
|
247 |
aurelien |
141 |
observationValidationData4.setId("4");
|
227 |
aurelien |
142 |
observationValidationData4.ajouterVoteDetermination(voteDetermination);
|
154 |
benjamin |
143 |
observationValidationData4.setDate(new Date());
|
|
|
144 |
observationValidationDatas.add(observationValidationData4);
|
|
|
145 |
|
|
|
146 |
PropositionDetermination observationValidationData5 = new PropositionDetermination();
|
|
|
147 |
observationValidationData5.setEspece("Acer monsp subsp. monsp.");
|
|
|
148 |
observationValidationData5.setContributeur("Louis Aragon");
|
159 |
benjamin |
149 |
Commentaire commentaire3 = new Commentaire("Greg", new Date(), "Tout est affaire de décor...");
|
306 |
aurelien |
150 |
observationValidationData5.ajouterCommentaire(commentaire3);
|
247 |
aurelien |
151 |
observationValidationData5.setId("5");
|
227 |
aurelien |
152 |
observationValidationData5.ajouterVoteDetermination(voteDetermination);
|
154 |
benjamin |
153 |
observationValidationData5.setDate(new Date());
|
|
|
154 |
observationValidationDatas.add(observationValidationData5);
|
|
|
155 |
|
199 |
gduche |
156 |
int numobs = 44120;
|
224 |
aurelien |
157 |
for (int i = 0; i < 40; i++) {
|
48 |
benjamin |
158 |
|
103 |
benjamin |
159 |
Observation observation = new Observation();
|
|
|
160 |
String auteur = auteurs.next();
|
|
|
161 |
observation.setAuteur(auteur);
|
|
|
162 |
observation.setSpecies(auteurObs.get(auteur));
|
|
|
163 |
|
199 |
gduche |
164 |
numobs += i;
|
103 |
benjamin |
165 |
observation.setNumNomenclatural("num nomenclatural " + i);
|
282 |
benjamin |
166 |
observation.setDate("28/09/2011");
|
103 |
benjamin |
167 |
observation.setFamille("famille " + i);
|
|
|
168 |
observation.setLocalite("localite " + i);
|
135 |
gduche |
169 |
observation.setNomRetenu(auteurObs.get(auteur));
|
103 |
benjamin |
170 |
observation.setMotsClefs(motsClefs);
|
154 |
benjamin |
171 |
observation.setImageCelValidationDatas(observationValidationDatas);
|
103 |
benjamin |
172 |
|
154 |
benjamin |
173 |
Image image = new Image();
|
|
|
174 |
image.setIdImage("id image " + i);
|
199 |
gduche |
175 |
image.setUrlFormat("http://www.tela-botanica.org/appli:cel-img:0000" + String.valueOf(numobs) + "%s%.jpg");
|
154 |
benjamin |
176 |
image.setUrl("http://www.tela-botanica.org/appli:cel-img:0000" + String.valueOf(numobs) + "CRS.jpg");
|
199 |
gduche |
177 |
image.setMiniature("http://www.tela-botanica.org/appli:cel-img:0000" + String.valueOf(numobs) + "XS.jpg");
|
154 |
benjamin |
178 |
observation.getImages().add(image);
|
|
|
179 |
image.setObservation(observation);
|
|
|
180 |
images.add(image);
|
|
|
181 |
|
199 |
gduche |
182 |
// nombre d'images aléatoires
|
|
|
183 |
int nbImagesAssociees = (int) Math.round(Math.random() * 10);
|
|
|
184 |
for (int j = 0; j < nbImagesAssociees; j++) {
|
|
|
185 |
numobs++;
|
|
|
186 |
image = new Image();
|
|
|
187 |
image.setIdImage("id image " + i);
|
|
|
188 |
image.setUrlFormat("http://www.tela-botanica.org/appli:cel-img:0000" + String.valueOf(numobs) + "%s%.jpg");
|
|
|
189 |
image.setUrl("http://www.tela-botanica.org/appli:cel-img:0000" + String.valueOf(numobs) + "CRS.jpg");
|
|
|
190 |
image.setMiniature("http://www.tela-botanica.org/appli:cel-img:0000" + String.valueOf(numobs) + "XS.jpg");
|
|
|
191 |
observation.getImages().add(image);
|
|
|
192 |
image.setObservation(observation);
|
|
|
193 |
images.add(image);
|
|
|
194 |
}
|
|
|
195 |
|
154 |
benjamin |
196 |
VoteProtocole voteProtocole = new VoteProtocole();
|
234 |
gduche |
197 |
voteProtocole.setProtocole(protocol1);
|
159 |
benjamin |
198 |
voteProtocole.setVote(3);
|
154 |
benjamin |
199 |
voteProtocole.setContributeur("aurelien");
|
|
|
200 |
voteProtocole.setDate(new Date());
|
|
|
201 |
|
|
|
202 |
image.getVoteProtocoles().add(voteProtocole);
|
|
|
203 |
|
159 |
benjamin |
204 |
VoteProtocole voteProtocole2 = new VoteProtocole();
|
234 |
gduche |
205 |
voteProtocole2.setProtocole(protocol2);
|
159 |
benjamin |
206 |
voteProtocole2.setVote(2);
|
|
|
207 |
voteProtocole2.setContributeur("jpm");
|
|
|
208 |
voteProtocole2.setDate(new Date());
|
|
|
209 |
|
|
|
210 |
image.getVoteProtocoles().add(voteProtocole2);
|
|
|
211 |
|
103 |
benjamin |
212 |
observations.add(observation);
|
|
|
213 |
}
|
199 |
gduche |
214 |
|
180 |
benjamin |
215 |
ajouterVotesAleatoires();
|
177 |
benjamin |
216 |
|
9 |
benjamin |
217 |
}
|
199 |
gduche |
218 |
|
282 |
benjamin |
219 |
private void ajouterVotesAleatoires() {
|
167 |
aurelien |
220 |
for (PropositionDetermination validation : observationValidationDatas) {
|
199 |
gduche |
221 |
int nbVotesAjoutes = (int) Math.round(Math.random() * 20);
|
|
|
222 |
|
167 |
aurelien |
223 |
for (int i = 0; i < nbVotesAjoutes; i++) {
|
|
|
224 |
VoteDetermination vd = new VoteDetermination();
|
199 |
gduche |
225 |
vd.setVote((int) Math.round(Math.random()));
|
167 |
aurelien |
226 |
vd.setDate(new Date());
|
|
|
227 |
vd.setContributeur("test");
|
199 |
gduche |
228 |
|
167 |
aurelien |
229 |
validation.ajouterVoteDetermination(vd);
|
|
|
230 |
}
|
|
|
231 |
}
|
|
|
232 |
}
|
199 |
gduche |
233 |
|
282 |
benjamin |
234 |
/*
|
|
|
235 |
* (non-Javadoc)
|
|
|
236 |
*
|
|
|
237 |
* @see
|
|
|
238 |
* org.tela_botanica.del.client.utils.ObservationService#getObservations
|
|
|
239 |
* (java.util.HashMap)
|
|
|
240 |
*/
|
|
|
241 |
@Override
|
335 |
benjamin |
242 |
public List<Observation> getObservations(InformationsRecherche informationsRecherche) {
|
|
|
243 |
if (informationsRecherche == null) {
|
199 |
gduche |
244 |
return getObservations();
|
|
|
245 |
} else {
|
|
|
246 |
int nbResultats = (int) Math.round(Math.random() * 20);
|
|
|
247 |
List<Observation> resultatRecherche = new ArrayList<Observation>();
|
|
|
248 |
for (int i = 0; i < nbResultats; i++) {
|
|
|
249 |
int numeroResultat = (int) Math.round(Math.random() * (observations.size() - 1));
|
|
|
250 |
resultatRecherche.add(observations.get(numeroResultat));
|
|
|
251 |
}
|
|
|
252 |
return resultatRecherche;
|
|
|
253 |
}
|
182 |
benjamin |
254 |
}
|
9 |
benjamin |
255 |
|
282 |
benjamin |
256 |
/*
|
|
|
257 |
* (non-Javadoc)
|
|
|
258 |
*
|
|
|
259 |
* @see
|
|
|
260 |
* org.tela_botanica.del.client.utils.ObservationService#getObservations()
|
|
|
261 |
*/
|
|
|
262 |
@Override
|
9 |
benjamin |
263 |
public List<Observation> getObservations() {
|
|
|
264 |
return observations;
|
|
|
265 |
}
|
159 |
benjamin |
266 |
|
282 |
benjamin |
267 |
/*
|
|
|
268 |
* (non-Javadoc)
|
|
|
269 |
*
|
|
|
270 |
* @see org.tela_botanica.del.client.utils.ObservationService#getImages()
|
|
|
271 |
*/
|
290 |
benjamin |
272 |
public List<Image> getImages(int debut, int fin) {
|
|
|
273 |
List<Image> sousListe = new ArrayList<Image>();
|
|
|
274 |
for (int i = debut; i < fin; i++) {
|
|
|
275 |
if (images.get(i) != null ) {
|
|
|
276 |
sousListe.add(images.get(i));
|
|
|
277 |
} else {
|
|
|
278 |
break;
|
|
|
279 |
}
|
|
|
280 |
}
|
154 |
benjamin |
281 |
return images;
|
|
|
282 |
}
|
9 |
benjamin |
283 |
|
282 |
benjamin |
284 |
/*
|
|
|
285 |
* (non-Javadoc)
|
|
|
286 |
*
|
|
|
287 |
* @see
|
|
|
288 |
* org.tela_botanica.del.client.utils.ObservationService#getVote(java.lang
|
|
|
289 |
* .String)
|
|
|
290 |
*/
|
|
|
291 |
@Override
|
177 |
benjamin |
292 |
public List<VoteProtocole> getVote(String idImage) {
|
|
|
293 |
for (Image image : images) {
|
|
|
294 |
if (image.getIdImage().equals(idImage)) {
|
|
|
295 |
return image.getVoteProtocoles();
|
154 |
benjamin |
296 |
}
|
177 |
benjamin |
297 |
|
154 |
benjamin |
298 |
}
|
|
|
299 |
return null;
|
9 |
benjamin |
300 |
}
|
48 |
benjamin |
301 |
|
282 |
benjamin |
302 |
/*
|
|
|
303 |
* (non-Javadoc)
|
|
|
304 |
*
|
|
|
305 |
* @see org.tela_botanica.del.client.utils.ObservationService#
|
|
|
306 |
* getVoteByImageAndProtocol(java.lang.String, java.lang.String)
|
|
|
307 |
*/
|
|
|
308 |
@Override
|
177 |
benjamin |
309 |
public List<VoteProtocole> getVoteByImageAndProtocol(String idImage, String protocolName) {
|
154 |
benjamin |
310 |
|
177 |
benjamin |
311 |
List<VoteProtocole> voteProtocolesLocal = new ArrayList<VoteProtocole>();
|
|
|
312 |
|
|
|
313 |
for (Image image : images) {
|
|
|
314 |
if (image.getIdImage().equals(idImage)) {
|
|
|
315 |
for (VoteProtocole voteProtocole : image.getVoteProtocoles()) {
|
234 |
gduche |
316 |
if (voteProtocole.getProtocole().getNom().equals(protocolName)) {
|
177 |
benjamin |
317 |
voteProtocolesLocal.add(voteProtocole);
|
154 |
benjamin |
318 |
}
|
|
|
319 |
}
|
|
|
320 |
}
|
177 |
benjamin |
321 |
|
103 |
benjamin |
322 |
}
|
177 |
benjamin |
323 |
return voteProtocolesLocal;
|
103 |
benjamin |
324 |
}
|
|
|
325 |
|
282 |
benjamin |
326 |
/*
|
|
|
327 |
* (non-Javadoc)
|
|
|
328 |
*
|
|
|
329 |
* @see
|
|
|
330 |
* org.tela_botanica.del.client.utils.ObservationService#getImagesEfloreParTaxon
|
|
|
331 |
* (java.lang.String)
|
|
|
332 |
*/
|
|
|
333 |
@Override
|
154 |
benjamin |
334 |
public List<Image> getImagesEfloreParTaxon(String nomTaxon) {
|
282 |
benjamin |
335 |
|
|
|
336 |
List<Image> imagesEflore = new ArrayList<Image>();
|
|
|
337 |
int nbResultats = (int) Math.round(Math.random() * 20);
|
|
|
338 |
for (int i = 0; i < nbResultats; i++) {
|
|
|
339 |
int numeroResultat = (int) Math.round(Math.random() * (images.size() - 1));
|
|
|
340 |
imagesEflore.add(images.get(numeroResultat));
|
|
|
341 |
}
|
|
|
342 |
return imagesEflore;
|
9 |
benjamin |
343 |
}
|
115 |
benjamin |
344 |
|
282 |
benjamin |
345 |
/*
|
|
|
346 |
* (non-Javadoc)
|
|
|
347 |
*
|
|
|
348 |
* @see
|
|
|
349 |
* org.tela_botanica.del.client.utils.ObservationService#getProtocole(java
|
|
|
350 |
* .lang.String)
|
|
|
351 |
*/
|
|
|
352 |
@Override
|
107 |
benjamin |
353 |
public Protocole getProtocole(String nomProtocole) {
|
|
|
354 |
for (Protocole protocole : protocoles) {
|
|
|
355 |
if (protocole.getNom().equals(nomProtocole)) {
|
|
|
356 |
return protocole;
|
|
|
357 |
}
|
|
|
358 |
}
|
|
|
359 |
return null;
|
|
|
360 |
}
|
159 |
benjamin |
361 |
|
282 |
benjamin |
362 |
/*
|
|
|
363 |
* (non-Javadoc)
|
|
|
364 |
*
|
|
|
365 |
* @see
|
|
|
366 |
* org.tela_botanica.del.client.utils.ObservationService#getProtocoles()
|
|
|
367 |
*/
|
|
|
368 |
@Override
|
177 |
benjamin |
369 |
public List<Protocole> getProtocoles() {
|
|
|
370 |
return protocoles;
|
|
|
371 |
}
|
|
|
372 |
|
282 |
benjamin |
373 |
/*
|
|
|
374 |
* (non-Javadoc)
|
|
|
375 |
*
|
|
|
376 |
* @see org.tela_botanica.del.client.utils.ObservationService#saveVote(org.
|
|
|
377 |
* tela_botanica.del.client.modeles.VoteProtocole)
|
|
|
378 |
*/
|
|
|
379 |
@Override
|
294 |
benjamin |
380 |
public void saveVote(String idImage, VoteProtocole voteProtocole) {
|
159 |
benjamin |
381 |
// TODO implement method
|
154 |
benjamin |
382 |
}
|
135 |
gduche |
383 |
|
282 |
benjamin |
384 |
/*
|
|
|
385 |
* (non-Javadoc)
|
|
|
386 |
*
|
|
|
387 |
* @see
|
|
|
388 |
* org.tela_botanica.del.client.utils.ObservationService#saveValidationData
|
|
|
389 |
* (org.tela_botanica.del.client.modeles.PropositionDetermination)
|
|
|
390 |
*/
|
|
|
391 |
@Override
|
294 |
benjamin |
392 |
public void saveValidationData(String idObservation, PropositionDetermination validationData) throws ExceptionClient {
|
154 |
benjamin |
393 |
observationValidationDatas.add(validationData);
|
48 |
benjamin |
394 |
}
|
|
|
395 |
|
9 |
benjamin |
396 |
public static MockDatasource getInstance() {
|
|
|
397 |
if (instance == null) {
|
|
|
398 |
instance = new MockDatasource();
|
|
|
399 |
}
|
|
|
400 |
return instance;
|
|
|
401 |
}
|
154 |
benjamin |
402 |
|
312 |
gduche |
403 |
@Override
|
335 |
benjamin |
404 |
public List<Image> getImagesParTaxon(InformationsRecherche informationsRecherche, int debut, int fin) {
|
312 |
gduche |
405 |
return MockDatasource.getInstance().getImages(debut, fin);
|
|
|
406 |
}
|
|
|
407 |
|
9 |
benjamin |
408 |
}
|