Subversion Repositories eFlore/Applications.coel

Rev

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

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