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.ParametreFenetre;
|
8 |
import org.tela_botanica.client.composants.ParametreFenetre;
|
9 |
import org.tela_botanica.client.i18n.Constantes;
|
9 |
import org.tela_botanica.client.i18n.Constantes;
|
10 |
import org.tela_botanica.client.i18n.ErrorMessages;
|
10 |
import org.tela_botanica.client.i18n.ErrorMessages;
|
11 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
11 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
12 |
import org.tela_botanica.client.modeles.Collection;
|
12 |
import org.tela_botanica.client.modeles.Collection;
|
- |
|
13 |
import org.tela_botanica.client.modeles.CollectionAPersonne;
|
13 |
import org.tela_botanica.client.modeles.CollectionListe;
|
14 |
import org.tela_botanica.client.modeles.CollectionListe;
|
14 |
import org.tela_botanica.client.modeles.Configuration;
|
15 |
import org.tela_botanica.client.modeles.Configuration;
|
15 |
import org.tela_botanica.client.modeles.Information;
|
16 |
import org.tela_botanica.client.modeles.Information;
|
16 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
17 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
17 |
import org.tela_botanica.client.modeles.Personne;
|
18 |
import org.tela_botanica.client.modeles.Personne;
|
18 |
import org.tela_botanica.client.modeles.PersonneListe;
|
19 |
import org.tela_botanica.client.modeles.PersonneListe;
|
19 |
import org.tela_botanica.client.modeles.Projet;
|
20 |
import org.tela_botanica.client.modeles.Projet;
|
20 |
import org.tela_botanica.client.modeles.ProjetListe;
|
21 |
import org.tela_botanica.client.modeles.ProjetListe;
|
21 |
import org.tela_botanica.client.modeles.Publication;
|
22 |
import org.tela_botanica.client.modeles.Publication;
|
22 |
import org.tela_botanica.client.modeles.PublicationListe;
|
23 |
import org.tela_botanica.client.modeles.PublicationListe;
|
23 |
import org.tela_botanica.client.modeles.Structure;
|
24 |
import org.tela_botanica.client.modeles.Structure;
|
24 |
import org.tela_botanica.client.modeles.StructureAPersonne;
|
25 |
import org.tela_botanica.client.modeles.StructureAPersonne;
|
- |
|
26 |
import org.tela_botanica.client.modeles.CollectionAPersonneListe;
|
25 |
import org.tela_botanica.client.modeles.StructureAPersonneListe;
|
27 |
import org.tela_botanica.client.modeles.StructureAPersonneListe;
|
26 |
import org.tela_botanica.client.modeles.StructureConservation;
|
28 |
import org.tela_botanica.client.modeles.StructureConservation;
|
27 |
import org.tela_botanica.client.modeles.StructureListe;
|
29 |
import org.tela_botanica.client.modeles.StructureListe;
|
28 |
import org.tela_botanica.client.modeles.StructureValorisation;
|
30 |
import org.tela_botanica.client.modeles.StructureValorisation;
|
29 |
import org.tela_botanica.client.modeles.Utilisateur;
|
31 |
import org.tela_botanica.client.modeles.Utilisateur;
|
30 |
import org.tela_botanica.client.modeles.ValeurListe;
|
32 |
import org.tela_botanica.client.modeles.ValeurListe;
|
31 |
import org.tela_botanica.client.vues.CollectionForm;
|
33 |
import org.tela_botanica.client.vues.CollectionForm;
|
32 |
import org.tela_botanica.client.vues.CollectionListeVue;
|
34 |
import org.tela_botanica.client.vues.CollectionListeVue;
|
33 |
import org.tela_botanica.client.vues.CollectionVue;
|
35 |
import org.tela_botanica.client.vues.CollectionVue;
|
34 |
import org.tela_botanica.client.vues.ContenuVue;
|
36 |
import org.tela_botanica.client.vues.ContenuVue;
|
35 |
import org.tela_botanica.client.vues.EnteteVue;
|
37 |
import org.tela_botanica.client.vues.EnteteVue;
|
36 |
import org.tela_botanica.client.vues.Formulaire;
|
38 |
import org.tela_botanica.client.vues.Formulaire;
|
37 |
import org.tela_botanica.client.vues.PersonneForm;
|
39 |
import org.tela_botanica.client.vues.PersonneForm;
|
38 |
import org.tela_botanica.client.vues.ProjetVue;
|
40 |
import org.tela_botanica.client.vues.ProjetVue;
|
39 |
import org.tela_botanica.client.vues.PublicationForm;
|
41 |
import org.tela_botanica.client.vues.PublicationForm;
|
40 |
import org.tela_botanica.client.vues.StructureForm;
|
42 |
import org.tela_botanica.client.vues.StructureForm;
|
41 |
import org.tela_botanica.client.vues.PersonneVue;
|
43 |
import org.tela_botanica.client.vues.PersonneVue;
|
42 |
import org.tela_botanica.client.vues.PopupChargement;
|
44 |
import org.tela_botanica.client.vues.PopupChargement;
|
43 |
import org.tela_botanica.client.vues.PublicationVue;
|
45 |
import org.tela_botanica.client.vues.PublicationVue;
|
44 |
import org.tela_botanica.client.vues.StatutVue;
|
46 |
import org.tela_botanica.client.vues.StatutVue;
|
45 |
import org.tela_botanica.client.vues.StructureVue;
|
47 |
import org.tela_botanica.client.vues.StructureVue;
|
46 |
import org.tela_botanica.client.vues.MenuVue;
|
48 |
import org.tela_botanica.client.vues.MenuVue;
|
47 |
|
49 |
|
48 |
import com.extjs.gxt.ui.client.Registry;
|
50 |
import com.extjs.gxt.ui.client.Registry;
|
49 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
51 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
50 |
import com.extjs.gxt.ui.client.event.Listener;
|
52 |
import com.extjs.gxt.ui.client.event.Listener;
|
51 |
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
53 |
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
52 |
import com.extjs.gxt.ui.client.util.Margins;
|
54 |
import com.extjs.gxt.ui.client.util.Margins;
|
53 |
import com.extjs.gxt.ui.client.widget.Component;
|
55 |
import com.extjs.gxt.ui.client.widget.Component;
|
54 |
import com.extjs.gxt.ui.client.widget.Dialog;
|
56 |
import com.extjs.gxt.ui.client.widget.Dialog;
|
55 |
import com.extjs.gxt.ui.client.widget.Info;
|
57 |
import com.extjs.gxt.ui.client.widget.Info;
|
56 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
58 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
57 |
import com.extjs.gxt.ui.client.widget.Viewport;
|
59 |
import com.extjs.gxt.ui.client.widget.Viewport;
|
58 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
60 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
59 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
|
61 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
|
60 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
62 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
61 |
import com.google.gwt.core.client.GWT;
|
63 |
import com.google.gwt.core.client.GWT;
|
62 |
import com.google.gwt.i18n.client.Dictionary;
|
64 |
import com.google.gwt.i18n.client.Dictionary;
|
63 |
import com.google.gwt.user.client.Window;
|
65 |
import com.google.gwt.user.client.Window;
|
64 |
import com.google.gwt.user.client.ui.RootPanel;
|
66 |
import com.google.gwt.user.client.ui.RootPanel;
|
65 |
|
67 |
|
66 |
public class Mediateur implements Rafraichissable {
|
68 |
public class Mediateur implements Rafraichissable {
|
67 |
|
69 |
|
68 |
private Viewport viewport;
|
70 |
private Viewport viewport;
|
69 |
private Modele modele = null;
|
71 |
private Modele modele = null;
|
70 |
public static final Constantes i18nC = getI18nConstante();
|
72 |
public static final Constantes i18nC = getI18nConstante();
|
71 |
public static final ErrorMessages i18nM = getI18nMessage();
|
73 |
public static final ErrorMessages i18nM = getI18nMessage();
|
72 |
|
74 |
|
73 |
private EnteteVue panneauNord = null;
|
75 |
private EnteteVue panneauNord = null;
|
74 |
private MenuVue panneauOuest = null;
|
76 |
private MenuVue panneauOuest = null;
|
75 |
private ContenuVue panneauCentre = null;
|
77 |
private ContenuVue panneauCentre = null;
|
76 |
private StatutVue panneauSud = null;
|
78 |
private StatutVue panneauSud = null;
|
77 |
|
79 |
|
78 |
private IdentificationFenetre fenetreIdentification = null;
|
80 |
private IdentificationFenetre fenetreIdentification = null;
|
79 |
|
81 |
|
80 |
public Mediateur() {
|
82 |
public Mediateur() {
|
81 |
// Enregistrement du Médiateur dans le Registre
|
83 |
// Enregistrement du Médiateur dans le Registre
|
82 |
Registry.register(RegistreId.MEDIATEUR, this);
|
84 |
Registry.register(RegistreId.MEDIATEUR, this);
|
83 |
|
85 |
|
84 |
//Initialisation du Registre
|
86 |
//Initialisation du Registre
|
85 |
initialiserRegistre();
|
87 |
initialiserRegistre();
|
86 |
|
88 |
|
87 |
// Création du Modèle qui s'enregistre lui même dans le Registre
|
89 |
// Création du Modèle qui s'enregistre lui même dans le Registre
|
88 |
modele = new Modele();
|
90 |
modele = new Modele();
|
89 |
|
91 |
|
90 |
// Création du Viewport qui contient la disposition globale de l'application
|
92 |
// Création du Viewport qui contient la disposition globale de l'application
|
91 |
viewport = new Viewport();
|
93 |
viewport = new Viewport();
|
92 |
viewport.setLayout(new BorderLayout());
|
94 |
viewport.setLayout(new BorderLayout());
|
93 |
|
95 |
|
94 |
// Création des différents panneaux
|
96 |
// Création des différents panneaux
|
95 |
creerPanneauNord();
|
97 |
creerPanneauNord();
|
96 |
creerPanneauOuest();
|
98 |
creerPanneauOuest();
|
97 |
creerPanneauCentral();
|
99 |
creerPanneauCentral();
|
98 |
creerPanneauSud();
|
100 |
creerPanneauSud();
|
99 |
|
101 |
|
100 |
// Connection de l'utilisateur
|
102 |
// Connection de l'utilisateur
|
101 |
connecterUtilisateur(null, null);
|
103 |
connecterUtilisateur(null, null);
|
102 |
|
104 |
|
103 |
// Retour à GWT du Viewport une fois constuit
|
105 |
// Retour à GWT du Viewport une fois constuit
|
104 |
RootPanel.get().add(viewport);
|
106 |
RootPanel.get().add(viewport);
|
105 |
}
|
107 |
}
|
106 |
|
108 |
|
107 |
//+----------------------------------------------------------------------------------------------------------------+
|
109 |
//+----------------------------------------------------------------------------------------------------------------+
|
108 |
// GESTION de l'I18N et du REGISTRE
|
110 |
// GESTION de l'I18N et du REGISTRE
|
109 |
//+----------------------------------------------------------------------------------------------------------------+
|
111 |
//+----------------------------------------------------------------------------------------------------------------+
|
110 |
protected static Constantes getI18nConstante() {
|
112 |
protected static Constantes getI18nConstante() {
|
111 |
return GWT.create(Constantes.class);
|
113 |
return GWT.create(Constantes.class);
|
112 |
}
|
114 |
}
|
113 |
|
115 |
|
114 |
protected static ErrorMessages getI18nMessage() {
|
116 |
protected static ErrorMessages getI18nMessage() {
|
115 |
return GWT.create(ErrorMessages.class);
|
117 |
return GWT.create(ErrorMessages.class);
|
116 |
}
|
118 |
}
|
117 |
|
119 |
|
118 |
protected void initialiserRegistre() {
|
120 |
protected void initialiserRegistre() {
|
119 |
Registry.register(RegistreId.APPLI_NOM, i18nC.appliNom());
|
121 |
Registry.register(RegistreId.APPLI_NOM, i18nC.appliNom());
|
120 |
Registry.register(RegistreId.APPLI_CODE, i18nC.appliCode());
|
122 |
Registry.register(RegistreId.APPLI_CODE, i18nC.appliCode());
|
121 |
Registry.register(RegistreId.APPLI_VERSION, i18nC.appliVersionNumero());
|
123 |
Registry.register(RegistreId.APPLI_VERSION, i18nC.appliVersionNumero());
|
122 |
Registry.register(RegistreId.APPLI_REVISION, "$Revision: 501 $");
|
124 |
Registry.register(RegistreId.APPLI_REVISION, "$Revision: 501 $");
|
123 |
|
125 |
|
124 |
Registry.register(RegistreId.CONFIG, new Configuration());
|
126 |
Registry.register(RegistreId.CONFIG, new Configuration());
|
125 |
Registry.register(RegistreId.POPUP_CHARGEMENT, new PopupChargement(this));
|
127 |
Registry.register(RegistreId.POPUP_CHARGEMENT, new PopupChargement(this));
|
126 |
Registry.register(RegistreId.UTILISATEUR_COURANT, new Utilisateur());
|
128 |
Registry.register(RegistreId.UTILISATEUR_COURANT, new Utilisateur());
|
127 |
Registry.register(RegistreId.PROJET_COURANT, new Projet());
|
129 |
Registry.register(RegistreId.PROJET_COURANT, new Projet());
|
128 |
}
|
130 |
}
|
129 |
|
131 |
|
130 |
//+----------------------------------------------------------------------------------------------------------------+
|
132 |
//+----------------------------------------------------------------------------------------------------------------+
|
131 |
// GESTION des PANNEAUX PRINCIPAUX
|
133 |
// GESTION des PANNEAUX PRINCIPAUX
|
132 |
//+----------------------------------------------------------------------------------------------------------------+
|
134 |
//+----------------------------------------------------------------------------------------------------------------+
|
133 |
|
135 |
|
134 |
private void creerPanneauNord() {
|
136 |
private void creerPanneauNord() {
|
135 |
panneauNord = new EnteteVue(this);
|
137 |
panneauNord = new EnteteVue(this);
|
136 |
|
138 |
|
137 |
BorderLayoutData regionNord = new BorderLayoutData(LayoutRegion.NORTH, 100);
|
139 |
BorderLayoutData regionNord = new BorderLayoutData(LayoutRegion.NORTH, 100);
|
138 |
regionNord.setCollapsible(true);
|
140 |
regionNord.setCollapsible(true);
|
139 |
regionNord.setFloatable(true);
|
141 |
regionNord.setFloatable(true);
|
140 |
regionNord.setSplit(false);
|
142 |
regionNord.setSplit(false);
|
141 |
regionNord.setMargins(new Margins(5, 5, 0, 5));
|
143 |
regionNord.setMargins(new Margins(5, 5, 0, 5));
|
142 |
|
144 |
|
143 |
viewport.add(panneauNord, regionNord);
|
145 |
viewport.add(panneauNord, regionNord);
|
144 |
}
|
146 |
}
|
145 |
|
147 |
|
146 |
private void creerPanneauOuest() {
|
148 |
private void creerPanneauOuest() {
|
147 |
panneauOuest = new MenuVue(this);
|
149 |
panneauOuest = new MenuVue(this);
|
148 |
|
150 |
|
149 |
BorderLayoutData regionOuest = new BorderLayoutData(LayoutRegion.WEST, 200);
|
151 |
BorderLayoutData regionOuest = new BorderLayoutData(LayoutRegion.WEST, 200);
|
150 |
regionOuest.setSplit(true);
|
152 |
regionOuest.setSplit(true);
|
151 |
regionOuest.setCollapsible(true);
|
153 |
regionOuest.setCollapsible(true);
|
152 |
regionOuest.setMargins(new Margins(5));
|
154 |
regionOuest.setMargins(new Margins(5));
|
153 |
|
155 |
|
154 |
viewport.add(panneauOuest, regionOuest);
|
156 |
viewport.add(panneauOuest, regionOuest);
|
155 |
}
|
157 |
}
|
156 |
|
158 |
|
157 |
private void creerPanneauCentral() {
|
159 |
private void creerPanneauCentral() {
|
158 |
panneauCentre = new ContenuVue(this);
|
160 |
panneauCentre = new ContenuVue(this);
|
159 |
|
161 |
|
160 |
BorderLayoutData regionCentre = new BorderLayoutData(LayoutRegion.CENTER);
|
162 |
BorderLayoutData regionCentre = new BorderLayoutData(LayoutRegion.CENTER);
|
161 |
regionCentre.setMargins(new Margins(5, 5, 5, 0));
|
163 |
regionCentre.setMargins(new Margins(5, 5, 5, 0));
|
162 |
|
164 |
|
163 |
viewport.add(panneauCentre, regionCentre);
|
165 |
viewport.add(panneauCentre, regionCentre);
|
164 |
}
|
166 |
}
|
165 |
|
167 |
|
166 |
private void creerPanneauSud() {
|
168 |
private void creerPanneauSud() {
|
167 |
panneauSud = new StatutVue();
|
169 |
panneauSud = new StatutVue();
|
168 |
|
170 |
|
169 |
BorderLayoutData regionSud = new BorderLayoutData(LayoutRegion.SOUTH, 20);
|
171 |
BorderLayoutData regionSud = new BorderLayoutData(LayoutRegion.SOUTH, 20);
|
170 |
regionSud.setCollapsible(true);
|
172 |
regionSud.setCollapsible(true);
|
171 |
regionSud.setFloatable(true);
|
173 |
regionSud.setFloatable(true);
|
172 |
regionSud.setSplit(false);
|
174 |
regionSud.setSplit(false);
|
173 |
regionSud.setMargins(new Margins(0));
|
175 |
regionSud.setMargins(new Margins(0));
|
174 |
|
176 |
|
175 |
viewport.add(panneauSud, regionSud);
|
177 |
viewport.add(panneauSud, regionSud);
|
176 |
}
|
178 |
}
|
177 |
|
179 |
|
178 |
public void actualiserPanneauCentral() {
|
180 |
public void actualiserPanneauCentral() {
|
179 |
panneauCentre.layout();
|
181 |
panneauCentre.layout();
|
180 |
}
|
182 |
}
|
181 |
|
183 |
|
182 |
//+----------------------------------------------------------------------------------------------------------------+
|
184 |
//+----------------------------------------------------------------------------------------------------------------+
|
183 |
// GESTION du MENU
|
185 |
// GESTION du MENU
|
184 |
//+----------------------------------------------------------------------------------------------------------------+
|
186 |
//+----------------------------------------------------------------------------------------------------------------+
|
185 |
|
187 |
|
186 |
public void clicMenu(String codeMenuClique) {
|
188 |
public void clicMenu(String codeMenuClique) {
|
187 |
activerChargement(codeMenuClique);
|
189 |
activerChargement(codeMenuClique);
|
188 |
panneauOuest.selectionMenu(codeMenuClique);
|
190 |
panneauOuest.selectionMenu(codeMenuClique);
|
189 |
if (codeMenuClique.equals(MenuApplicationId.STRUCTURE)) {
|
191 |
if (codeMenuClique.equals(MenuApplicationId.STRUCTURE)) {
|
190 |
selectionnerStructure(panneauCentre, null);
|
192 |
selectionnerStructure(panneauCentre, null);
|
191 |
} else if (codeMenuClique.equals(MenuApplicationId.COLLECTION)) {
|
193 |
} else if (codeMenuClique.equals(MenuApplicationId.COLLECTION)) {
|
192 |
selectionnerCollection(panneauCentre, null);
|
194 |
selectionnerCollection(panneauCentre, null);
|
193 |
} else if (codeMenuClique.equals(MenuApplicationId.PERSONNE)) {
|
195 |
} else if (codeMenuClique.equals(MenuApplicationId.PERSONNE)) {
|
194 |
selectionnerPersonne(panneauCentre, null, null);
|
196 |
selectionnerPersonne(panneauCentre, null, null);
|
195 |
} else if (codeMenuClique.equals(MenuApplicationId.PUBLICATION)) {
|
197 |
} else if (codeMenuClique.equals(MenuApplicationId.PUBLICATION)) {
|
196 |
selectionnerPublication(panneauCentre,null);
|
198 |
selectionnerPublication(panneauCentre,null);
|
197 |
} else if (codeMenuClique.equals(MenuApplicationId.PROJET)) {
|
199 |
} else if (codeMenuClique.equals(MenuApplicationId.PROJET)) {
|
198 |
selectionnerProjets(panneauCentre);
|
200 |
selectionnerProjets(panneauCentre);
|
199 |
} else {
|
201 |
} else {
|
200 |
GWT.log(i18nM.nonImplemente(codeMenuClique), null);
|
202 |
GWT.log(i18nM.nonImplemente(codeMenuClique), null);
|
201 |
}
|
203 |
}
|
202 |
panneauCentre.layout();
|
204 |
panneauCentre.layout();
|
203 |
}
|
205 |
}
|
204 |
|
206 |
|
205 |
public void activerChargement(String message) {
|
207 |
public void activerChargement(String message) {
|
206 |
afficherPopinChargement();
|
208 |
afficherPopinChargement();
|
207 |
panneauSud.showBusy(i18nC.chargement()+" "+message);
|
209 |
panneauSud.showBusy(i18nC.chargement()+" "+message);
|
208 |
}
|
210 |
}
|
209 |
|
211 |
|
210 |
public void desactiverChargement() {
|
212 |
public void desactiverChargement() {
|
211 |
masquerPopinChargement();
|
213 |
masquerPopinChargement();
|
212 |
panneauSud.clear();
|
214 |
panneauSud.clear();
|
213 |
}
|
215 |
}
|
214 |
|
216 |
|
215 |
//+----------------------------------------------------------------------------------------------------------------+
|
217 |
//+----------------------------------------------------------------------------------------------------------------+
|
216 |
// GESTION DES FENÊTRES
|
218 |
// GESTION DES FENÊTRES
|
217 |
//+----------------------------------------------------------------------------------------------------------------+
|
219 |
//+----------------------------------------------------------------------------------------------------------------+
|
218 |
|
220 |
|
219 |
public void ouvrirAide() {
|
221 |
public void ouvrirAide() {
|
220 |
AideFenetre aideFenetre = new AideFenetre();
|
222 |
AideFenetre aideFenetre = new AideFenetre();
|
221 |
aideFenetre.show();
|
223 |
aideFenetre.show();
|
222 |
// FIXME : apparament le fade In/Fade Out pose problème sur les navigateurs...
|
224 |
// FIXME : apparament le fade In/Fade Out pose problème sur les navigateurs...
|
223 |
//aideFenetre.el().fadeIn(FxConfig.NONE);
|
225 |
//aideFenetre.el().fadeIn(FxConfig.NONE);
|
224 |
}
|
226 |
}
|
225 |
|
227 |
|
226 |
public void ouvrirParametres() {
|
228 |
public void ouvrirParametres() {
|
227 |
ParametreFenetre parametresFenetre = new ParametreFenetre();
|
229 |
ParametreFenetre parametresFenetre = new ParametreFenetre();
|
228 |
parametresFenetre.show();
|
230 |
parametresFenetre.show();
|
229 |
}
|
231 |
}
|
230 |
|
232 |
|
231 |
public void ouvrirIdentification() {
|
233 |
public void ouvrirIdentification() {
|
232 |
fenetreIdentification = new IdentificationFenetre();
|
234 |
fenetreIdentification = new IdentificationFenetre();
|
233 |
fenetreIdentification.show();
|
235 |
fenetreIdentification.show();
|
234 |
}
|
236 |
}
|
235 |
|
237 |
|
236 |
public void ouvrirApplis(String id) {
|
238 |
public void ouvrirApplis(String id) {
|
237 |
if (id.equals(ComposantId.MENU_CEL)) {
|
239 |
if (id.equals(ComposantId.MENU_CEL)) {
|
238 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getCelUrl(), "Carnet en ligne", "");
|
240 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getCelUrl(), "Carnet en ligne", "");
|
239 |
} else if (id.equals(ComposantId.MENU_BEL)) {
|
241 |
} else if (id.equals(ComposantId.MENU_BEL)) {
|
240 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getCelUrl(), "Biblio en ligne", "");
|
242 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getCelUrl(), "Biblio en ligne", "");
|
241 |
}
|
243 |
}
|
242 |
}
|
244 |
}
|
243 |
|
245 |
|
244 |
//+----------------------------------------------------------------------------------------------------------------+
|
246 |
//+----------------------------------------------------------------------------------------------------------------+
|
245 |
// GESTION de l'UTILISATEUR et de l'IDENTIFICATION
|
247 |
// GESTION de l'UTILISATEUR et de l'IDENTIFICATION
|
246 |
//+----------------------------------------------------------------------------------------------------------------+
|
248 |
//+----------------------------------------------------------------------------------------------------------------+
|
247 |
/**
|
249 |
/**
|
248 |
* Retourne l'identifiant de l'utilisateur courrant de l'application.
|
250 |
* Retourne l'identifiant de l'utilisateur courrant de l'application.
|
249 |
*/
|
251 |
*/
|
250 |
public String getUtilisateurId() {
|
252 |
public String getUtilisateurId() {
|
251 |
String id = null;
|
253 |
String id = null;
|
252 |
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
|
254 |
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
|
253 |
if (!utilisateurCourant.getId().equals("")) {
|
255 |
if (!utilisateurCourant.getId().equals("")) {
|
254 |
id = utilisateurCourant.getId();
|
256 |
id = utilisateurCourant.getId();
|
255 |
}
|
257 |
}
|
256 |
return id;
|
258 |
return id;
|
257 |
}
|
259 |
}
|
258 |
|
260 |
|
259 |
public void connecterUtilisateur(String login, String mdp) {
|
261 |
public void connecterUtilisateur(String login, String mdp) {
|
260 |
modele.connecterUtilisateur(this, login, mdp);
|
262 |
modele.connecterUtilisateur(this, login, mdp);
|
261 |
}
|
263 |
}
|
262 |
|
264 |
|
263 |
public void deconnecterUtilisateur() {
|
265 |
public void deconnecterUtilisateur() {
|
264 |
modele.deconnecterUtilisateur(this);
|
266 |
modele.deconnecterUtilisateur(this);
|
265 |
}
|
267 |
}
|
266 |
|
268 |
|
267 |
public void mettreAJourEtatIdentification(Utilisateur utilisateur) {
|
269 |
public void mettreAJourEtatIdentification(Utilisateur utilisateur) {
|
268 |
// Mise à jour du registre
|
270 |
// Mise à jour du registre
|
269 |
Registry.register(RegistreId.UTILISATEUR_COURANT, utilisateur);
|
271 |
Registry.register(RegistreId.UTILISATEUR_COURANT, utilisateur);
|
270 |
// Création de l'information de mise à jour de l'utilisateur
|
272 |
// Création de l'information de mise à jour de l'utilisateur
|
271 |
Information info = new Information("maj_utilisateur");
|
273 |
Information info = new Information("maj_utilisateur");
|
272 |
|
274 |
|
273 |
// Rafraichissement de la fenêtre d'Identification
|
275 |
// Rafraichissement de la fenêtre d'Identification
|
274 |
if (fenetreIdentification != null) {
|
276 |
if (fenetreIdentification != null) {
|
275 |
fenetreIdentification.rafraichir(info);
|
277 |
fenetreIdentification.rafraichir(info);
|
276 |
}
|
278 |
}
|
277 |
|
279 |
|
278 |
// Rafraichissement du panneau Nord
|
280 |
// Rafraichissement du panneau Nord
|
279 |
panneauNord.rafraichir(info);
|
281 |
panneauNord.rafraichir(info);
|
280 |
|
282 |
|
281 |
// Rafraichissement du panneau Centre
|
283 |
// Rafraichissement du panneau Centre
|
282 |
if (panneauCentre != null) {
|
284 |
if (panneauCentre != null) {
|
283 |
panneauCentre.rafraichir(info);
|
285 |
panneauCentre.rafraichir(info);
|
284 |
}
|
286 |
}
|
285 |
}
|
287 |
}
|
286 |
|
288 |
|
287 |
//+----------------------------------------------------------------------------------------------------------------+
|
289 |
//+----------------------------------------------------------------------------------------------------------------+
|
288 |
// GESTION DES VALEURS ET LISTES
|
290 |
// GESTION DES VALEURS ET LISTES
|
289 |
//+----------------------------------------------------------------------------------------------------------------+
|
291 |
//+----------------------------------------------------------------------------------------------------------------+
|
290 |
|
292 |
|
291 |
public void obtenirListeValeurEtRafraichir(Rafraichissable vueARafraichir, String listeId) {
|
293 |
public void obtenirListeValeurEtRafraichir(Rafraichissable vueARafraichir, String listeId) {
|
292 |
modele.obtenirListeValeurs(vueARafraichir, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId));
|
294 |
modele.obtenirListeValeurs(vueARafraichir, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId));
|
293 |
}
|
295 |
}
|
294 |
|
296 |
|
295 |
public void obtenirValeurEtRafraichir(Rafraichissable vue, String listeId, String identifiantValeur) {
|
297 |
public void obtenirValeurEtRafraichir(Rafraichissable vue, String listeId, String identifiantValeur) {
|
296 |
modele.obtenirValeur(vue, "abv", ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId), identifiantValeur);
|
298 |
modele.obtenirValeur(vue, "abv", ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId), identifiantValeur);
|
297 |
}
|
299 |
}
|
298 |
|
300 |
|
299 |
public void obtenirListeRegionsEtRafraichir(Rafraichissable vue, String strListeId, String strPays) {
|
301 |
public void obtenirListeRegionsEtRafraichir(Rafraichissable vue, String strListeId, String strPays) {
|
300 |
modele.obtenirListeRegion(vue, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(strListeId), strPays+".__");
|
302 |
modele.obtenirListeRegion(vue, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(strListeId), strPays+".__");
|
301 |
}
|
303 |
}
|
302 |
|
304 |
|
303 |
//+----------------------------------------------------------------------------------------------------------------+
|
305 |
//+----------------------------------------------------------------------------------------------------------------+
|
304 |
// GESTION des PROJETS
|
306 |
// GESTION des PROJETS
|
305 |
//+----------------------------------------------------------------------------------------------------------------+
|
307 |
//+----------------------------------------------------------------------------------------------------------------+
|
306 |
|
308 |
|
307 |
/**
|
309 |
/**
|
308 |
* Retourne l'identifiant du projet courrant de l'application.
|
310 |
* Retourne l'identifiant du projet courrant de l'application.
|
309 |
*/
|
311 |
*/
|
310 |
public String getProjetId() {
|
312 |
public String getProjetId() {
|
311 |
String id = null;
|
313 |
String id = null;
|
312 |
Projet projetCourant = (Projet) Registry.get(RegistreId.PROJET_COURANT);
|
314 |
Projet projetCourant = (Projet) Registry.get(RegistreId.PROJET_COURANT);
|
313 |
if (projetCourant != null && !projetCourant.getId().equals("")) {
|
315 |
if (projetCourant != null && !projetCourant.getId().equals("")) {
|
314 |
id = projetCourant.getId();
|
316 |
id = projetCourant.getId();
|
315 |
}
|
317 |
}
|
316 |
return id;
|
318 |
return id;
|
317 |
}
|
319 |
}
|
318 |
|
320 |
|
319 |
//Greg : ajout d'un écouteur pour le changement liste projet
|
321 |
//Greg : ajout d'un écouteur pour le changement liste projet
|
320 |
public void selectionnerProjets(Rafraichissable vueARafraichir) {
|
322 |
public void selectionnerProjets(Rafraichissable vueARafraichir) {
|
321 |
modele.selectionnerProjets(vueARafraichir);
|
323 |
modele.selectionnerProjets(vueARafraichir);
|
322 |
}
|
324 |
}
|
323 |
|
325 |
|
324 |
public void selectionnerProjetCourant(Projet projetSelectionne) {
|
326 |
public void selectionnerProjetCourant(Projet projetSelectionne) {
|
325 |
Registry.register(RegistreId.PROJET_COURANT, projetSelectionne);
|
327 |
Registry.register(RegistreId.PROJET_COURANT, projetSelectionne);
|
326 |
if (panneauCentre.getContenu() instanceof PersonneVue) {
|
328 |
if (panneauCentre.getContenu() instanceof PersonneVue) {
|
327 |
//modele.selectionnerPersonne(contenuPanneauCentre, null, getProjetId(), null);
|
329 |
//modele.selectionnerPersonne(contenuPanneauCentre, null, getProjetId(), null);
|
328 |
selectionnerPersonne(panneauCentre, null, getProjetId());
|
330 |
selectionnerPersonne(panneauCentre, null, getProjetId());
|
329 |
//FIXME Le rafraichissement du panneau ne se fait pas!
|
331 |
//FIXME Le rafraichissement du panneau ne se fait pas!
|
330 |
} else if (panneauCentre.getContenu() instanceof StructureVue) {
|
332 |
} else if (panneauCentre.getContenu() instanceof StructureVue) {
|
331 |
modele.selectionnerStructure(panneauCentre.getContenu(), getProjetId(), null);
|
333 |
modele.selectionnerStructure(panneauCentre.getContenu(), getProjetId(), null);
|
332 |
} else if (panneauCentre.getContenu() instanceof CollectionVue) {
|
334 |
} else if (panneauCentre.getContenu() instanceof CollectionVue) {
|
333 |
modele.selectionnerCollection(panneauCentre.getContenu(), getProjetId(), null);
|
335 |
modele.selectionnerCollection(panneauCentre.getContenu(), getProjetId(), null);
|
334 |
}
|
336 |
}
|
335 |
}
|
337 |
}
|
336 |
|
338 |
|
337 |
//+----------------------------------------------------------------------------------------------------------------+
|
339 |
//+----------------------------------------------------------------------------------------------------------------+
|
338 |
// GESTION DES STRUCTURES
|
340 |
// GESTION DES STRUCTURES
|
339 |
//+----------------------------------------------------------------------------------------------------------------+
|
341 |
//+----------------------------------------------------------------------------------------------------------------+
|
340 |
|
342 |
|
341 |
public void afficherListeStructures(StructureListe structuresACharger) {
|
343 |
public void afficherListeStructures(StructureListe structuresACharger) {
|
342 |
if (!(panneauCentre.getContenu() instanceof StructureVue)) {
|
344 |
if (!(panneauCentre.getContenu() instanceof StructureVue)) {
|
343 |
panneauCentre.removeAll();
|
345 |
panneauCentre.removeAll();
|
344 |
panneauCentre.add(new StructureVue(this));
|
346 |
panneauCentre.add(new StructureVue(this));
|
345 |
}
|
347 |
}
|
346 |
panneauCentre.getContenu().rafraichir(structuresACharger);
|
348 |
panneauCentre.getContenu().rafraichir(structuresACharger);
|
347 |
}
|
349 |
}
|
348 |
|
350 |
|
349 |
public void afficherFormStructure(String structureId) {
|
351 |
public void afficherFormStructure(String structureId) {
|
350 |
String mode = Formulaire.MODE_AJOUTER;
|
352 |
String mode = Formulaire.MODE_AJOUTER;
|
351 |
if (structureId != null) {
|
353 |
if (structureId != null) {
|
352 |
mode = Formulaire.MODE_MODIFIER;
|
354 |
mode = Formulaire.MODE_MODIFIER;
|
353 |
}
|
355 |
}
|
354 |
|
356 |
|
355 |
panneauCentre.removeAll();
|
357 |
panneauCentre.removeAll();
|
356 |
StructureForm structureForm = new StructureForm(this, mode);
|
358 |
StructureForm structureForm = new StructureForm(this, mode);
|
357 |
panneauCentre.add(structureForm);
|
359 |
panneauCentre.add(structureForm);
|
358 |
|
360 |
|
359 |
if (mode.equals(Formulaire.MODE_MODIFIER)) {
|
361 |
if (mode.equals(Formulaire.MODE_MODIFIER)) {
|
360 |
selectionnerStructure(structureForm, structureId);
|
362 |
selectionnerStructure(structureForm, structureId);
|
361 |
selectionnerStructureAPersonne(structureForm, structureId, StructureAPersonne.ROLE_EQUIPE);
|
363 |
selectionnerStructureAPersonne(structureForm, structureId, StructureAPersonne.ROLE_EQUIPE);
|
362 |
}
|
364 |
}
|
363 |
|
365 |
|
364 |
panneauCentre.layout();
|
366 |
panneauCentre.layout();
|
365 |
}
|
367 |
}
|
366 |
|
368 |
|
367 |
public void clicListeStructure(Structure structure) {
|
369 |
public void clicListeStructure(Structure structure) {
|
368 |
panneauCentre.getContenu().rafraichir(structure);
|
370 |
panneauCentre.getContenu().rafraichir(structure);
|
369 |
if (structure != null && structure.getPersonnel() == null) {
|
371 |
if (structure != null && structure.getPersonnel() == null) {
|
370 |
selectionnerStructureAPersonne(panneauCentre.getContenu(), structure.getId(), StructureAPersonne.ROLE_EQUIPE);
|
372 |
selectionnerStructureAPersonne(panneauCentre.getContenu(), structure.getId(), StructureAPersonne.ROLE_EQUIPE);
|
371 |
}
|
373 |
}
|
372 |
}
|
374 |
}
|
373 |
|
375 |
|
374 |
public void clicAjouterStructure() {
|
376 |
public void clicAjouterStructure() {
|
375 |
afficherFormStructure(null);
|
377 |
afficherFormStructure(null);
|
376 |
}
|
378 |
}
|
377 |
|
379 |
|
378 |
public void clicModifierStructure(List<Structure> structureSelection) {
|
380 |
public void clicModifierStructure(List<Structure> structureSelection) {
|
379 |
if (structureSelection.size() == 0) {
|
381 |
if (structureSelection.size() == 0) {
|
380 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
382 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
381 |
} else if (structureSelection.size() > 1) {
|
383 |
} else if (structureSelection.size() > 1) {
|
382 |
Info.display("Information", "Veuillez sélectionner une seule structure à la fois.");
|
384 |
Info.display("Information", "Veuillez sélectionner une seule structure à la fois.");
|
383 |
} else if (structureSelection.size() == 1) {
|
385 |
} else if (structureSelection.size() == 1) {
|
384 |
afficherFormStructure(structureSelection.get(0).getId());
|
386 |
afficherFormStructure(structureSelection.get(0).getId());
|
385 |
} else {
|
387 |
} else {
|
386 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierStructure() du Médiateur.");
|
388 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierStructure() du Médiateur.");
|
387 |
}
|
389 |
}
|
388 |
}
|
390 |
}
|
389 |
|
391 |
|
390 |
public void clicSupprimerStructure(final Rafraichissable vue, final List<Structure> structureSelection) {
|
392 |
public void clicSupprimerStructure(final Rafraichissable vue, final List<Structure> structureSelection) {
|
391 |
if (structureSelection.size() == 0) {
|
393 |
if (structureSelection.size() == 0) {
|
392 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
394 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
393 |
} else if(structureSelection.size() > 0) {
|
395 |
} else if(structureSelection.size() > 0) {
|
394 |
String titre = "Supprimer des structures";
|
396 |
String titre = "Supprimer des structures";
|
395 |
String message = "Êtes vous sur de vouloir supprimer les structures sélectionnées ?";
|
397 |
String message = "Êtes vous sur de vouloir supprimer les structures sélectionnées ?";
|
396 |
if (structureSelection.size() == 1) {
|
398 |
if (structureSelection.size() == 1) {
|
397 |
titre = "Supprimer une structure";
|
399 |
titre = "Supprimer une structure";
|
398 |
message = "Êtes vous sur de vouloir supprimer la structure sélectionnée ?";
|
400 |
message = "Êtes vous sur de vouloir supprimer la structure sélectionnée ?";
|
399 |
}
|
401 |
}
|
400 |
|
402 |
|
401 |
final Listener<MessageBoxEvent> suppressionEcouteur = new Listener<MessageBoxEvent>() {
|
403 |
final Listener<MessageBoxEvent> suppressionEcouteur = new Listener<MessageBoxEvent>() {
|
402 |
public void handleEvent(MessageBoxEvent ce) {
|
404 |
public void handleEvent(MessageBoxEvent ce) {
|
403 |
Dialog dialog = (Dialog) ce.getComponent();
|
405 |
Dialog dialog = (Dialog) ce.getComponent();
|
404 |
Button btn = ce.getButtonClicked();
|
406 |
Button btn = ce.getButtonClicked();
|
405 |
|
407 |
|
406 |
if (btn.getText().equals(dialog.yesText)) {
|
408 |
if (btn.getText().equals(dialog.yesText)) {
|
407 |
String idStr = "" ;
|
409 |
String idStr = "" ;
|
408 |
for(int i = 0 ; i < structureSelection.size() ; i++) {
|
410 |
for(int i = 0 ; i < structureSelection.size() ; i++) {
|
409 |
idStr += structureSelection.get(i).getId()+",";
|
411 |
idStr += structureSelection.get(i).getId()+",";
|
410 |
}
|
412 |
}
|
411 |
supprimerStructure(vue, idStr);
|
413 |
supprimerStructure(vue, idStr);
|
412 |
}
|
414 |
}
|
413 |
}
|
415 |
}
|
414 |
};
|
416 |
};
|
415 |
|
417 |
|
416 |
MessageBox.confirm(titre, message, suppressionEcouteur);
|
418 |
MessageBox.confirm(titre, message, suppressionEcouteur);
|
417 |
} else {
|
419 |
} else {
|
418 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerStructure() du Médiateur.");
|
420 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerStructure() du Médiateur.");
|
419 |
}
|
421 |
}
|
420 |
}
|
422 |
}
|
421 |
|
423 |
|
422 |
public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId) {
|
424 |
public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId) {
|
423 |
modele.selectionnerStructure(vueARafraichir, getProjetId(), structureId);
|
425 |
modele.selectionnerStructure(vueARafraichir, getProjetId(), structureId);
|
424 |
}
|
426 |
}
|
425 |
|
427 |
|
426 |
public void selectionnerStructureParProjet(Rafraichissable vueARafraichir, String projetId) {
|
428 |
public void selectionnerStructureParProjet(Rafraichissable vueARafraichir, String projetId) {
|
427 |
modele.selectionnerStructure(vueARafraichir, projetId, null);
|
429 |
modele.selectionnerStructure(vueARafraichir, projetId, null);
|
428 |
}
|
430 |
}
|
429 |
|
431 |
|
430 |
public void ajouterStructure(Rafraichissable vueARafraichir, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
|
432 |
public void ajouterStructure(Rafraichissable vueARafraichir, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
|
431 |
modele.ajouterStructure(vueARafraichir, structure, conservation, valorisation);
|
433 |
modele.ajouterStructure(vueARafraichir, structure, conservation, valorisation);
|
432 |
}
|
434 |
}
|
433 |
|
435 |
|
434 |
public void modifierStructure(Rafraichissable vueARafraichir, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
|
436 |
public void modifierStructure(Rafraichissable vueARafraichir, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
|
435 |
modele.modifierStructure(vueARafraichir, structureId, structure, conservation, valorisation);
|
437 |
modele.modifierStructure(vueARafraichir, structureId, structure, conservation, valorisation);
|
436 |
}
|
438 |
}
|
437 |
|
439 |
|
438 |
public void supprimerStructure(Rafraichissable vueARafraichir, String IdentifiantsStructureSepareParVirgule) {
|
440 |
public void supprimerStructure(Rafraichissable vueARafraichir, String IdentifiantsStructureSepareParVirgule) {
|
439 |
modele.supprimerStructure(vueARafraichir, IdentifiantsStructureSepareParVirgule);
|
441 |
modele.supprimerStructure(vueARafraichir, IdentifiantsStructureSepareParVirgule);
|
440 |
}
|
442 |
}
|
441 |
|
443 |
|
442 |
//+----------------------------------------------------------------------------------------------------------------+
|
444 |
//+----------------------------------------------------------------------------------------------------------------+
|
443 |
// GESTION de la relation STRUCTURE A PERSONNE
|
445 |
// GESTION de la relation STRUCTURE A PERSONNE
|
444 |
public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId) {
|
446 |
public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId) {
|
445 |
modele.selectionnerStructureAPersonne(vueARafraichir, structureId, roleId);
|
447 |
modele.selectionnerStructureAPersonne(vueARafraichir, structureId, roleId);
|
446 |
}
|
448 |
}
|
447 |
|
449 |
|
448 |
public void ajouterStructureAPersonne(Rafraichissable vueARafraichir, String structureId, StructureAPersonneListe personnelAjoute) {
|
450 |
public void ajouterStructureAPersonne(Rafraichissable vueARafraichir, String structureId, StructureAPersonneListe personnelAjoute) {
|
449 |
if (personnelAjoute != null && personnelAjoute.size() > 0) {
|
451 |
if (personnelAjoute != null && personnelAjoute.size() > 0) {
|
450 |
for (Iterator<String> it = personnelAjoute.keySet().iterator(); it.hasNext();) {
|
452 |
for (Iterator<String> it = personnelAjoute.keySet().iterator(); it.hasNext();) {
|
451 |
modele.ajouterStructureAPersonne(vueARafraichir, structureId, (StructureAPersonne) personnelAjoute.get(it.next()));
|
453 |
modele.ajouterStructureAPersonne(vueARafraichir, structureId, (StructureAPersonne) personnelAjoute.get(it.next()));
|
452 |
}
|
454 |
}
|
453 |
}
|
455 |
}
|
454 |
}
|
456 |
}
|
455 |
|
457 |
|
456 |
public void modifierStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelModifie) {
|
458 |
public void modifierStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelModifie) {
|
457 |
if (personnelModifie != null && personnelModifie.size() > 0) {
|
459 |
if (personnelModifie != null && personnelModifie.size() > 0) {
|
458 |
for (Iterator<String> it = personnelModifie.keySet().iterator(); it.hasNext();) {
|
460 |
for (Iterator<String> it = personnelModifie.keySet().iterator(); it.hasNext();) {
|
459 |
modele.modifierStructureAPersonne(vueARafraichir, (StructureAPersonne) personnelModifie.get(it.next()));
|
461 |
modele.modifierStructureAPersonne(vueARafraichir, (StructureAPersonne) personnelModifie.get(it.next()));
|
460 |
}
|
462 |
}
|
461 |
}
|
463 |
}
|
462 |
}
|
464 |
}
|
463 |
|
465 |
|
464 |
public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelSupprime) {
|
466 |
public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelSupprime) {
|
465 |
if (personnelSupprime != null && personnelSupprime.size() > 0) {
|
467 |
if (personnelSupprime != null && personnelSupprime.size() > 0) {
|
466 |
String idStructureAPersonneSepareParVirgule = "" ;
|
468 |
String idStructureAPersonneSepareParVirgule = "" ;
|
467 |
for (Iterator<String> it = personnelSupprime.keySet().iterator(); it.hasNext();) {
|
469 |
for (Iterator<String> it = personnelSupprime.keySet().iterator(); it.hasNext();) {
|
468 |
idStructureAPersonneSepareParVirgule += personnelSupprime.get(it.next()).getId()+"," ;
|
470 |
idStructureAPersonneSepareParVirgule += personnelSupprime.get(it.next()).getId()+"," ;
|
469 |
}
|
471 |
}
|
470 |
modele.supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSepareParVirgule);
|
472 |
modele.supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSepareParVirgule);
|
471 |
}
|
473 |
}
|
472 |
}
|
474 |
}
|
473 |
|
475 |
|
474 |
//+----------------------------------------------------------------------------------------------------------------+
|
476 |
//+----------------------------------------------------------------------------------------------------------------+
|
475 |
// GESTION des COLLECTIONS
|
477 |
// GESTION des COLLECTIONS
|
476 |
//+----------------------------------------------------------------------------------------------------------------+
|
478 |
//+----------------------------------------------------------------------------------------------------------------+
|
477 |
|
479 |
|
478 |
public void afficherListeCollections(CollectionListe collectionsACharger) {
|
480 |
public void afficherListeCollections(CollectionListe collectionsACharger) {
|
479 |
if (!(panneauCentre.getContenu() instanceof CollectionVue)) {
|
481 |
if (!(panneauCentre.getContenu() instanceof CollectionVue)) {
|
480 |
panneauCentre.removeAll();
|
482 |
panneauCentre.removeAll();
|
481 |
panneauCentre.add(new CollectionVue(this));
|
483 |
panneauCentre.add(new CollectionVue(this));
|
482 |
}
|
484 |
}
|
483 |
|
485 |
|
484 |
panneauCentre.getContenu().rafraichir(collectionsACharger);
|
486 |
panneauCentre.getContenu().rafraichir(collectionsACharger);
|
485 |
}
|
487 |
}
|
486 |
|
488 |
|
487 |
public void afficherFormCollection(String collectionId) {
|
489 |
public void afficherFormCollection(String collectionId) {
|
488 |
String mode = Formulaire.MODE_AJOUTER;
|
490 |
String mode = Formulaire.MODE_AJOUTER;
|
489 |
if (collectionId != null) {
|
491 |
if (collectionId != null) {
|
490 |
mode = Formulaire.MODE_MODIFIER;
|
492 |
mode = Formulaire.MODE_MODIFIER;
|
491 |
}
|
493 |
}
|
492 |
|
494 |
|
493 |
panneauCentre.removeAll();
|
495 |
panneauCentre.removeAll();
|
494 |
CollectionForm collectionForm = new CollectionForm(this, mode);
|
496 |
CollectionForm collectionForm = new CollectionForm(this, mode);
|
495 |
panneauCentre.add(collectionForm);
|
497 |
panneauCentre.add(collectionForm);
|
496 |
|
498 |
|
497 |
if (mode.equals(Formulaire.MODE_MODIFIER)) {
|
499 |
if (mode.equals(Formulaire.MODE_MODIFIER)) {
|
498 |
selectionnerCollection(collectionForm, collectionId);
|
500 |
selectionnerCollection(collectionForm, collectionId);
|
499 |
}
|
501 |
}
|
500 |
|
502 |
|
501 |
panneauCentre.layout();
|
503 |
panneauCentre.layout();
|
502 |
}
|
504 |
}
|
503 |
|
505 |
|
504 |
public void clicListeCollection(Collection collectionCliquee) {
|
506 |
public void clicListeCollection(Collection collectionCliquee) {
|
505 |
panneauCentre.getContenu().rafraichir(collectionCliquee);
|
507 |
panneauCentre.getContenu().rafraichir(collectionCliquee);
|
506 |
}
|
508 |
}
|
507 |
|
509 |
|
508 |
public void clicAjouterCollection() {
|
510 |
public void clicAjouterCollection() {
|
509 |
afficherFormCollection(null);
|
511 |
afficherFormCollection(null);
|
510 |
}
|
512 |
}
|
511 |
|
513 |
|
512 |
public void clicModifierCollection(List<Collection> selection) {
|
514 |
public void clicModifierCollection(List<Collection> selection) {
|
513 |
if (selection.size() == 0) {
|
515 |
if (selection.size() == 0) {
|
514 |
Info.display("Information", "Veuillez sélectionner une collection.");
|
516 |
Info.display("Information", "Veuillez sélectionner une collection.");
|
515 |
} else if (selection.size() > 1) {
|
517 |
} else if (selection.size() > 1) {
|
516 |
Info.display("Information", "Veuillez sélectionner une seule collection à la fois.");
|
518 |
Info.display("Information", "Veuillez sélectionner une seule collection à la fois.");
|
517 |
} else if (selection.size() == 1) {
|
519 |
} else if (selection.size() == 1) {
|
518 |
afficherFormCollection(selection.get(0).getId());
|
520 |
afficherFormCollection(selection.get(0).getId());
|
519 |
} else {
|
521 |
} else {
|
520 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCollection() du Médiateur.");
|
522 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCollection() du Médiateur.");
|
521 |
}
|
523 |
}
|
522 |
}
|
524 |
}
|
523 |
|
525 |
|
524 |
public void clicSupprimerCollection(CollectionListeVue collectionListeVue, List<Collection> collectionsASupprimer) {
|
526 |
public void clicSupprimerCollection(CollectionListeVue collectionListeVue, List<Collection> collectionsASupprimer) {
|
525 |
// TODO Auto-generated method stub
|
527 |
// TODO Auto-generated method stub
|
526 |
}
|
528 |
}
|
527 |
|
529 |
|
528 |
public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId) {
|
530 |
public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId) {
|
529 |
modele.selectionnerCollection(vueARafraichir, getProjetId(), collectionId);
|
531 |
modele.selectionnerCollection(vueARafraichir, getProjetId(), collectionId);
|
530 |
}
|
532 |
}
|
531 |
|
533 |
|
532 |
public void selectionnerCollectionParProjet(Rafraichissable vueARafraichir, String projetId) {
|
534 |
public void selectionnerCollectionParProjet(Rafraichissable vueARafraichir, String projetId) {
|
533 |
modele.selectionnerCollection(vueARafraichir, projetId, null);
|
535 |
modele.selectionnerCollection(vueARafraichir, projetId, null);
|
534 |
}
|
536 |
}
|
535 |
|
537 |
|
536 |
public void ajouterCollection(Rafraichissable vueARafraichir, Collection collection) {
|
538 |
public void ajouterCollection(Rafraichissable vueARafraichir, Collection collection) {
|
537 |
modele.ajouterCollection(vueARafraichir, getUtilisateurId(), collection);
|
539 |
modele.ajouterCollection(vueARafraichir, getUtilisateurId(), collection);
|
538 |
}
|
540 |
}
|
539 |
|
541 |
|
540 |
public void modifierCollection(Rafraichissable vueARafraichir, Collection collection) {
|
542 |
public void modifierCollection(Rafraichissable vueARafraichir, Collection collection) {
|
541 |
modele.modifierCollection(vueARafraichir, collection);
|
543 |
modele.modifierCollection(vueARafraichir, collection);
|
542 |
}
|
544 |
}
|
543 |
|
545 |
|
544 |
public void supprimerCollection(Rafraichissable vueARafraichir, String IdentifiantsCollectionSepareParVirgule) {
|
546 |
public void supprimerCollection(Rafraichissable vueARafraichir, String IdentifiantsCollectionSepareParVirgule) {
|
545 |
modele.supprimerCollection(vueARafraichir, getUtilisateurId(), IdentifiantsCollectionSepareParVirgule);
|
547 |
modele.supprimerCollection(vueARafraichir, getUtilisateurId(), IdentifiantsCollectionSepareParVirgule);
|
546 |
}
|
548 |
}
|
547 |
|
549 |
|
548 |
//+----------------------------------------------------------------------------------------------------------------+
|
550 |
//+----------------------------------------------------------------------------------------------------------------+
|
- |
|
551 |
// GESTION de la relation COLLECTION A PERSONNE
|
- |
|
552 |
|
- |
|
553 |
public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId) {
|
- |
|
554 |
modele.selectionnerCollectionAPersonne(vueARafraichir, collectionId, roleId);
|
- |
|
555 |
}
|
- |
|
556 |
|
- |
|
557 |
public void ajouterCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, CollectionAPersonneListe personnesAjoutees) {
|
- |
|
558 |
if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
|
- |
|
559 |
for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
|
- |
|
560 |
modele.ajouterCollectionAPersonne(vueARafraichir, collectionId, (CollectionAPersonne) personnesAjoutees.get(it.next()));
|
- |
|
561 |
}
|
- |
|
562 |
}
|
- |
|
563 |
}
|
- |
|
564 |
|
- |
|
565 |
public void modifierCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesModifiees) {
|
- |
|
566 |
if (personnesModifiees != null && personnesModifiees.size() > 0) {
|
- |
|
567 |
for (Iterator<String> it = personnesModifiees.keySet().iterator(); it.hasNext();) {
|
- |
|
568 |
modele.modifierCollectionAPersonne(vueARafraichir, (CollectionAPersonne) personnesModifiees.get(it.next()));
|
- |
|
569 |
}
|
- |
|
570 |
}
|
- |
|
571 |
}
|
- |
|
572 |
|
- |
|
573 |
public void supprimerCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesSupprimees) {
|
- |
|
574 |
if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
|
- |
|
575 |
String idCollectionAPersonneSeparesParVirgule = "" ;
|
- |
|
576 |
for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
|
- |
|
577 |
idCollectionAPersonneSeparesParVirgule += personnesSupprimees.get(it.next()).getId()+"," ;
|
- |
|
578 |
}
|
- |
|
579 |
modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionAPersonneSeparesParVirgule);
|
- |
|
580 |
}
|
- |
|
581 |
}
|
- |
|
582 |
|
- |
|
583 |
//+----------------------------------------------------------------------------------------------------------------+
|
- |
|
584 |
// GESTION de la relation COLLECTION A PUBLICATION
|
- |
|
585 |
|
- |
|
586 |
//+----------------------------------------------------------------------------------------------------------------+
|
- |
|
587 |
// GESTION de la relation COLLECTION A COMMENTAIRE
|
- |
|
588 |
|
- |
|
589 |
//+----------------------------------------------------------------------------------------------------------------+
|
549 |
// GESTION DES PERSONNES
|
590 |
// GESTION DES PERSONNES
|
550 |
//+----------------------------------------------------------------------------------------------------------------+
|
591 |
//+----------------------------------------------------------------------------------------------------------------+
|
551 |
|
592 |
|
552 |
public void clicListePersonne(Personne personne) {
|
593 |
public void clicListePersonne(Personne personne) {
|
553 |
panneauCentre.getContenu().rafraichir(personne);
|
594 |
panneauCentre.getContenu().rafraichir(personne);
|
554 |
}
|
595 |
}
|
555 |
|
596 |
|
556 |
public void afficherListePersonnes(PersonneListe personnesACharger) {
|
597 |
public void afficherListePersonnes(PersonneListe personnesACharger) {
|
557 |
if (!(panneauCentre.getContenu() instanceof PersonneVue)) {
|
598 |
if (!(panneauCentre.getContenu() instanceof PersonneVue)) {
|
558 |
panneauCentre.removeAll();
|
599 |
panneauCentre.removeAll();
|
559 |
panneauCentre.add(new PersonneVue(this));
|
600 |
panneauCentre.add(new PersonneVue(this));
|
560 |
panneauCentre.setId(ComposantId.PANNEAU_PERSONNE_LISTES);
|
601 |
panneauCentre.setId(ComposantId.PANNEAU_PERSONNE_LISTES);
|
561 |
}
|
602 |
}
|
562 |
|
603 |
|
563 |
panneauCentre.getContenu().rafraichir(personnesACharger);
|
604 |
panneauCentre.getContenu().rafraichir(personnesACharger);
|
564 |
}
|
605 |
}
|
565 |
|
606 |
|
566 |
public void clicAjouterPersonne() {
|
607 |
public void clicAjouterPersonne() {
|
567 |
afficherPersonneForm(null);
|
608 |
afficherPersonneForm(null);
|
568 |
}
|
609 |
}
|
569 |
|
610 |
|
570 |
public void clicModifierPersonne(Personne personne) {
|
611 |
public void clicModifierPersonne(Personne personne) {
|
571 |
afficherPersonneForm(personne);
|
612 |
afficherPersonneForm(personne);
|
572 |
}
|
613 |
}
|
573 |
|
614 |
|
574 |
public void afficherPersonneForm(Personne personne) {
|
615 |
public void afficherPersonneForm(Personne personne) {
|
575 |
String mode = "";
|
- |
|
576 |
String personneId = null;
|
616 |
String personneId = null;
|
577 |
if (personne != null) {
|
617 |
if (personne != null) {
|
578 |
mode = PersonneForm.MODE_MODIFIER;
|
- |
|
579 |
personneId = personne.getId();
|
618 |
personneId = personne.getId();
|
580 |
} else {
|
- |
|
581 |
mode = PersonneForm.MODE_AJOUTER;
|
- |
|
582 |
}
|
619 |
}
|
583 |
|
620 |
|
584 |
panneauCentre.removeAll();
|
621 |
panneauCentre.removeAll();
|
585 |
PersonneForm formulairePersonneVue = new PersonneForm(this, mode, personneId);
|
622 |
PublicationForm publicationForm = new PublicationForm(this, personneId);
|
586 |
|
- |
|
587 |
if (mode.equals(PersonneForm.MODE_MODIFIER)) {
|
623 |
panneauCentre.add(publicationForm);
|
588 |
selectionnerPersonne(formulairePersonneVue, personne, null);
|
- |
|
589 |
}
|
- |
|
590 |
|
- |
|
591 |
panneauCentre.add(formulairePersonneVue);
|
624 |
|
592 |
panneauCentre.layout();
|
625 |
panneauCentre.layout();
|
593 |
}
|
626 |
}
|
594 |
|
627 |
|
595 |
public void clicSupprimerPersonne(final Rafraichissable vue,final List<Personne> personneSelection) {
|
628 |
public void clicSupprimerPersonne(final Rafraichissable vue,final List<Personne> personneSelection) {
|
596 |
|
629 |
|
597 |
//Empecher suppression utilisateur
|
630 |
//Empecher suppression utilisateur
|
598 |
for (int i=0; i < personneSelection.size(); i++) {
|
631 |
for (int i=0; i < personneSelection.size(); i++) {
|
599 |
Personne courante = personneSelection.get(i);
|
632 |
Personne courante = personneSelection.get(i);
|
600 |
if (courante.getId().equals(getUtilisateurId())) {
|
633 |
if (courante.getId().equals(getUtilisateurId())) {
|
601 |
Info.display("Information", "Vous ne pouvez pas supprimer votre compte");
|
634 |
Info.display("Information", "Vous ne pouvez pas supprimer votre compte");
|
602 |
personneSelection.remove(courante);
|
635 |
personneSelection.remove(courante);
|
603 |
}
|
636 |
}
|
604 |
}
|
637 |
}
|
605 |
|
638 |
|
606 |
if (personneSelection.size() == 0) {
|
639 |
if (personneSelection.size() == 0) {
|
607 |
Info.display("Information", "Veuillez sélectionner une personne.");
|
640 |
Info.display("Information", "Veuillez sélectionner une personne.");
|
608 |
} else if(personneSelection.size() > 0) {
|
641 |
} else if(personneSelection.size() > 0) {
|
609 |
String message = "Êtes vous sur de vouloir supprimer les personnes sélectionnées ?";
|
642 |
String message = "Êtes vous sur de vouloir supprimer les personnes sélectionnées ?";
|
610 |
if (personneSelection.size() == 1) {
|
643 |
if (personneSelection.size() == 1) {
|
611 |
message = "Êtes vous sur de vouloir supprimer la personne sélectionnée ?";
|
644 |
message = "Êtes vous sur de vouloir supprimer la personne sélectionnée ?";
|
612 |
}
|
645 |
}
|
613 |
|
646 |
|
614 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
647 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
615 |
public void handleEvent(MessageBoxEvent ce) {
|
648 |
public void handleEvent(MessageBoxEvent ce) {
|
616 |
Dialog dialog = (Dialog) ce.getComponent();
|
649 |
Dialog dialog = (Dialog) ce.getComponent();
|
617 |
Button btn = ce.getButtonClicked();
|
650 |
Button btn = ce.getButtonClicked();
|
618 |
|
651 |
|
619 |
if (btn.getText().equals(dialog.yesText)) {
|
652 |
if (btn.getText().equals(dialog.yesText)) {
|
620 |
String idPersonneSepareParVirgule = "" ;
|
653 |
String idPersonneSepareParVirgule = "" ;
|
621 |
Iterator<Personne> itPersonne = personneSelection.iterator();
|
654 |
Iterator<Personne> itPersonne = personneSelection.iterator();
|
622 |
while (itPersonne.hasNext()) {
|
655 |
while (itPersonne.hasNext()) {
|
623 |
Personne personneCourante = itPersonne.next();
|
656 |
Personne personneCourante = itPersonne.next();
|
624 |
idPersonneSepareParVirgule += personneCourante.getId();
|
657 |
idPersonneSepareParVirgule += personneCourante.getId();
|
625 |
idPersonneSepareParVirgule +=",";
|
658 |
idPersonneSepareParVirgule +=",";
|
626 |
}
|
659 |
}
|
627 |
modele.supprimerPersonne(vue, idPersonneSepareParVirgule);
|
660 |
modele.supprimerPersonne(vue, idPersonneSepareParVirgule);
|
628 |
}
|
661 |
}
|
629 |
}
|
662 |
}
|
630 |
};
|
663 |
};
|
631 |
|
664 |
|
632 |
MessageBox.confirm("Supprimer une personne", message, listenerSuppression);
|
665 |
MessageBox.confirm("Supprimer une personne", message, listenerSuppression);
|
633 |
} else {
|
666 |
} else {
|
634 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerPersonne() du Médiateur.");
|
667 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerPersonne() du Médiateur.");
|
635 |
}
|
668 |
}
|
636 |
}
|
669 |
}
|
637 |
|
670 |
|
638 |
public void selectionnerPersonne(Rafraichissable vue, Personne personne, String projetId) {
|
671 |
public void selectionnerPersonne(Rafraichissable vue, Personne personne, String projetId) {
|
639 |
int nbElements = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
|
672 |
int nbElements = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
|
640 |
selectionnerPersonne(vue, personne, projetId, 0, nbElements);
|
673 |
selectionnerPersonne(vue, personne, projetId, 0, nbElements);
|
641 |
}
|
674 |
}
|
642 |
|
675 |
|
643 |
public void selectionnerPersonne(Rafraichissable vue, Personne personne, String projetId, int start, int nbElements) {
|
676 |
public void selectionnerPersonne(Rafraichissable vue, Personne personne, String projetId, int start, int nbElements) {
|
644 |
String personneId = null;
|
677 |
String personneId = null;
|
645 |
if (personne != null) {
|
678 |
if (personne != null) {
|
646 |
personneId = personne.getId();
|
679 |
personneId = personne.getId();
|
647 |
}
|
680 |
}
|
648 |
modele.selectionnerPersonne(vue, personneId, projetId, null, start, nbElements);
|
681 |
modele.selectionnerPersonne(vue, personneId, projetId, null, start, nbElements);
|
649 |
}
|
682 |
}
|
650 |
|
683 |
|
651 |
public void selectionnerPersonneParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
|
684 |
public void selectionnerPersonneParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
|
652 |
modele.selectionnerPersonne(vueARafraichir, null, projetId, nomComplet, 0, -1);
|
685 |
modele.selectionnerPersonne(vueARafraichir, null, projetId, nomComplet, 0, -1);
|
653 |
}
|
686 |
}
|
654 |
|
687 |
|
655 |
public void selectionnerPersonneParProjet(Rafraichissable vueARafraichir, String projetId) {
|
688 |
public void selectionnerPersonneParProjet(Rafraichissable vueARafraichir, String projetId) {
|
656 |
modele.selectionnerPersonne(vueARafraichir, null, projetId, null, 0, -1);
|
689 |
modele.selectionnerPersonne(vueARafraichir, null, projetId, null, 0, -1);
|
657 |
}
|
690 |
}
|
658 |
|
691 |
|
659 |
public void enregistrerPersonne(Rafraichissable vue, Personne personne){
|
692 |
public void enregistrerPersonne(Rafraichissable vue, Personne personne){
|
660 |
if (personne.getId() != null && !personne.getId().trim().equals("")) {
|
693 |
if (personne.getId() != null && !personne.getId().trim().equals("")) {
|
661 |
modele.modifierPersonne(vue, personne);
|
694 |
modele.modifierPersonne(vue, personne);
|
662 |
} else {
|
695 |
} else {
|
663 |
modele.ajouterPersonne(vue, personne);
|
696 |
modele.ajouterPersonne(vue, personne);
|
664 |
}
|
697 |
}
|
665 |
}
|
698 |
}
|
666 |
|
699 |
|
667 |
//+----------------------------------------------------------------------------------------------------------------+
|
700 |
//+----------------------------------------------------------------------------------------------------------------+
|
668 |
// GESTION DES PUBLICATIONS
|
701 |
// GESTION DES PUBLICATIONS
|
669 |
//+----------------------------------------------------------------------------------------------------------------+
|
702 |
//+----------------------------------------------------------------------------------------------------------------+
|
670 |
|
703 |
|
671 |
public void afficherListePublication(PublicationListe nouvelleDonnees) {
|
704 |
public void afficherListePublication(PublicationListe nouvelleDonnees) {
|
672 |
if (!(panneauCentre.getContenu() instanceof PublicationVue)) {
|
705 |
if (!(panneauCentre.getContenu() instanceof PublicationVue)) {
|
673 |
panneauCentre.removeAll();
|
706 |
panneauCentre.removeAll();
|
674 |
PublicationVue publicationVue = new PublicationVue(this) ;
|
707 |
PublicationVue publicationVue = new PublicationVue(this) ;
|
675 |
panneauCentre.setId(ComposantId.PANNEAU_PUBLICATION_LISTE);
|
708 |
panneauCentre.setId(ComposantId.PANNEAU_PUBLICATION_LISTE);
|
676 |
panneauCentre.add(publicationVue);
|
709 |
panneauCentre.add(publicationVue);
|
677 |
panneauCentre.layout(true);
|
710 |
panneauCentre.layout(true);
|
678 |
}
|
711 |
}
|
679 |
|
712 |
|
680 |
masquerPopinChargement();
|
713 |
masquerPopinChargement();
|
681 |
|
714 |
|
682 |
panneauCentre.getContenu().rafraichir(nouvelleDonnees);
|
715 |
panneauCentre.getContenu().rafraichir(nouvelleDonnees);
|
683 |
}
|
716 |
}
|
684 |
|
717 |
|
685 |
public void afficherFormPublication(String publicationId) {
|
718 |
public void afficherFormPublication(String publicationId) {
|
686 |
panneauCentre.removeAll();
|
719 |
panneauCentre.removeAll();
|
687 |
PublicationForm publicationForm = new PublicationForm(this, publicationId);
|
720 |
PublicationForm publicationForm = new PublicationForm(this, publicationId);
|
688 |
panneauCentre.add(publicationForm);
|
721 |
panneauCentre.add(publicationForm);
|
689 |
|
722 |
|
690 |
panneauCentre.layout();
|
723 |
panneauCentre.layout();
|
691 |
}
|
724 |
}
|
692 |
|
725 |
|
693 |
public void clicListePublication(Publication publication) {
|
726 |
public void clicListePublication(Publication publication) {
|
694 |
if (publication != null) {
|
727 |
if (publication != null) {
|
695 |
panneauCentre.getContenu().rafraichir(publication);
|
728 |
panneauCentre.getContenu().rafraichir(publication);
|
696 |
}
|
729 |
}
|
697 |
}
|
730 |
}
|
698 |
|
731 |
|
699 |
public void clicAjouterPublication() {
|
732 |
public void clicAjouterPublication() {
|
700 |
afficherFormPublication(null);
|
733 |
afficherFormPublication(null);
|
701 |
}
|
734 |
}
|
702 |
|
735 |
|
703 |
public void clicModifierPublication(List<Publication> selection) {
|
736 |
public void clicModifierPublication(List<Publication> selection) {
|
704 |
if (selection.size() == 0) {
|
737 |
if (selection.size() == 0) {
|
705 |
Info.display("Information", "Veuillez sélectionner une publication.");
|
738 |
Info.display("Information", "Veuillez sélectionner une publication.");
|
706 |
} else if (selection.size() > 1) {
|
739 |
} else if (selection.size() > 1) {
|
707 |
Info.display("Information", "Veuillez sélectionner une seule publication à la fois.");
|
740 |
Info.display("Information", "Veuillez sélectionner une seule publication à la fois.");
|
708 |
} else if (selection.size() == 1) {
|
741 |
} else if (selection.size() == 1) {
|
709 |
afficherFormPublication(selection.get(0).getId());
|
742 |
afficherFormPublication(selection.get(0).getId());
|
710 |
} else {
|
743 |
} else {
|
711 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPublication() du Médiateur.");
|
744 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPublication() du Médiateur.");
|
712 |
}
|
745 |
}
|
713 |
}
|
746 |
}
|
714 |
|
747 |
|
715 |
public void clicSupprimerPublication(final List<Publication> publicationListe) {
|
748 |
public void clicSupprimerPublication(final List<Publication> publicationListe) {
|
716 |
if (publicationListe.size() <= 0) {
|
749 |
if (publicationListe.size() <= 0) {
|
717 |
MessageBox.alert("Attention", "Vous devez sélectionner une publication", null);
|
750 |
MessageBox.alert("Attention", "Vous devez sélectionner une publication", null);
|
718 |
} else {
|
751 |
} else {
|
719 |
String message = "Voulez-vous vraiment supprimer ces publications ?";
|
752 |
String message = "Voulez-vous vraiment supprimer ces publications ?";
|
720 |
if (publicationListe.size() == 1) {
|
753 |
if (publicationListe.size() == 1) {
|
721 |
message = "Voulez-vous vraiment supprimer cette publication ?";
|
754 |
message = "Voulez-vous vraiment supprimer cette publication ?";
|
722 |
}
|
755 |
}
|
723 |
|
756 |
|
724 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
757 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
725 |
public void handleEvent(MessageBoxEvent ce) {
|
758 |
public void handleEvent(MessageBoxEvent ce) {
|
726 |
Dialog dialog = (Dialog) ce.getComponent();
|
759 |
Dialog dialog = (Dialog) ce.getComponent();
|
727 |
Button btn = ce.getButtonClicked();
|
760 |
Button btn = ce.getButtonClicked();
|
728 |
|
761 |
|
729 |
if (btn.getText().equals(dialog.yesText)) {
|
762 |
if (btn.getText().equals(dialog.yesText)) {
|
730 |
modele.supprimerPublication(panneauCentre.getContenu(), publicationListe);
|
763 |
modele.supprimerPublication(panneauCentre.getContenu(), publicationListe);
|
731 |
}
|
764 |
}
|
732 |
}
|
765 |
}
|
733 |
};
|
766 |
};
|
734 |
|
767 |
|
735 |
MessageBox.confirm("Supprimer une publication", message, listenerSuppression);
|
768 |
MessageBox.confirm("Supprimer une publication", message, listenerSuppression);
|
736 |
}
|
769 |
}
|
737 |
}
|
770 |
}
|
738 |
|
771 |
|
739 |
public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId) {
|
772 |
public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId) {
|
740 |
modele.selectionnerPublication(vueARafraichir, publicationId, getProjetId(), null);
|
773 |
modele.selectionnerPublication(vueARafraichir, publicationId, getProjetId(), null);
|
741 |
}
|
774 |
}
|
742 |
|
775 |
|
743 |
public void selectionnerPublicationParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
|
776 |
public void selectionnerPublicationParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
|
744 |
modele.selectionnerPublication(vueARafraichir, null, projetId, nomComplet);
|
777 |
modele.selectionnerPublication(vueARafraichir, null, projetId, nomComplet);
|
745 |
}
|
778 |
}
|
746 |
|
779 |
|
747 |
public void ajouterPublication(Rafraichissable vueARafraichir, Publication publication) {
|
780 |
public void ajouterPublication(Rafraichissable vueARafraichir, Publication publication) {
|
748 |
modele.ajouterPublication(vueARafraichir, publication);
|
781 |
modele.ajouterPublication(vueARafraichir, publication);
|
749 |
}
|
782 |
}
|
750 |
|
783 |
|
751 |
public void modifierPublication(Rafraichissable vueARafraichir, Publication publication) {
|
784 |
public void modifierPublication(Rafraichissable vueARafraichir, Publication publication) {
|
752 |
modele.modifierPublication(vueARafraichir, publication);
|
785 |
modele.modifierPublication(vueARafraichir, publication);
|
753 |
}
|
786 |
}
|
754 |
|
787 |
|
755 |
public void clicObtenirListeEditeurs(Rafraichissable vueARafraichir) {
|
788 |
public void clicObtenirListeEditeurs(Rafraichissable vueARafraichir) {
|
756 |
selectionnerStructureParProjet(vueARafraichir, null);
|
789 |
selectionnerStructureParProjet(vueARafraichir, null);
|
757 |
}
|
790 |
}
|
758 |
|
791 |
|
759 |
public void clicObtenirListeAuteurs(Rafraichissable vueARafraichir) {
|
792 |
public void clicObtenirListeAuteurs(Rafraichissable vueARafraichir) {
|
760 |
selectionnerPersonneParProjet(vueARafraichir, null);
|
793 |
selectionnerPersonneParProjet(vueARafraichir, null);
|
761 |
}
|
794 |
}
|
762 |
|
795 |
|
763 |
//+----------------------------------------------------------------------------------------------------------------+
|
796 |
//+----------------------------------------------------------------------------------------------------------------+
|
764 |
// GESTION de la relation PUBLICATION A PERSONNE
|
797 |
// GESTION de la relation PUBLICATION A PERSONNE
|
765 |
|
798 |
|
766 |
public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
|
799 |
public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
|
767 |
modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleId);
|
800 |
modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleId);
|
768 |
}
|
801 |
}
|
769 |
|
802 |
|
770 |
public void ajouterPublicationAPersonne(Rafraichissable vueArafraichir, String publicationId, String personnesId, String roleId) {
|
803 |
public void ajouterPublicationAPersonne(Rafraichissable vueArafraichir, String publicationId, String personnesId, String roleId) {
|
771 |
modele.ajouterAuteurPublication(vueArafraichir, publicationId, personnesId, roleId);
|
804 |
modele.ajouterAuteurPublication(vueArafraichir, publicationId, personnesId, roleId);
|
772 |
}
|
805 |
}
|
773 |
|
806 |
|
774 |
public void modifierPublicationAPersonne(Rafraichissable vueArafraichir, String publicationId, String personnesId, String roleId) {
|
807 |
public void modifierPublicationAPersonne(Rafraichissable vueArafraichir, String publicationId, String personnesId, String roleId) {
|
775 |
modele.modifierAuteurPublication(vueArafraichir, publicationId, personnesId, roleId);
|
808 |
modele.modifierAuteurPublication(vueArafraichir, publicationId, personnesId, roleId);
|
776 |
}
|
809 |
}
|
777 |
|
810 |
|
778 |
//+----------------------------------------------------------------------------------------------------------------+
|
811 |
//+----------------------------------------------------------------------------------------------------------------+
|
779 |
// RAFRAICHISSEMENT
|
812 |
// RAFRAICHISSEMENT
|
780 |
//+----------------------------------------------------------------------------------------------------------------+
|
813 |
//+----------------------------------------------------------------------------------------------------------------+
|
781 |
|
814 |
|
782 |
public void rafraichir(Object nouvelleDonnees) {
|
815 |
public void rafraichir(Object nouvelleDonnees) {
|
783 |
if (nouvelleDonnees instanceof Utilisateur) {
|
816 |
if (nouvelleDonnees instanceof Utilisateur) {
|
784 |
mettreAJourEtatIdentification((Utilisateur) nouvelleDonnees);
|
817 |
mettreAJourEtatIdentification((Utilisateur) nouvelleDonnees);
|
785 |
} else {
|
818 |
} else {
|
786 |
GWT.log(i18nM.erreurRafraichir(nouvelleDonnees.getClass(), this.getClass()), null);
|
819 |
GWT.log(i18nM.erreurRafraichir(nouvelleDonnees.getClass(), this.getClass()), null);
|
787 |
}
|
820 |
}
|
788 |
}
|
821 |
}
|
789 |
|
822 |
|
790 |
//+----------------------------------------------------------------------------------------------------------------+
|
823 |
//+----------------------------------------------------------------------------------------------------------------+
|
791 |
// GESTION du STATUT
|
824 |
// GESTION du STATUT
|
792 |
//+----------------------------------------------------------------------------------------------------------------+
|
825 |
//+----------------------------------------------------------------------------------------------------------------+
|
793 |
|
826 |
|
794 |
public void afficherPopinChargement() {
|
827 |
public void afficherPopinChargement() {
|
795 |
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).center();
|
828 |
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).center();
|
796 |
}
|
829 |
}
|
797 |
|
830 |
|
798 |
public void masquerPopinChargement() {
|
831 |
public void masquerPopinChargement() {
|
799 |
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).hide();
|
832 |
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).hide();
|
800 |
}
|
833 |
}
|
801 |
|
834 |
|
802 |
public void afficherListeProjets(ProjetListe projetsACharger) {
|
835 |
public void afficherListeProjets(ProjetListe projetsACharger) {
|
803 |
if (!(panneauCentre.getContenu() instanceof ProjetVue)) {
|
836 |
if (!(panneauCentre.getContenu() instanceof ProjetVue)) {
|
804 |
panneauCentre.removeAll();
|
837 |
panneauCentre.removeAll();
|
805 |
panneauCentre.add(new ProjetVue(this));
|
838 |
panneauCentre.add(new ProjetVue(this));
|
806 |
panneauCentre.setId(ComposantId.PANNEAU_PROJET_LISTE);
|
839 |
panneauCentre.setId(ComposantId.PANNEAU_PROJET_LISTE);
|
807 |
panneauCentre.layout();
|
840 |
panneauCentre.layout();
|
808 |
}
|
841 |
}
|
809 |
|
842 |
|
810 |
panneauCentre.getContenu().rafraichir(projetsACharger);
|
843 |
panneauCentre.getContenu().rafraichir(projetsACharger);
|
811 |
}
|
844 |
}
|
812 |
|
845 |
|
813 |
|
846 |
|
814 |
//+----------------------------------------------------------------------------------------------------------------+
|
847 |
//+----------------------------------------------------------------------------------------------------------------+
|
815 |
// GESTION des projets
|
848 |
// GESTION des projets
|
816 |
//+----------------------------------------------------------------------------------------------------------------+
|
849 |
//+----------------------------------------------------------------------------------------------------------------+
|
817 |
public void clicListeProjet(Projet projet) {
|
850 |
public void clicListeProjet(Projet projet) {
|
818 |
panneauCentre.getContenu().rafraichir(projet);
|
851 |
panneauCentre.getContenu().rafraichir(projet);
|
819 |
}
|
852 |
}
|
820 |
|
853 |
|
821 |
public void clicSupprimerProjet(List<Projet> selectedItems) {
|
854 |
public void clicSupprimerProjet(List<Projet> selectedItems) {
|
822 |
// TODO Auto-generated method stub
|
855 |
// TODO Auto-generated method stub
|
823 |
|
856 |
|
824 |
}
|
857 |
}
|
825 |
|
858 |
|
826 |
public void clicModifierProjet(List<Projet> selectedItems) {
|
859 |
public void clicModifierProjet(List<Projet> selectedItems) {
|
827 |
// TODO Auto-generated method stub
|
860 |
// TODO Auto-generated method stub
|
828 |
|
861 |
|
829 |
}
|
862 |
}
|
830 |
|
863 |
|
831 |
public void clicAjouterProjet() {
|
864 |
public void clicAjouterProjet() {
|
832 |
// TODO Auto-generated method stub
|
865 |
// TODO Auto-generated method stub
|
833 |
|
866 |
|
834 |
}
|
867 |
}
|
835 |
|
868 |
|
836 |
}
|
869 |
}
|