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