Subversion Repositories eFlore/Applications.coel

Rev

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

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