Subversion Repositories eFlore/Applications.coel

Rev

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

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