Subversion Repositories eFlore/Applications.coel

Rev

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

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