Subversion Repositories eFlore/Applications.coel

Rev

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

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