| Line 9... |
Line 9... |
| 9 |
import org.tela_botanica.client.ComposantId;
|
9 |
import org.tela_botanica.client.ComposantId;
|
| 10 |
import org.tela_botanica.client.Mediateur;
|
10 |
import org.tela_botanica.client.Mediateur;
|
| 11 |
import org.tela_botanica.client.RegistreId;
|
11 |
import org.tela_botanica.client.RegistreId;
|
| 12 |
import org.tela_botanica.client.configuration.Configuration;
|
12 |
import org.tela_botanica.client.configuration.Configuration;
|
| 13 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
13 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
| 14 |
import org.tela_botanica.client.modeles.Valeur;
|
- |
|
| 15 |
import org.tela_botanica.client.modeles.ValeurListe;
|
14 |
import org.tela_botanica.client.modeles.ValeurListe;
|
| 16 |
import org.tela_botanica.client.modeles.personne.Personne;
|
15 |
import org.tela_botanica.client.modeles.personne.Personne;
|
| 17 |
import org.tela_botanica.client.modeles.publication.Publication;
|
16 |
import org.tela_botanica.client.modeles.publication.Publication;
|
| 18 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
|
17 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
|
| 19 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
|
18 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
|
| - |
|
19 |
import org.tela_botanica.client.synchronisation.Sequenceur;
|
| 20 |
import org.tela_botanica.client.util.Debug;
|
20 |
import org.tela_botanica.client.util.Debug;
|
| 21 |
import org.tela_botanica.client.vues.DetailVue;
|
21 |
import org.tela_botanica.client.vues.DetailVue;
|
| Line 22... |
Line 22... |
| 22 |
|
22 |
|
| 23 |
import com.extjs.gxt.ui.client.Registry;
|
23 |
import com.extjs.gxt.ui.client.Registry;
|
| Line 47... |
Line 47... |
| 47 |
private TabItem tabPublications;
|
47 |
private TabItem tabPublications;
|
| Line 48... |
Line 48... |
| 48 |
|
48 |
|
| Line 49... |
Line 49... |
| 49 |
private HashMap hmLabelFieldRegion = new HashMap();
|
49 |
private HashMap hmLabelFieldRegion = new HashMap();
|
| 50 |
|
50 |
|
| 51 |
private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
|
51 |
private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
|
| Line 52... |
Line 52... |
| 52 |
private boolean ontologieRecue = false;
|
52 |
//private boolean ontologieRecue = false;
|
| 53 |
private Personne personneAAfficher = null;
|
53 |
private Personne personneAAfficher = null;
|
| 54 |
|
54 |
|
| Line 55... |
Line 55... |
| 55 |
private boolean personneAffichee = false;
|
55 |
//private boolean personneAffichee = false;
|
| 56 |
private String tableauPublicationsLieesTpl = "";
|
- |
|
| 57 |
private String lignePublicationLieeTpl = "";
|
- |
|
| 58 |
|
- |
|
| 59 |
private void chargerOntologie() {
|
- |
|
| 60 |
mediateur.obtenirListeValeurEtRafraichir(this, "pays");
|
- |
|
| Line 61... |
Line 56... |
| 61 |
mediateur.obtenirListeValeurEtRafraichir(this, "tel");
|
56 |
private String tableauPublicationsLieesTpl = "";
|
| 62 |
mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication");
|
57 |
private String lignePublicationLieeTpl = "";
|
| 63 |
}
|
- |
|
| 64 |
|
58 |
|
| - |
|
59 |
private Sequenceur sequenceur = new Sequenceur();
|
| 65 |
|
60 |
|
| Line 66... |
Line 61... |
| 66 |
public PersonneDetailVue(Mediateur mediateur) {
|
61 |
public PersonneDetailVue(Mediateur mediateur) {
|
| 67 |
super(mediateur);
|
62 |
super(mediateur);
|
| Line 87... |
Line 82... |
| 87 |
tabAdresse.setScrollMode(Scroll.AUTO);
|
82 |
tabAdresse.setScrollMode(Scroll.AUTO);
|
| Line 88... |
Line 83... |
| 88 |
|
83 |
|
| 89 |
tabInfosNat = new TabItem(i18nC.personneInfoNat());
|
84 |
tabInfosNat = new TabItem(i18nC.personneInfoNat());
|
| Line 90... |
Line -... |
| 90 |
tabInfosNat.setScrollMode(Scroll.AUTO);
|
- |
|
| 91 |
|
85 |
tabInfosNat.setScrollMode(Scroll.AUTO);
|
| 92 |
//Greg : ajout d'un résumé des publications
|
86 |
|
| 93 |
tabPublications = new TabItem(i18nC.tabPublications());
|
87 |
tabPublications = new TabItem(i18nC.tabPublications());
|
| Line 94... |
Line 88... |
| 94 |
tabPublications.setScrollMode(Scroll.AUTO);
|
88 |
tabPublications.setScrollMode(Scroll.AUTO);
|
| Line 320... |
Line 314... |
| 320 |
Collection<String> colClesComposants = hmLabelFieldRegion.keySet();
|
314 |
Collection<String> colClesComposants = hmLabelFieldRegion.keySet();
|
| 321 |
Iterator<String> itComposants = colClesComposants.iterator();
|
315 |
Iterator<String> itComposants = colClesComposants.iterator();
|
| Line 322... |
Line 316... |
| 322 |
|
316 |
|
| 323 |
while (itComposants.hasNext()) {
|
317 |
while (itComposants.hasNext()) {
|
| 324 |
String region = itComposants.next();
|
318 |
String region = itComposants.next();
|
| 325 |
mediateur.obtenirValeurEtRafraichir(this, "region", region);
|
319 |
mediateur.obtenirValeurEtRafraichir(this, "region", region, sequenceur);
|
| 326 |
}
|
320 |
}
|
| Line 327... |
Line 321... |
| 327 |
}
|
321 |
}
|
| 328 |
|
322 |
|
| Line 430... |
Line 424... |
| 430 |
afficherOnglet(tableauPublicationsLieesTpl, paramsPublis, tabPublications);
|
424 |
afficherOnglet(tableauPublicationsLieesTpl, paramsPublis, tabPublications);
|
| Line 431... |
Line 425... |
| 431 |
|
425 |
|
| Line 432... |
Line 426... |
| 432 |
}
|
426 |
}
|
| 433 |
|
- |
|
| 434 |
public void rafraichir(Object nouvellesDonnees) {
|
- |
|
| 435 |
|
- |
|
| 436 |
// FIXME : Ci-dessous, on utilise le booléen personneAffichee pour éviter un affichage répété de personnes.
|
- |
|
| 437 |
// Se règlerait avec une gestion Synchrone/Asynchrone
|
- |
|
| 438 |
|
- |
|
| 439 |
// Si on a reçu une personne on en affiche les détails
|
- |
|
| 440 |
if (nouvellesDonnees instanceof Personne) {
|
- |
|
| 441 |
personneAAfficher = (Personne) nouvellesDonnees;
|
- |
|
| 442 |
personneAffichee = false;
|
- |
|
| 443 |
} else if (nouvellesDonnees instanceof ValeurListe) {
|
- |
|
| 444 |
ValeurListe ontologieReceptionnee = (ValeurListe) nouvellesDonnees;
|
- |
|
| 445 |
ajouterListeValeursAOntologie(ontologieReceptionnee);
|
- |
|
| 446 |
ontologieRecue = true;
|
- |
|
| 447 |
|
- |
|
| 448 |
// Remplacer ci-dessous par Ontologie
|
- |
|
| 449 |
ValeurListe listeValeur = (ValeurListe) nouvellesDonnees;
|
- |
|
| 450 |
if (listeValeur.getId().equals(config.getListeId("region"))) {
|
- |
|
| 451 |
|
- |
|
| 452 |
Collection colCleListeValeur = listeValeur.keySet();
|
- |
|
| 453 |
Iterator<String> itLv = colCleListeValeur.iterator();
|
- |
|
| 454 |
while (itLv.hasNext()) {
|
- |
|
| 455 |
String idRegion = itLv.next();
|
- |
|
| 456 |
Valeur region = listeValeur.get(idRegion);
|
- |
|
| 457 |
|
- |
|
| 458 |
if (region != null) {
|
- |
|
| 459 |
|
- |
|
| 460 |
String strRegionId = region.getAbreviation();
|
- |
|
| 461 |
|
- |
|
| 462 |
LinkedList<LabelField> listComposantsRegion = (LinkedList) hmLabelFieldRegion.get(strRegionId);
|
- |
|
| 463 |
for (int i = 0; i < listComposantsRegion.size(); i++) {
|
- |
|
| 464 |
LabelField lfRegion = listComposantsRegion.get(i);
|
- |
|
| Line 465... |
Line 427... |
| 465 |
lfRegion.setFieldLabel(region.getNom());
|
427 |
|
| 466 |
}
|
- |
|
| 467 |
|
- |
|
| - |
|
428 |
public void rafraichir(Object nouvellesDonnees) {
|
| - |
|
429 |
|
| - |
|
430 |
if (nouvellesDonnees instanceof ValeurListe) {
|
| 468 |
}
|
431 |
ajouterListeValeursAOntologie((ValeurListe) nouvellesDonnees);
|
| 469 |
}
|
432 |
} else if (nouvellesDonnees instanceof Personne) {
|
| 470 |
}
|
433 |
afficherDetailPersonne((Personne) nouvellesDonnees);
|
| 471 |
} else if (nouvellesDonnees instanceof PublicationAPersonneListe) {
|
- |
|
| 472 |
afficherPublications((PublicationAPersonneListe) nouvellesDonnees);
|
- |
|
| 473 |
}
|
- |
|
| 474 |
|
- |
|
| 475 |
if (ontologieRecue && personneAAfficher != null && personneAffichee == false) {
|
- |
|
| 476 |
afficherDetailPersonne(personneAAfficher);
|
434 |
} else if (nouvellesDonnees instanceof PublicationAPersonneListe) {
|
| Line 477... |
Line 435... |
| 477 |
personneAffichee = true;
|
435 |
afficherPublications((PublicationAPersonneListe) nouvellesDonnees);
|
| 478 |
}
|
436 |
}
|