Subversion Repositories eFlore/Applications.coel

Rev

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

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