Subversion Repositories eFlore/Applications.coel

Rev

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

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