Subversion Repositories eFlore/Applications.coel

Rev

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

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