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