Subversion Repositories eFlore/Applications.coel

Rev

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

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