Subversion Repositories eFlore/Applications.coel

Rev

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

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