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