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