Subversion Repositories eFlore/Applications.coel

Rev

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

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