Subversion Repositories eFlore/Applications.del

Rev

Rev 690 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 690 Rev 814
Line 23... Line 23...
23
import org.tela_botanica.del.client.services.rest.PropositionDeterminationService;
23
import org.tela_botanica.del.client.services.rest.PropositionDeterminationService;
24
import org.tela_botanica.del.client.services.rest.ProtocoleService;
24
import org.tela_botanica.del.client.services.rest.ProtocoleService;
25
import org.tela_botanica.del.client.services.rest.VoteProtocoleService;
25
import org.tela_botanica.del.client.services.rest.VoteProtocoleService;
26
import org.tela_botanica.del.client.services.rest.async.ImagesParTaxonCallback;
26
import org.tela_botanica.del.client.services.rest.async.ImagesParTaxonCallback;
27
import org.tela_botanica.del.client.services.rest.async.ObservationsCallback;
27
import org.tela_botanica.del.client.services.rest.async.ObservationsCallback;
-
 
28
import org.tela_botanica.del.client.services.rest.async.ProtocolesCallback;
Line 28... Line 29...
28
 
29
 
Line 29... Line 30...
29
public class MockDatasource implements ObservationService, ImageService, ProtocoleService, VoteProtocoleService, PropositionDeterminationService {
30
public class MockDatasource implements ObservationService, ImageService, ProtocoleService, VoteProtocoleService, PropositionDeterminationService {
Line 91... Line 92...
91
		motsClefs.add("fruit");
92
		motsClefs.add("fruit");
Line 92... Line 93...
92
 
93
 
Line 93... Line 94...
93
		Iterator<String> auteurs = auteurObs.keySet().iterator();
94
		Iterator<String> auteurs = auteurObs.keySet().iterator();
94
 
95
 
95
		Protocole protocol1 = new Protocole();
96
		Protocole protocol1 = new Protocole();
Line 96... Line 97...
96
		protocol1.setNom(Protocole.ESTHETISME);
97
		protocol1.setNom("esthétique");
97
		protocol1.setId(0);
98
		protocol1.setId(0);
98
 
99
 
Line 99... Line 100...
99
		Protocole protocol2 = new Protocole();
100
		Protocole protocol2 = new Protocole();
100
		protocol2.setNom(Protocole.IDENTIFICATION_AUTOMATIQUE);
101
		protocol2.setNom("capitalisation de scan de feuilles");
Line 300... Line 301...
300
	@Override
301
	@Override
301
	public List<VoteProtocole> getVotePourImageEtProtocole(String idImage, String protocolName) {
302
	public List<VoteProtocole> getVotePourImageEtProtocole(String idImage, String protocolName) {
Line 302... Line 303...
302
 
303
 
Line 303... Line -...
303
		List<VoteProtocole> voteProtocolesLocal = new ArrayList<VoteProtocole>();
-
 
304
 
-
 
305
		// for (Image image : images) {
-
 
306
		// if (image.getIdImage().equals(idImage)) {
-
 
307
		// for (VoteProtocole voteProtocole : image.getVoteProtocoles()) {
-
 
308
		// if (voteProtocole.getProtocole().getNom().equals(protocolName)) {
-
 
309
		// voteProtocolesLocal.add(voteProtocole);
-
 
310
		// }
-
 
311
		// }
-
 
312
		// }
-
 
313
		//
-
 
314
		// }
304
		List<VoteProtocole> voteProtocolesLocal = new ArrayList<VoteProtocole>();
315
 
305
 
316
		int rand = (int) (Math.random() * 5);
306
		int rand = (int) (Math.random() * 5);
317
		for (int i = 0; i < rand; i++) {
307
		for (int i = 0; i < rand; i++) {
318
			VoteProtocole voteProtocole = new VoteProtocole();
308
			VoteProtocole voteProtocole = new VoteProtocole();
Line 334... Line 324...
334
	}
324
	}
Line 335... Line 325...
335
 
325
 
336
	/*
326
	/*
337
	 * (non-Javadoc)
327
	 * (non-Javadoc)
338
	 * 
-
 
339
	 * @see
-
 
340
	 * org.tela_botanica.del.client.utils.ObservationService#getProtocole(java
-
 
341
	 * .lang.String)
-
 
342
	 */
-
 
343
	@Override
-
 
344
	public Protocole getProtocole(String nomProtocole) {
-
 
345
		for (Protocole protocole : protocoles) {
-
 
346
			if (protocole.getNom().equals(nomProtocole)) {
-
 
347
				return protocole;
-
 
348
			}
-
 
349
		}
-
 
350
		return null;
-
 
351
	}
-
 
352
 
-
 
353
	/*
-
 
354
	 * (non-Javadoc)
-
 
355
	 * 
-
 
356
	 * @see
-
 
357
	 * org.tela_botanica.del.client.utils.ObservationService#getProtocoles()
-
 
358
	 */
-
 
359
	@Override
-
 
360
	public List<Protocole> getProtocoles() {
-
 
361
		return protocoles;
-
 
362
	}
-
 
363
 
-
 
364
	/*
-
 
365
	 * (non-Javadoc)
-
 
366
	 * 
328
	 * 
367
	 * @see org.tela_botanica.del.client.utils.ObservationService#saveVote(org.
329
	 * @see org.tela_botanica.del.client.utils.ObservationService#saveVote(org.
368
	 * tela_botanica.del.client.modeles.VoteProtocole)
330
	 * tela_botanica.del.client.modeles.VoteProtocole)
369
	 */
331
	 */
370
	@Override
332
	@Override
Line 412... Line 374...
412
	public void getImagesParObservation(String observationId, ImagesParTaxonCallback callback) {
374
	public void getImagesParObservation(String observationId, ImagesParTaxonCallback callback) {
413
		// TODO Auto-generated method stub
375
		// TODO Auto-generated method stub
Line 414... Line 376...
414
 
376
 
Line -... Line 377...
-
 
377
	}
-
 
378
 
-
 
379
	@Override
-
 
380
	public void getProtocoles(ProtocolesCallback pc) {
-
 
381
		// TODO Auto-generated method stub
-
 
382
		
-
 
383
	}
-
 
384
 
-
 
385
	@Override
-
 
386
	public void getProtocole(String nomProtocole) {
-
 
387
		// TODO Auto-generated method stub
-
 
388
		
415
	}
389
	}