Subversion Repositories eFlore/Applications.coel

Rev

Rev 883 | Rev 898 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 883 Rev 892
1
package org.tela_botanica.client;
1
package org.tela_botanica.client;
2
 
2
 
3
import java.util.Iterator;
3
import java.util.Iterator;
4
import java.util.List;
4
import java.util.List;
5
 
5
 
6
import org.tela_botanica.client.interfaces.Rafraichissable;
6
import org.tela_botanica.client.interfaces.Rafraichissable;
7
import org.tela_botanica.client.modeles.Collection;
7
import org.tela_botanica.client.modeles.Collection;
8
import org.tela_botanica.client.modeles.CollectionAPersonne;
8
import org.tela_botanica.client.modeles.CollectionAPersonne;
9
import org.tela_botanica.client.modeles.CollectionAPersonneAsyncDao;
9
import org.tela_botanica.client.modeles.CollectionAPersonneAsyncDao;
10
import org.tela_botanica.client.modeles.CollectionAPublication;
10
import org.tela_botanica.client.modeles.CollectionAPublication;
11
import org.tela_botanica.client.modeles.CollectionAPublicationAsyncDao;
11
import org.tela_botanica.client.modeles.CollectionAPublicationAsyncDao;
12
import org.tela_botanica.client.modeles.CollectionAsyncDao;
12
import org.tela_botanica.client.modeles.CollectionAsyncDao;
13
import org.tela_botanica.client.modeles.Personne;
13
import org.tela_botanica.client.modeles.Personne;
14
import org.tela_botanica.client.modeles.PersonneAsyncDao;
14
import org.tela_botanica.client.modeles.PersonneAsyncDao;
-
 
15
import org.tela_botanica.client.modeles.Projet;
15
import org.tela_botanica.client.modeles.ProjetAsyncDao;
16
import org.tela_botanica.client.modeles.ProjetAsyncDao;
16
import org.tela_botanica.client.modeles.Publication;
17
import org.tela_botanica.client.modeles.Publication;
17
import org.tela_botanica.client.modeles.PublicationAPersonneAsyncDao;
18
import org.tela_botanica.client.modeles.PublicationAPersonneAsyncDao;
18
import org.tela_botanica.client.modeles.PublicationAsyncDao;
19
import org.tela_botanica.client.modeles.PublicationAsyncDao;
19
import org.tela_botanica.client.modeles.Structure;
20
import org.tela_botanica.client.modeles.Structure;
20
import org.tela_botanica.client.modeles.StructureAPersonne;
21
import org.tela_botanica.client.modeles.StructureAPersonne;
21
import org.tela_botanica.client.modeles.StructureAPersonneAsyncDao;
22
import org.tela_botanica.client.modeles.StructureAPersonneAsyncDao;
22
import org.tela_botanica.client.modeles.StructureAsyncDao;
23
import org.tela_botanica.client.modeles.StructureAsyncDao;
23
import org.tela_botanica.client.modeles.StructureConservation;
24
import org.tela_botanica.client.modeles.StructureConservation;
24
import org.tela_botanica.client.modeles.StructureValorisation;
25
import org.tela_botanica.client.modeles.StructureValorisation;
25
import org.tela_botanica.client.modeles.Utilisateur;
26
import org.tela_botanica.client.modeles.Utilisateur;
26
import org.tela_botanica.client.modeles.UtilisateurAsyncDao;
27
import org.tela_botanica.client.modeles.UtilisateurAsyncDao;
27
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
28
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
28
 
29
 
29
import com.extjs.gxt.ui.client.Registry;
30
import com.extjs.gxt.ui.client.Registry;
30
import com.google.gwt.core.client.GWT;
31
import com.google.gwt.core.client.GWT;
31
import com.google.gwt.user.client.Window;
32
import com.google.gwt.user.client.Window;
32
 
33
 
33
// TODO : le transformer en SINGLETON
34
// TODO : le transformer en SINGLETON
34
public class Modele {
35
public class Modele {
35
 
36
 
36
	public Modele() {
37
	public Modele() {
37
		Registry.register(RegistreId.MODELE, this);
38
		Registry.register(RegistreId.MODELE, this);
38
	}
39
	}
39
 
40
 
40
	//+----------------------------------------------------------------------------------------------------------------+
41
	//+----------------------------------------------------------------------------------------------------------------+
41
	//												GESTION DES VALEURS ET LISTES
42
	//												GESTION DES VALEURS ET LISTES
42
	//+----------------------------------------------------------------------------------------------------------------+
43
	//+----------------------------------------------------------------------------------------------------------------+
43
	
44
	
44
	public void obtenirListeValeurs(Rafraichissable vue, Integer id) {
45
	public void obtenirListeValeurs(Rafraichissable vue, Integer id) {
45
		ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
46
		ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
46
		lsDao.obtenirListe(id);
47
		lsDao.obtenirListe(id);
47
	}
48
	}
48
	
49
	
49
	
50
	
50
	public void obtenirListeRegion(Rafraichissable vue, Integer id, String region) {
51
	public void obtenirListeRegion(Rafraichissable vue, Integer id, String region) {
51
		ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
52
		ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
52
		lsDao.selectionner("abv", id, null, region);
53
		lsDao.selectionner("abv", id, null, region);
53
	}
54
	}
54
	
55
	
55
	public void obtenirValeur(Rafraichissable vue, String type, Integer id, String identifiant) {
56
	public void obtenirValeur(Rafraichissable vue, String type, Integer id, String identifiant) {
56
		ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
57
		ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
57
		lsDao.selectionner(type, id, null, identifiant);
58
		lsDao.selectionner(type, id, null, identifiant);
58
	}
59
	}
59
	
60
	
60
	//+----------------------------------------------------------------------------------------------------------------+
61
	//+----------------------------------------------------------------------------------------------------------------+
61
	//												GESTION DES UTILISATEURS
62
	//												GESTION DES UTILISATEURS
62
	//+----------------------------------------------------------------------------------------------------------------+
63
	//+----------------------------------------------------------------------------------------------------------------+
63
	
64
	
64
	public void connecterUtilisateur(Rafraichissable vue, String login, String mdp) {
65
	public void connecterUtilisateur(Rafraichissable vue, String login, String mdp) {
65
		Utilisateur utilisateur = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
66
		Utilisateur utilisateur = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
66
		utilisateur.setLogin(login);
67
		utilisateur.setLogin(login);
67
		utilisateur.setMotDePasse(mdp);
68
		utilisateur.setMotDePasse(mdp);
68
		UtilisateurAsyncDao uDao = new UtilisateurAsyncDao(vue);
69
		UtilisateurAsyncDao uDao = new UtilisateurAsyncDao(vue);
69
		uDao.connecterUtilisateur();		
70
		uDao.connecterUtilisateur();		
70
	}
71
	}
71
	
72
	
72
	public void deconnecterUtilisateur(Rafraichissable vue) {
73
	public void deconnecterUtilisateur(Rafraichissable vue) {
73
		UtilisateurAsyncDao uDao = new UtilisateurAsyncDao(vue);
74
		UtilisateurAsyncDao uDao = new UtilisateurAsyncDao(vue);
74
		uDao.deconnecterUtilisateur();		
75
		uDao.deconnecterUtilisateur();		
75
	}
76
	}
76
		
77
		
77
	//+----------------------------------------------------------------------------------------------------------------+
78
	//+----------------------------------------------------------------------------------------------------------------+
78
	//												GESTION DES PROJETS
79
	//												GESTION DES PROJETS
79
	//+----------------------------------------------------------------------------------------------------------------+
80
	//+----------------------------------------------------------------------------------------------------------------+
80
	
81
	
81
	public void selectionnerProjets(Rafraichissable vueARafraichir)	{
82
	public void selectionnerProjets(Rafraichissable vueARafraichir)	{
82
		ProjetAsyncDao projetsDao = new ProjetAsyncDao(vueARafraichir);
83
		ProjetAsyncDao projetsDao = new ProjetAsyncDao(vueARafraichir);
83
		projetsDao.selectionner();
84
		projetsDao.selectionner();
84
	}
85
	}
85
 
86
 
86
	//+----------------------------------------------------------------------------------------------------------------+
87
	//+----------------------------------------------------------------------------------------------------------------+
87
	//												GESTION DES STRUCTURES
88
	//												GESTION DES STRUCTURES
88
	//+----------------------------------------------------------------------------------------------------------------+
89
	//+----------------------------------------------------------------------------------------------------------------+
89
 
90
 
90
	public void selectionnerStructure(Rafraichissable vueARafraichir, String projetId, String structureId) {
91
	public void selectionnerStructure(Rafraichissable vueARafraichir, String projetId, String structureId) {
91
		// Gestion des données des tables coel_structure, coel_structure_conservation et coel_structure_valorisation 
92
		// Gestion des données des tables coel_structure, coel_structure_conservation et coel_structure_valorisation 
92
		StructureAsyncDao sDao = new StructureAsyncDao(vueARafraichir);
93
		StructureAsyncDao sDao = new StructureAsyncDao(vueARafraichir);
93
		sDao.selectionner(projetId, structureId);
94
		sDao.selectionner(projetId, structureId);
94
	}
95
	}
95
	
96
	
96
	/** Lance la creation d'une Structure
97
	/** Lance la creation d'une Structure
97
	 * @param vueARafraichir la vue demandant a être rafraichie
98
	 * @param vueARafraichir la vue demandant a être rafraichie
98
	 * @param structure les données de la structure
99
	 * @param structure les données de la structure
99
	 */
100
	 */
100
	public void ajouterStructure(Rafraichissable vueARafraichir, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
101
	public void ajouterStructure(Rafraichissable vueARafraichir, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
101
		StructureAsyncDao structureDao = new StructureAsyncDao(vueARafraichir);
102
		StructureAsyncDao structureDao = new StructureAsyncDao(vueARafraichir);
102
		structureDao.ajouter(structure, conservation, valorisation);
103
		structureDao.ajouter(structure, conservation, valorisation);
103
	}
104
	}
104
 
105
 
105
	public void supprimerStructure(Rafraichissable vueARafraichir, String idStr) {
106
	public void supprimerStructure(Rafraichissable vueARafraichir, String idStr) {
106
		StructureAsyncDao structureDao = new StructureAsyncDao(vueARafraichir);
107
		StructureAsyncDao structureDao = new StructureAsyncDao(vueARafraichir);
107
		structureDao.supprimer(idStr);
108
		structureDao.supprimer(idStr);
108
	}
109
	}
109
	
110
	
110
	public void modifierStructure(Rafraichissable vueARafraichir, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
111
	public void modifierStructure(Rafraichissable vueARafraichir, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
111
		StructureAsyncDao structureDao = new StructureAsyncDao(vueARafraichir);
112
		StructureAsyncDao structureDao = new StructureAsyncDao(vueARafraichir);
112
		structureDao.modifier(structureId, structure, conservation, valorisation);
113
		structureDao.modifier(structureId, structure, conservation, valorisation);
113
	}
114
	}
114
 
115
 
115
	//+----------------------------------------------------------------------------------------------------------------+
116
	//+----------------------------------------------------------------------------------------------------------------+
116
	// GESTION de la relation STRUCTURE A PERSONNE
117
	// GESTION de la relation STRUCTURE A PERSONNE
117
	
118
	
118
	public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId) {
119
	public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId) {
119
		// Gestion des données de la table coel_structure_a_personne
120
		// Gestion des données de la table coel_structure_a_personne
120
		if (structureId != null && roleId != null) {
121
		if (structureId != null && roleId != null) {
121
			StructureAPersonneAsyncDao sapDao = new StructureAPersonneAsyncDao(vueARafraichir);
122
			StructureAPersonneAsyncDao sapDao = new StructureAPersonneAsyncDao(vueARafraichir);
122
			sapDao.selectionner(structureId, roleId);
123
			sapDao.selectionner(structureId, roleId);
123
		}
124
		}
124
	}
125
	}
125
	
126
	
126
	public void modifierStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonne personnel) {
127
	public void modifierStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonne personnel) {
127
		StructureAPersonneAsyncDao structureAPersonneDao = new StructureAPersonneAsyncDao(vueARafraichir);
128
		StructureAPersonneAsyncDao structureAPersonneDao = new StructureAPersonneAsyncDao(vueARafraichir);
128
		structureAPersonneDao.modifier(personnel);
129
		structureAPersonneDao.modifier(personnel);
129
	}
130
	}
130
	
131
	
131
	public void ajouterStructureAPersonne(Rafraichissable vueARafraichir, String structureId, StructureAPersonne personnel) {
132
	public void ajouterStructureAPersonne(Rafraichissable vueARafraichir, String structureId, StructureAPersonne personnel) {
132
		StructureAPersonneAsyncDao structureAPersonneDao = new StructureAPersonneAsyncDao(vueARafraichir);
133
		StructureAPersonneAsyncDao structureAPersonneDao = new StructureAPersonneAsyncDao(vueARafraichir);
133
		structureAPersonneDao.ajouter(structureId, personnel);	
134
		structureAPersonneDao.ajouter(structureId, personnel);	
134
	}
135
	}
135
	
136
	
136
	public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, String personnelId) {
137
	public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, String personnelId) {
137
		StructureAPersonneAsyncDao structureAPersonneDao = new StructureAPersonneAsyncDao(vueARafraichir);
138
		StructureAPersonneAsyncDao structureAPersonneDao = new StructureAPersonneAsyncDao(vueARafraichir);
138
		structureAPersonneDao.supprimer(personnelId);
139
		structureAPersonneDao.supprimer(personnelId);
139
	}
140
	}
140
 
141
 
141
	//+----------------------------------------------------------------------------------------------------------------+
142
	//+----------------------------------------------------------------------------------------------------------------+
142
	//												GESTION DES COLLECTIONS
143
	//												GESTION DES COLLECTIONS
143
	//+----------------------------------------------------------------------------------------------------------------+
144
	//+----------------------------------------------------------------------------------------------------------------+
144
	
145
	
145
	public void selectionnerCollection(Rafraichissable vueARafraichir, String projetId, String collectionId) {
146
	public void selectionnerCollection(Rafraichissable vueARafraichir, String projetId, String collectionId) {
146
		CollectionAsyncDao cDao = new CollectionAsyncDao(vueARafraichir);
147
		CollectionAsyncDao cDao = new CollectionAsyncDao(vueARafraichir);
147
		cDao.selectionner(projetId, collectionId);
148
		cDao.selectionner(projetId, collectionId);
148
	}
149
	}
149
	
150
	
150
	public void ajouterCollection(Rafraichissable vueARafraichir, String utilisateurId, Collection collection) {
151
	public void ajouterCollection(Rafraichissable vueARafraichir, String utilisateurId, Collection collection) {
151
		// TODO Auto-generated method stub
152
		// TODO Auto-generated method stub
152
		
153
		
153
	}
154
	}
154
 
155
 
155
	public void modifierCollection(Rafraichissable vueARafraichir, Collection collection) {
156
	public void modifierCollection(Rafraichissable vueARafraichir, Collection collection) {
156
		CollectionAsyncDao cDao = new CollectionAsyncDao(vueARafraichir);
157
		CollectionAsyncDao cDao = new CollectionAsyncDao(vueARafraichir);
157
		cDao.modifier(collection);
158
		cDao.modifier(collection);
158
	}
159
	}
159
 
160
 
160
	public void supprimerCollection(Rafraichissable vueARafraichir, String utilisateurId, String identifiantsCollectionSepareParVirgule) {
161
	public void supprimerCollection(Rafraichissable vueARafraichir, String utilisateurId, String identifiantsCollectionSepareParVirgule) {
161
		// TODO Auto-generated method stub
162
		// TODO Auto-generated method stub
162
		
163
		
163
	}
164
	}
164
	
165
	
165
	//+----------------------------------------------------------------------------------------------------------------+
166
	//+----------------------------------------------------------------------------------------------------------------+
166
	// GESTION de la relation COLLECTION A PERSONNE
167
	// GESTION de la relation COLLECTION A PERSONNE
167
	
168
	
168
	public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId) {
169
	public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId) {
169
		CollectionAPersonneAsyncDao sapDao = new CollectionAPersonneAsyncDao(vueARafraichir);
170
		CollectionAPersonneAsyncDao sapDao = new CollectionAPersonneAsyncDao(vueARafraichir);
170
		sapDao.selectionner(collectionId, roleId);
171
		sapDao.selectionner(collectionId, roleId);
171
	}
172
	}
172
	
173
	
173
	public void modifierCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonne collectionAPersonne) {
174
	public void modifierCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonne collectionAPersonne) {
174
		CollectionAPersonneAsyncDao collectionAPersonneDao = new CollectionAPersonneAsyncDao(vueARafraichir);
175
		CollectionAPersonneAsyncDao collectionAPersonneDao = new CollectionAPersonneAsyncDao(vueARafraichir);
175
		collectionAPersonneDao.modifier(collectionAPersonne);
176
		collectionAPersonneDao.modifier(collectionAPersonne);
176
	}
177
	}
177
	
178
	
178
	public void ajouterCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, CollectionAPersonne collectionAPersonne) {
179
	public void ajouterCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, CollectionAPersonne collectionAPersonne) {
179
		CollectionAPersonneAsyncDao collectionAPersonneDao = new CollectionAPersonneAsyncDao(vueARafraichir);
180
		CollectionAPersonneAsyncDao collectionAPersonneDao = new CollectionAPersonneAsyncDao(vueARafraichir);
180
		collectionAPersonneDao.ajouter(collectionId, collectionAPersonne);	
181
		collectionAPersonneDao.ajouter(collectionId, collectionAPersonne);	
181
	}
182
	}
182
	
183
	
183
	public void supprimerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionAPersonneId) {
184
	public void supprimerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionAPersonneId) {
184
		CollectionAPersonneAsyncDao collectionAPersonneDao = new CollectionAPersonneAsyncDao(vueARafraichir);
185
		CollectionAPersonneAsyncDao collectionAPersonneDao = new CollectionAPersonneAsyncDao(vueARafraichir);
185
		collectionAPersonneDao.supprimer(collectionAPersonneId);
186
		collectionAPersonneDao.supprimer(collectionAPersonneId);
186
	}
187
	}
187
	
188
	
188
	//+----------------------------------------------------------------------------------------------------------------+
189
	//+----------------------------------------------------------------------------------------------------------------+
189
	// GESTION de la relation COLLECTION A PUBLICATION
190
	// GESTION de la relation COLLECTION A PUBLICATION
190
	
191
	
191
	public void selectionnerCollectionAPublication(Rafraichissable vueARafraichir, String collectionId) {
192
	public void selectionnerCollectionAPublication(Rafraichissable vueARafraichir, String collectionId) {
192
		CollectionAPublicationAsyncDao capDao = new CollectionAPublicationAsyncDao(vueARafraichir);
193
		CollectionAPublicationAsyncDao capDao = new CollectionAPublicationAsyncDao(vueARafraichir);
193
		capDao.selectionner(collectionId);
194
		capDao.selectionner(collectionId);
194
	}
195
	}
195
	
196
	
196
	public void modifierCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublication collectionAPublication) {
197
	public void modifierCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublication collectionAPublication) {
197
		CollectionAPublicationAsyncDao collectionAPublicationDao = new CollectionAPublicationAsyncDao(vueARafraichir);
198
		CollectionAPublicationAsyncDao collectionAPublicationDao = new CollectionAPublicationAsyncDao(vueARafraichir);
198
		collectionAPublicationDao.modifier(collectionAPublication);
199
		collectionAPublicationDao.modifier(collectionAPublication);
199
	}
200
	}
200
	
201
	
201
	public void ajouterCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, CollectionAPublication collectionAPublication) {
202
	public void ajouterCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, CollectionAPublication collectionAPublication) {
202
		CollectionAPublicationAsyncDao collectionAPublicationDao = new CollectionAPublicationAsyncDao(vueARafraichir);
203
		CollectionAPublicationAsyncDao collectionAPublicationDao = new CollectionAPublicationAsyncDao(vueARafraichir);
203
		collectionAPublicationDao.ajouter(collectionId, collectionAPublication);	
204
		collectionAPublicationDao.ajouter(collectionId, collectionAPublication);	
204
	}
205
	}
205
	
206
	
206
	public void supprimerCollectionAPublication(Rafraichissable vueARafraichir, String collectionAPublicationId) {
207
	public void supprimerCollectionAPublication(Rafraichissable vueARafraichir, String collectionAPublicationId) {
207
		CollectionAPublicationAsyncDao collectionAPublicationDao = new CollectionAPublicationAsyncDao(vueARafraichir);
208
		CollectionAPublicationAsyncDao collectionAPublicationDao = new CollectionAPublicationAsyncDao(vueARafraichir);
208
		collectionAPublicationDao.supprimer(collectionAPublicationId);
209
		collectionAPublicationDao.supprimer(collectionAPublicationId);
209
	}
210
	}
210
	
211
	
211
	//+----------------------------------------------------------------------------------------------------------------+
212
	//+----------------------------------------------------------------------------------------------------------------+
212
	//												GESTION DES PERSONNES
213
	//												GESTION DES PERSONNES
213
	//+----------------------------------------------------------------------------------------------------------------+
214
	//+----------------------------------------------------------------------------------------------------------------+
214
	
215
	
215
	public void selectionnerPersonne(Rafraichissable vueARafraichir, String personneId, String projetId, String nomComplet, int start, int nbElements) {
216
	public void selectionnerPersonne(Rafraichissable vueARafraichir, String personneId, String projetId, String nomComplet, int start, int nbElements) {
216
		PersonneAsyncDao pDao = new PersonneAsyncDao(vueARafraichir);
217
		PersonneAsyncDao pDao = new PersonneAsyncDao(vueARafraichir);
217
		pDao.selectionner(personneId, projetId, nomComplet, start, nbElements);
218
		pDao.selectionner(personneId, projetId, nomComplet, start, nbElements);
218
	}
219
	}
219
 
220
 
220
	public void supprimerPersonne(Rafraichissable vueARafraichir, String idPersonneSepareParVirgule) {
221
	public void supprimerPersonne(Rafraichissable vueARafraichir, String idPersonneSepareParVirgule) {
221
		PersonneAsyncDao personneDao = new PersonneAsyncDao(vueARafraichir);
222
		PersonneAsyncDao personneDao = new PersonneAsyncDao(vueARafraichir);
222
		personneDao.supprimer(idPersonneSepareParVirgule);
223
		personneDao.supprimer(idPersonneSepareParVirgule);
223
		
224
		
224
	}
225
	}
225
	
226
	
226
	public void ajouterPersonne(Rafraichissable vue, Personne personne)	{
227
	public void ajouterPersonne(Rafraichissable vue, Personne personne)	{
227
		PersonneAsyncDao personneDao = new PersonneAsyncDao(vue);
228
		PersonneAsyncDao personneDao = new PersonneAsyncDao(vue);
228
		personneDao.ajouter(personne);
229
		personneDao.ajouter(personne);
229
	}
230
	}
230
	
231
	
231
	public void modifierPersonne(Rafraichissable vueARafraichir, Personne personne)	{
232
	public void modifierPersonne(Rafraichissable vueARafraichir, Personne personne)	{
232
		PersonneAsyncDao personneDao = new PersonneAsyncDao(vueARafraichir);
233
		PersonneAsyncDao personneDao = new PersonneAsyncDao(vueARafraichir);
233
		personneDao.modifier(personne);
234
		personneDao.modifier(personne);
234
	}
235
	}
235
		
236
		
236
	//+----------------------------------------------------------------------------------------------------------------+
237
	//+----------------------------------------------------------------------------------------------------------------+
237
	//												GESTION DES PUBLICATIONS
238
	//												GESTION DES PUBLICATIONS
238
	//+----------------------------------------------------------------------------------------------------------------+
239
	//+----------------------------------------------------------------------------------------------------------------+
239
	
240
	
240
	public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId, String projetId, String nomComplet) {		
241
	public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId, String projetId, String nomComplet) {		
241
		PublicationAsyncDao lsDao = new PublicationAsyncDao(vueARafraichir);
242
		PublicationAsyncDao lsDao = new PublicationAsyncDao(vueARafraichir);
242
		lsDao.selectionner(publicationId, projetId, nomComplet);
243
		lsDao.selectionner(publicationId, projetId, nomComplet);
243
	}
244
	}
244
	
245
	
245
	public void modifierPublication(Rafraichissable vueRafraichir, Publication publication) {
246
	public void modifierPublication(Rafraichissable vueRafraichir, Publication publication) {
246
		PublicationAsyncDao pDao = new PublicationAsyncDao(vueRafraichir);
247
		PublicationAsyncDao pDao = new PublicationAsyncDao(vueRafraichir);
247
		pDao.modifier(publication);
248
		pDao.modifier(publication);
248
	}
249
	}
249
 
250
 
250
	public void ajouterPublication(Rafraichissable vueARafraichir, Publication publication) {
251
	public void ajouterPublication(Rafraichissable vueARafraichir, Publication publication) {
251
		PublicationAsyncDao pDao = new PublicationAsyncDao(vueARafraichir);
252
		PublicationAsyncDao pDao = new PublicationAsyncDao(vueARafraichir);
252
		pDao.ajouter(publication);
253
		pDao.ajouter(publication);
253
	}
254
	}
254
 
255
 
255
	public void supprimerPublication(Rafraichissable vueARafraichir, List<Publication> publicationListe) {
256
	public void supprimerPublication(Rafraichissable vueARafraichir, List<Publication> publicationListe) {
256
		String publicationsId = "";
257
		String publicationsId = "";
257
		for(Iterator<Publication> it = publicationListe.iterator(); it.hasNext();) {
258
		for(Iterator<Publication> it = publicationListe.iterator(); it.hasNext();) {
258
			Publication pub = it.next();
259
			Publication pub = it.next();
259
			publicationsId += pub.getId();
260
			publicationsId += pub.getId();
260
			if(it.hasNext()) {
261
			if(it.hasNext()) {
261
				publicationsId += ",";
262
				publicationsId += ",";
262
			}
263
			}
263
		}
264
		}
264
		PublicationAsyncDao pDao = new PublicationAsyncDao(vueARafraichir);
265
		PublicationAsyncDao pDao = new PublicationAsyncDao(vueARafraichir);
265
		pDao.supprimer(publicationsId);	
266
		pDao.supprimer(publicationsId);	
266
	}
267
	}
267
 
268
 
268
	//+----------------------------------------------------------------------------------------------------------------+
269
	//+----------------------------------------------------------------------------------------------------------------+
269
	// GESTION de la relation PUBLICATION A PERSONNE
270
	// GESTION de la relation PUBLICATION A PERSONNE
270
 
271
 
271
	public void selectionPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
272
	public void selectionPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
272
		PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
273
		PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
273
		paDao.selectionner(publicationId, personnesId, roleId);
274
		paDao.selectionner(publicationId, personnesId, roleId);
274
	}
275
	}
275
	
276
	
276
	public void ajouterAuteurPublication(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
277
	public void ajouterAuteurPublication(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
277
		PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
278
		PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
278
		paDao.ajouter(publicationId, personnesId, roleId);
279
		paDao.ajouter(publicationId, personnesId, roleId);
279
	}
280
	}
280
 
281
 
281
	public void modifierAuteurPublication(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
282
	public void modifierAuteurPublication(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
282
		PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
283
		PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
283
		paDao.modifier(publicationId, personnesId, roleId);
284
		paDao.modifier(publicationId, personnesId, roleId);
284
	}
285
	}
285
 
286
 
286
	public void selectionnerProjet(Rafraichissable vueARafraichir,
287
	public void selectionnerProjet(Rafraichissable vueARafraichir,
287
			String projetId) {
288
			String projetId) {
288
		ProjetAsyncDao pADAO = new ProjetAsyncDao(vueARafraichir);
289
		ProjetAsyncDao pADAO = new ProjetAsyncDao(vueARafraichir);
289
		pADAO.selectionnerProjet(projetId);
290
		pADAO.selectionnerProjet(projetId);
290
	}
291
	}
-
 
292
 
-
 
293
	public void ajouterProjet(Rafraichissable vueARafraichir,
-
 
294
			Projet projetCollecte) {
-
 
295
		ProjetAsyncDao pADAO = new ProjetAsyncDao(vueARafraichir);
-
 
296
		pADAO.ajouter(projetCollecte);
-
 
297
		
-
 
298
	}
-
 
299
 
-
 
300
	public void modifierProjet(Rafraichissable vueARafraichir,
-
 
301
			Projet projetCollecte) {
-
 
302
		ProjetAsyncDao pADAO = new ProjetAsyncDao(vueARafraichir);
-
 
303
		pADAO.modifier(projetCollecte);
-
 
304
	}
291
 
305
 
292
}
306
}