Subversion Repositories eFlore/Applications.coel

Rev

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

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