Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1155 Rev 1156
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.composants.AideFenetre;
6
import org.tela_botanica.client.composants.AideFenetre;
7
import org.tela_botanica.client.composants.IdentificationFenetre;
7
import org.tela_botanica.client.composants.IdentificationFenetre;
8
import org.tela_botanica.client.composants.LicenceFenetre;
8
import org.tela_botanica.client.composants.LicenceFenetre;
9
import org.tela_botanica.client.composants.AproposFenetre;
9
import org.tela_botanica.client.composants.AproposFenetre;
10
import org.tela_botanica.client.configuration.APropos;
10
import org.tela_botanica.client.configuration.APropos;
11
import org.tela_botanica.client.configuration.Configuration;
11
import org.tela_botanica.client.configuration.Configuration;
12
import org.tela_botanica.client.i18n.Constantes;
12
import org.tela_botanica.client.i18n.Constantes;
13
import org.tela_botanica.client.i18n.ErrorMessages;
13
import org.tela_botanica.client.i18n.ErrorMessages;
14
import org.tela_botanica.client.interfaces.Rafraichissable;
14
import org.tela_botanica.client.interfaces.Rafraichissable;
15
import org.tela_botanica.client.modeles.Information;
15
import org.tela_botanica.client.modeles.Information;
16
import org.tela_botanica.client.modeles.MenuApplicationId;
16
import org.tela_botanica.client.modeles.MenuApplicationId;
17
import org.tela_botanica.client.modeles.Utilisateur;
17
import org.tela_botanica.client.modeles.Utilisateur;
18
import org.tela_botanica.client.modeles.Valeur;
18
import org.tela_botanica.client.modeles.Valeur;
19
import org.tela_botanica.client.modeles.ValeurListe;
-
 
20
import org.tela_botanica.client.modeles.collection.Collection;
19
import org.tela_botanica.client.modeles.collection.Collection;
21
import org.tela_botanica.client.modeles.collection.CollectionACommentaire;
20
import org.tela_botanica.client.modeles.collection.CollectionACommentaire;
22
import org.tela_botanica.client.modeles.collection.CollectionACommentaireAsyncDao;
21
import org.tela_botanica.client.modeles.collection.CollectionACommentaireAsyncDao;
23
import org.tela_botanica.client.modeles.collection.CollectionACommentaireListe;
22
import org.tela_botanica.client.modeles.collection.CollectionACommentaireListe;
24
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
23
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
25
import org.tela_botanica.client.modeles.collection.CollectionAPersonneListe;
24
import org.tela_botanica.client.modeles.collection.CollectionAPersonneListe;
26
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
25
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
27
import org.tela_botanica.client.modeles.collection.CollectionAPublicationListe;
26
import org.tela_botanica.client.modeles.collection.CollectionAPublicationListe;
28
import org.tela_botanica.client.modeles.collection.CollectionListe;
27
import org.tela_botanica.client.modeles.collection.CollectionListe;
29
import org.tela_botanica.client.modeles.commentaire.Commentaire;
28
import org.tela_botanica.client.modeles.commentaire.Commentaire;
30
import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
29
import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
31
import org.tela_botanica.client.modeles.personne.Personne;
30
import org.tela_botanica.client.modeles.personne.Personne;
32
import org.tela_botanica.client.modeles.personne.PersonneListe;
31
import org.tela_botanica.client.modeles.personne.PersonneListe;
33
import org.tela_botanica.client.modeles.projet.Projet;
32
import org.tela_botanica.client.modeles.projet.Projet;
34
import org.tela_botanica.client.modeles.projet.ProjetListe;
33
import org.tela_botanica.client.modeles.projet.ProjetListe;
35
import org.tela_botanica.client.modeles.publication.Publication;
34
import org.tela_botanica.client.modeles.publication.Publication;
36
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
35
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
37
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
36
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
38
import org.tela_botanica.client.modeles.publication.PublicationListe;
37
import org.tela_botanica.client.modeles.publication.PublicationListe;
39
import org.tela_botanica.client.modeles.structure.Structure;
38
import org.tela_botanica.client.modeles.structure.Structure;
40
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
39
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
41
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
40
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
42
import org.tela_botanica.client.modeles.structure.StructureConservation;
41
import org.tela_botanica.client.modeles.structure.StructureConservation;
43
import org.tela_botanica.client.modeles.structure.StructureListe;
42
import org.tela_botanica.client.modeles.structure.StructureListe;
44
import org.tela_botanica.client.modeles.structure.StructureValorisation;
43
import org.tela_botanica.client.modeles.structure.StructureValorisation;
45
import org.tela_botanica.client.util.Debug;
44
import org.tela_botanica.client.util.Debug;
46
import org.tela_botanica.client.vues.ContenuVue;
45
import org.tela_botanica.client.vues.ContenuVue;
47
import org.tela_botanica.client.vues.EnteteVue;
46
import org.tela_botanica.client.vues.EnteteVue;
48
import org.tela_botanica.client.vues.Formulaire;
47
import org.tela_botanica.client.vues.Formulaire;
49
import org.tela_botanica.client.vues.NavigationVue;
48
import org.tela_botanica.client.vues.NavigationVue;
50
import org.tela_botanica.client.vues.PopupChargement;
49
import org.tela_botanica.client.vues.PopupChargement;
51
import org.tela_botanica.client.vues.StatutVue;
50
import org.tela_botanica.client.vues.StatutVue;
52
import org.tela_botanica.client.vues.MenuVue;
-
 
53
import org.tela_botanica.client.vues.accueil.AccueilVue;
51
import org.tela_botanica.client.vues.accueil.AccueilVue;
54
import org.tela_botanica.client.vues.collection.CollectionForm;
52
import org.tela_botanica.client.vues.collection.CollectionForm;
55
import org.tela_botanica.client.vues.collection.CollectionListeVue;
53
import org.tela_botanica.client.vues.collection.CollectionListeVue;
56
import org.tela_botanica.client.vues.collection.CollectionVue;
54
import org.tela_botanica.client.vues.collection.CollectionVue;
57
import org.tela_botanica.client.vues.commentaire.CommentaireForm;
55
import org.tela_botanica.client.vues.commentaire.CommentaireForm;
58
import org.tela_botanica.client.vues.commentaire.CommentaireVue;
56
import org.tela_botanica.client.vues.commentaire.CommentaireVue;
59
import org.tela_botanica.client.vues.personne.PersonneForm;
57
import org.tela_botanica.client.vues.personne.PersonneForm;
60
import org.tela_botanica.client.vues.personne.PersonneVue;
58
import org.tela_botanica.client.vues.personne.PersonneVue;
61
import org.tela_botanica.client.vues.projet.ProjetForm;
59
import org.tela_botanica.client.vues.projet.ProjetForm;
62
import org.tela_botanica.client.vues.projet.ProjetVue;
60
import org.tela_botanica.client.vues.projet.ProjetVue;
63
import org.tela_botanica.client.vues.publication.PublicationForm;
61
import org.tela_botanica.client.vues.publication.PublicationForm;
64
import org.tela_botanica.client.vues.publication.PublicationVue;
62
import org.tela_botanica.client.vues.publication.PublicationVue;
65
import org.tela_botanica.client.vues.structure.StructureForm;
63
import org.tela_botanica.client.vues.structure.StructureForm;
66
import org.tela_botanica.client.vues.structure.StructureVue;
64
import org.tela_botanica.client.vues.structure.StructureVue;
67
 
65
 
68
import com.extjs.gxt.ui.client.Registry;
66
import com.extjs.gxt.ui.client.Registry;
69
import com.extjs.gxt.ui.client.Style.LayoutRegion;
67
import com.extjs.gxt.ui.client.Style.LayoutRegion;
70
import com.extjs.gxt.ui.client.event.Listener;
68
import com.extjs.gxt.ui.client.event.Listener;
71
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
69
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
72
import com.extjs.gxt.ui.client.util.Margins;
70
import com.extjs.gxt.ui.client.util.Margins;
73
import com.extjs.gxt.ui.client.widget.Component;
-
 
74
import com.extjs.gxt.ui.client.widget.Dialog;
71
import com.extjs.gxt.ui.client.widget.Dialog;
75
import com.extjs.gxt.ui.client.widget.Info;
72
import com.extjs.gxt.ui.client.widget.Info;
76
import com.extjs.gxt.ui.client.widget.MessageBox;
73
import com.extjs.gxt.ui.client.widget.MessageBox;
77
import com.extjs.gxt.ui.client.widget.Viewport;
74
import com.extjs.gxt.ui.client.widget.Viewport;
78
import com.extjs.gxt.ui.client.widget.button.Button;
75
import com.extjs.gxt.ui.client.widget.button.Button;
79
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
76
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
80
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
77
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
81
import com.google.gwt.core.client.GWT;
78
import com.google.gwt.core.client.GWT;
82
import com.google.gwt.i18n.client.Dictionary;
79
import com.google.gwt.i18n.client.Dictionary;
83
import com.google.gwt.user.client.Window;
80
import com.google.gwt.user.client.Window;
84
import com.google.gwt.user.client.ui.RootPanel;
81
import com.google.gwt.user.client.ui.RootPanel;
85
 
82
 
86
public class Mediateur implements Rafraichissable {
83
public class Mediateur implements Rafraichissable {
87
	
84
	
88
	private Viewport viewport;
85
	private Viewport viewport;
89
	private Modele modele = null;
86
	private Modele modele = null;
90
	public static final Constantes i18nC = getI18nConstante();
87
	public static final Constantes i18nC = getI18nConstante();
91
	public static final ErrorMessages i18nM = getI18nMessage();
88
	public static final ErrorMessages i18nM = getI18nMessage();
92
	
89
	
93
	private EnteteVue panneauNord = null;
90
	private EnteteVue panneauNord = null;
94
	private NavigationVue panneauOuest = null;
91
	private NavigationVue panneauOuest = null;
95
	private ContenuVue panneauCentre = null;
92
	private ContenuVue panneauCentre = null;
96
	private StatutVue panneauSud = null;
93
	private StatutVue panneauSud = null;
97
	
94
	
98
	private IdentificationFenetre fenetreIdentification = null;
95
	private IdentificationFenetre fenetreIdentification = null;
99
	private int nbElements = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
96
	private int nbElements = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
-
 
97
	
100
	public Mediateur() {
98
	public Mediateur() {
101
		// Enregistrement du Médiateur dans le Registre
99
		// Enregistrement du Médiateur dans le Registre
102
		Registry.register(RegistreId.MEDIATEUR, this);
100
		Registry.register(RegistreId.MEDIATEUR, this);
103
 
101
 
104
		//Initialisation du Registre
102
		//Initialisation du Registre
105
		initialiserRegistre();
103
		initialiserRegistre();
106
		
104
		
107
		// Création du Modèle qui s'enregistre lui même dans le Registre
105
		// Création du Modèle qui s'enregistre lui même dans le Registre
108
		modele = new Modele();
106
		modele = new Modele();
109
 
107
 
110
		// Création du Viewport qui contient la disposition globale de l'application
108
		// Création du Viewport qui contient la disposition globale de l'application
111
		viewport = new Viewport();
109
		viewport = new Viewport();
112
		viewport.setLayout(new BorderLayout());
110
		viewport.setLayout(new BorderLayout());
113
 
111
 
114
		// Création des différents panneaux
112
		// Création des différents panneaux
115
	    creerPanneauNord();
113
	    creerPanneauNord();
116
	    creerPanneauOuest();
114
	    creerPanneauOuest();
117
	    creerPanneauCentral();
115
	    creerPanneauCentral();
118
	    creerPanneauSud();
116
	    creerPanneauSud();
119
		
117
		
120
		// Connection de l'utilisateur
118
		// Connection de l'utilisateur
121
		connecterUtilisateur(null, null);
119
		connecterUtilisateur(null, null);
122
		
120
		
123
		// Retour à GWT du Viewport une fois constuit
121
		// Retour à GWT du Viewport une fois constuit
124
		RootPanel.get().add(viewport);
122
		RootPanel.get().add(viewport);
125
	}
123
	}
126
	
124
	
127
	//+----------------------------------------------------------------------------------------------------------------+
125
	//+----------------------------------------------------------------------------------------------------------------+
128
	//												GESTION de l'I18N et du REGISTRE
126
	//												GESTION de l'I18N et du REGISTRE
129
	//+----------------------------------------------------------------------------------------------------------------+
127
	//+----------------------------------------------------------------------------------------------------------------+
130
	protected static Constantes getI18nConstante() {
128
	protected static Constantes getI18nConstante() {
131
		return GWT.create(Constantes.class);
129
		return GWT.create(Constantes.class);
132
	}
130
	}
133
	
131
	
134
	protected static ErrorMessages getI18nMessage() {
132
	protected static ErrorMessages getI18nMessage() {
135
		return GWT.create(ErrorMessages.class);
133
		return GWT.create(ErrorMessages.class);
136
	}
134
	}
137
	
135
	
138
	protected void initialiserRegistre() {
136
	protected void initialiserRegistre() {
139
		APropos apropos = new APropos();
137
		APropos apropos = new APropos();
140
		
138
		
141
		Registry.register(RegistreId.APPLI_NOM, apropos.getAppliNom());
139
		Registry.register(RegistreId.APPLI_NOM, apropos.getAppliNom());
142
		Registry.register(RegistreId.APPLI_CODE, apropos.getAppliCode());
140
		Registry.register(RegistreId.APPLI_CODE, apropos.getAppliCode());
143
		Registry.register(RegistreId.APPLI_VERSION, apropos.getAppliVersionCode());
141
		Registry.register(RegistreId.APPLI_VERSION, apropos.getAppliVersionCode());
144
		Registry.register(RegistreId.APPLI_VERSION_NOM, apropos.getAppliVersionNom());
142
		Registry.register(RegistreId.APPLI_VERSION_NOM, apropos.getAppliVersionNom());
145
		
143
		
146
		Registry.register(RegistreId.APPLI_DEVELOPPEURS, apropos.getDeveloppeurs());
144
		Registry.register(RegistreId.APPLI_DEVELOPPEURS, apropos.getDeveloppeurs());
147
		Registry.register(RegistreId.APPLI_TRADUCTEURS, apropos.getTraducteurs());
145
		Registry.register(RegistreId.APPLI_TRADUCTEURS, apropos.getTraducteurs());
148
		Registry.register(RegistreId.APPLI_LICENCE, apropos.getLicence());
146
		Registry.register(RegistreId.APPLI_LICENCE, apropos.getLicence());
149
		Registry.register(RegistreId.APPLI_REVISION, apropos.getRevisionGlobale());
147
		Registry.register(RegistreId.APPLI_REVISION, apropos.getRevisionGlobale());
150
		Registry.register(RegistreId.APPLI_COMPILATION_JAVA_VERSION, apropos.getVersionJavaCompilation());
148
		Registry.register(RegistreId.APPLI_COMPILATION_JAVA_VERSION, apropos.getVersionJavaCompilation());
151
		Registry.register(RegistreId.APPLI_COMPILATION_DATE_HEURE, apropos.getDateHeureCompilation());
149
		Registry.register(RegistreId.APPLI_COMPILATION_DATE_HEURE, apropos.getDateHeureCompilation());
152
 
150
 
153
		Registry.register(RegistreId.CONFIG, new Configuration());
151
		Registry.register(RegistreId.CONFIG, new Configuration());
154
		Registry.register(RegistreId.POPUP_CHARGEMENT, new PopupChargement(this));
152
		Registry.register(RegistreId.POPUP_CHARGEMENT, new PopupChargement(this));
155
		Registry.register(RegistreId.UTILISATEUR_COURANT, new Utilisateur());
153
		Registry.register(RegistreId.UTILISATEUR_COURANT, new Utilisateur());
156
		Registry.register(RegistreId.PROJET_COURANT, new Projet());
154
		Registry.register(RegistreId.PROJET_COURANT, new Projet());
157
	}
155
	}
158
	
156
	
159
	//+----------------------------------------------------------------------------------------------------------------+
157
	//+----------------------------------------------------------------------------------------------------------------+
160
	//												GESTION des PANNEAUX PRINCIPAUX
158
	//												GESTION des PANNEAUX PRINCIPAUX
161
	//+----------------------------------------------------------------------------------------------------------------+
159
	//+----------------------------------------------------------------------------------------------------------------+
162
	
160
	
163
	private void creerPanneauNord() {
161
	private void creerPanneauNord() {
164
		panneauNord = new EnteteVue(this);
162
		panneauNord = new EnteteVue(this);
165
		
163
		
166
		BorderLayoutData regionNord = new BorderLayoutData(LayoutRegion.NORTH, 100);  
164
		BorderLayoutData regionNord = new BorderLayoutData(LayoutRegion.NORTH, 100);  
167
		regionNord.setCollapsible(true);
165
		regionNord.setCollapsible(true);
168
		regionNord.setFloatable(true);
166
		regionNord.setFloatable(true);
169
		regionNord.setSplit(false);
167
		regionNord.setSplit(false);
170
		regionNord.setMargins(new Margins(5, 5, 0, 5));
168
		regionNord.setMargins(new Margins(5, 5, 0, 5));
171
		
169
		
172
		viewport.add(panneauNord, regionNord);
170
		viewport.add(panneauNord, regionNord);
173
	}
171
	}
174
	
172
	
175
	private void creerPanneauOuest() {
173
	private void creerPanneauOuest() {
176
		panneauOuest = new NavigationVue(this); 
174
		panneauOuest = new NavigationVue(this); 
177
		
175
		
178
		BorderLayoutData regionOuest = new BorderLayoutData(LayoutRegion.WEST, 200);  
176
		BorderLayoutData regionOuest = new BorderLayoutData(LayoutRegion.WEST, 200);  
179
		regionOuest.setSplit(true);
177
		regionOuest.setSplit(true);
180
		regionOuest.setCollapsible(true);  
178
		regionOuest.setCollapsible(true);  
181
		regionOuest.setMargins(new Margins(5));
179
		regionOuest.setMargins(new Margins(5));
182
 
180
 
183
		viewport.add(panneauOuest, regionOuest);
181
		viewport.add(panneauOuest, regionOuest);
184
	}
182
	}
185
 
183
 
186
	private void creerPanneauCentral() {
184
	private void creerPanneauCentral() {
187
		panneauCentre = new ContenuVue(this);
185
		panneauCentre = new ContenuVue(this);
188
 
186
 
189
		BorderLayoutData regionCentre = new BorderLayoutData(LayoutRegion.CENTER);  
187
		BorderLayoutData regionCentre = new BorderLayoutData(LayoutRegion.CENTER);  
190
		regionCentre.setMargins(new Margins(5, 5, 5, 0));
188
		regionCentre.setMargins(new Margins(5, 5, 5, 0));
191
 
189
 
192
		viewport.add(panneauCentre, regionCentre);
190
		viewport.add(panneauCentre, regionCentre);
193
	}
191
	}
194
	
192
	
195
	private void creerPanneauSud() {
193
	private void creerPanneauSud() {
196
		panneauSud = new StatutVue();
194
		panneauSud = new StatutVue();
197
		
195
		
198
		BorderLayoutData regionSud = new BorderLayoutData(LayoutRegion.SOUTH, 20); 
196
		BorderLayoutData regionSud = new BorderLayoutData(LayoutRegion.SOUTH, 20); 
199
		regionSud.setCollapsible(true);
197
		regionSud.setCollapsible(true);
200
		regionSud.setFloatable(true);
198
		regionSud.setFloatable(true);
201
		regionSud.setSplit(false);
199
		regionSud.setSplit(false);
202
		regionSud.setMargins(new Margins(0));
200
		regionSud.setMargins(new Margins(0));
203
		
201
		
204
		viewport.add(panneauSud, regionSud);
202
		viewport.add(panneauSud, regionSud);
205
	}
203
	}
206
 
204
 
207
	public void actualiserPanneauCentral() {
205
	public void actualiserPanneauCentral() {
208
		panneauCentre.layout();
206
		panneauCentre.layout();
209
	}
207
	}
210
	
208
	
211
	//+----------------------------------------------------------------------------------------------------------------+
209
	//+----------------------------------------------------------------------------------------------------------------+
212
	//												GESTION du MENU
210
	//												GESTION du MENU
213
	//+----------------------------------------------------------------------------------------------------------------+
211
	//+----------------------------------------------------------------------------------------------------------------+
214
	
212
	
215
	public void clicMenu(String codeMenuClique) {
213
	public void clicMenu(String codeMenuClique) {
216
		activerChargement(codeMenuClique);
214
		activerChargement(codeMenuClique);
217
		panneauOuest.getMenu().selectionMenu(codeMenuClique);
215
		panneauOuest.getMenu().selectionMenu(codeMenuClique);
218
		if (codeMenuClique.equals(MenuApplicationId.ACCUEIL)) {
216
		if (codeMenuClique.equals(MenuApplicationId.ACCUEIL)) {
219
			afficherAccueil();
217
			afficherAccueil();
220
		} else if (codeMenuClique.equals(MenuApplicationId.PROJET)) {
218
		} else if (codeMenuClique.equals(MenuApplicationId.PROJET)) {
221
			selectionnerProjet(panneauCentre, null); 
219
			selectionnerProjet(panneauCentre, null); 
222
		} else if (codeMenuClique.equals(MenuApplicationId.STRUCTURE)) {
220
		} else if (codeMenuClique.equals(MenuApplicationId.STRUCTURE)) {
223
			selectionnerStructure(panneauCentre, null);
221
			selectionnerStructure(panneauCentre, null);
224
		} else if (codeMenuClique.equals(MenuApplicationId.COLLECTION)) { 
222
		} else if (codeMenuClique.equals(MenuApplicationId.COLLECTION)) { 
225
			selectionnerCollection(panneauCentre, null, null);
223
			selectionnerCollection(panneauCentre, null, null);
226
		} else if (codeMenuClique.equals(MenuApplicationId.PERSONNE)) { 
224
		} else if (codeMenuClique.equals(MenuApplicationId.PERSONNE)) { 
227
			selectionnerPersonne(panneauCentre, null, getProjetId());
225
			selectionnerPersonne(panneauCentre, null, getProjetId());
228
		} else if (codeMenuClique.equals(MenuApplicationId.PUBLICATION)) {
226
		} else if (codeMenuClique.equals(MenuApplicationId.PUBLICATION)) {
229
			selectionnerPublication(panneauCentre, null);
227
			selectionnerPublication(panneauCentre, null);
230
		} else if (codeMenuClique.equals(MenuApplicationId.COMMENTAIRE)) {
228
		} else if (codeMenuClique.equals(MenuApplicationId.COMMENTAIRE)) {
231
			selectionnerCommentaire(panneauCentre, null);
229
			selectionnerCommentaire(panneauCentre, null);
232
		} else {
230
		} else {
233
			GWT.log(i18nM.nonImplemente(codeMenuClique), null);
231
			GWT.log(i18nM.nonImplemente(codeMenuClique), null);
234
		}
232
		}
235
		panneauCentre.layout();
233
		panneauCentre.layout();
236
	}
234
	}
237
 
235
 
238
	public void activerChargement(String message) {
236
	public void activerChargement(String message) {
239
		afficherPopinChargement();
237
		afficherPopinChargement();
240
		panneauCentre.disable();
238
		panneauCentre.disable();
241
		panneauSud.showBusy(i18nC.chargement()+" "+message);
239
		panneauSud.showBusy(i18nC.chargement()+" "+message);
242
	}
240
	}
243
	
241
	
244
	public void desactiverChargement() {
242
	public void desactiverChargement() {
245
		masquerPopinChargement();
243
		masquerPopinChargement();
246
		panneauCentre.enable();
244
		panneauCentre.enable();
247
		panneauSud.clear();
245
		panneauSud.clear();
248
	}
246
	}
249
		
247
		
250
	//+----------------------------------------------------------------------------------------------------------------+
248
	//+----------------------------------------------------------------------------------------------------------------+
251
	//												GESTION DES FENÊTRES
249
	//												GESTION DES FENÊTRES
252
	//+----------------------------------------------------------------------------------------------------------------+
250
	//+----------------------------------------------------------------------------------------------------------------+
253
 
251
 
254
	public void ouvrirAide() {
252
	public void ouvrirAide() {
255
		AideFenetre aideFenetre = new AideFenetre();
253
		AideFenetre aideFenetre = new AideFenetre();
256
		aideFenetre.show();
254
		aideFenetre.show();
257
		// FIXME : apparament le fade In/Fade Out pose problème sur les navigateurs...
255
		// FIXME : apparament le fade In/Fade Out pose problème sur les navigateurs...
258
		//aideFenetre.el().fadeIn(FxConfig.NONE);
256
		//aideFenetre.el().fadeIn(FxConfig.NONE);
259
	}
257
	}
260
 
258
 
261
	public void ouvrirParametres() {
259
	public void ouvrirParametres() {
262
		AproposFenetre parametresFenetre = new AproposFenetre();
260
		AproposFenetre parametresFenetre = new AproposFenetre();
263
		parametresFenetre.show();
261
		parametresFenetre.show();
264
	}
262
	}
265
 
263
 
266
	public void ouvrirIdentification() {
264
	public void ouvrirIdentification() {
267
		fenetreIdentification = new IdentificationFenetre(this);
265
		fenetreIdentification = new IdentificationFenetre(this);
268
		fenetreIdentification.show();
266
		fenetreIdentification.show();
269
	}
267
	}
270
 
268
 
271
	public void ouvrirUrlExterne(String id) {
269
	public void ouvrirUrlExterne(String id) {
272
		if (id.equals(ComposantId.MENU_CEL)) {
270
		if (id.equals(ComposantId.MENU_CEL)) {
273
			Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("cel"), "Carnet en ligne", "");
271
			Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("cel"), "Carnet en ligne", "");
274
		} else if (id.equals(ComposantId.MENU_BEL)) {
272
		} else if (id.equals(ComposantId.MENU_BEL)) {
275
			Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("cel"), "Biblio en ligne", "");
273
			Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("cel"), "Biblio en ligne", "");
276
		} else if (id.equals(ComposantId.MENU_BOGUE)) {
274
		} else if (id.equals(ComposantId.MENU_BOGUE)) {
277
			Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("bogue"), "Bogue", "");
275
			Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("bogue"), "Bogue", "");
278
		} else if (id.equals(ComposantId.MENU_COMMENTAIRE)) {
276
		} else if (id.equals(ComposantId.MENU_COMMENTAIRE)) {
279
			Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("commentaire"), "Commentaire", "");
277
			Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("commentaire"), "Commentaire", "");
280
		}
278
		}
281
	}
279
	}
282
 
280
 
283
	public void afficherFenetreLicence(IdentificationFenetre vue)	{
281
	public void afficherFenetreLicence(IdentificationFenetre vue)	{
284
		LicenceFenetre lf = new LicenceFenetre(vue);
282
		LicenceFenetre lf = new LicenceFenetre(vue);
285
	}
283
	}
286
	
284
	
287
	public void accepterLicence(Rafraichissable vue)	{
285
	public void accepterLicence(Rafraichissable vue)	{
288
		modele.accepterLicence(vue);		
286
		modele.accepterLicence(vue);		
289
	}
287
	}
290
	//+----------------------------------------------------------------------------------------------------------------+
288
	//+----------------------------------------------------------------------------------------------------------------+
291
	//												GESTION de l'UTILISATEUR et de l'IDENTIFICATION
289
	//												GESTION de l'UTILISATEUR et de l'IDENTIFICATION
292
	//+----------------------------------------------------------------------------------------------------------------+
290
	//+----------------------------------------------------------------------------------------------------------------+
293
	/**
291
	/**
294
	 * Retourne l'identifiant de l'utilisateur courrant de l'application.
292
	 * Retourne l'identifiant de l'utilisateur courrant de l'application.
295
	 */
293
	 */
296
	public String getUtilisateurId() {
294
	public String getUtilisateurId() {
297
		String id = null;
295
		String id = null;
298
		Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
296
		Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
299
		if (!utilisateurCourant.getId().equals("")) {
297
		if (!utilisateurCourant.getId().equals("")) {
300
			id = utilisateurCourant.getId();
298
			id = utilisateurCourant.getId();
301
		}
299
		}
302
		return id;
300
		return id;
303
	}
301
	}
304
	
302
	
305
	public Utilisateur getUtilisateur() {
303
	public Utilisateur getUtilisateur() {
306
		Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
304
		Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
307
		return utilisateurCourant;
305
		return utilisateurCourant;
308
	}
306
	}
309
	
307
	
310
	public void connecterUtilisateur(String login, String mdp) {
308
	public void connecterUtilisateur(String login, String mdp) {
311
		modele.connecterUtilisateur(this, login, mdp);
309
		modele.connecterUtilisateur(this, login, mdp);
312
	}
310
	}
313
	
311
	
314
	public void deconnecterUtilisateur() {
312
	public void deconnecterUtilisateur() {
315
		modele.deconnecterUtilisateur(this);
313
		modele.deconnecterUtilisateur(this);
316
	}
314
	}
317
	
315
	
318
	public void repandreEtatIdentification(Utilisateur utilisateur) {
316
	public void repandreEtatIdentification(Utilisateur utilisateur) {
319
		// Mise à jour du registre
317
		// Mise à jour du registre
320
		Registry.register(RegistreId.UTILISATEUR_COURANT, utilisateur);
318
		Registry.register(RegistreId.UTILISATEUR_COURANT, utilisateur);
321
		// Propagation de l'information de mise à jour de l'utilisateur
319
		// Propagation de l'information de mise à jour de l'utilisateur
322
		repandreInfoMiseAJourUtilisateur();
320
		repandreInfoMiseAJourUtilisateur();
323
	}
321
	}
324
	
322
	
325
	public void repandreInfoMiseAJourUtilisateur() {
323
	public void repandreInfoMiseAJourUtilisateur() {
326
		// Création de l'information de mise à jour de l'utilisateur
324
		// Création de l'information de mise à jour de l'utilisateur
327
		Information info = new Information("maj_utilisateur");
325
		Information info = new Information("maj_utilisateur");
328
 
326
 
329
		// Rafraichissement de la fenêtre d'Identification
327
		// Rafraichissement de la fenêtre d'Identification
330
		if (fenetreIdentification != null && fenetreIdentification.isVisible()) {
328
		if (fenetreIdentification != null && fenetreIdentification.isVisible()) {
331
			fenetreIdentification.rafraichir(info);
329
			fenetreIdentification.rafraichir(info);
332
		}
330
		}
333
		
331
		
334
		// Rafraichissement du panneau Nord
332
		// Rafraichissement du panneau Nord
335
		panneauNord.rafraichir(info);
333
		panneauNord.rafraichir(info);
336
 
334
 
337
		// Rafraichissement du panneau Centre
335
		// Rafraichissement du panneau Centre
338
		if (panneauCentre != null) {
336
		if (panneauCentre != null) {
339
			panneauCentre.rafraichir(info);
337
			panneauCentre.rafraichir(info);
340
		}
338
		}
341
	}
339
	}
342
	
340
	
343
	public void modifierUtilisateur()	{
341
	public void modifierUtilisateur()	{
344
		Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
342
		Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
345
		panneauNord.rafraichir(utilisateurCourant);
343
		panneauNord.rafraichir(utilisateurCourant);
346
		modele.modifierUtilisateur(this, utilisateurCourant);
344
		modele.modifierUtilisateur(this, utilisateurCourant);
347
	}
345
	}
348
	
346
	
349
	public void mettreAJourPersonneAnnuaire(Utilisateur utilisateur)	{
347
	public void mettreAJourPersonneAnnuaire(Utilisateur utilisateur)	{
350
		panneauNord.rafraichir(utilisateur);
348
		panneauNord.rafraichir(utilisateur);
351
		modele.mettreAJourPersonneAnnuaire(this, utilisateur);
349
		modele.mettreAJourPersonneAnnuaire(this, utilisateur);
352
	}
350
	}
353
 
351
 
354
	//+----------------------------------------------------------------------------------------------------------------+
352
	//+----------------------------------------------------------------------------------------------------------------+
355
	//												GESTION DES VALEURS ET LISTES
353
	//												GESTION DES VALEURS ET LISTES
356
	//+----------------------------------------------------------------------------------------------------------------+
354
	//+----------------------------------------------------------------------------------------------------------------+
357
 
355
 
358
	public void obtenirListeValeurEtRafraichir(Rafraichissable vueARafraichir, String listeId)	{
356
	public void obtenirListeValeurEtRafraichir(Rafraichissable vueARafraichir, String listeId)	{
359
		modele.obtenirListeValeurs(vueARafraichir, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId));
357
		modele.obtenirListeValeurs(vueARafraichir, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId));
360
	}
358
	}
361
	
359
	
362
	public void obtenirValeurEtRafraichir(Rafraichissable vue, String listeId, String identifiantValeur)	{
360
	public void obtenirValeurEtRafraichir(Rafraichissable vue, String listeId, String identifiantValeur)	{
363
		modele.obtenirValeur(vue, "abv", ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId), identifiantValeur);
361
		modele.obtenirValeur(vue, "abv", ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId), identifiantValeur);
364
	}
362
	}
365
	
363
	
366
	public void obtenirListeRegionsEtRafraichir(Rafraichissable vue, String strListeId, String strPays)	{
364
	public void obtenirListeRegionsEtRafraichir(Rafraichissable vue, String strListeId, String strPays)	{
367
		modele.obtenirListeRegion(vue, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(strListeId), strPays+".__");
365
		modele.obtenirListeRegion(vue, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(strListeId), strPays+".__");
368
	}
366
	}
369
	
367
	
370
	//+----------------------------------------------------------------------------------------------------------------+
368
	//+----------------------------------------------------------------------------------------------------------------+
371
	//												GESTION des APPLETS de l'ACCUEIL
369
	//												GESTION des APPLETS de l'ACCUEIL
372
	//+----------------------------------------------------------------------------------------------------------------+
370
	//+----------------------------------------------------------------------------------------------------------------+
373
	
371
	
374
	public void afficherAccueil() {
372
	public void afficherAccueil() {
375
		if (!(panneauCentre.getContenu() instanceof AccueilVue)) {
373
		if (!(panneauCentre.getContenu() instanceof AccueilVue)) {
376
			panneauCentre.removeAll();
374
			panneauCentre.removeAll();
377
			panneauCentre.add(new AccueilVue(this));
375
			panneauCentre.add(new AccueilVue(this));
378
		}
376
		}
379
	}
377
	}
380
	
378
	
381
	//+----------------------------------------------------------------------------------------------------------------+
379
	//+----------------------------------------------------------------------------------------------------------------+
382
	//												GESTION des PROJETS
380
	//												GESTION des PROJETS
383
	//+----------------------------------------------------------------------------------------------------------------+
381
	//+----------------------------------------------------------------------------------------------------------------+
384
	
382
	
385
	public void afficherFormProjet(String projetId) {
383
	public void afficherFormProjet(String projetId) {
386
		panneauCentre.removeAll();
384
		panneauCentre.removeAll();
387
		ProjetForm projetForm = new ProjetForm(this, projetId);
385
		ProjetForm projetForm = new ProjetForm(this, projetId);
388
		panneauCentre.add(projetForm);
386
		panneauCentre.add(projetForm);
389
		
387
		
390
		panneauCentre.layout();
388
		panneauCentre.layout();
391
	}
389
	}
392
	
390
	
393
	public void afficherListeProjets(ProjetListe projetsACharger)	{
391
	public void afficherListeProjets(ProjetListe projetsACharger)	{
394
		if (!(panneauCentre.getContenu() instanceof ProjetVue))	{
392
		if (!(panneauCentre.getContenu() instanceof ProjetVue))	{
395
			panneauCentre.removeAll();
393
			panneauCentre.removeAll();
396
			panneauCentre.add(new ProjetVue(this));
394
			panneauCentre.add(new ProjetVue(this));
397
			panneauCentre.setId(ComposantId.PANNEAU_PROJET_LISTE);
395
			panneauCentre.setId(ComposantId.PANNEAU_PROJET_LISTE);
398
			panneauCentre.layout();
396
			panneauCentre.layout();
399
		}	
397
		}	
400
		
398
		
401
		panneauCentre.getContenu().rafraichir(projetsACharger);
399
		panneauCentre.getContenu().rafraichir(projetsACharger);
402
		mettreFiltreAJour(projetsACharger);
400
		mettreFiltreAJour(projetsACharger);
403
	}
401
	}
404
	
402
	
405
	public void mettreFiltreAJour(ProjetListe projetsACharger) {
403
	public void mettreFiltreAJour(ProjetListe projetsACharger) {
406
		panneauOuest.getFiltre().rafraichir(projetsACharger);	
404
		panneauOuest.getFiltre().rafraichir(projetsACharger);	
407
	}
405
	}
408
	
406
	
409
	public void mettreFiltreAJour(List<Projet> projetsACharger) {
407
	public void mettreFiltreAJour(List<Projet> projetsACharger) {
410
		panneauOuest.getFiltre().rafraichir(projetsACharger);	
408
		panneauOuest.getFiltre().rafraichir(projetsACharger);	
411
	}
409
	}
412
	
410
	
413
	public void clicListeProjet(Projet projet) {
411
	public void clicListeProjet(Projet projet) {
414
		panneauCentre.getContenu().rafraichir(projet);
412
		panneauCentre.getContenu().rafraichir(projet);
415
	}
413
	}
416
 
414
 
417
	public void clicSupprimerProjet(final List<Projet> projetListe) {
415
	public void clicSupprimerProjet(final List<Projet> projetListe) {
418
		if (projetListe.size() <= 0) {
416
		if (projetListe.size() <= 0) {
419
			MessageBox.alert("Attention", "Vous devez sélectionner un projet", null); 
417
			MessageBox.alert("Attention", "Vous devez sélectionner un projet", null); 
420
		} else {
418
		} else {
421
			String message = "Voulez-vous vraiment supprimer ces projets ?";
419
			String message = "Voulez-vous vraiment supprimer ces projets ?";
422
			if (projetListe.size() == 1) {
420
			if (projetListe.size() == 1) {
423
				message = "Voulez-vous vraiment supprimer ce projet ?";
421
				message = "Voulez-vous vraiment supprimer ce projet ?";
424
			}
422
			}
425
			
423
			
426
			final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { 
424
			final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { 
427
				public void handleEvent(MessageBoxEvent ce) {  
425
				public void handleEvent(MessageBoxEvent ce) {  
428
					Dialog dialog = (Dialog) ce.getComponent();
426
					Dialog dialog = (Dialog) ce.getComponent();
429
				    Button btn = ce.getButtonClicked();  
427
				    Button btn = ce.getButtonClicked();  
430
				    	   
428
				    	   
431
				    if (btn.getText().equals(dialog.yesText)) {
429
				    if (btn.getText().equals(dialog.yesText)) {
432
				    	modele.supprimerProjet(panneauCentre.getContenu(), projetListe);  
430
				    	modele.supprimerProjet(panneauCentre.getContenu(), projetListe);  
433
				    }
431
				    }
434
				}
432
				}
435
			};
433
			};
436
				     
434
				     
437
			MessageBox.confirm("Supprimer un projet", message, listenerSuppression);
435
			MessageBox.confirm("Supprimer un projet", message, listenerSuppression);
438
		}
436
		}
439
		
437
		
440
	}
438
	}
441
 
439
 
442
	public void clicModifierProjet(List<Projet> projetsSelectionnes) {
440
	public void clicModifierProjet(List<Projet> projetsSelectionnes) {
443
		if (projetsSelectionnes.size() == 0) {
441
		if (projetsSelectionnes.size() == 0) {
444
			Info.display("Information", "Veuillez sélectionner un projet.");
442
			Info.display("Information", "Veuillez sélectionner un projet.");
445
		} else if (projetsSelectionnes.size() > 1) {
443
		} else if (projetsSelectionnes.size() > 1) {
446
			Info.display("Information", "Veuillez sélectionner un seul projet à la fois.");
444
			Info.display("Information", "Veuillez sélectionner un seul projet à la fois.");
447
		} else if (projetsSelectionnes.size() == 1) {
445
		} else if (projetsSelectionnes.size() == 1) {
448
			afficherFormProjet(projetsSelectionnes.get(0).getId());
446
			afficherFormProjet(projetsSelectionnes.get(0).getId());
449
		} else {
447
		} else {
450
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierProjet() du Médiateur.");
448
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierProjet() du Médiateur.");
451
		}
449
		}
452
	}
450
	}
453
 
451
 
454
	public void clicAjouterProjet() {
452
	public void clicAjouterProjet() {
455
		afficherFormProjet(null);
453
		afficherFormProjet(null);
456
	}
454
	}
457
 
455
 
458
	public void selectionnerProjet(Rafraichissable vueARafraichir, String projetId) {
456
	public void selectionnerProjet(Rafraichissable vueARafraichir, String projetId) {
459
		selectionnerProjet(vueARafraichir, projetId, null, 0, nbElements);
457
		selectionnerProjet(vueARafraichir, projetId, null, 0, nbElements);
460
	}
458
	}
461
	
459
	
462
	public void selectionnerProjet(Rafraichissable vueARafraichir, String projetId, String nom, int start, int nbElements) {
460
	public void selectionnerProjet(Rafraichissable vueARafraichir, String projetId, String nom, int start, int nbElements) {
463
		modele.selectionnerProjet(vueARafraichir, projetId, nom, start, this.nbElements);
461
		modele.selectionnerProjet(vueARafraichir, projetId, nom, start, this.nbElements);
464
	}
462
	}
465
 
463
 
466
	public void ajouterProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
464
	public void ajouterProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
467
		modele.ajouterProjet(vueARafraichir, projetCollecte);
465
		modele.ajouterProjet(vueARafraichir, projetCollecte);
468
	}
466
	}
469
 
467
 
470
	public void modifierProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
468
	public void modifierProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
471
		modele.modifierProjet(vueARafraichir, projetCollecte);	
469
		modele.modifierProjet(vueARafraichir, projetCollecte);	
472
	}
470
	}
473
	
471
	
474
	//+----------------------------------------------------------------------------------------------------------------+
472
	//+----------------------------------------------------------------------------------------------------------------+
475
	// SELECTION : projet
473
	// SELECTION : projet
476
	/**
474
	/**
477
	 * Retourne l'identifiant du projet courrant de l'application.
475
	 * Retourne l'identifiant du projet courrant de l'application.
478
	 */
476
	 */
479
	public String getProjetId() {
477
	public String getProjetId() {
480
		String id = null;
478
		String id = null;
481
		Projet projetCourant = (Projet) Registry.get(RegistreId.PROJET_COURANT);
479
		Projet projetCourant = (Projet) Registry.get(RegistreId.PROJET_COURANT);
482
		if (projetCourant != null && !projetCourant.getId().equals("")) {
480
		if (projetCourant != null && !projetCourant.getId().equals("")) {
483
			id = projetCourant.getId();
481
			id = projetCourant.getId();
484
		}
482
		}
485
		return id;
483
		return id;
486
	}
484
	}
487
		
485
		
488
	public void selectionnerProjetCourant(Projet projetSelectionne) {
486
	public void selectionnerProjetCourant(Projet projetSelectionne) {
489
		Registry.register(RegistreId.PROJET_COURANT, projetSelectionne);
487
		Registry.register(RegistreId.PROJET_COURANT, projetSelectionne);
490
		if (panneauCentre.getContenu() instanceof AccueilVue)	{
488
		if (panneauCentre.getContenu() instanceof AccueilVue)	{
491
			desactiverChargement();
489
			desactiverChargement();
492
		} else if (panneauCentre.getContenu() instanceof ProjetVue)	{
490
		} else if (panneauCentre.getContenu() instanceof ProjetVue)	{
493
			selectionnerProjet(panneauCentre.getContenu(), null);
491
			selectionnerProjet(panneauCentre.getContenu(), null);
494
		} else if (panneauCentre.getContenu() instanceof StructureVue)	{
492
		} else if (panneauCentre.getContenu() instanceof StructureVue)	{
495
			selectionnerStructure(panneauCentre.getContenu(), null);
493
			selectionnerStructure(panneauCentre.getContenu(), null);
496
		} else if (panneauCentre.getContenu() instanceof CollectionVue)	{
494
		} else if (panneauCentre.getContenu() instanceof CollectionVue)	{
497
			selectionnerCollection(panneauCentre.getContenu(), null, null);
495
			selectionnerCollection(panneauCentre.getContenu(), null, null);
498
		} else if (panneauCentre.getContenu() instanceof PersonneVue) {
496
		} else if (panneauCentre.getContenu() instanceof PersonneVue) {
499
			selectionnerPersonne(panneauCentre.getContenu(), null, getProjetId());
497
			selectionnerPersonne(panneauCentre.getContenu(), null, getProjetId());
500
		} else if (panneauCentre.getContenu() instanceof PublicationVue) {
498
		} else if (panneauCentre.getContenu() instanceof PublicationVue) {
501
			selectionnerPublication(panneauCentre.getContenu(), null);
499
			selectionnerPublication(panneauCentre.getContenu(), null);
502
		} else if (panneauCentre.getContenu() instanceof CommentaireVue) {
500
		} else if (panneauCentre.getContenu() instanceof CommentaireVue) {
503
			selectionnerCommentaire(panneauCentre.getContenu(), null);
501
			selectionnerCommentaire(panneauCentre.getContenu(), null);
504
		}
502
		}
505
	}
503
	}
506
	
504
	
507
	
505
	
508
	//+----------------------------------------------------------------------------------------------------------------+
506
	//+----------------------------------------------------------------------------------------------------------------+
509
	//												GESTION DES STRUCTURES
507
	//												GESTION DES STRUCTURES
510
	//+----------------------------------------------------------------------------------------------------------------+
508
	//+----------------------------------------------------------------------------------------------------------------+
511
 
509
 
512
	public void afficherListeStructures(StructureListe structuresACharger) {
510
	public void afficherListeStructures(StructureListe structuresACharger) {
513
		if (!(panneauCentre.getContenu() instanceof StructureVue))	{	
511
		if (!(panneauCentre.getContenu() instanceof StructureVue))	{	
514
			panneauCentre.removeAll();
512
			panneauCentre.removeAll();
515
			panneauCentre.add(new StructureVue(this));
513
			panneauCentre.add(new StructureVue(this));
516
		}
514
		}
517
		panneauCentre.getContenu().rafraichir(structuresACharger);
515
		panneauCentre.getContenu().rafraichir(structuresACharger);
518
	}
516
	}
519
	
517
	
520
	public void afficherFormStructure(String structureId) {
518
	public void afficherFormStructure(String structureId) {
521
		String mode = Formulaire.MODE_AJOUTER;
519
		String mode = Formulaire.MODE_AJOUTER;
522
		if (structureId != null) {
520
		if (structureId != null) {
523
			mode = Formulaire.MODE_MODIFIER;
521
			mode = Formulaire.MODE_MODIFIER;
524
		}
522
		}
525
		
523
		
526
		panneauCentre.removeAll();
524
		panneauCentre.removeAll();
527
		StructureForm structureForm = new StructureForm(this, mode);
525
		StructureForm structureForm = new StructureForm(this, mode);
528
		panneauCentre.add(structureForm);
526
		panneauCentre.add(structureForm);
529
		
527
		
530
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
528
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
531
			selectionnerStructure(structureForm, structureId);
529
			selectionnerStructure(structureForm, structureId);
532
			selectionnerStructureAPersonne(structureForm, structureId, StructureAPersonne.ROLE_EQUIPE);
530
			selectionnerStructureAPersonne(structureForm, structureId, StructureAPersonne.ROLE_EQUIPE);
533
		}
531
		}
534
		
532
		
535
		panneauCentre.layout();
533
		panneauCentre.layout();
536
	}
534
	}
537
	
535
	
538
	public void clicListeStructure(Structure structure) {
536
	public void clicListeStructure(Structure structure) {
539
		panneauCentre.getContenu().rafraichir(structure);
537
		panneauCentre.getContenu().rafraichir(structure);
540
		if (structure != null && structure.getPersonnel() == null) {
538
		if (structure != null && structure.getPersonnel() == null) {
541
			selectionnerStructureAPersonne(panneauCentre.getContenu(), structure.getId(), StructureAPersonne.ROLE_EQUIPE);
539
			selectionnerStructureAPersonne(panneauCentre.getContenu(), structure.getId(), StructureAPersonne.ROLE_EQUIPE);
542
		}
540
		}
543
	}
541
	}
544
 
542
 
545
	public void clicAjouterStructure() {
543
	public void clicAjouterStructure() {
546
		afficherFormStructure(null);
544
		afficherFormStructure(null);
547
	}
545
	}
548
	
546
	
549
	public void clicModifierStructure(List<Structure> structureSelection) {
547
	public void clicModifierStructure(List<Structure> structureSelection) {
550
		if (structureSelection.size() == 0) {
548
		if (structureSelection.size() == 0) {
551
			Info.display("Information", "Veuillez sélectionner une structure.");
549
			Info.display("Information", "Veuillez sélectionner une structure.");
552
		} else if (structureSelection.size() > 1) {
550
		} else if (structureSelection.size() > 1) {
553
			Info.display("Information", "Veuillez sélectionner une seule structure à la fois.");
551
			Info.display("Information", "Veuillez sélectionner une seule structure à la fois.");
554
		} else if (structureSelection.size() == 1) {
552
		} else if (structureSelection.size() == 1) {
555
			afficherFormStructure(structureSelection.get(0).getId());
553
			afficherFormStructure(structureSelection.get(0).getId());
556
		} else {
554
		} else {
557
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierStructure() du Médiateur.");
555
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierStructure() du Médiateur.");
558
		}
556
		}
559
	}
557
	}
560
	
558
	
561
	public void clicSupprimerStructure(final Rafraichissable vue, final List<Structure> structureSelection) {
559
	public void clicSupprimerStructure(final Rafraichissable vue, final List<Structure> structureSelection) {
562
		if (structureSelection.size() == 0) {
560
		if (structureSelection.size() == 0) {
563
			Info.display("Information", "Veuillez sélectionner une structure.");
561
			Info.display("Information", "Veuillez sélectionner une structure.");
564
		} else if(structureSelection.size() > 0) {
562
		} else if(structureSelection.size() > 0) {
565
			String titre = "Supprimer des structures";
563
			String titre = "Supprimer des structures";
566
			String message = "Êtes vous sur de vouloir supprimer les structures sélectionnées ?";
564
			String message = "Êtes vous sur de vouloir supprimer les structures sélectionnées ?";
567
			if (structureSelection.size() == 1) {
565
			if (structureSelection.size() == 1) {
568
				titre = "Supprimer une structure";
566
				titre = "Supprimer une structure";
569
				message = "Êtes vous sur de vouloir supprimer la structure sélectionnée ?";
567
				message = "Êtes vous sur de vouloir supprimer la structure sélectionnée ?";
570
			}
568
			}
571
			
569
			
572
			final Listener<MessageBoxEvent> suppressionEcouteur = new Listener<MessageBoxEvent>() { 
570
			final Listener<MessageBoxEvent> suppressionEcouteur = new Listener<MessageBoxEvent>() { 
573
				public void handleEvent(MessageBoxEvent ce) {  
571
				public void handleEvent(MessageBoxEvent ce) {  
574
					Dialog dialog = (Dialog) ce.getComponent();
572
					Dialog dialog = (Dialog) ce.getComponent();
575
					Button btn = ce.getButtonClicked();  
573
					Button btn = ce.getButtonClicked();  
576
 
574
 
577
					if (btn.getText().equals(dialog.yesText))	{
575
					if (btn.getText().equals(dialog.yesText))	{
578
						String idStr = "" ;
576
						String idStr = "" ;
579
						for(int i = 0 ; i < structureSelection.size() ; i++) {
577
						for(int i = 0 ; i < structureSelection.size() ; i++) {
580
							idStr += structureSelection.get(i).getId()+","; 
578
							idStr += structureSelection.get(i).getId()+","; 
581
						}
579
						}
582
						supprimerStructure(vue, idStr);
580
						supprimerStructure(vue, idStr);
583
					}
581
					}
584
				}
582
				}
585
			};
583
			};
586
			
584
			
587
			MessageBox.confirm(titre, message, suppressionEcouteur);
585
			MessageBox.confirm(titre, message, suppressionEcouteur);
588
		} else {
586
		} else {
589
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerStructure() du Médiateur.");
587
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerStructure() du Médiateur.");
590
		}
588
		}
591
	}
589
	}
592
	
590
	
593
	public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId) {
591
	public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId) {
594
		modele.selectionnerStructure(vueARafraichir, getProjetId(), structureId, null, 0, nbElements);
592
		modele.selectionnerStructure(vueARafraichir, getProjetId(), structureId, null, 0, nbElements);
595
	}
593
	}
596
	
594
	
597
	public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId, String projetId, String nom, int start, int nbElements)	{
595
	public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId, String projetId, String nom, int start, int nbElements)	{
598
		modele.selectionnerStructure(vueARafraichir, getProjetId(), structureId, nom, start, nbElements);
596
		modele.selectionnerStructure(vueARafraichir, getProjetId(), structureId, nom, start, nbElements);
599
	}
597
	}
600
	
598
	
601
	public void selectionnerStructureParProjet(Rafraichissable vueARafraichir, String projetId) {
599
	public void selectionnerStructureParProjet(Rafraichissable vueARafraichir, String projetId) {
602
		modele.selectionnerStructure(vueARafraichir, projetId, null, null, 0, -1);
600
		modele.selectionnerStructure(vueARafraichir, projetId, null, null, 0, -1);
603
	}
601
	}
604
	
602
	
605
	public void ajouterStructure(Rafraichissable vueARafraichir, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
603
	public void ajouterStructure(Rafraichissable vueARafraichir, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
606
		modele.ajouterStructure(vueARafraichir, structure, conservation, valorisation);
604
		modele.ajouterStructure(vueARafraichir, structure, conservation, valorisation);
607
	}
605
	}
608
	
606
	
609
	public void modifierStructure(Rafraichissable vueARafraichir, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
607
	public void modifierStructure(Rafraichissable vueARafraichir, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
610
		modele.modifierStructure(vueARafraichir, structureId, structure, conservation, valorisation);
608
		modele.modifierStructure(vueARafraichir, structureId, structure, conservation, valorisation);
611
	}
609
	}
612
	
610
	
613
	public void supprimerStructure(Rafraichissable vueARafraichir, String IdentifiantsStructureSepareParVirgule) {
611
	public void supprimerStructure(Rafraichissable vueARafraichir, String IdentifiantsStructureSepareParVirgule) {
614
		modele.supprimerStructure(vueARafraichir, IdentifiantsStructureSepareParVirgule);
612
		modele.supprimerStructure(vueARafraichir, IdentifiantsStructureSepareParVirgule);
615
	}
613
	}
616
	
614
	
617
	//+----------------------------------------------------------------------------------------------------------------+
615
	//+----------------------------------------------------------------------------------------------------------------+
618
	// GESTION de la relation STRUCTURE A PERSONNE
616
	// GESTION de la relation STRUCTURE A PERSONNE
619
	public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId) {
617
	public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId) {
620
		modele.selectionnerStructureAPersonne(vueARafraichir, structureId, roleId);
618
		modele.selectionnerStructureAPersonne(vueARafraichir, structureId, roleId);
621
	}
619
	}
622
	
620
	
623
	public void ajouterStructureAPersonne(Rafraichissable vueARafraichir, String structureId, StructureAPersonneListe personnelAjoute) {
621
	public void ajouterStructureAPersonne(Rafraichissable vueARafraichir, String structureId, StructureAPersonneListe personnelAjoute) {
624
		if (personnelAjoute != null && personnelAjoute.size() > 0) {
622
		if (personnelAjoute != null && personnelAjoute.size() > 0) {
625
			for (Iterator<String> it = personnelAjoute.keySet().iterator(); it.hasNext();) {
623
			for (Iterator<String> it = personnelAjoute.keySet().iterator(); it.hasNext();) {
626
				modele.ajouterStructureAPersonne(vueARafraichir, structureId, (StructureAPersonne) personnelAjoute.get(it.next()));
624
				modele.ajouterStructureAPersonne(vueARafraichir, structureId, (StructureAPersonne) personnelAjoute.get(it.next()));
627
			}
625
			}
628
		}
626
		}
629
	}
627
	}
630
	
628
	
631
	public void modifierStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelModifie) {
629
	public void modifierStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelModifie) {
632
		if (personnelModifie != null && personnelModifie.size() > 0) {
630
		if (personnelModifie != null && personnelModifie.size() > 0) {
633
			for (Iterator<String> it = personnelModifie.keySet().iterator(); it.hasNext();) {
631
			for (Iterator<String> it = personnelModifie.keySet().iterator(); it.hasNext();) {
634
				modele.modifierStructureAPersonne(vueARafraichir, (StructureAPersonne) personnelModifie.get(it.next()));
632
				modele.modifierStructureAPersonne(vueARafraichir, (StructureAPersonne) personnelModifie.get(it.next()));
635
			}
633
			}
636
		}
634
		}
637
	}
635
	}
638
	
636
	
639
	public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelSupprime) {
637
	public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelSupprime) {
640
		if (personnelSupprime != null && personnelSupprime.size() > 0) {
638
		if (personnelSupprime != null && personnelSupprime.size() > 0) {
641
			String idStructureAPersonneSepareParVirgule = "" ;
639
			String idStructureAPersonneSepareParVirgule = "" ;
642
			Iterator<String> it = personnelSupprime.keySet().iterator();
640
			Iterator<String> it = personnelSupprime.keySet().iterator();
643
			while (it.hasNext()) {
641
			while (it.hasNext()) {
644
				idStructureAPersonneSepareParVirgule += personnelSupprime.get(it.next()).getId();
642
				idStructureAPersonneSepareParVirgule += personnelSupprime.get(it.next()).getId();
645
				idStructureAPersonneSepareParVirgule += (it.hasNext()) ? "," : "";
643
				idStructureAPersonneSepareParVirgule += (it.hasNext()) ? "," : "";
646
			}
644
			}
647
			supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSepareParVirgule);
645
			supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSepareParVirgule);
648
		}
646
		}
649
	}
647
	}
650
	
648
	
651
	public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, String idStructureAPersonneSeparesParVirgule) {
649
	public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, String idStructureAPersonneSeparesParVirgule) {
652
		modele.supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSeparesParVirgule);
650
		modele.supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSeparesParVirgule);
653
	}
651
	}
654
	
652
	
655
	public void supprimerStructureAPersonne(final Rafraichissable vueARafraichir, final List<Structure> structuresListe) {
653
	public void supprimerStructureAPersonne(final Rafraichissable vueARafraichir, final List<Structure> structuresListe) {
656
		if (structuresListe.size() != 0) {
654
		if (structuresListe.size() != 0) {
657
			String idStructureSepareParVirgule = "" ;
655
			String idStructureSepareParVirgule = "" ;
658
			Iterator<Structure> it = structuresListe.iterator();
656
			Iterator<Structure> it = structuresListe.iterator();
659
			while (it.hasNext()) {
657
			while (it.hasNext()) {
660
				Structure structure = it.next();
658
				Structure structure = it.next();
661
				idStructureSepareParVirgule += structure.getId();
659
				idStructureSepareParVirgule += structure.getId();
662
				idStructureSepareParVirgule += it.hasNext() ? "," : "";
660
				idStructureSepareParVirgule += it.hasNext() ? "," : "";
663
			}
661
			}
664
			supprimerStructureAPersonne(vueARafraichir, idStructureSepareParVirgule);
662
			supprimerStructureAPersonne(vueARafraichir, idStructureSepareParVirgule);
665
		}
663
		}
666
	}
664
	}
667
	
665
	
668
	//+----------------------------------------------------------------------------------------------------------------+
666
	//+----------------------------------------------------------------------------------------------------------------+
669
	//												GESTION des COLLECTIONS
667
	//												GESTION des COLLECTIONS
670
	//+----------------------------------------------------------------------------------------------------------------+
668
	//+----------------------------------------------------------------------------------------------------------------+
671
	
669
	
672
	public void afficherListeCollections(CollectionListe collectionsACharger) {
670
	public void afficherListeCollections(CollectionListe collectionsACharger) {
673
		if (!(panneauCentre.getContenu() instanceof CollectionVue)) {
671
		if (!(panneauCentre.getContenu() instanceof CollectionVue)) {
674
			panneauCentre.removeAll();
672
			panneauCentre.removeAll();
675
			panneauCentre.add(new CollectionVue(this));
673
			panneauCentre.add(new CollectionVue(this));
676
		}
674
		}
677
		
675
		
678
		panneauCentre.getContenu().rafraichir(collectionsACharger);
676
		panneauCentre.getContenu().rafraichir(collectionsACharger);
679
	}
677
	}
680
	
678
	
681
	public void afficherFormCollection(String collectionId) {
679
	public void afficherFormCollection(String collectionId) {
682
		panneauCentre.removeAll();
680
		panneauCentre.removeAll();
683
		CollectionForm collectionForm = new CollectionForm(this, collectionId);
681
		CollectionForm collectionForm = new CollectionForm(this, collectionId);
684
		panneauCentre.add(collectionForm);
682
		panneauCentre.add(collectionForm);
685
		
683
		
686
		panneauCentre.layout();
684
		panneauCentre.layout();
687
	}
685
	}
688
	
686
	
689
	public void clicListeCollection(Collection collectionCliquee) {
687
	public void clicListeCollection(Collection collectionCliquee) {
690
		panneauCentre.getContenu().rafraichir(collectionCliquee);
688
		panneauCentre.getContenu().rafraichir(collectionCliquee);
691
		if (collectionCliquee != null) {
689
		if (collectionCliquee != null) {
692
			selectionnerCollectionAPersonne(panneauCentre.getContenu(), collectionCliquee.getId(), null);
690
			selectionnerCollectionAPersonne(panneauCentre.getContenu(), collectionCliquee.getId(), null);
693
			selectionnerCollectionAPublication(panneauCentre.getContenu(), collectionCliquee.getId());
691
			selectionnerCollectionAPublication(panneauCentre.getContenu(), collectionCliquee.getId());
694
			selectionnerCollectionACommentaire(panneauCentre.getContenu(), collectionCliquee.getId());
692
			selectionnerCollectionACommentaire(panneauCentre.getContenu(), collectionCliquee.getId());
695
		} 
693
		} 
696
	}
694
	}
697
	
695
	
698
	public void clicAjouterCollection() {
696
	public void clicAjouterCollection() {
699
		afficherFormCollection(null);
697
		afficherFormCollection(null);
700
	}
698
	}
701
 
699
 
702
	public void clicModifierCollection(List<Collection> selection) {
700
	public void clicModifierCollection(List<Collection> selection) {
703
		if (selection.size() == 0) {
701
		if (selection.size() == 0) {
704
			Info.display("Information", "Veuillez sélectionner une collection.");
702
			Info.display("Information", "Veuillez sélectionner une collection.");
705
		} else if (selection.size() > 1) {
703
		} else if (selection.size() > 1) {
706
			Info.display("Information", "Veuillez sélectionner une seule collection à la fois.");
704
			Info.display("Information", "Veuillez sélectionner une seule collection à la fois.");
707
		} else if (selection.size() == 1) {
705
		} else if (selection.size() == 1) {
708
			afficherFormCollection(selection.get(0).getId());
706
			afficherFormCollection(selection.get(0).getId());
709
		} else {
707
		} else {
710
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCollection() du Médiateur.");
708
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCollection() du Médiateur.");
711
		}
709
		}
712
	}
710
	}
713
 
711
 
714
	public void clicSupprimerCollection(CollectionListeVue collectionListeVue, final List<Collection> collectionsASupprimer) {
712
	public void clicSupprimerCollection(CollectionListeVue collectionListeVue, final List<Collection> collectionsASupprimer) {
715
		if (collectionsASupprimer.size() <= 0) {
713
		if (collectionsASupprimer.size() <= 0) {
716
			MessageBox.alert("Attention", "Vous devez sélectionner au moins une collection", null); 
714
			MessageBox.alert("Attention", "Vous devez sélectionner au moins une collection", null); 
717
		} else {
715
		} else {
718
			String message = "Voulez-vous vraiment supprimer ces collections ?";
716
			String message = "Voulez-vous vraiment supprimer ces collections ?";
719
			if (collectionsASupprimer.size() == 1) {
717
			if (collectionsASupprimer.size() == 1) {
720
				message = "Voulez-vous vraiment supprimer cette collection ?";
718
				message = "Voulez-vous vraiment supprimer cette collection ?";
721
			}
719
			}
722
			
720
			
723
			final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { 
721
			final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { 
724
				public void handleEvent(MessageBoxEvent ce) {  
722
				public void handleEvent(MessageBoxEvent ce) {  
725
					Dialog dialog = (Dialog) ce.getComponent();
723
					Dialog dialog = (Dialog) ce.getComponent();
726
				    Button btn = ce.getButtonClicked();  
724
				    Button btn = ce.getButtonClicked();  
727
				    	   
725
				    	   
728
				    if (btn.getText().equals(dialog.yesText)) {
726
				    if (btn.getText().equals(dialog.yesText)) {
729
				    	supprimerCollection(panneauCentre.getContenu(), collectionsASupprimer);
727
				    	supprimerCollection(panneauCentre.getContenu(), collectionsASupprimer);
730
				    }
728
				    }
731
				}
729
				}
732
			};
730
			};
733
				     
731
				     
734
			MessageBox.confirm("Supprimer une collection", message, listenerSuppression);
732
			MessageBox.confirm("Supprimer une collection", message, listenerSuppression);
735
		}	
733
		}	
736
	}
734
	}
737
 
735
 
738
	public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom) {
736
	public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom) {
739
		
-
 
740
		System.out.println(nbElements);
-
 
741
		selectionnerCollection(vueARafraichir, collectionId, nom, 0, nbElements);
737
		selectionnerCollection(vueARafraichir, collectionId, nom, 0, nbElements);
742
	}
738
	}
743
	
739
	
744
	public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom, int start, int nbElements)	{
740
	public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom, int start, int nbElements)	{
745
		modele.selectionnerCollection(vueARafraichir, getProjetId(), collectionId, nom, start, this.nbElements);
741
		modele.selectionnerCollection(vueARafraichir, getProjetId(), collectionId, nom, start, nbElements);
746
	}
742
	}
747
	
743
	
748
	public void selectionnerCollectionParProjet(Rafraichissable vueARafraichir, String projetId) {
744
	public void selectionnerCollectionParProjet(Rafraichissable vueARafraichir, String projetId) {
749
		modele.selectionnerCollection(vueARafraichir, projetId, null, null, 0, nbElements);
745
		modele.selectionnerCollection(vueARafraichir, projetId, null, null, 0, -1);
750
	}
746
	}
751
	
747
	
752
	public void ajouterCollection(Rafraichissable vueARafraichir, Collection collection) {
748
	public void ajouterCollection(Rafraichissable vueARafraichir, Collection collection) {
753
		modele.ajouterCollection(vueARafraichir, collection);
749
		modele.ajouterCollection(vueARafraichir, collection);
754
	}
750
	}
755
	
751
	
756
	public void modifierCollection(Rafraichissable vueARafraichir, Collection collection) {
752
	public void modifierCollection(Rafraichissable vueARafraichir, Collection collection) {
757
		modele.modifierCollection(vueARafraichir, collection);
753
		modele.modifierCollection(vueARafraichir, collection);
758
	}
754
	}
759
	
755
	
760
	public void supprimerCollection(Rafraichissable vueARafraichir, List<Collection> collectionsListe) {
756
	public void supprimerCollection(Rafraichissable vueARafraichir, List<Collection> collectionsListe) {
761
		if (collectionsListe != null && collectionsListe.size() > 0) {
757
		if (collectionsListe != null && collectionsListe.size() > 0) {
762
			String idCollectionSeparesParVirgule = "" ;
758
			String idCollectionSeparesParVirgule = "" ;
763
			Iterator<Collection> it = collectionsListe.iterator();
759
			Iterator<Collection> it = collectionsListe.iterator();
764
			while (it.hasNext()) {
760
			while (it.hasNext()) {
765
				idCollectionSeparesParVirgule += it.next().getId();
761
				idCollectionSeparesParVirgule += it.next().getId();
766
				if (it.hasNext()) {
762
				if (it.hasNext()) {
767
					idCollectionSeparesParVirgule += ",";
763
					idCollectionSeparesParVirgule += ",";
768
				}
764
				}
769
			}
765
			}
770
			modele.supprimerCollection(vueARafraichir, idCollectionSeparesParVirgule);
766
			modele.supprimerCollection(vueARafraichir, idCollectionSeparesParVirgule);
771
			modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionSeparesParVirgule);
767
			modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionSeparesParVirgule);
772
			modele.supprimerCollectionAPublication(vueARafraichir, idCollectionSeparesParVirgule);
768
			modele.supprimerCollectionAPublication(vueARafraichir, idCollectionSeparesParVirgule);
773
			//modele.supprimerCollectionACommentaire(vueARafraichir, idCollectionSeparesParVirgule);
769
			//modele.supprimerCollectionACommentaire(vueARafraichir, idCollectionSeparesParVirgule);
774
		}
770
		}
775
		
771
		
776
	}
772
	}
777
	
773
	
778
	//+----------------------------------------------------------------------------------------------------------------+
774
	//+----------------------------------------------------------------------------------------------------------------+
779
	// GESTION de la relation COLLECTION A PERSONNE
775
	// GESTION de la relation COLLECTION A PERSONNE
780
	
776
	
781
	public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId) {
777
	public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId) {
782
		modele.selectionnerCollectionAPersonne(vueARafraichir, collectionId, roleId);
778
		modele.selectionnerCollectionAPersonne(vueARafraichir, collectionId, roleId);
783
	}
779
	}
784
	
780
	
785
	public void ajouterCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, CollectionAPersonneListe personnesAjoutees) {
781
	public void ajouterCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, CollectionAPersonneListe personnesAjoutees) {
786
		if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
782
		if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
787
			for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
783
			for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
788
				modele.ajouterCollectionAPersonne(vueARafraichir, collectionId, (CollectionAPersonne) personnesAjoutees.get(it.next()));
784
				modele.ajouterCollectionAPersonne(vueARafraichir, collectionId, (CollectionAPersonne) personnesAjoutees.get(it.next()));
789
			}
785
			}
790
		}
786
		}
791
	}
787
	}
792
	
788
	
793
	public void modifierCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesModifiees) {
789
	public void modifierCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesModifiees) {
794
		if (personnesModifiees != null && personnesModifiees.size() > 0) {
790
		if (personnesModifiees != null && personnesModifiees.size() > 0) {
795
			for (Iterator<String> it = personnesModifiees.keySet().iterator(); it.hasNext();) {
791
			for (Iterator<String> it = personnesModifiees.keySet().iterator(); it.hasNext();) {
796
				modele.modifierCollectionAPersonne(vueARafraichir, (CollectionAPersonne) personnesModifiees.get(it.next()));
792
				modele.modifierCollectionAPersonne(vueARafraichir, (CollectionAPersonne) personnesModifiees.get(it.next()));
797
			}
793
			}
798
		}
794
		}
799
	}
795
	}
800
	
796
	
801
	public void supprimerCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesSupprimees) {
797
	public void supprimerCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesSupprimees) {
802
		if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
798
		if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
803
			String idCollectionAPersonneSeparesParVirgule = "" ;
799
			String idCollectionAPersonneSeparesParVirgule = "" ;
804
			for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
800
			for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
805
				idCollectionAPersonneSeparesParVirgule += personnesSupprimees.get(it.next()).getId();
801
				idCollectionAPersonneSeparesParVirgule += personnesSupprimees.get(it.next()).getId();
806
				if (it.hasNext()) {
802
				if (it.hasNext()) {
807
					idCollectionAPersonneSeparesParVirgule += ",";
803
					idCollectionAPersonneSeparesParVirgule += ",";
808
				}
804
				}
809
			}
805
			}
810
			modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionAPersonneSeparesParVirgule);
806
			modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionAPersonneSeparesParVirgule);
811
		}
807
		}
812
	}
808
	}
813
	
809
	
814
	//+----------------------------------------------------------------------------------------------------------------+
810
	//+----------------------------------------------------------------------------------------------------------------+
815
	// GESTION de la relation COLLECTION A PUBLICATION
811
	// GESTION de la relation COLLECTION A PUBLICATION
816
	
812
	
817
	public void selectionnerCollectionAPublication(Rafraichissable vueARafraichir, String collectionId) {
813
	public void selectionnerCollectionAPublication(Rafraichissable vueARafraichir, String collectionId) {
818
		modele.selectionnerCollectionAPublication(vueARafraichir, collectionId);
814
		modele.selectionnerCollectionAPublication(vueARafraichir, collectionId);
819
	}
815
	}
820
	
816
	
821
	public void ajouterCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, CollectionAPublicationListe publicationsAjoutees) {
817
	public void ajouterCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, CollectionAPublicationListe publicationsAjoutees) {
822
		if (publicationsAjoutees != null && publicationsAjoutees.size() > 0) {
818
		if (publicationsAjoutees != null && publicationsAjoutees.size() > 0) {
823
			for (Iterator<String> it = publicationsAjoutees.keySet().iterator(); it.hasNext();) {
819
			for (Iterator<String> it = publicationsAjoutees.keySet().iterator(); it.hasNext();) {
824
				modele.ajouterCollectionAPublication(vueARafraichir, collectionId, (CollectionAPublication) publicationsAjoutees.get(it.next()));
820
				modele.ajouterCollectionAPublication(vueARafraichir, collectionId, (CollectionAPublication) publicationsAjoutees.get(it.next()));
825
			}
821
			}
826
		}
822
		}
827
	}
823
	}
828
	
824
	
829
	public void modifierCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublicationListe publicationsModifiees) {
825
	public void modifierCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublicationListe publicationsModifiees) {
830
		if (publicationsModifiees != null && publicationsModifiees.size() > 0) {
826
		if (publicationsModifiees != null && publicationsModifiees.size() > 0) {
831
			for (Iterator<String> it = publicationsModifiees.keySet().iterator(); it.hasNext();) {
827
			for (Iterator<String> it = publicationsModifiees.keySet().iterator(); it.hasNext();) {
832
				modele.modifierCollectionAPublication(vueARafraichir, (CollectionAPublication) publicationsModifiees.get(it.next()));
828
				modele.modifierCollectionAPublication(vueARafraichir, (CollectionAPublication) publicationsModifiees.get(it.next()));
833
			}
829
			}
834
		}
830
		}
835
	}
831
	}
836
	
832
	
837
	public void supprimerCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublicationListe publicationsSupprimees) {
833
	public void supprimerCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublicationListe publicationsSupprimees) {
838
		if (publicationsSupprimees != null && publicationsSupprimees.size() > 0) {
834
		if (publicationsSupprimees != null && publicationsSupprimees.size() > 0) {
839
			String idCollectionAPublicationSeparesParVirgule = "" ;
835
			String idCollectionAPublicationSeparesParVirgule = "" ;
840
			for (Iterator<String> it = publicationsSupprimees.keySet().iterator(); it.hasNext();) {
836
			for (Iterator<String> it = publicationsSupprimees.keySet().iterator(); it.hasNext();) {
841
				idCollectionAPublicationSeparesParVirgule += publicationsSupprimees.get(it.next()).getId();
837
				idCollectionAPublicationSeparesParVirgule += publicationsSupprimees.get(it.next()).getId();
842
				if (it.hasNext()) {
838
				if (it.hasNext()) {
843
					idCollectionAPublicationSeparesParVirgule += ",";
839
					idCollectionAPublicationSeparesParVirgule += ",";
844
				}
840
				}
845
			}
841
			}
846
			modele.supprimerCollectionAPublication(vueARafraichir, idCollectionAPublicationSeparesParVirgule);
842
			modele.supprimerCollectionAPublication(vueARafraichir, idCollectionAPublicationSeparesParVirgule);
847
		}
843
		}
848
	}
844
	}
849
 
845
 
850
	//+----------------------------------------------------------------------------------------------------------------+
846
	//+----------------------------------------------------------------------------------------------------------------+
851
	// GESTION de la relation COLLECTION A COMMENTAIRE
847
	// GESTION de la relation COLLECTION A COMMENTAIRE
852
	
848
	
853
	public void selectionnerCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId) {
849
	public void selectionnerCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId) {
854
		modele.selectionnerCollectionACommentaire(vueARafraichir, collectionId);
850
		modele.selectionnerCollectionACommentaire(vueARafraichir, collectionId);
855
	}
851
	}
856
	
852
	
857
	public void ajouterCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId, CollectionACommentaireListe commentairesAjoutees) {
853
	public void ajouterCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId, CollectionACommentaireListe commentairesAjoutees) {
858
		if (commentairesAjoutees != null && commentairesAjoutees.size() > 0) {
854
		if (commentairesAjoutees != null && commentairesAjoutees.size() > 0) {
859
			for (Iterator<String> it = commentairesAjoutees.keySet().iterator(); it.hasNext();) {
855
			for (Iterator<String> it = commentairesAjoutees.keySet().iterator(); it.hasNext();) {
860
				modele.ajouterCollectionACommentaire(vueARafraichir, collectionId, (CollectionACommentaire) commentairesAjoutees.get(it.next()));
856
				modele.ajouterCollectionACommentaire(vueARafraichir, collectionId, (CollectionACommentaire) commentairesAjoutees.get(it.next()));
861
			}
857
			}
862
		}
858
		}
863
	}
859
	}
864
	
860
	
865
	public void modifierCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaireListe commentairesModifiees) {
861
	public void modifierCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaireListe commentairesModifiees) {
866
		if (commentairesModifiees != null && commentairesModifiees.size() > 0) {
862
		if (commentairesModifiees != null && commentairesModifiees.size() > 0) {
867
			for (Iterator<String> it = commentairesModifiees.keySet().iterator(); it.hasNext();) {
863
			for (Iterator<String> it = commentairesModifiees.keySet().iterator(); it.hasNext();) {
868
				modele.modifierCollectionACommentaire(vueARafraichir, (CollectionACommentaire) commentairesModifiees.get(it.next()));
864
				modele.modifierCollectionACommentaire(vueARafraichir, (CollectionACommentaire) commentairesModifiees.get(it.next()));
869
			}
865
			}
870
		}
866
		}
871
	}
867
	}
872
	
868
	
873
	public void supprimerCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaireListe commentairesSupprimees) {
869
	public void supprimerCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaireListe commentairesSupprimees) {
874
		if (commentairesSupprimees != null && commentairesSupprimees.size() > 0) {
870
		if (commentairesSupprimees != null && commentairesSupprimees.size() > 0) {
875
			String idCollectionACommentaireSeparesParVirgule = "" ;
871
			String idCollectionACommentaireSeparesParVirgule = "" ;
876
			for (Iterator<String> it = commentairesSupprimees.keySet().iterator(); it.hasNext();) {
872
			for (Iterator<String> it = commentairesSupprimees.keySet().iterator(); it.hasNext();) {
877
				idCollectionACommentaireSeparesParVirgule += commentairesSupprimees.get(it.next()).getId();
873
				idCollectionACommentaireSeparesParVirgule += commentairesSupprimees.get(it.next()).getId();
878
				if (it.hasNext()) {
874
				if (it.hasNext()) {
879
					idCollectionACommentaireSeparesParVirgule += ",";
875
					idCollectionACommentaireSeparesParVirgule += ",";
880
				}
876
				}
881
			}
877
			}
882
			modele.supprimerCollectionACommentaire(vueARafraichir, idCollectionACommentaireSeparesParVirgule, CollectionACommentaireAsyncDao.SUPPRESSION_PAR_COLLECTION);
878
			modele.supprimerCollectionACommentaire(vueARafraichir, idCollectionACommentaireSeparesParVirgule, CollectionACommentaireAsyncDao.SUPPRESSION_PAR_COLLECTION);
883
		}
879
		}
884
	}
880
	}
885
	//+----------------------------------------------------------------------------------------------------------------+
881
	//+----------------------------------------------------------------------------------------------------------------+
886
	//												GESTION DES PERSONNES
882
	//												GESTION DES PERSONNES
887
	//+----------------------------------------------------------------------------------------------------------------+
883
	//+----------------------------------------------------------------------------------------------------------------+
888
 
884
 
889
	public void afficherListePersonnes(PersonneListe personnesACharger)	{
885
	public void afficherListePersonnes(PersonneListe personnesACharger)	{
890
		if (!(panneauCentre.getContenu() instanceof PersonneVue))	{
886
		if (!(panneauCentre.getContenu() instanceof PersonneVue))	{
891
			panneauCentre.removeAll();
887
			panneauCentre.removeAll();
892
			panneauCentre.add(new PersonneVue(this));
888
			panneauCentre.add(new PersonneVue(this));
893
			panneauCentre.setId(ComposantId.PANNEAU_PERSONNE_LISTES);
889
			panneauCentre.setId(ComposantId.PANNEAU_PERSONNE_LISTES);
894
		}	
890
		}	
895
		
891
		
896
		panneauCentre.getContenu().rafraichir(personnesACharger);
892
		panneauCentre.getContenu().rafraichir(personnesACharger);
897
	}
893
	}
898
	
894
	
899
	public void afficherFormPersonne(String personneId)	{
895
	public void afficherFormPersonne(String personneId)	{
900
		panneauCentre.removeAll();
896
		panneauCentre.removeAll();
901
		PersonneForm personneForm = new PersonneForm(this, personneId);
897
		PersonneForm personneForm = new PersonneForm(this, personneId);
902
		panneauCentre.add(personneForm);
898
		panneauCentre.add(personneForm);
903
		
899
		
904
		panneauCentre.layout();
900
		panneauCentre.layout();
905
	}
901
	}
906
 
902
 
907
	public void clicListePersonne(Personne personne)	{
903
	public void clicListePersonne(Personne personne)	{
908
		panneauCentre.getContenu().rafraichir(personne);
904
		panneauCentre.getContenu().rafraichir(personne);
909
	}
905
	}
910
 
906
 
911
	public void clicAjouterPersonne()	{
907
	public void clicAjouterPersonne()	{
912
		afficherFormPersonne(null);
908
		afficherFormPersonne(null);
913
	}
909
	}
914
	
910
	
915
	public void clicModifierPersonne(List<Personne> selection)	{
911
	public void clicModifierPersonne(List<Personne> selection)	{
916
		if (selection.size() == 0) {
912
		if (selection.size() == 0) {
917
			Info.display("Information", "Veuillez sélectionner une personne.");
913
			Info.display("Information", "Veuillez sélectionner une personne.");
918
		} else if (selection.size() > 1) {
914
		} else if (selection.size() > 1) {
919
			Info.display("Information", "Veuillez sélectionner une seule personne à la fois.");
915
			Info.display("Information", "Veuillez sélectionner une seule personne à la fois.");
920
		} else if (selection.size() == 1) {
916
		} else if (selection.size() == 1) {
921
			afficherFormPersonne(selection.get(0).getId());
917
			afficherFormPersonne(selection.get(0).getId());
922
		} else {
918
		} else {
923
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPersonne() du Médiateur.");
919
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPersonne() du Médiateur.");
924
		}			
920
		}			
925
	}
921
	}
926
	
922
	
927
	
923
	
928
	public void clicSupprimerPersonne(final Rafraichissable vue, final List<Personne> personneSelection) {
924
	public void clicSupprimerPersonne(final Rafraichissable vue, final List<Personne> personneSelection) {
929
		//Empecher suppression utilisateur
925
		//Empecher suppression utilisateur
930
		for (int i=0; i < personneSelection.size(); i++)	{
926
		for (int i=0; i < personneSelection.size(); i++)	{
931
			Personne courante = personneSelection.get(i);
927
			Personne courante = personneSelection.get(i);
932
			if (courante.getId().equals(getUtilisateurId()))	{
928
			if (courante.getId().equals(getUtilisateurId()))	{
933
				Info.display("Information", "Vous ne pouvez pas supprimer votre compte");
929
				Info.display("Information", "Vous ne pouvez pas supprimer votre compte");
934
				personneSelection.remove(courante);
930
				personneSelection.remove(courante);
935
			}
931
			}
936
		}
932
		}
937
		
933
		
938
		if (personneSelection.size() == 0) {
934
		if (personneSelection.size() == 0) {
939
			Info.display("Information", "Veuillez sélectionner une personne.");
935
			Info.display("Information", "Veuillez sélectionner une personne.");
940
		} else if(personneSelection.size() > 0) {
936
		} else if(personneSelection.size() > 0) {
941
			String message = "Êtes vous sur de vouloir supprimer les personnes sélectionnées ?";
937
			String message = "Êtes vous sur de vouloir supprimer les personnes sélectionnées ?";
942
			if (personneSelection.size() == 1) {
938
			if (personneSelection.size() == 1) {
943
				message = "Êtes vous sur de vouloir supprimer la personne sélectionnée ?";
939
				message = "Êtes vous sur de vouloir supprimer la personne sélectionnée ?";
944
			}
940
			}
945
			
941
			
946
			final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { 
942
			final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { 
947
				public void handleEvent(MessageBoxEvent ce) {
943
				public void handleEvent(MessageBoxEvent ce) {
948
					Dialog dialog = (Dialog) ce.getComponent();
944
					Dialog dialog = (Dialog) ce.getComponent();
949
					Button btn = ce.getButtonClicked();
945
					Button btn = ce.getButtonClicked();
950
 
946
 
951
					if (btn.getText().equals(dialog.yesText)) {
947
					if (btn.getText().equals(dialog.yesText)) {
952
						String idPersonneSepareParVirgule = "" ;
948
						String idPersonneSepareParVirgule = "" ;
953
						Iterator<Personne> itPersonne = personneSelection.iterator();
949
						Iterator<Personne> itPersonne = personneSelection.iterator();
954
						while (itPersonne.hasNext()) {
950
						while (itPersonne.hasNext()) {
955
							Personne personneCourante = itPersonne.next();
951
							Personne personneCourante = itPersonne.next();
956
							idPersonneSepareParVirgule += personneCourante.getId();
952
							idPersonneSepareParVirgule += personneCourante.getId();
957
							idPersonneSepareParVirgule +=",";
953
							idPersonneSepareParVirgule +=",";
958
						}
954
						}
959
						modele.supprimerPersonne(vue, idPersonneSepareParVirgule);  
955
						modele.supprimerPersonne(vue, idPersonneSepareParVirgule);  
960
					}
956
					}
961
				}
957
				}
962
			};
958
			};
963
			
959
			
964
			MessageBox.confirm("Supprimer une personne", message, listenerSuppression);
960
			MessageBox.confirm("Supprimer une personne", message, listenerSuppression);
965
		} else {
961
		} else {
966
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerPersonne() du Médiateur.");
962
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerPersonne() du Médiateur.");
967
		}
963
		}
968
	}
964
	}
969
 
965
 
970
	public void selectionnerPersonne(Rafraichissable vueARafraichir, Personne personne, String projetId)	{
966
	public void selectionnerPersonne(Rafraichissable vueARafraichir, Personne personne, String projetId)	{
971
		selectionnerPersonne(vueARafraichir, personne, projetId, 0, nbElements);
967
		selectionnerPersonne(vueARafraichir, personne, projetId, 0, nbElements);
972
	}
968
	}
973
	
969
	
974
	public void selectionnerPersonne(Rafraichissable vueARafraichir, Personne personne, String projetId, int start, int nbElements)	{
970
	public void selectionnerPersonne(Rafraichissable vueARafraichir, Personne personne, String projetId, int start, int nbElements)	{
975
		String personneId = null;
971
		String personneId = null;
976
		String personneNom = null;
972
		String personneNom = null;
977
		if (personne != null)	{
973
		if (personne != null)	{
978
			personneId = personne.getId();
974
			personneId = personne.getId();
979
			personneNom = personne.getNom();
975
			personneNom = personne.getNom();
980
		}
976
		}
981
		modele.selectionnerPersonne(vueARafraichir, personneId, projetId, personneNom, start, nbElements);
977
		modele.selectionnerPersonne(vueARafraichir, personneId, projetId, personneNom, start, nbElements);
982
	}
978
	}
983
	
979
	
984
	public void selectionnerPersonneParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
980
	public void selectionnerPersonneParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
985
		modele.selectionnerPersonne(vueARafraichir, null, projetId, nomComplet, 0, -1);		
981
		modele.selectionnerPersonne(vueARafraichir, null, projetId, nomComplet, 0, -1);		
986
	}
982
	}
987
	
983
	
988
	public void selectionnerPersonneParProjet(Rafraichissable vueARafraichir, String projetId) {
984
	public void selectionnerPersonneParProjet(Rafraichissable vueARafraichir, String projetId) {
989
		modele.selectionnerPersonne(vueARafraichir, null, projetId, null, 0, -1);		
985
		modele.selectionnerPersonne(vueARafraichir, null, projetId, null, 0, -1);		
990
	}
986
	}
991
	
987
	
992
	public void enregistrerPersonne(Rafraichissable vue, Personne personne){
988
	public void enregistrerPersonne(Rafraichissable vue, Personne personne){
993
		if (personne.getId() != null && !personne.getId().trim().equals("")) {	
989
		if (personne.getId() != null && !personne.getId().trim().equals("")) {	
994
			modele.modifierPersonne(vue, personne);
990
			modele.modifierPersonne(vue, personne);
995
		}	else {
991
		}	else {
996
			modele.ajouterPersonne(vue, personne);
992
			modele.ajouterPersonne(vue, personne);
997
		}
993
		}
998
	}
994
	}
999
	
995
	
1000
	//+----------------------------------------------------------------------------------------------------------------+
996
	//+----------------------------------------------------------------------------------------------------------------+
1001
	//												GESTION DES PUBLICATIONS
997
	//												GESTION DES PUBLICATIONS
1002
	//+----------------------------------------------------------------------------------------------------------------+
998
	//+----------------------------------------------------------------------------------------------------------------+
1003
 
999
 
1004
	public void afficherListePublication(PublicationListe nouvelleDonnees) {
1000
	public void afficherListePublication(PublicationListe nouvelleDonnees) {
1005
		if (!(panneauCentre.getContenu() instanceof PublicationVue))	{
1001
		if (!(panneauCentre.getContenu() instanceof PublicationVue))	{
1006
			panneauCentre.removeAll();
1002
			panneauCentre.removeAll();
1007
			panneauCentre.add(new PublicationVue(this));
1003
			panneauCentre.add(new PublicationVue(this));
1008
		}	
1004
		}	
1009
		
1005
		
1010
		panneauCentre.getContenu().rafraichir(nouvelleDonnees);	
1006
		panneauCentre.getContenu().rafraichir(nouvelleDonnees);	
1011
	}
1007
	}
1012
	
1008
	
1013
	public void afficherFormPublication(String publicationId) {
1009
	public void afficherFormPublication(String publicationId) {
1014
		panneauCentre.removeAll();
1010
		panneauCentre.removeAll();
1015
		PublicationForm publicationForm = new PublicationForm(this, publicationId);
1011
		PublicationForm publicationForm = new PublicationForm(this, publicationId);
1016
		panneauCentre.add(publicationForm);
1012
		panneauCentre.add(publicationForm);
1017
		
1013
		
1018
		panneauCentre.layout();
1014
		panneauCentre.layout();
1019
	}
1015
	}
1020
	
1016
	
1021
	public void clicListePublication(Publication publication) {
1017
	public void clicListePublication(Publication publication) {
1022
		if (publication != null) {
1018
		if (publication != null) {
1023
			panneauCentre.getContenu().rafraichir(publication);	
1019
			panneauCentre.getContenu().rafraichir(publication);	
1024
		}
1020
		}
1025
	}
1021
	}
1026
 
1022
 
1027
	public void clicAjouterPublication() {
1023
	public void clicAjouterPublication() {
1028
		afficherFormPublication(null);
1024
		afficherFormPublication(null);
1029
	}
1025
	}
1030
	
1026
	
1031
	public void clicModifierPublication(List<Publication> selection) {
1027
	public void clicModifierPublication(List<Publication> selection) {
1032
		if (selection.size() == 0) {
1028
		if (selection.size() == 0) {
1033
			Info.display("Information", "Veuillez sélectionner une publication.");
1029
			Info.display("Information", "Veuillez sélectionner une publication.");
1034
		} else if (selection.size() > 1) {
1030
		} else if (selection.size() > 1) {
1035
			Info.display("Information", "Veuillez sélectionner une seule publication à la fois.");
1031
			Info.display("Information", "Veuillez sélectionner une seule publication à la fois.");
1036
		} else if (selection.size() == 1) {
1032
		} else if (selection.size() == 1) {
1037
			afficherFormPublication(selection.get(0).getId());
1033
			afficherFormPublication(selection.get(0).getId());
1038
		} else {
1034
		} else {
1039
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPublication() du Médiateur.");
1035
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPublication() du Médiateur.");
1040
		}
1036
		}
1041
	}
1037
	}
1042
	
1038
	
1043
	public void clicSupprimerPublication(final List<Publication> publicationListe) {
1039
	public void clicSupprimerPublication(final List<Publication> publicationListe) {
1044
		if (publicationListe.size() <= 0) {
1040
		if (publicationListe.size() <= 0) {
1045
			MessageBox.alert("Attention", "Vous devez sélectionner une publication", null); 
1041
			MessageBox.alert("Attention", "Vous devez sélectionner une publication", null); 
1046
		} else {
1042
		} else {
1047
			String message = "Voulez-vous vraiment supprimer ces publications ?";
1043
			String message = "Voulez-vous vraiment supprimer ces publications ?";
1048
			if (publicationListe.size() == 1) {
1044
			if (publicationListe.size() == 1) {
1049
				message = "Voulez-vous vraiment supprimer cette publication ?";
1045
				message = "Voulez-vous vraiment supprimer cette publication ?";
1050
			}
1046
			}
1051
			
1047
			
1052
			final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { 
1048
			final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { 
1053
				public void handleEvent(MessageBoxEvent ce) {  
1049
				public void handleEvent(MessageBoxEvent ce) {  
1054
					Dialog dialog = (Dialog) ce.getComponent();
1050
					Dialog dialog = (Dialog) ce.getComponent();
1055
				    Button btn = ce.getButtonClicked();  
1051
				    Button btn = ce.getButtonClicked();  
1056
				    	   
1052
				    	   
1057
				    if (btn.getText().equals(dialog.yesText)) {
1053
				    if (btn.getText().equals(dialog.yesText)) {
1058
				    	supprimerPublication(panneauCentre.getContenu(), publicationListe);
1054
				    	supprimerPublication(panneauCentre.getContenu(), publicationListe);
1059
				    }
1055
				    }
1060
				}
1056
				}
1061
			};
1057
			};
1062
				     
1058
				     
1063
			MessageBox.confirm("Supprimer une publication", message, listenerSuppression);
1059
			MessageBox.confirm("Supprimer une publication", message, listenerSuppression);
1064
		}
1060
		}
1065
	}
1061
	}
1066
	
1062
	
1067
	public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId) {
1063
	public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId) {
1068
		selectionnerPublication(vueARafraichir, getProjetId(), publicationId, null, 0, nbElements);
1064
		selectionnerPublication(vueARafraichir, getProjetId(), publicationId, null, 0, nbElements);
1069
	}
1065
	}
1070
	
1066
	
1071
	public void selectionnerPublicationParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
1067
	public void selectionnerPublicationParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
1072
		selectionnerPublication(vueARafraichir, projetId, null, nomComplet, 0, nbElements);
1068
		selectionnerPublication(vueARafraichir, projetId, null, nomComplet, 0, nbElements);
1073
	}
1069
	}
1074
	
1070
	
1075
	public void selectionnerPublication(Rafraichissable vueARafraichir, String projetId, String publicationId, String nomComplet, int pageCourante, int nbElements) {
1071
	public void selectionnerPublication(Rafraichissable vueARafraichir, String projetId, String publicationId, String nomComplet, int pageCourante, int nbElements) {
1076
		modele.selectionnerPublication(vueARafraichir, publicationId, projetId, nomComplet, nbElements, pageCourante);		
1072
		modele.selectionnerPublication(vueARafraichir, publicationId, projetId, nomComplet, nbElements, pageCourante);		
1077
	}
1073
	}
1078
		
1074
		
1079
	public void ajouterPublication(Rafraichissable vueARafraichir, Publication publication) {
1075
	public void ajouterPublication(Rafraichissable vueARafraichir, Publication publication) {
1080
		modele.ajouterPublication(vueARafraichir, publication);
1076
		modele.ajouterPublication(vueARafraichir, publication);
1081
	}
1077
	}
1082
	
1078
	
1083
	public void modifierPublication(Rafraichissable vueARafraichir, Publication publication) {
1079
	public void modifierPublication(Rafraichissable vueARafraichir, Publication publication) {
1084
		modele.modifierPublication(vueARafraichir, publication);
1080
		modele.modifierPublication(vueARafraichir, publication);
1085
	}
1081
	}
1086
	
1082
	
1087
	public void supprimerPublication(Rafraichissable vueARafraichir, List<Publication> publicationsListe) {
1083
	public void supprimerPublication(Rafraichissable vueARafraichir, List<Publication> publicationsListe) {
1088
		if (publicationsListe != null && publicationsListe.size() > 0) {
1084
		if (publicationsListe != null && publicationsListe.size() > 0) {
1089
			String idPublicationSeparesParVirgule = "" ;
1085
			String idPublicationSeparesParVirgule = "" ;
1090
			Iterator<Publication> it = publicationsListe.iterator();
1086
			Iterator<Publication> it = publicationsListe.iterator();
1091
			while (it.hasNext()) {
1087
			while (it.hasNext()) {
1092
				idPublicationSeparesParVirgule += it.next().getId();
1088
				idPublicationSeparesParVirgule += it.next().getId();
1093
				if (it.hasNext()) {
1089
				if (it.hasNext()) {
1094
					idPublicationSeparesParVirgule += ",";
1090
					idPublicationSeparesParVirgule += ",";
1095
				}
1091
				}
1096
			}
1092
			}
1097
			modele.supprimerPublication(vueARafraichir, idPublicationSeparesParVirgule);
1093
			modele.supprimerPublication(vueARafraichir, idPublicationSeparesParVirgule);
1098
			modele.supprimerPublicationAPersonne(vueARafraichir, idPublicationSeparesParVirgule);
1094
			modele.supprimerPublicationAPersonne(vueARafraichir, idPublicationSeparesParVirgule);
1099
		}
1095
		}
1100
	}
1096
	}
1101
 
1097
 
1102
	public void clicObtenirListeEditeurs(Rafraichissable vueARafraichir) {
1098
	public void clicObtenirListeEditeurs(Rafraichissable vueARafraichir) {
1103
		selectionnerStructureParProjet(vueARafraichir, null);
1099
		selectionnerStructureParProjet(vueARafraichir, null);
1104
	}
1100
	}
1105
 
1101
 
1106
	public void clicObtenirListeAuteurs(Rafraichissable vueARafraichir) {
1102
	public void clicObtenirListeAuteurs(Rafraichissable vueARafraichir) {
1107
		selectionnerPersonneParProjet(vueARafraichir, null);
1103
		selectionnerPersonneParProjet(vueARafraichir, null);
1108
	}
1104
	}
1109
	
1105
	
1110
	//+----------------------------------------------------------------------------------------------------------------+
1106
	//+----------------------------------------------------------------------------------------------------------------+
1111
	// GESTION de la relation PUBLICATION A PERSONNE
1107
	// GESTION de la relation PUBLICATION A PERSONNE
1112
 
1108
 
1113
	public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
1109
	public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
1114
		modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleId);
1110
		modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleId);
1115
	}
1111
	}
1116
	
1112
	
1117
	public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, List<Valeur> roleId) {
1113
	public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, List<Valeur> roleId) {
1118
		String roleIds = "";
1114
		String roleIds = "";
1119
		Iterator<Valeur> itRole = roleId.iterator();
1115
		Iterator<Valeur> itRole = roleId.iterator();
1120
		while (itRole.hasNext())	{
1116
		while (itRole.hasNext())	{
1121
			roleIds+= itRole.next().getId();
1117
			roleIds+= itRole.next().getId();
1122
			if (itRole.hasNext())	{
1118
			if (itRole.hasNext())	{
1123
				roleIds+=",";
1119
				roleIds+=",";
1124
			}
1120
			}
1125
		}
1121
		}
1126
		modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleIds);
1122
		modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleIds);
1127
	}
1123
	}
1128
	
1124
	
1129
	public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, PublicationAPersonneListe personnesAjoutees, String roleId) {
1125
	public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, PublicationAPersonneListe personnesAjoutees, String roleId) {
1130
		if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
1126
		if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
1131
			String idPublicationAPersonneSepareParVirgule = "" ;
1127
			String idPublicationAPersonneSepareParVirgule = "" ;
1132
			for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
1128
			for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
1133
				idPublicationAPersonneSepareParVirgule += personnesAjoutees.get(it.next()).getIdPersonne();
1129
				idPublicationAPersonneSepareParVirgule += personnesAjoutees.get(it.next()).getIdPersonne();
1134
				if (it.hasNext()) {
1130
				if (it.hasNext()) {
1135
					idPublicationAPersonneSepareParVirgule += ",";
1131
					idPublicationAPersonneSepareParVirgule += ",";
1136
				}
1132
				}
1137
			}
1133
			}
1138
			modele.ajouterPublicationAPersonne(vueARafraichir, publicationId, idPublicationAPersonneSepareParVirgule, roleId);
1134
			modele.ajouterPublicationAPersonne(vueARafraichir, publicationId, idPublicationAPersonneSepareParVirgule, roleId);
1139
		}
1135
		}
1140
	}
1136
	}
1141
	
1137
	
1142
	public void supprimerPublicationAPersonne(Rafraichissable vueARafraichir, PublicationAPersonneListe personnesSupprimees) {
1138
	public void supprimerPublicationAPersonne(Rafraichissable vueARafraichir, PublicationAPersonneListe personnesSupprimees) {
1143
		if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
1139
		if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
1144
			String idPublicationAPersonneSepareParVirgule = "" ;
1140
			String idPublicationAPersonneSepareParVirgule = "" ;
1145
			for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
1141
			for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
1146
				idPublicationAPersonneSepareParVirgule += personnesSupprimees.get(it.next()).getId();
1142
				idPublicationAPersonneSepareParVirgule += personnesSupprimees.get(it.next()).getId();
1147
				if (it.hasNext()) {
1143
				if (it.hasNext()) {
1148
					idPublicationAPersonneSepareParVirgule += ",";
1144
					idPublicationAPersonneSepareParVirgule += ",";
1149
				}
1145
				}
1150
			}
1146
			}
1151
			modele.supprimerPublicationAPersonne(vueARafraichir, idPublicationAPersonneSepareParVirgule);
1147
			modele.supprimerPublicationAPersonne(vueARafraichir, idPublicationAPersonneSepareParVirgule);
1152
		}
1148
		}
1153
	}
1149
	}
1154
	
1150
	
1155
	//Lier plusieurs publication à une personne
1151
	//Lier plusieurs publication à une personne
1156
	public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, PublicationAPersonneListe listePublications, String personneId, String roleId) {
1152
	public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, PublicationAPersonneListe listePublications, String personneId, String roleId) {
1157
		if (listePublications!=null && listePublications.size()>0)	{
1153
		if (listePublications!=null && listePublications.size()>0)	{
1158
			String idsPubli = "";
1154
			String idsPubli = "";
1159
			String rolesIds = "";
1155
			String rolesIds = "";
1160
			for (Iterator<String> it = listePublications.keySet().iterator(); it.hasNext();) {
1156
			for (Iterator<String> it = listePublications.keySet().iterator(); it.hasNext();) {
1161
				PublicationAPersonne publi = listePublications.get(it.next());
1157
				PublicationAPersonne publi = listePublications.get(it.next());
1162
				idsPubli += publi.getId();
1158
				idsPubli += publi.getId();
1163
				rolesIds += publi.getRole();
1159
				rolesIds += publi.getRole();
1164
				if (it.hasNext()) {
1160
				if (it.hasNext()) {
1165
					idsPubli += ",";
1161
					idsPubli += ",";
1166
					rolesIds += ",";
1162
					rolesIds += ",";
1167
				}
1163
				}
1168
			}			
1164
			}			
1169
			modele.ajouterPublicationAPersonne(vueARafraichir, idsPubli, personneId, rolesIds);
1165
			modele.ajouterPublicationAPersonne(vueARafraichir, idsPubli, personneId, rolesIds);
1170
		}
1166
		}
1171
	}
1167
	}
1172
	
1168
	
1173
	//+----------------------------------------------------------------------------------------------------------------+
1169
	//+----------------------------------------------------------------------------------------------------------------+
1174
	//												GESTION DES COMMENTAIRES
1170
	//												GESTION DES COMMENTAIRES
1175
	//+----------------------------------------------------------------------------------------------------------------+
1171
	//+----------------------------------------------------------------------------------------------------------------+
1176
 
1172
 
1177
	public void afficherListeCommentaire(CommentaireListe nouvelleDonnees) {
1173
	public void afficherListeCommentaire(CommentaireListe nouvelleDonnees) {
1178
		if (!(panneauCentre.getContenu() instanceof CommentaireVue)) {
1174
		if (!(panneauCentre.getContenu() instanceof CommentaireVue)) {
1179
			panneauCentre.removeAll();
1175
			panneauCentre.removeAll();
1180
			panneauCentre.add(new CommentaireVue(this));
1176
			panneauCentre.add(new CommentaireVue(this));
1181
		}	
1177
		}	
1182
		
1178
		
1183
		panneauCentre.getContenu().rafraichir(nouvelleDonnees);	
1179
		panneauCentre.getContenu().rafraichir(nouvelleDonnees);	
1184
	}
1180
	}
1185
	
1181
	
1186
	public void afficherFormCommentaire(String commentaireId) {
1182
	public void afficherFormCommentaire(String commentaireId) {
1187
		panneauCentre.removeAll();
1183
		panneauCentre.removeAll();
1188
		CommentaireForm commentaireForm = new CommentaireForm(this, commentaireId);
1184
		CommentaireForm commentaireForm = new CommentaireForm(this, commentaireId);
1189
		panneauCentre.add(commentaireForm);
1185
		panneauCentre.add(commentaireForm);
1190
		
1186
		
1191
		panneauCentre.layout();
1187
		panneauCentre.layout();
1192
	}
1188
	}
1193
	
1189
	
1194
	public void clicListeCommentaire(Commentaire commentaire) {
1190
	public void clicListeCommentaire(Commentaire commentaire) {
1195
		if (commentaire != null) {
1191
		if (commentaire != null) {
1196
			panneauCentre.getContenu().rafraichir(commentaire);	
1192
			panneauCentre.getContenu().rafraichir(commentaire);	
1197
		}
1193
		}
1198
	}
1194
	}
1199
 
1195
 
1200
	public void clicAjouterCommentaire() {
1196
	public void clicAjouterCommentaire() {
1201
		afficherFormCommentaire(null);
1197
		afficherFormCommentaire(null);
1202
	}
1198
	}
1203
	
1199
	
1204
	public void clicModifierCommentaire(List<Commentaire> selection) {
1200
	public void clicModifierCommentaire(List<Commentaire> selection) {
1205
		if (selection.size() == 0) {
1201
		if (selection.size() == 0) {
1206
			Info.display("Information", "Veuillez sélectionner un commentaire.");
1202
			Info.display("Information", "Veuillez sélectionner un commentaire.");
1207
		} else if (selection.size() > 1) {
1203
		} else if (selection.size() > 1) {
1208
			Info.display("Information", "Veuillez sélectionner un seul commentaire à la fois.");
1204
			Info.display("Information", "Veuillez sélectionner un seul commentaire à la fois.");
1209
		} else if (selection.size() == 1) {
1205
		} else if (selection.size() == 1) {
1210
			afficherFormCommentaire(selection.get(0).getId());
1206
			afficherFormCommentaire(selection.get(0).getId());
1211
		} else {
1207
		} else {
1212
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCommentaire() du Médiateur.");
1208
			Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCommentaire() du Médiateur.");
1213
		}
1209
		}
1214
	}
1210
	}
1215
	
1211
	
1216
	public void clicSupprimerCommentaire(final List<Commentaire> commentaireListe) {
1212
	public void clicSupprimerCommentaire(final List<Commentaire> commentaireListe) {
1217
		if (commentaireListe.size() <= 0) {
1213
		if (commentaireListe.size() <= 0) {
1218
			MessageBox.alert("Attention", "Vous devez sélectionner un commentaire", null); 
1214
			MessageBox.alert("Attention", "Vous devez sélectionner un commentaire", null); 
1219
		} else {
1215
		} else {
1220
			String message = "Voulez-vous vraiment supprimer ces commentaires ?";
1216
			String message = "Voulez-vous vraiment supprimer ces commentaires ?";
1221
			if (commentaireListe.size() == 1) {
1217
			if (commentaireListe.size() == 1) {
1222
				message = "Voulez-vous vraiment supprimer ce commentaire ?";
1218
				message = "Voulez-vous vraiment supprimer ce commentaire ?";
1223
			}
1219
			}
1224
			
1220
			
1225
			final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { 
1221
			final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() { 
1226
				public void handleEvent(MessageBoxEvent ce) {  
1222
				public void handleEvent(MessageBoxEvent ce) {  
1227
					Dialog dialog = (Dialog) ce.getComponent();
1223
					Dialog dialog = (Dialog) ce.getComponent();
1228
				    Button btn = ce.getButtonClicked();  
1224
				    Button btn = ce.getButtonClicked();  
1229
				    	   
1225
				    	   
1230
				    if (btn.getText().equals(dialog.yesText)) {
1226
				    if (btn.getText().equals(dialog.yesText)) {
1231
				    	supprimerCommentaire(panneauCentre.getContenu(), commentaireListe);
1227
				    	supprimerCommentaire(panneauCentre.getContenu(), commentaireListe);
1232
				    }
1228
				    }
1233
				}
1229
				}
1234
			};
1230
			};
1235
				     
1231
				     
1236
			MessageBox.confirm("Supprimer un commentaire", message, listenerSuppression);
1232
			MessageBox.confirm("Supprimer un commentaire", message, listenerSuppression);
1237
		}
1233
		}
1238
	}
1234
	}
1239
	
1235
	
1240
	public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId) {
1236
	public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId) {
1241
		selectionnerCommentaire(vueARafraichir, commentaireId, null, 0, nbElements);
1237
		selectionnerCommentaire(vueARafraichir, commentaireId, null, 0, nbElements);
1242
	}
1238
	}
1243
	public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId, String titre, int pageCourante, int nbElements) {
1239
	public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId, String titre, int pageCourante, int nbElements) {
1244
		modele.selectionnerCommentaire(vueARafraichir, commentaireId, getProjetId(), titre, pageCourante, nbElements);
1240
		modele.selectionnerCommentaire(vueARafraichir, commentaireId, getProjetId(), titre, pageCourante, nbElements);
1245
	}
1241
	}
1246
	
1242
	
1247
	public void selectionnerCommentaireParTitre(Rafraichissable vueARafraichir, String titre) {
1243
	public void selectionnerCommentaireParTitre(Rafraichissable vueARafraichir, String titre) {
1248
		selectionnerCommentaire(vueARafraichir, null, titre, 0, nbElements);
1244
		selectionnerCommentaire(vueARafraichir, null, titre, 0, nbElements);
1249
	}
1245
	}
1250
	
1246
	
1251
	public void ajouterCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
1247
	public void ajouterCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
1252
		modele.ajouterCommentaire(vueARafraichir, commentaire);
1248
		modele.ajouterCommentaire(vueARafraichir, commentaire);
1253
	}
1249
	}
1254
	
1250
	
1255
	public void modifierCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
1251
	public void modifierCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
1256
		modele.modifierCommentaire(vueARafraichir, commentaire);
1252
		modele.modifierCommentaire(vueARafraichir, commentaire);
1257
	}
1253
	}
1258
	
1254
	
1259
	public void supprimerCommentaire(Rafraichissable vueARafraichir, List<Commentaire> commentairesListe) {
1255
	public void supprimerCommentaire(Rafraichissable vueARafraichir, List<Commentaire> commentairesListe) {
1260
		if (commentairesListe != null && commentairesListe.size() > 0) {
1256
		if (commentairesListe != null && commentairesListe.size() > 0) {
1261
			String idCommentaireSeparesParVirgule = "" ;
1257
			String idCommentaireSeparesParVirgule = "" ;
1262
			Iterator<Commentaire> it = commentairesListe.iterator();
1258
			Iterator<Commentaire> it = commentairesListe.iterator();
1263
			while (it.hasNext()) {
1259
			while (it.hasNext()) {
1264
				idCommentaireSeparesParVirgule += it.next().getId();
1260
				idCommentaireSeparesParVirgule += it.next().getId();
1265
				if (it.hasNext()) {
1261
				if (it.hasNext()) {
1266
					idCommentaireSeparesParVirgule += ",";
1262
					idCommentaireSeparesParVirgule += ",";
1267
				}
1263
				}
1268
			}
1264
			}
1269
			modele.supprimerCommentaire(vueARafraichir, idCommentaireSeparesParVirgule);
1265
			modele.supprimerCommentaire(vueARafraichir, idCommentaireSeparesParVirgule);
1270
			modele.supprimerCollectionACommentaire(vueARafraichir, idCommentaireSeparesParVirgule, CollectionACommentaireAsyncDao.SUPPRESSION_PAR_COMMENTAIRE);
1266
			modele.supprimerCollectionACommentaire(vueARafraichir, idCommentaireSeparesParVirgule, CollectionACommentaireAsyncDao.SUPPRESSION_PAR_COMMENTAIRE);
1271
		}
1267
		}
1272
	}
1268
	}
1273
	
1269
	
1274
	//+----------------------------------------------------------------------------------------------------------------+
1270
	//+----------------------------------------------------------------------------------------------------------------+
1275
	//												RAFRAICHISSEMENT
1271
	//												RAFRAICHISSEMENT
1276
	//+----------------------------------------------------------------------------------------------------------------+
1272
	//+----------------------------------------------------------------------------------------------------------------+
1277
	
1273
	
1278
	public void rafraichir(Object nouvellesDonnees) {
1274
	public void rafraichir(Object nouvellesDonnees) {
1279
		if (nouvellesDonnees instanceof Utilisateur) {
1275
		if (nouvellesDonnees instanceof Utilisateur) {
1280
			repandreEtatIdentification((Utilisateur) nouvellesDonnees);
1276
			repandreEtatIdentification((Utilisateur) nouvellesDonnees);
1281
		} else if (nouvellesDonnees instanceof Information) {
1277
		} else if (nouvellesDonnees instanceof Information) {
1282
			Information info = (Information) nouvellesDonnees;
1278
			Information info = (Information) nouvellesDonnees;
1283
			if (info.getType().equals("modification_personne")) {
1279
			if (info.getType().equals("modification_personne")) {
1284
				repandreInfoMiseAJourUtilisateur();
1280
				repandreInfoMiseAJourUtilisateur();
1285
			}
1281
			}
1286
		} else {
1282
		} else {
1287
			GWT.log(i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
1283
			GWT.log(i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
1288
		}
1284
		}
1289
	}
1285
	}
1290
	
1286
	
1291
	//+----------------------------------------------------------------------------------------------------------------+
1287
	//+----------------------------------------------------------------------------------------------------------------+
1292
	//												GESTION du STATUT
1288
	//												GESTION du STATUT
1293
	//+----------------------------------------------------------------------------------------------------------------+
1289
	//+----------------------------------------------------------------------------------------------------------------+
1294
	
1290
	
1295
	public void afficherPopinChargement()	{
1291
	public void afficherPopinChargement()	{
1296
		((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).center();
1292
		((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).center();
1297
	}
1293
	}
1298
		
1294
		
1299
	public void masquerPopinChargement()	{		
1295
	public void masquerPopinChargement()	{		
1300
		((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).hide();
1296
		((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).hide();
1301
	}
1297
	}
1302
	
1298
	
1303
	public String obtenirClasseContenu()	{
1299
	public String obtenirClasseContenu()	{
1304
		String classeContenu = null;
1300
		String classeContenu = null;
1305
		if (panneauCentre.getContenu() != null)	{
1301
		if (panneauCentre.getContenu() != null)	{
1306
			classeContenu = panneauCentre.getContenu().getClass().toString();
1302
			classeContenu = panneauCentre.getContenu().getClass().toString();
1307
		}	
1303
		}	
1308
		return classeContenu;
1304
		return classeContenu;
1309
	} 
1305
	} 
1310
 
1306
 
1311
}
1307
}