Subversion Repositories eFlore/Applications.coel

Rev

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

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