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.interfaces.Rafraichissable;
|
9 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
10 |
import org.tela_botanica.client.modeles.Configuration;
|
10 |
import org.tela_botanica.client.modeles.Configuration;
|
11 |
import org.tela_botanica.client.modeles.Information;
|
11 |
import org.tela_botanica.client.modeles.Information;
|
12 |
import org.tela_botanica.client.modeles.Menu;
|
12 |
import org.tela_botanica.client.modeles.Menu;
|
13 |
import org.tela_botanica.client.modeles.Personne;
|
13 |
import org.tela_botanica.client.modeles.Personne;
|
14 |
import org.tela_botanica.client.modeles.PersonneListe;
|
14 |
import org.tela_botanica.client.modeles.PersonneListe;
|
15 |
import org.tela_botanica.client.modeles.Projet;
|
15 |
import org.tela_botanica.client.modeles.Projet;
|
16 |
import org.tela_botanica.client.modeles.ProjetsListe;
|
16 |
import org.tela_botanica.client.modeles.ProjetsListe;
|
17 |
import org.tela_botanica.client.modeles.Publication;
|
17 |
import org.tela_botanica.client.modeles.Publication;
|
18 |
import org.tela_botanica.client.modeles.PublicationListe;
|
18 |
import org.tela_botanica.client.modeles.PublicationListe;
|
19 |
import org.tela_botanica.client.modeles.Structure;
|
19 |
import org.tela_botanica.client.modeles.Structure;
|
20 |
import org.tela_botanica.client.modeles.StructureAPersonne;
|
20 |
import org.tela_botanica.client.modeles.StructureAPersonne;
|
21 |
import org.tela_botanica.client.modeles.StructureAPersonneListe;
|
21 |
import org.tela_botanica.client.modeles.StructureAPersonneListe;
|
22 |
import org.tela_botanica.client.modeles.StructureConservation;
|
22 |
import org.tela_botanica.client.modeles.StructureConservation;
|
23 |
import org.tela_botanica.client.modeles.StructureListe;
|
23 |
import org.tela_botanica.client.modeles.StructureListe;
|
24 |
import org.tela_botanica.client.modeles.StructureValorisation;
|
24 |
import org.tela_botanica.client.modeles.StructureValorisation;
|
25 |
import org.tela_botanica.client.modeles.Utilisateur;
|
25 |
import org.tela_botanica.client.modeles.Utilisateur;
|
26 |
import org.tela_botanica.client.modeles.ValeurListe;
|
26 |
import org.tela_botanica.client.modeles.ValeurListe;
|
27 |
import org.tela_botanica.client.vues.ContenuPanneauVue;
|
27 |
import org.tela_botanica.client.vues.ContenuPanneauVue;
|
28 |
import org.tela_botanica.client.vues.EntetePanneauVue;
|
28 |
import org.tela_botanica.client.vues.EntetePanneauVue;
|
29 |
import org.tela_botanica.client.vues.FormPersonneVue;
|
29 |
import org.tela_botanica.client.vues.FormPersonneVue;
|
30 |
import org.tela_botanica.client.vues.FormPublicationVue;
|
30 |
import org.tela_botanica.client.vues.FormPublicationVue;
|
31 |
import org.tela_botanica.client.vues.FormStructureVue;
|
31 |
import org.tela_botanica.client.vues.FormStructureVue;
|
32 |
import org.tela_botanica.client.vues.PersonneDetailPanneauVue;
|
32 |
import org.tela_botanica.client.vues.PersonneDetailPanneauVue;
|
33 |
import org.tela_botanica.client.vues.PersonneVue;
|
33 |
import org.tela_botanica.client.vues.PersonneVue;
|
34 |
import org.tela_botanica.client.vues.PublicationDetailPanneauVue;
|
34 |
import org.tela_botanica.client.vues.PublicationDetailPanneauVue;
|
35 |
import org.tela_botanica.client.vues.PublicationListePanneauVue;
|
35 |
import org.tela_botanica.client.vues.PublicationListePanneauVue;
|
36 |
import org.tela_botanica.client.vues.PublicationVue;
|
36 |
import org.tela_botanica.client.vues.PublicationVue;
|
37 |
import org.tela_botanica.client.vues.StructureDetailPanneauVue;
|
37 |
import org.tela_botanica.client.vues.StructureDetailPanneauVue;
|
38 |
import org.tela_botanica.client.vues.StructureListePanneauVue;
|
38 |
import org.tela_botanica.client.vues.StructureListePanneauVue;
|
39 |
import org.tela_botanica.client.vues.StructureVue;
|
39 |
import org.tela_botanica.client.vues.StructureVue;
|
40 |
import org.tela_botanica.client.vues.MenuPanneauVue;
|
40 |
import org.tela_botanica.client.vues.MenuPanneauVue;
|
41 |
|
41 |
|
42 |
import com.extjs.gxt.ui.client.Registry;
|
42 |
import com.extjs.gxt.ui.client.Registry;
|
43 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
43 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
44 |
import com.extjs.gxt.ui.client.util.Margins;
|
44 |
import com.extjs.gxt.ui.client.util.Margins;
|
45 |
import com.extjs.gxt.ui.client.widget.Info;
|
45 |
import com.extjs.gxt.ui.client.widget.Info;
|
46 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
46 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
47 |
import com.extjs.gxt.ui.client.widget.Viewport;
|
47 |
import com.extjs.gxt.ui.client.widget.Viewport;
|
48 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
|
48 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
|
49 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
49 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
50 |
import com.google.gwt.core.client.GWT;
|
50 |
import com.google.gwt.core.client.GWT;
|
51 |
import com.google.gwt.dom.client.Element;
|
51 |
import com.google.gwt.dom.client.Element;
|
52 |
import com.google.gwt.user.client.Window;
|
52 |
import com.google.gwt.user.client.Window;
|
53 |
import com.google.gwt.user.client.ui.RootPanel;
|
53 |
import com.google.gwt.user.client.ui.RootPanel;
|
54 |
|
54 |
|
55 |
public class Mediateur {
|
55 |
public class Mediateur {
|
56 |
|
56 |
|
57 |
private Modele modele = null;
|
57 |
private Modele modele = null;
|
58 |
private Utilisateur utilisateur = null;
|
58 |
private Utilisateur utilisateur = null;
|
59 |
|
59 |
|
60 |
private Viewport viewport;
|
60 |
private Viewport viewport;
|
61 |
private EntetePanneauVue panneauNord = null;
|
61 |
private EntetePanneauVue panneauNord = null;
|
62 |
private MenuPanneauVue panneauOuest = null;
|
62 |
private MenuPanneauVue panneauOuest = null;
|
63 |
private ContenuPanneauVue panneauCentre = null;
|
63 |
private ContenuPanneauVue panneauCentre = null;
|
64 |
private Rafraichissable contenuPanneauCentre = null;
|
64 |
private Rafraichissable contenuPanneauCentre = null;
|
65 |
|
65 |
|
66 |
|
66 |
|
67 |
|
67 |
|
68 |
public Mediateur() {
|
68 |
public Mediateur() {
|
69 |
// Enregistrement du Médiateur dans le Registre
|
69 |
// Enregistrement du Médiateur dans le Registre
|
70 |
Registry.register(RegistreId.MEDIATEUR, this);
|
70 |
Registry.register(RegistreId.MEDIATEUR, this);
|
71 |
// Création du Modèle qui s'enregistre lui même dans le Registre
|
71 |
// Création du Modèle qui s'enregistre lui même dans le Registre
|
72 |
modele = new Modele();
|
72 |
modele = new Modele();
|
73 |
// Création de l'utilsateur courrant
|
73 |
// Création de l'utilsateur courrant
|
74 |
utilisateur = new Utilisateur(null, false);
|
74 |
utilisateur = new Utilisateur(null, false);
|
75 |
Registry.register(RegistreId.UTILISATEUR, utilisateur);
|
75 |
Registry.register(RegistreId.UTILISATEUR, utilisateur);
|
76 |
this.connecterUtilisateur(null, null);
|
76 |
this.connecterUtilisateur(null, null);
|
77 |
|
77 |
|
78 |
// Création du Viewport qui contient la disposition globale de l'application
|
78 |
// Création du Viewport qui contient la disposition globale de l'application
|
79 |
viewport = new Viewport();
|
79 |
viewport = new Viewport();
|
80 |
viewport.setLayout(new BorderLayout());
|
80 |
viewport.setLayout(new BorderLayout());
|
81 |
|
81 |
|
82 |
// Création des différents panneaux
|
82 |
// Création des différents panneaux
|
83 |
creerPanneauNord();
|
83 |
creerPanneauNord();
|
84 |
creerPanneauOuest();
|
84 |
creerPanneauOuest();
|
85 |
creerPanneauCentral();
|
85 |
creerPanneauCentral();
|
86 |
|
86 |
|
87 |
// Registry utile car présent partout!
|
87 |
// Registry utile car présent partout!
|
88 |
Registry.register(RegistreId.VIEWPORT, viewport);
|
88 |
Registry.register(RegistreId.VIEWPORT, viewport);
|
89 |
Registry.register(RegistreId.PANNEAU_OUEST, panneauOuest);
|
89 |
Registry.register(RegistreId.PANNEAU_OUEST, panneauOuest);
|
90 |
Registry.register(RegistreId.PANNEAU_CENTRE, panneauCentre);
|
90 |
Registry.register(RegistreId.PANNEAU_CENTRE, panneauCentre);
|
91 |
|
91 |
|
92 |
// Chargement du menu
|
92 |
// Chargement du menu
|
93 |
chargeMenu(panneauOuest.listerMenu());
|
93 |
chargeMenu(panneauOuest.listerMenu());
|
94 |
|
94 |
|
95 |
// Retour à GWT du Viewport une fois constuit
|
95 |
// Retour à GWT du Viewport une fois constuit
|
96 |
RootPanel.get().add(viewport);
|
96 |
RootPanel.get().add(viewport);
|
97 |
}
|
97 |
}
|
98 |
|
98 |
|
99 |
//+----------------------------------------------------------------------------------------------------------------+
|
99 |
//+----------------------------------------------------------------------------------------------------------------+
|
100 |
// GESTION des PANNEAUX PRINCIPAUX
|
100 |
// GESTION des PANNEAUX PRINCIPAUX
|
101 |
//+----------------------------------------------------------------------------------------------------------------+
|
101 |
//+----------------------------------------------------------------------------------------------------------------+
|
102 |
|
102 |
|
103 |
private void creerPanneauNord() {
|
103 |
private void creerPanneauNord() {
|
104 |
panneauNord = new EntetePanneauVue();
|
104 |
panneauNord = new EntetePanneauVue();
|
105 |
|
105 |
|
106 |
BorderLayoutData regionNord = new BorderLayoutData(LayoutRegion.NORTH, 100);
|
106 |
BorderLayoutData regionNord = new BorderLayoutData(LayoutRegion.NORTH, 100);
|
107 |
regionNord.setCollapsible(true);
|
107 |
regionNord.setCollapsible(true);
|
108 |
regionNord.setFloatable(true);
|
108 |
regionNord.setFloatable(true);
|
109 |
regionNord.setSplit(false);
|
109 |
regionNord.setSplit(false);
|
110 |
regionNord.setMargins(new Margins(5, 5, 0, 5));
|
110 |
regionNord.setMargins(new Margins(5, 5, 0, 5));
|
111 |
|
111 |
|
112 |
viewport.add(panneauNord, regionNord);
|
112 |
viewport.add(panneauNord, regionNord);
|
113 |
}
|
113 |
}
|
114 |
|
114 |
|
115 |
private void creerPanneauOuest() {
|
115 |
private void creerPanneauOuest() {
|
116 |
panneauOuest = new MenuPanneauVue();
|
116 |
panneauOuest = new MenuPanneauVue();
|
117 |
|
117 |
|
118 |
BorderLayoutData regionOuest = new BorderLayoutData(LayoutRegion.WEST, 200);
|
118 |
BorderLayoutData regionOuest = new BorderLayoutData(LayoutRegion.WEST, 200);
|
119 |
regionOuest.setSplit(true);
|
119 |
regionOuest.setSplit(true);
|
120 |
regionOuest.setCollapsible(true);
|
120 |
regionOuest.setCollapsible(true);
|
121 |
regionOuest.setMargins(new Margins(5));
|
121 |
regionOuest.setMargins(new Margins(5));
|
122 |
|
122 |
|
123 |
viewport.add(panneauOuest, regionOuest);
|
123 |
viewport.add(panneauOuest, regionOuest);
|
124 |
}
|
124 |
}
|
125 |
|
125 |
|
126 |
private void creerPanneauCentral() {
|
126 |
private void creerPanneauCentral() {
|
127 |
panneauCentre = new ContenuPanneauVue();
|
127 |
panneauCentre = new ContenuPanneauVue();
|
128 |
|
128 |
|
129 |
BorderLayoutData regionCentre = new BorderLayoutData(LayoutRegion.CENTER);
|
129 |
BorderLayoutData regionCentre = new BorderLayoutData(LayoutRegion.CENTER);
|
130 |
regionCentre.setMargins(new Margins(5, 5, 5, 0));
|
130 |
regionCentre.setMargins(new Margins(5, 5, 5, 0));
|
131 |
|
131 |
|
132 |
viewport.add(panneauCentre, regionCentre);
|
132 |
viewport.add(panneauCentre, regionCentre);
|
133 |
}
|
133 |
}
|
134 |
|
134 |
|
135 |
//+----------------------------------------------------------------------------------------------------------------+
|
135 |
//+----------------------------------------------------------------------------------------------------------------+
|
136 |
// GESTION du MENU
|
136 |
// GESTION du MENU
|
137 |
//+----------------------------------------------------------------------------------------------------------------+
|
137 |
//+----------------------------------------------------------------------------------------------------------------+
|
138 |
|
138 |
|
139 |
public void chargeMenu(Menu menus) {
|
139 |
public void chargeMenu(Menu menus) {
|
140 |
((MenuPanneauVue) Registry.get(RegistreId.PANNEAU_OUEST)).rafraichir(menus);
|
140 |
((MenuPanneauVue) Registry.get(RegistreId.PANNEAU_OUEST)).rafraichir(menus);
|
141 |
}
|
141 |
}
|
142 |
|
142 |
|
143 |
public void clicMenu(String menuNom) {
|
143 |
public void clicMenu(String menuNom) {
|
144 |
panneauCentre.removeAll();
|
144 |
panneauCentre.removeAll();
|
145 |
if (menuNom.equals("Institutions")) {
|
145 |
if (menuNom.equals("Institutions")) {
|
146 |
((Modele) Registry.get(RegistreId.MODELE)).selectionnerStructures(getUtilisateurId(), getProjetId());
|
146 |
((Modele) Registry.get(RegistreId.MODELE)).selectionnerStructures(getUtilisateurId(), getProjetId());
|
147 |
} else if (menuNom.equals("Publications")) {
|
147 |
} else if (menuNom.equals("Publications")) {
|
148 |
((Modele) Registry.get(RegistreId.MODELE)).obtenirListePublications();
|
148 |
((Modele) Registry.get(RegistreId.MODELE)).obtenirListePublications();
|
149 |
} else if (menuNom.equals("Personnes")) {
|
149 |
} else if (menuNom.equals("Personnes")) {
|
150 |
((Modele) Registry.get(RegistreId.MODELE)).obtenirListePersonnes();
|
150 |
((Modele) Registry.get(RegistreId.MODELE)).obtenirListePersonnes();
|
151 |
}
|
151 |
}
|
152 |
else {
|
152 |
else {
|
153 |
GWT.log("Non implémenté! Menu id : "+menuNom, null);
|
153 |
GWT.log("Non implémenté! Menu id : "+menuNom, null);
|
154 |
}
|
154 |
}
|
155 |
panneauCentre.layout();
|
155 |
panneauCentre.layout();
|
156 |
}
|
156 |
}
|
157 |
|
157 |
|
158 |
//+----------------------------------------------------------------------------------------------------------------+
|
158 |
//+----------------------------------------------------------------------------------------------------------------+
|
159 |
// GESTION DES FENÊTRES
|
159 |
// GESTION DES FENÊTRES
|
160 |
//+----------------------------------------------------------------------------------------------------------------+
|
160 |
//+----------------------------------------------------------------------------------------------------------------+
|
161 |
|
161 |
|
162 |
public void ouvrirAide() {
|
162 |
public void ouvrirAide() {
|
163 |
AideFenetre aideFenetre = new AideFenetre();
|
163 |
AideFenetre aideFenetre = new AideFenetre();
|
164 |
aideFenetre.show();
|
164 |
aideFenetre.show();
|
165 |
// FIXME : apparament le fade In/Fade Out pose problème sur les navigateurs...
|
165 |
// FIXME : apparament le fade In/Fade Out pose problème sur les navigateurs...
|
166 |
//aideFenetre.el().fadeIn(FxConfig.NONE);
|
166 |
//aideFenetre.el().fadeIn(FxConfig.NONE);
|
167 |
}
|
167 |
}
|
168 |
|
168 |
|
169 |
public void ouvrirParametres() {
|
169 |
public void ouvrirParametres() {
|
170 |
ParametreFenetre parametresFenetre = new ParametreFenetre();
|
170 |
ParametreFenetre parametresFenetre = new ParametreFenetre();
|
171 |
parametresFenetre.show();
|
171 |
parametresFenetre.show();
|
172 |
}
|
172 |
}
|
173 |
|
173 |
|
174 |
public void ouvrirIdentification() {
|
174 |
public void ouvrirIdentification() {
|
175 |
IdentificationFenetre identifFenetre = new IdentificationFenetre();
|
175 |
IdentificationFenetre identifFenetre = new IdentificationFenetre();
|
176 |
identifFenetre.show();
|
176 |
identifFenetre.show();
|
177 |
}
|
177 |
}
|
178 |
|
178 |
|
179 |
public void ouvrirApplis(String id) {
|
179 |
public void ouvrirApplis(String id) {
|
180 |
if (id.equals(ComposantId.MENU_CEL)) {
|
180 |
if (id.equals(ComposantId.MENU_CEL)) {
|
181 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getCelUrl(), "Carnet en ligne", "");
|
181 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getCelUrl(), "Carnet en ligne", "");
|
182 |
} else if (id.equals(ComposantId.MENU_BEL)) {
|
182 |
} else if (id.equals(ComposantId.MENU_BEL)) {
|
183 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getCelUrl(), "Biblio en ligne", "");
|
183 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getCelUrl(), "Biblio en ligne", "");
|
184 |
}
|
184 |
}
|
185 |
}
|
185 |
}
|
186 |
|
186 |
|
187 |
//+----------------------------------------------------------------------------------------------------------------+
|
187 |
//+----------------------------------------------------------------------------------------------------------------+
|
188 |
// GESTION de l'UTILISATEUR et de l'IDENTIFICATION
|
188 |
// GESTION de l'UTILISATEUR et de l'IDENTIFICATION
|
189 |
//+----------------------------------------------------------------------------------------------------------------+
|
189 |
//+----------------------------------------------------------------------------------------------------------------+
|
190 |
/**
|
190 |
/**
|
191 |
* Retourne l'identifiant de l'utilisateur courrant de l'application.
|
191 |
* Retourne l'identifiant de l'utilisateur courrant de l'application.
|
192 |
*/
|
192 |
*/
|
193 |
public String getUtilisateurId() {
|
193 |
public String getUtilisateurId() {
|
194 |
return utilisateur.getId();
|
194 |
return utilisateur.getId();
|
195 |
}
|
195 |
}
|
196 |
|
196 |
|
197 |
public void clicIdentification() {
|
197 |
public void clicIdentification() {
|
198 |
// Gestion du login
|
198 |
// Gestion du login
|
199 |
IdentificationFenetre dialog = new IdentificationFenetre();
|
199 |
IdentificationFenetre dialog = new IdentificationFenetre();
|
200 |
dialog.setClosable(false);
|
200 |
dialog.setClosable(false);
|
201 |
dialog.show();
|
201 |
dialog.show();
|
202 |
}
|
202 |
}
|
203 |
|
203 |
|
204 |
public void connecterUtilisateur(String login, String mdp) {
|
204 |
public void connecterUtilisateur(String login, String mdp) {
|
205 |
((Modele) Registry.get(RegistreId.MODELE)).connecterUtilisateur(login, mdp);
|
205 |
((Modele) Registry.get(RegistreId.MODELE)).connecterUtilisateur(login, mdp);
|
206 |
}
|
206 |
}
|
207 |
|
207 |
|
208 |
public void deconnecterUtilisateur() {
|
208 |
public void deconnecterUtilisateur() {
|
209 |
((Modele) Registry.get(RegistreId.MODELE)).deconnecterUtilisateur();
|
209 |
((Modele) Registry.get(RegistreId.MODELE)).deconnecterUtilisateur();
|
210 |
}
|
210 |
}
|
211 |
|
211 |
|
212 |
public void mettreAJourEtatIdentification(Utilisateur utilisateur) {
|
212 |
public void mettreAJourEtatIdentification(Utilisateur utilisateur) {
|
213 |
// Mise à jour du registre
|
213 |
// Mise à jour du registre
|
214 |
Registry.register(RegistreId.UTILISATEUR, utilisateur);
|
214 |
Registry.register(RegistreId.UTILISATEUR, utilisateur);
|
215 |
|
215 |
|
216 |
// Création de l'information de mise à jour de l'utilisateur
|
216 |
// Création de l'information de mise à jour de l'utilisateur
|
217 |
Information info = new Information("maj_utilisateur");
|
217 |
Information info = new Information("maj_utilisateur");
|
218 |
|
218 |
|
219 |
// Rafraichissement du panneau Nord
|
219 |
// Rafraichissement du panneau Nord
|
220 |
panneauNord.rafraichir(info);
|
220 |
panneauNord.rafraichir(info);
|
221 |
|
221 |
|
222 |
// Rafraichissement du panneau Centre
|
222 |
// Rafraichissement du panneau Centre
|
223 |
if (contenuPanneauCentre != null) {
|
223 |
if (contenuPanneauCentre != null) {
|
224 |
contenuPanneauCentre.rafraichir(info);
|
224 |
contenuPanneauCentre.rafraichir(info);
|
225 |
}
|
225 |
}
|
226 |
}
|
226 |
}
|
227 |
|
227 |
|
228 |
//+----------------------------------------------------------------------------------------------------------------+
|
228 |
//+----------------------------------------------------------------------------------------------------------------+
|
229 |
// GESTION DES PERSONNES
|
229 |
// GESTION DES PERSONNES
|
230 |
//+----------------------------------------------------------------------------------------------------------------+
|
230 |
//+----------------------------------------------------------------------------------------------------------------+
|
231 |
|
231 |
|
232 |
public void clicListePersonne(Personne personne) {
|
232 |
public void clicListePersonne(Personne personne) {
|
233 |
((PersonneDetailPanneauVue) Registry.get(RegistreId.PANNEAU_PERSONNE_DETAIL)).rafraichir(personne);
|
233 |
((PersonneDetailPanneauVue) Registry.get(RegistreId.PANNEAU_PERSONNE_DETAIL)).rafraichir(personne);
|
234 |
|
234 |
|
235 |
}
|
235 |
}
|
236 |
|
236 |
|
237 |
public void afficherListePersonnes(PersonneListe nouvelleDonnees) {
|
237 |
public void afficherListePersonnes(PersonneListe nouvelleDonnees) {
|
238 |
|
238 |
|
239 |
PersonneVue personneVue = new PersonneVue();
|
239 |
PersonneVue personneVue = new PersonneVue();
|
240 |
contenuPanneauCentre = personneVue;
|
240 |
contenuPanneauCentre = personneVue;
|
241 |
panneauCentre.add(personneVue);
|
241 |
panneauCentre.add(personneVue);
|
242 |
personneVue.rafraichir(nouvelleDonnees);
|
242 |
personneVue.rafraichir(nouvelleDonnees);
|
243 |
}
|
243 |
}
|
244 |
|
244 |
|
245 |
public void clicAjouterPersonne() {
|
245 |
public void clicAjouterPersonne() {
|
246 |
FormPersonneVue fPersonneVue = new FormPersonneVue();
|
246 |
FormPersonneVue fPersonneVue = new FormPersonneVue();
|
247 |
contenuPanneauCentre = fPersonneVue;
|
247 |
contenuPanneauCentre = fPersonneVue;
|
248 |
panneauCentre.add(fPersonneVue);
|
248 |
panneauCentre.add(fPersonneVue);
|
249 |
}
|
249 |
}
|
250 |
|
250 |
|
251 |
public void selectionnerPersonneParNomComplet(Rafraichissable vue, String projetId, String nomComplet) {
|
251 |
public void selectionnerPersonneParNomComplet(Rafraichissable vue, String projetId, String nomComplet) {
|
252 |
modele.selectionnerPersonne(vue, null, projetId, nomComplet);
|
252 |
modele.selectionnerPersonne(vue, null, projetId, nomComplet);
|
253 |
}
|
253 |
}
|
254 |
|
254 |
|
255 |
public void clicSupprimerPersonne(Rafraichissable vue,List<Personne> personneSelection) {
|
255 |
public void clicSupprimerPersonne(Rafraichissable vue,List<Personne> personneSelection) {
|
256 |
|
256 |
|
257 |
String ids = "" ;
|
257 |
String ids = "" ;
|
258 |
|
258 |
|
259 |
if (personneSelection.size() == 0) {
|
259 |
if (personneSelection.size() == 0) {
|
260 |
Info.display("Information", "Veuillez sélectionner une personne.");
|
260 |
Info.display("Information", "Veuillez sélectionner une personne.");
|
261 |
} else if(personneSelection.size() > 0) {
|
261 |
} else if(personneSelection.size() > 0) {
|
262 |
String message = "Êtes vous sur de vouloir supprimer les personnes sélectionnées ?";
|
262 |
String message = "Êtes vous sur de vouloir supprimer les personnes sélectionnées ?";
|
263 |
if (personneSelection.size() == 1) {
|
263 |
if (personneSelection.size() == 1) {
|
264 |
message = "Êtes vous sur de vouloir supprimer la personne sélectionnée ?";
|
264 |
message = "Êtes vous sur de vouloir supprimer la personne sélectionnée ?";
|
265 |
}
|
265 |
}
|
266 |
if(Window.confirm(message)) {
|
266 |
if(Window.confirm(message)) {
|
267 |
String idStr = "" ;
|
267 |
String idStr = "" ;
|
268 |
for(int i = 0 ; i < personneSelection.size() ; i++) {
|
268 |
for(int i = 0 ; i < personneSelection.size() ; i++) {
|
269 |
idStr += personneSelection.get(i).getId()+"," ;
|
269 |
idStr += personneSelection.get(i).getId()+"," ;
|
270 |
}
|
270 |
}
|
271 |
modele.supprimerPersonne(vue, getUtilisateurId(), idStr);
|
271 |
modele.supprimerPersonne(vue, getUtilisateurId(), idStr);
|
272 |
}
|
272 |
}
|
273 |
} else {
|
273 |
} else {
|
274 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerPersonne() du Médiateur.");
|
274 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerPersonne() du Médiateur.");
|
275 |
}
|
275 |
}
|
276 |
}
|
276 |
}
|
277 |
|
277 |
|
278 |
//+----------------------------------------------------------------------------------------------------------------+
|
278 |
//+----------------------------------------------------------------------------------------------------------------+
|
279 |
// GESTION DES VALEURS ET LISTES
|
279 |
// GESTION DES VALEURS ET LISTES
|
280 |
//+----------------------------------------------------------------------------------------------------------------+
|
280 |
//+----------------------------------------------------------------------------------------------------------------+
|
281 |
|
281 |
|
282 |
public void afficherListeValeurs(ValeurListe nouvelleDonnees) {
|
282 |
public void afficherListeValeurs(ValeurListe nouvelleDonnees) {
|
283 |
if (panneauCentre.getId().equals(ComposantId.PANNEAU_STRUCTURE_FORM)) {
|
283 |
if (panneauCentre.getId().equals(ComposantId.PANNEAU_STRUCTURE_FORM)) {
|
284 |
((FormStructureVue) panneauCentre.getItem(0)).rafraichir(nouvelleDonnees);
|
284 |
((FormStructureVue) panneauCentre.getItem(0)).rafraichir(nouvelleDonnees);
|
285 |
} else {
|
285 |
} else {
|
286 |
GWT.log("Aucun panneau trouvé pour afficher la liste de valeur", null);
|
286 |
GWT.log("Aucun panneau trouvé pour afficher la liste de valeur", null);
|
287 |
}
|
287 |
}
|
288 |
}
|
288 |
}
|
289 |
|
289 |
|
290 |
//+----------------------------------------------------------------------------------------------------------------+
|
290 |
//+----------------------------------------------------------------------------------------------------------------+
|
291 |
// GESTION DES PUBLICATIONS
|
291 |
// GESTION DES PUBLICATIONS
|
292 |
//+----------------------------------------------------------------------------------------------------------------+
|
292 |
//+----------------------------------------------------------------------------------------------------------------+
|
293 |
|
293 |
|
294 |
public void afficherListePublication(PublicationListe nouvelleDonnees) {
|
294 |
public void afficherListePublication(PublicationListe nouvelleDonnees) {
|
295 |
|
295 |
|
296 |
PublicationVue publicationVue = new PublicationVue() ;
|
296 |
PublicationVue publicationVue = new PublicationVue() ;
|
297 |
panneauCentre.removeAll();
|
297 |
panneauCentre.removeAll();
|
298 |
panneauCentre.add(publicationVue);
|
298 |
panneauCentre.add(publicationVue);
|
299 |
contenuPanneauCentre = publicationVue;
|
299 |
contenuPanneauCentre = publicationVue;
|
300 |
publicationVue.rafraichir(nouvelleDonnees);
|
300 |
publicationVue.rafraichir(nouvelleDonnees);
|
301 |
|
301 |
|
302 |
}
|
302 |
}
|
303 |
|
303 |
|
304 |
public void clicListePublication(Publication publication) {
|
304 |
public void clicListePublication(Publication publication) {
|
305 |
|
305 |
|
306 |
((PublicationDetailPanneauVue) Registry.get(RegistreId.PANNEAU_PUBLICATION_DETAIL)).rafraichir(publication);
|
306 |
((PublicationDetailPanneauVue) Registry.get(RegistreId.PANNEAU_PUBLICATION_DETAIL)).rafraichir(publication);
|
307 |
}
|
307 |
}
|
308 |
|
308 |
|
309 |
public void clicAjouterPublication() {
|
309 |
public void clicAjouterPublication() {
|
310 |
panneauCentre.removeAll();
|
310 |
panneauCentre.removeAll();
|
311 |
FormPublicationVue formPublicationVue = new FormPublicationVue();
|
311 |
FormPublicationVue formPublicationVue = new FormPublicationVue();
|
312 |
panneauCentre.add(formPublicationVue);
|
312 |
panneauCentre.add(formPublicationVue);
|
313 |
panneauCentre.setId(ComposantId.PANNEAU_FORM_PUBLICATION);
|
313 |
panneauCentre.setId(ComposantId.PANNEAU_FORM_PUBLICATION);
|
314 |
panneauCentre.layout();
|
314 |
panneauCentre.layout();
|
315 |
}
|
315 |
}
|
316 |
|
316 |
|
317 |
public void clicModifierPublication(List<Publication> publicationListe) {
|
317 |
public void clicModifierPublication(List<Publication> publicationListe) {
|
318 |
if(publicationListe.size() <= 0) {
|
318 |
if(publicationListe.size() <= 0) {
|
319 |
Window.alert("Il faut selectionner une publication");
|
319 |
Window.alert("Il faut selectionner une publication");
|
320 |
}
|
320 |
}
|
321 |
else {
|
321 |
else {
|
322 |
Publication pubAModifier = publicationListe.get(publicationListe.size() -1);
|
322 |
Publication pubAModifier = publicationListe.get(publicationListe.size() -1);
|
323 |
panneauCentre.removeAll();
|
323 |
panneauCentre.removeAll();
|
324 |
FormPublicationVue formPublicationVue = new FormPublicationVue();
|
324 |
FormPublicationVue formPublicationVue = new FormPublicationVue();
|
325 |
panneauCentre.add(formPublicationVue);
|
325 |
panneauCentre.add(formPublicationVue);
|
326 |
panneauCentre.setId(ComposantId.PANNEAU_FORM_PUBLICATION);
|
326 |
panneauCentre.setId(ComposantId.PANNEAU_FORM_PUBLICATION);
|
327 |
panneauCentre.layout();
|
327 |
panneauCentre.layout();
|
328 |
formPublicationVue.rafraichir(pubAModifier);
|
328 |
formPublicationVue.rafraichir(pubAModifier);
|
329 |
}
|
329 |
}
|
330 |
|
330 |
|
331 |
}
|
331 |
}
|
332 |
|
332 |
|
333 |
|
333 |
|
334 |
public void clicSupprimerPublication(List<Publication> publicationListe) {
|
334 |
public void clicSupprimerPublication(List<Publication> publicationListe) {
|
335 |
if(publicationListe.size() <= 0) {
|
335 |
if(publicationListe.size() <= 0) {
|
336 |
Window.alert("Il faut selectionner une publication");
|
336 |
Window.alert("Il faut selectionner une publication");
|
337 |
}
|
337 |
}
|
338 |
else {
|
338 |
else {
|
339 |
String message = "" ;
|
339 |
String message = "" ;
|
340 |
if(publicationListe.size() == 1) {
|
340 |
if(publicationListe.size() == 1) {
|
341 |
message = "Voulez-vous vraiment supprimer cette publication ?";
|
341 |
message = "Voulez-vous vraiment supprimer cette publication ?";
|
342 |
}
|
342 |
}
|
343 |
else {
|
343 |
else {
|
344 |
message = "Voulez-vous vraiment supprimer ces publication ?";
|
344 |
message = "Voulez-vous vraiment supprimer ces publication ?";
|
345 |
}
|
345 |
}
|
346 |
if(Window.confirm(message)) {
|
346 |
if(Window.confirm(message)) {
|
347 |
modele.supprimerPublication(getUtilisateurId(),publicationListe);
|
347 |
modele.supprimerPublication(getUtilisateurId(),publicationListe);
|
348 |
}
|
348 |
}
|
349 |
}
|
349 |
}
|
350 |
|
350 |
|
351 |
}
|
351 |
}
|
352 |
|
352 |
|
353 |
public void ajouterPublication(FormPublicationVue formPublicationVue,
|
353 |
public void ajouterPublication(FormPublicationVue formPublicationVue,
|
354 |
Publication publi) {
|
354 |
Publication publi) {
|
355 |
modele.ajouterPublication(getUtilisateurId(),publi);
|
355 |
modele.ajouterPublication(getUtilisateurId(),publi);
|
356 |
}
|
356 |
}
|
357 |
|
357 |
|
358 |
public void modifierPublication(FormPublicationVue formPublicationVue, Publication publi) {
|
358 |
public void modifierPublication(FormPublicationVue formPublicationVue, Publication publi) {
|
359 |
modele.modifierPublication(getUtilisateurId(),publi);
|
359 |
modele.modifierPublication(getUtilisateurId(),publi);
|
360 |
}
|
360 |
}
|
361 |
|
361 |
|
362 |
public void clicObtenirListeEditeurs(Rafraichissable r) {
|
362 |
public void clicObtenirListeEditeurs(Rafraichissable r) {
|
363 |
modele.obtenirListeStructures(r,getUtilisateurId(), null);
|
363 |
modele.obtenirListeStructures(r,getUtilisateurId(), null);
|
364 |
|
364 |
|
365 |
}
|
365 |
}
|
366 |
|
366 |
|
367 |
public void clicObtenirListeAuteurs(Rafraichissable r) {
|
367 |
public void clicObtenirListeAuteurs(Rafraichissable r) {
|
368 |
modele.obtenirListePersonnes(r);
|
368 |
modele.obtenirListePersonnes(r);
|
369 |
}
|
369 |
}
|
370 |
|
370 |
|
371 |
//+----------------------------------------------------------------------------------------------------------------+
|
371 |
//+----------------------------------------------------------------------------------------------------------------+
|
372 |
// GESTION DES STRUCTURES
|
372 |
// GESTION DES STRUCTURES
|
373 |
//+----------------------------------------------------------------------------------------------------------------+
|
373 |
//+----------------------------------------------------------------------------------------------------------------+
|
374 |
|
374 |
|
375 |
public void clicListeInstitution(Structure institution) {
|
375 |
public void clicListeInstitution(Structure institution) {
|
376 |
((StructureDetailPanneauVue) Registry.get(RegistreId.PANNEAU_INSTITUTION_DETAIL)).rafraichir(institution);
|
376 |
((StructureDetailPanneauVue) Registry.get(RegistreId.PANNEAU_INSTITUTION_DETAIL)).rafraichir(institution);
|
377 |
}
|
377 |
}
|
378 |
|
378 |
|
379 |
public void afficherListeStructures(StructureListe nouvelleDonnees) {
|
379 |
public void afficherListeStructures(StructureListe nouvelleDonnees) {
|
380 |
// TODO : créer dès l'initialisation de l'application InsitutionVue et la cacher
|
380 |
// TODO : créer dès l'initialisation de l'application InsitutionVue et la cacher
|
381 |
StructureVue institutionVue = new StructureVue();
|
381 |
StructureVue institutionVue = new StructureVue();
|
382 |
panneauCentre.add(institutionVue);
|
382 |
panneauCentre.add(institutionVue);
|
383 |
panneauCentre.setId(ComposantId.PANNEAU_STRUCTURE_LISTE);
|
383 |
panneauCentre.setId(ComposantId.PANNEAU_STRUCTURE_LISTE);
|
384 |
contenuPanneauCentre = institutionVue;
|
384 |
contenuPanneauCentre = institutionVue;
|
385 |
institutionVue.rafraichir(nouvelleDonnees);
|
385 |
institutionVue.rafraichir(nouvelleDonnees);
|
386 |
}
|
386 |
}
|
387 |
|
387 |
|
388 |
public void clicAjouterStructure() {
|
388 |
public void clicAjouterStructure() {
|
389 |
panneauCentre.removeAll();
|
389 |
panneauCentre.removeAll();
|
390 |
FormStructureVue formStructureVue = new FormStructureVue();
|
390 |
FormStructureVue formStructureVue = new FormStructureVue();
|
391 |
panneauCentre.add(formStructureVue);
|
391 |
panneauCentre.add(formStructureVue);
|
392 |
panneauCentre.setId(ComposantId.PANNEAU_STRUCTURE_FORM);
|
392 |
panneauCentre.setId(ComposantId.PANNEAU_STRUCTURE_FORM);
|
393 |
panneauCentre.layout();
|
393 |
panneauCentre.layout();
|
394 |
}
|
394 |
}
|
395 |
|
- |
|
396 |
/**
|
395 |
|
397 |
* TODO : afficher un message du type "Structure ajoutée".
|
396 |
public void clicModifierStructure(List<Structure> structureSelection) {
|
- |
|
397 |
if (structureSelection.size() == 0) {
|
- |
|
398 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
- |
|
399 |
} else if(structureSelection.size() > 1) {
|
- |
|
400 |
Info.display("Information", "Veuillez sélectionner une seule structure à la fois.");
|
- |
|
401 |
} else if(structureSelection.size() == 1) {
|
- |
|
402 |
panneauCentre.removeAll();
|
398 |
* Lance la creation d'une structure
|
403 |
FormStructureVue formStructureVue = new FormStructureVue();
|
- |
|
404 |
panneauCentre.add(formStructureVue);
|
399 |
* @param les données de la structure saisie
|
405 |
panneauCentre.setId(ComposantId.PANNEAU_STRUCTURE_FORM);
|
400 |
*/
|
406 |
|
401 |
public void ajouterStructure(Rafraichissable vue, Structure structure) {
|
407 |
selectionnerStructure(formStructureVue, structureSelection.get(0).getId());
|
- |
|
408 |
selectionnerStructureAPersonne(formStructureVue, structureSelection.get(0).getId(), StructureAPersonne.ROLE_EQUIPE);
|
- |
|
409 |
|
- |
|
410 |
panneauCentre.layout();
|
- |
|
411 |
} else {
|
- |
|
412 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierStructure() du Médiateur.");
|
- |
|
413 |
}
|
402 |
modele.ajouterStructure(vue, getUtilisateurId(), structure);
|
414 |
|
403 |
}
|
415 |
}
|
404 |
|
416 |
|
405 |
public void clicSupprimerStructure(Rafraichissable vue, List<Structure> structureSelection) {
|
417 |
public void clicSupprimerStructure(Rafraichissable vue, List<Structure> structureSelection) {
|
406 |
if (structureSelection.size() == 0) {
|
418 |
if (structureSelection.size() == 0) {
|
407 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
419 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
408 |
} else if(structureSelection.size() > 0) {
|
420 |
} else if(structureSelection.size() > 0) {
|
409 |
String message = "Êtes vous sur de vouloir supprimer les structures sélectionnées ?";
|
421 |
String message = "Êtes vous sur de vouloir supprimer les structures sélectionnées ?";
|
410 |
if (structureSelection.size() == 1) {
|
422 |
if (structureSelection.size() == 1) {
|
411 |
message = "Êtes vous sur de vouloir supprimer la structure sélectionnée ?";
|
423 |
message = "Êtes vous sur de vouloir supprimer la structure sélectionnée ?";
|
412 |
}
|
424 |
}
|
413 |
if(Window.confirm(message)) {
|
425 |
if(Window.confirm(message)) {
|
414 |
String idStr = "" ;
|
426 |
String idStr = "" ;
|
415 |
for(int i = 0 ; i < structureSelection.size() ; i++) {
|
427 |
for(int i = 0 ; i < structureSelection.size() ; i++) {
|
416 |
idStr += structureSelection.get(i).getId()+"," ;
|
428 |
idStr += structureSelection.get(i).getId()+"," ;
|
417 |
}
|
429 |
}
|
418 |
modele.supprimerStructure(vue, getUtilisateurId(), idStr);
|
430 |
modele.supprimerStructure(vue, getUtilisateurId(), idStr);
|
419 |
}
|
431 |
}
|
420 |
} else {
|
432 |
} else {
|
421 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerStructure() du Médiateur.");
|
433 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerStructure() du Médiateur.");
|
422 |
}
|
434 |
}
|
423 |
}
|
435 |
}
|
424 |
|
436 |
|
425 |
public void clicModifierStructure(List<Structure> structureSelection) {
|
- |
|
426 |
if(structureSelection.size() == 0) {
|
- |
|
427 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
- |
|
428 |
} else if(structureSelection.size() > 1) {
|
- |
|
429 |
Info.display("Information", "Veuillez sélectionner une seule structure à la fois.");
|
437 |
public void selectionnerStructure(Rafraichissable vue, String structureId) {
|
430 |
} else if(structureSelection.size() == 1) {
|
- |
|
431 |
panneauCentre.removeAll();
|
438 |
GWT.log("Structure : "+structureId, null);
|
432 |
FormStructureVue formStructureVue = new FormStructureVue();
|
- |
|
433 |
panneauCentre.add(formStructureVue);
|
- |
|
- |
|
439 |
modele.selectionnerStructure(vue, getUtilisateurId(), null, structureId);
|
434 |
panneauCentre.setId(ComposantId.PANNEAU_STRUCTURE_FORM);
|
440 |
}
|
- |
|
441 |
|
435 |
|
442 |
/**
|
436 |
String idStr = "" ;
|
443 |
* TODO : afficher un message du type "Structure ajoutée".
|
437 |
for(int i = 0 ; i < structureSelection.size() ; i++) {
|
444 |
* Lance la creation d'une structure
|
438 |
idStr = structureSelection.get(i).getId();
|
445 |
* @param les données de la structure saisie
|
439 |
}
|
446 |
*/
|
440 |
selectionnerStructureAPersonne(formStructureVue, idStr, StructureAPersonne.ROLE_EQUIPE);
|
- |
|
441 |
|
- |
|
442 |
panneauCentre.layout();
|
- |
|
443 |
} else {
|
447 |
public void ajouterStructure(Rafraichissable vue, Structure structure) {
|
444 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierStructure() du Médiateur.");
|
- |
|
445 |
}
|
- |
|
446 |
|
448 |
modele.ajouterStructure(vue, getUtilisateurId(), structure);
|
447 |
}
|
449 |
}
|
448 |
|
450 |
|
449 |
public void modifierStructure(Rafraichissable vue, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
|
451 |
public void modifierStructure(Rafraichissable vue, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
|
450 |
modele.modifierStructure(vue, getUtilisateurId(), structure, conservation, valorisation);
|
452 |
modele.modifierStructure(vue, getUtilisateurId(), structure, conservation, valorisation);
|
451 |
}
|
453 |
}
|
- |
|
454 |
|
- |
|
455 |
//+----------------------------------------------------------------------------------------------------------------+
|
452 |
|
456 |
// GESTION de la relation STRUCTURE A PERSONNE
|
- |
|
457 |
public void selectionnerStructureAPersonne(Rafraichissable vue, String structureId, String roleId) {
|
453 |
public void selectionnerStructureAPersonne(Rafraichissable vue, String structureId, String roleId) {
|
458 |
GWT.log("Structure : "+structureId, null);
|
454 |
modele.selectionnerStructure(vue, getUtilisateurId(), null, structureId, roleId);
|
459 |
modele.selectionnerStructureAPersonne(vue, getUtilisateurId(), null, structureId, roleId);
|
455 |
}
|
460 |
}
|
456 |
|
461 |
|
457 |
public void modifierStructureAPersonne(Rafraichissable vue, StructureAPersonneListe personnelModifie) {
|
462 |
public void modifierStructureAPersonne(Rafraichissable vue, StructureAPersonneListe personnelModifie) {
|
458 |
if (personnelModifie != null && personnelModifie.size() > 0) {
|
463 |
if (personnelModifie != null && personnelModifie.size() > 0) {
|
459 |
GWT.log("Mediateur :modif", null);
|
464 |
GWT.log("Mediateur :modif", null);
|
460 |
for (Iterator<String> it = personnelModifie.keySet().iterator(); it.hasNext();) {
|
465 |
for (Iterator<String> it = personnelModifie.keySet().iterator(); it.hasNext();) {
|
461 |
modele.modifierStructureAPersonne(vue, getUtilisateurId(), (StructureAPersonne) personnelModifie.get(it.next()));
|
466 |
modele.modifierStructureAPersonne(vue, getUtilisateurId(), (StructureAPersonne) personnelModifie.get(it.next()));
|
462 |
}
|
467 |
}
|
463 |
}
|
468 |
}
|
464 |
}
|
469 |
}
|
465 |
|
470 |
|
466 |
public void ajouterStructureAPersonne(Rafraichissable vue, String structureId, StructureAPersonneListe personnelAjoute) {
|
471 |
public void ajouterStructureAPersonne(Rafraichissable vue, String structureId, StructureAPersonneListe personnelAjoute) {
|
467 |
if (personnelAjoute != null && personnelAjoute.size() > 0) {
|
472 |
if (personnelAjoute != null && personnelAjoute.size() > 0) {
|
468 |
for (Iterator<String> it = personnelAjoute.keySet().iterator(); it.hasNext();) {
|
473 |
for (Iterator<String> it = personnelAjoute.keySet().iterator(); it.hasNext();) {
|
469 |
modele.ajouterStructureAPersonne(vue, getUtilisateurId(), structureId, (StructureAPersonne) personnelAjoute.get(it.next()));
|
474 |
modele.ajouterStructureAPersonne(vue, getUtilisateurId(), structureId, (StructureAPersonne) personnelAjoute.get(it.next()));
|
470 |
}
|
475 |
}
|
471 |
}
|
476 |
}
|
472 |
}
|
477 |
}
|
473 |
|
478 |
|
474 |
public void supprimerStructureAPersonne(Rafraichissable vue, StructureAPersonneListe personnelSupprime) {
|
479 |
public void supprimerStructureAPersonne(Rafraichissable vue, StructureAPersonneListe personnelSupprime) {
|
475 |
if (personnelSupprime != null && personnelSupprime.size() > 0) {
|
480 |
if (personnelSupprime != null && personnelSupprime.size() > 0) {
|
476 |
String idStrAPer = "" ;
|
481 |
String idStrAPer = "" ;
|
477 |
for (Iterator<String> it = personnelSupprime.keySet().iterator(); it.hasNext();) {
|
482 |
for (Iterator<String> it = personnelSupprime.keySet().iterator(); it.hasNext();) {
|
478 |
idStrAPer += personnelSupprime.get(it.next()).getId()+"," ;
|
483 |
idStrAPer += personnelSupprime.get(it.next()).getId()+"," ;
|
479 |
}
|
484 |
}
|
480 |
modele.supprimerStructureAPersonne(vue, getUtilisateurId(), idStrAPer);
|
485 |
modele.supprimerStructureAPersonne(vue, getUtilisateurId(), idStrAPer);
|
481 |
}
|
486 |
}
|
482 |
}
|
487 |
}
|
483 |
|
488 |
|
484 |
//+----------------------------------------------------------------------------------------------------------------+
|
489 |
//+----------------------------------------------------------------------------------------------------------------+
|
485 |
// GESTION des PROJETS
|
490 |
// GESTION des PROJETS
|
486 |
//+----------------------------------------------------------------------------------------------------------------+
|
491 |
//+----------------------------------------------------------------------------------------------------------------+
|
487 |
|
492 |
|
488 |
/**
|
493 |
/**
|
489 |
* Retourne l'identifiant du projet courrant de l'application.
|
494 |
* Retourne l'identifiant du projet courrant de l'application.
|
490 |
*/
|
495 |
*/
|
491 |
public String getProjetId() {
|
496 |
public String getProjetId() {
|
492 |
return Registry.get(RegistreId.PROJET);
|
497 |
return Registry.get(RegistreId.PROJET);
|
493 |
}
|
498 |
}
|
494 |
|
499 |
|
495 |
//Greg : ajout d'un écouteur pour le changement liste projet
|
500 |
//Greg : ajout d'un écouteur pour le changement liste projet
|
496 |
public void rafraichirListeProjets() {
|
501 |
public void rafraichirListeProjets() {
|
497 |
((Modele) Registry.get(RegistreId.MODELE)).obtenirListeProjets();
|
502 |
((Modele) Registry.get(RegistreId.MODELE)).obtenirListeProjets();
|
498 |
}
|
503 |
}
|
499 |
|
504 |
|
500 |
public void afficherListeProjets(ProjetsListe projets) {
|
505 |
public void afficherListeProjets(ProjetsListe projets) {
|
501 |
((MenuPanneauVue) Registry.get(RegistreId.PANNEAU_OUEST)).rafraichir(projets);
|
506 |
((MenuPanneauVue) Registry.get(RegistreId.PANNEAU_OUEST)).rafraichir(projets);
|
502 |
}
|
507 |
}
|
503 |
|
508 |
|
504 |
public void selectionnerProjet(String selectedIndexValue) {
|
509 |
public void selectionnerProjet(String selectedIndexValue) {
|
505 |
Registry.register(RegistreId.PROJET, selectedIndexValue);
|
510 |
Registry.register(RegistreId.PROJET, selectedIndexValue);
|
506 |
if (contenuPanneauCentre instanceof PersonneVue) {
|
511 |
if (contenuPanneauCentre instanceof PersonneVue) {
|
507 |
((Modele) Registry.get(RegistreId.MODELE)).obtenirListePersonnes();
|
512 |
((Modele) Registry.get(RegistreId.MODELE)).obtenirListePersonnes();
|
508 |
//FIXME Le rafraichissement du panneau ne se fait pas!
|
513 |
//FIXME Le rafraichissement du panneau ne se fait pas!
|
509 |
}
|
514 |
}
|
510 |
}
|
515 |
}
|
511 |
|
516 |
|
512 |
}
|
517 |
}
|
513 |
|
518 |
|
514 |
|
519 |
|
515 |
|
520 |
|
516 |
|
521 |
|
517 |
|
522 |
|
518 |
|
523 |
|
519 |
|
524 |
|
520 |
|
525 |
|
521 |
|
526 |
|
522 |
|
527 |
|
523 |
|
528 |
|
524 |
|
529 |
|
525 |
|
530 |
|
526 |
|
531 |
|
527 |
|
532 |
|
528 |
|
533 |
|
529 |
|
534 |
|
530 |
|
535 |
|