Subversion Repositories eFlore/Applications.coel

Rev

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

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