Subversion Repositories eFlore/Applications.coel

Rev

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

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