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