Subversion Repositories eFlore/Applications.coel

Rev

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

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