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