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);
|
100 |
benjamin |
96 |
protocol1.setId(1);
|
|
|
97 |
|
103 |
benjamin |
98 |
Protocole protocol2 = new Protocole();
|
|
|
99 |
protocol2.setNom(Protocole.IDENTIFICATION_AUTOMATIQUE);
|
100 |
benjamin |
100 |
protocol2.setId(2);
|
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);
|
282 |
benjamin |
169 |
observation.setDate("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 |
|
|
|
205 |
image.getVoteProtocoles().add(voteProtocole);
|
|
|
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 |
|
|
|
213 |
image.getVoteProtocoles().add(voteProtocole2);
|
|
|
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)) {
|
|
|
277 |
return image.getVoteProtocoles();
|
154 |
benjamin |
278 |
}
|
177 |
benjamin |
279 |
|
154 |
benjamin |
280 |
}
|
374 |
aurelien |
281 |
return new ArrayList<VoteProtocole>(0);
|
9 |
benjamin |
282 |
}
|
48 |
benjamin |
283 |
|
282 |
benjamin |
284 |
/*
|
|
|
285 |
* (non-Javadoc)
|
|
|
286 |
*
|
|
|
287 |
* @see org.tela_botanica.del.client.utils.ObservationService#
|
|
|
288 |
* getVoteByImageAndProtocol(java.lang.String, java.lang.String)
|
|
|
289 |
*/
|
|
|
290 |
@Override
|
177 |
benjamin |
291 |
public List<VoteProtocole> getVoteByImageAndProtocol(String idImage, String protocolName) {
|
154 |
benjamin |
292 |
|
177 |
benjamin |
293 |
List<VoteProtocole> voteProtocolesLocal = new ArrayList<VoteProtocole>();
|
|
|
294 |
|
360 |
benjamin |
295 |
// for (Image image : images) {
|
|
|
296 |
// if (image.getIdImage().equals(idImage)) {
|
|
|
297 |
// for (VoteProtocole voteProtocole : image.getVoteProtocoles()) {
|
|
|
298 |
// if (voteProtocole.getProtocole().getNom().equals(protocolName)) {
|
|
|
299 |
// voteProtocolesLocal.add(voteProtocole);
|
|
|
300 |
// }
|
|
|
301 |
// }
|
|
|
302 |
// }
|
|
|
303 |
//
|
|
|
304 |
// }
|
177 |
benjamin |
305 |
|
360 |
benjamin |
306 |
if (protocolName.equals(Protocole.ESTHETISME)) {
|
|
|
307 |
|
|
|
308 |
VoteProtocole voteProtocole = new VoteProtocole();
|
|
|
309 |
voteProtocole.setProtocole(protocoles.get(0));
|
|
|
310 |
voteProtocole.setVote(3);
|
|
|
311 |
voteProtocole.setContributeur("aurelien");
|
|
|
312 |
voteProtocole.setDate(new Date());
|
|
|
313 |
|
|
|
314 |
VoteProtocole voteProtocole2 = new VoteProtocole();
|
|
|
315 |
voteProtocole2.setProtocole(protocoles.get(0));
|
|
|
316 |
voteProtocole2.setVote(2);
|
|
|
317 |
voteProtocole2.setContributeur("jpm");
|
|
|
318 |
voteProtocole2.setDate(new Date());
|
|
|
319 |
|
|
|
320 |
voteProtocolesLocal.add(voteProtocole);
|
|
|
321 |
voteProtocolesLocal.add(voteProtocole2);
|
103 |
benjamin |
322 |
}
|
360 |
benjamin |
323 |
|
|
|
324 |
else if (protocolName.equals(Protocole.IDENTIFICATION_AUTOMATIQUE)) {
|
|
|
325 |
|
|
|
326 |
VoteProtocole voteProtocole = new VoteProtocole();
|
|
|
327 |
voteProtocole.setProtocole(protocoles.get(0));
|
|
|
328 |
voteProtocole.setVote(5);
|
|
|
329 |
voteProtocole.setContributeur("ben");
|
|
|
330 |
voteProtocole.setDate(new Date());
|
|
|
331 |
|
|
|
332 |
VoteProtocole voteProtocole2 = new VoteProtocole();
|
|
|
333 |
voteProtocole2.setProtocole(protocoles.get(0));
|
|
|
334 |
voteProtocole2.setVote(5);
|
|
|
335 |
voteProtocole2.setContributeur("greg");
|
|
|
336 |
voteProtocole2.setDate(new Date());
|
|
|
337 |
|
|
|
338 |
voteProtocolesLocal.add(voteProtocole);
|
|
|
339 |
voteProtocolesLocal.add(voteProtocole2);
|
|
|
340 |
}
|
177 |
benjamin |
341 |
return voteProtocolesLocal;
|
103 |
benjamin |
342 |
}
|
|
|
343 |
|
282 |
benjamin |
344 |
/*
|
|
|
345 |
* (non-Javadoc)
|
|
|
346 |
*
|
|
|
347 |
* @see
|
|
|
348 |
* org.tela_botanica.del.client.utils.ObservationService#getProtocole(java
|
|
|
349 |
* .lang.String)
|
|
|
350 |
*/
|
|
|
351 |
@Override
|
107 |
benjamin |
352 |
public Protocole getProtocole(String nomProtocole) {
|
|
|
353 |
for (Protocole protocole : protocoles) {
|
|
|
354 |
if (protocole.getNom().equals(nomProtocole)) {
|
|
|
355 |
return protocole;
|
|
|
356 |
}
|
|
|
357 |
}
|
|
|
358 |
return null;
|
|
|
359 |
}
|
159 |
benjamin |
360 |
|
282 |
benjamin |
361 |
/*
|
|
|
362 |
* (non-Javadoc)
|
|
|
363 |
*
|
|
|
364 |
* @see
|
|
|
365 |
* org.tela_botanica.del.client.utils.ObservationService#getProtocoles()
|
|
|
366 |
*/
|
|
|
367 |
@Override
|
177 |
benjamin |
368 |
public List<Protocole> getProtocoles() {
|
|
|
369 |
return protocoles;
|
|
|
370 |
}
|
|
|
371 |
|
282 |
benjamin |
372 |
/*
|
|
|
373 |
* (non-Javadoc)
|
|
|
374 |
*
|
|
|
375 |
* @see org.tela_botanica.del.client.utils.ObservationService#saveVote(org.
|
|
|
376 |
* tela_botanica.del.client.modeles.VoteProtocole)
|
|
|
377 |
*/
|
|
|
378 |
@Override
|
294 |
benjamin |
379 |
public void saveVote(String idImage, VoteProtocole voteProtocole) {
|
159 |
benjamin |
380 |
// TODO implement method
|
154 |
benjamin |
381 |
}
|
135 |
gduche |
382 |
|
282 |
benjamin |
383 |
/*
|
|
|
384 |
* (non-Javadoc)
|
|
|
385 |
*
|
|
|
386 |
* @see
|
|
|
387 |
* org.tela_botanica.del.client.utils.ObservationService#saveValidationData
|
|
|
388 |
* (org.tela_botanica.del.client.modeles.PropositionDetermination)
|
|
|
389 |
*/
|
|
|
390 |
@Override
|
294 |
benjamin |
391 |
public void saveValidationData(String idObservation, PropositionDetermination validationData) throws ExceptionClient {
|
154 |
benjamin |
392 |
observationValidationDatas.add(validationData);
|
48 |
benjamin |
393 |
}
|
|
|
394 |
|
9 |
benjamin |
395 |
public static MockDatasource getInstance() {
|
|
|
396 |
if (instance == null) {
|
|
|
397 |
instance = new MockDatasource();
|
|
|
398 |
}
|
|
|
399 |
return instance;
|
|
|
400 |
}
|
154 |
benjamin |
401 |
|
312 |
gduche |
402 |
@Override
|
359 |
benjamin |
403 |
public void getImagesEfloreParTaxon(String nomTaxon, ImagesParTaxonCallback callback) {
|
351 |
aurelien |
404 |
// TODO Auto-generated method stub
|
360 |
benjamin |
405 |
|
312 |
gduche |
406 |
}
|
|
|
407 |
|
351 |
aurelien |
408 |
@Override
|
359 |
benjamin |
409 |
public void getImagesParTaxon(InformationsRecherche informationsRecherche, int debut, int fin, ImagesParTaxonCallback callback) {
|
351 |
aurelien |
410 |
// TODO Auto-generated method stub
|
360 |
benjamin |
411 |
|
351 |
aurelien |
412 |
}
|
359 |
benjamin |
413 |
|
392 |
aurelien |
414 |
@Override
|
|
|
415 |
public ObservationServiceResultat getObservations(
|
|
|
416 |
InformationsRecherche informationsRecherche, int debut, int fin,
|
|
|
417 |
ObservationsCallback callback) {
|
|
|
418 |
// TODO Auto-generated method stub
|
|
|
419 |
return null;
|
|
|
420 |
}
|
|
|
421 |
|
9 |
benjamin |
422 |
}
|