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