Subversion Repositories eFlore/Applications.coel

Rev

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

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