Subversion Repositories eFlore/Applications.coel

Rev

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

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