Subversion Repositories eFlore/Applications.del

Rev

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

Rev 335 Rev 351
Line 19... Line 19...
19
import org.tela_botanica.del.client.services.rest.ImageService;
19
import org.tela_botanica.del.client.services.rest.ImageService;
20
import org.tela_botanica.del.client.services.rest.ObservationService;
20
import org.tela_botanica.del.client.services.rest.ObservationService;
21
import org.tela_botanica.del.client.services.rest.PropositionDeterminationService;
21
import org.tela_botanica.del.client.services.rest.PropositionDeterminationService;
22
import org.tela_botanica.del.client.services.rest.ProtocoleService;
22
import org.tela_botanica.del.client.services.rest.ProtocoleService;
23
import org.tela_botanica.del.client.services.rest.VoteProtocoleService;
23
import org.tela_botanica.del.client.services.rest.VoteProtocoleService;
-
 
24
import org.tela_botanica.del.client.services.rest.async.ImagesParTaxonCallback;
-
 
25
 
Line 24... Line 26...
24
 
26
 
Line 25... Line 27...
25
public class MockDatasource implements ObservationService, ImageService, ProtocoleService, VoteProtocoleService, PropositionDeterminationService {
27
public class MockDatasource implements ObservationService, ImageService, ProtocoleService, VoteProtocoleService, PropositionDeterminationService {
Line 157... Line 159...
157
		for (int i = 0; i < 40; i++) {
159
		for (int i = 0; i < 40; i++) {
Line 158... Line 160...
158
 
160
 
159
			Observation observation = new Observation();
161
			Observation observation = new Observation();
160
			String auteur = auteurs.next();
162
			String auteur = auteurs.next();
161
			observation.setAuteur(auteur);
163
			observation.setAuteur(auteur);
Line 162... Line 164...
162
			observation.setSpecies(auteurObs.get(auteur));
164
			observation.setNomRetenu(auteurObs.get(auteur));
163
 
165
 
164
			numobs += i;
166
			numobs += i;
165
			observation.setNumNomenclatural("num nomenclatural " + i);
167
			observation.setNumNomenclatural("num nomenclatural " + i);
Line 325... Line 327...
325
 
327
 
326
	/*
328
	/*
327
	 * (non-Javadoc)
329
	 * (non-Javadoc)
328
	 * 
330
	 * 
329
	 * @see
-
 
330
	 * org.tela_botanica.del.client.utils.ObservationService#getImagesEfloreParTaxon
-
 
331
	 * (java.lang.String)
-
 
332
	 */
-
 
333
	@Override
-
 
334
	public List<Image> getImagesEfloreParTaxon(String nomTaxon) {
-
 
335
 
-
 
336
		List<Image> imagesEflore = new ArrayList<Image>();
-
 
337
		int nbResultats = (int) Math.round(Math.random() * 20);
-
 
338
		for (int i = 0; i < nbResultats; i++) {
-
 
339
			int numeroResultat = (int) Math.round(Math.random() * (images.size() - 1));
-
 
340
			imagesEflore.add(images.get(numeroResultat));
-
 
341
		}
-
 
342
		return imagesEflore;
-
 
343
	}
-
 
344
 
-
 
345
	/*
-
 
346
	 * (non-Javadoc)
-
 
347
	 * 
-
 
348
	 * @see
331
	 * @see
349
	 * org.tela_botanica.del.client.utils.ObservationService#getProtocole(java
332
	 * org.tela_botanica.del.client.utils.ObservationService#getProtocole(java
350
	 * .lang.String)
333
	 * .lang.String)
351
	 */
334
	 */
352
	@Override
335
	@Override
Line 399... Line 382...
399
		}
382
		}
400
		return instance;
383
		return instance;
401
	}
384
	}
Line 402... Line 385...
402
 
385
 
403
	@Override
386
	@Override
-
 
387
	public void getImagesEfloreParTaxon(String nomTaxon,
404
	public List<Image> getImagesParTaxon(InformationsRecherche informationsRecherche, int debut, int fin) {
388
			ImagesParTaxonCallback callback) {
-
 
389
		// TODO Auto-generated method stub
405
		return MockDatasource.getInstance().getImages(debut, fin);
390
		
Line -... Line 391...
-
 
391
	}
-
 
392
 
-
 
393
	@Override
-
 
394
	public void getImagesParTaxon(InformationsRecherche informationsRecherche,
-
 
395
			int debut, int fin, ImagesParTaxonCallback callback) {
-
 
396
		// TODO Auto-generated method stub
406
	}
397