Subversion Repositories eFlore/Applications.coel

Rev

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

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