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