Subversion Repositories eFlore/Applications.coel

Rev

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

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