Subversion Repositories eFlore/Applications.del

Rev

Rev 35 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35 Rev 40
Line 4... Line 4...
4
import java.util.Date;
4
import java.util.Date;
5
import java.util.List;
5
import java.util.List;
Line 6... Line 6...
6
 
6
 
7
import org.tela_botanica.del.client.exceptions.ExceptionClient;
7
import org.tela_botanica.del.client.exceptions.ExceptionClient;
-
 
8
import org.tela_botanica.del.client.modeles.Observation;
8
import org.tela_botanica.del.client.modeles.Observation;
9
import org.tela_botanica.del.client.modeles.ObservationDetermination;
Line 9... Line 10...
9
import org.tela_botanica.del.client.modeles.ObservationValidation;
10
import org.tela_botanica.del.client.modeles.ObservationValidation;
Line 10... Line 11...
10
 
11
 
Line 11... Line 12...
11
public class MockDatasource {
12
public class MockDatasource {
Line 12... Line 13...
12
 
13
 
-
 
14
	static MockDatasource instance;
-
 
15
 
Line 13... Line 16...
13
	static MockDatasource instance;
16
	List<Observation> observations = new ArrayList<Observation>();
Line 14... Line 17...
14
 
17
 
Line 15... Line 18...
15
	List<Observation> observations = new ArrayList<Observation>();
18
	List<ObservationValidation> observationValidationDatas = new ArrayList<ObservationValidation>();
Line 16... Line 19...
16
 
19
	
17
	List<ObservationValidation> observationValidationDatas = new ArrayList<ObservationValidation>();
20
	List<ObservationDetermination> observationDeterminationDatas = new ArrayList<ObservationDetermination>();
18
 
-
 
19
	private MockDatasource() {
21
 
20
 
22
	private MockDatasource() {
21
		for (int i = 0; i < 20; i++) {
23
 
22
 
24
		for (int i = 0; i < 20; i++) {
23
			Observation observation = new Observation();
25
 
24
 
26
			Observation observation = new Observation();
25
			observation.setAuteur("auteur " + i);
27
 
Line 48... Line 50...
48
		observationValidationData2.setContributor("contributeur test 2");
50
		observationValidationData2.setContributor("contributeur test 2");
49
		observationValidationData2.setId("2");
51
		observationValidationData2.setId("2");
50
		observationValidationData2.setIdImage("id image 1");
52
		observationValidationData2.setIdImage("id image 1");
51
		observationValidationData2.setVote(2);
53
		observationValidationData2.setVote(2);
52
		observationValidationDatas.add(observationValidationData2);
54
		observationValidationDatas.add(observationValidationData2);
-
 
55
		
-
 
56
		ObservationDetermination observationDeterminationData1 = new ObservationDetermination();
-
 
57
		observationDeterminationData1.setContributeur("Léo Ferré");
-
 
58
		observationDeterminationData1.setCommentaire("Avec le temps...");
-
 
59
		observationDeterminationData1.setId("1");
-
 
60
		observationDeterminationData1.setIdImage("id image 1");
-
 
61
		observationDeterminationData1.setPourcentageConfiance(90);
-
 
62
		observationDeterminationData1.setDateCommentaire("12/01/2011");
-
 
63
		observationDeterminationDatas.add(observationDeterminationData1);
-
 
64
		
-
 
65
		ObservationDetermination observationDeterminationData2 = new ObservationDetermination();
-
 
66
		observationDeterminationData2.setContributeur("Pierre Desproges");
-
 
67
		observationDeterminationData2.setCommentaire("Public chéri mon amour !");
-
 
68
		observationDeterminationData2.setId("2");
-
 
69
		observationDeterminationData2.setIdImage("id image 1");
-
 
70
		observationDeterminationData2.setPourcentageConfiance(30);
-
 
71
		observationDeterminationData2.setDateCommentaire("05/09/2011");
-
 
72
		observationDeterminationDatas.add(observationDeterminationData2);
-
 
73
		
-
 
74
		ObservationDetermination observationDeterminationData3 = new ObservationDetermination();
-
 
75
		observationDeterminationData3.setContributeur("Louis Aragon");
-
 
76
		observationDeterminationData3.setCommentaire("Tout est affaire de décor");
-
 
77
		observationDeterminationData3.setId("2");
-
 
78
		observationDeterminationData3.setIdImage("id image 1");
-
 
79
		observationDeterminationData3.setPourcentageConfiance(50);
-
 
80
		observationDeterminationData3.setDateCommentaire("14/08/2011");
-
 
81
		observationDeterminationDatas.add(observationDeterminationData3);
53
	}
82
	}
Line 54... Line 83...
54
 
83
 
-
 
84
	public List<Observation> getObservations() {
55
	public List<Observation> getObservations() {
85
 
56
		return observations;
86
		return observations;
Line 57... Line 87...
57
	}
87
	}
Line 58... Line 88...
58
 
88
 
59
	public List<ObservationValidation> getValidationData(String idImage) {
89
	public List<ObservationValidation> getValidationData(String idImage) {
-
 
90
 
-
 
91
		return observationValidationDatas;
-
 
92
	}
-
 
93
	
-
 
94
	public List<ObservationDetermination> getDeterminationData(String idImage) {
Line 60... Line 95...
60
 
95
 
-
 
96
		return observationDeterminationDatas;
Line 61... Line 97...
61
		return observationValidationDatas;
97
	}
Line 62... Line 98...
62
	}
98
 
63
 
99
	public void saveValidationData(ObservationValidation validationData)