Subversion Repositories eFlore/Applications.coel

Rev

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

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