| Line 27... |
Line 27... |
| 27 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
27 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
| 28 |
import com.extjs.gxt.ui.client.event.Events;
|
28 |
import com.extjs.gxt.ui.client.event.Events;
|
| 29 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
29 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
| 30 |
import com.extjs.gxt.ui.client.store.ListStore;
|
30 |
import com.extjs.gxt.ui.client.store.ListStore;
|
| 31 |
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
31 |
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
| - |
|
32 |
import com.extjs.gxt.ui.client.widget.Info;
|
| 32 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
33 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
| 33 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
34 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
| 34 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
35 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
| 35 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
36 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
| 36 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
37 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
| Line 98... |
Line 99... |
| 98 |
|
99 |
|
| 99 |
String modeDeCreation = (UtilString.isEmpty(publication.getId()) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
|
100 |
String modeDeCreation = (UtilString.isEmpty(publication.getId()) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
|
| Line 100... |
Line 101... |
| 100 |
initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.PUBLICATION);
|
101 |
initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.PUBLICATION);
|
| 101 |
|
102 |
|
| 102 |
panneauFormulaire.setLayout(new FlowLayout());
|
- |
|
| 103 |
String titre = genererTitreFormulaire();
|
103 |
panneauFormulaire.setLayout(new FlowLayout());
|
| 104 |
panneauFormulaire.setHeading(titre);
|
104 |
genererTitreFormulaire();
|
| 105 |
|
105 |
|
| Line 106... |
Line 106... |
| 106 |
creerZoneAuteurs();
|
106 |
creerZoneAuteurs();
|
| 107 |
panneauFormulaire.add(auteursFieldset);
|
107 |
panneauFormulaire.add(auteursFieldset);
|
| Line 116... |
Line 116... |
| 116 |
mediateurCourrant.selectionnerPublication(this, publicationId);
|
116 |
mediateurCourrant.selectionnerPublication(this, publicationId);
|
| 117 |
mediateurCourrant.selectionnerPublicationAPersonne(this, publicationId, null, PublicationAPersonne.ROLE_AUTEUR);
|
117 |
mediateurCourrant.selectionnerPublicationAPersonne(this, publicationId, null, PublicationAPersonne.ROLE_AUTEUR);
|
| 118 |
}
|
118 |
}
|
| 119 |
}
|
119 |
}
|
| Line 120... |
Line 120... |
| 120 |
|
120 |
|
| 121 |
private String genererTitreFormulaire() {
|
121 |
private void genererTitreFormulaire() {
|
| 122 |
String titre = i18nC.publicationTitreFormAjout();
|
122 |
String titre = i18nC.publicationTitreFormAjout();
|
| - |
|
123 |
if (mode.equals(Formulaire.MODE_MODIFIER)) {
|
| - |
|
124 |
titre = i18nC.publicationTitreFormModif();
|
| 123 |
if (mode.equals(Formulaire.MODE_MODIFIER)) {
|
125 |
if (publication != null) {
|
| - |
|
126 |
titre += " - "+i18nC.id()+": "+publication.getId();
|
| 124 |
titre = i18nC.publicationTitreFormModif()+" - "+i18nC.id()+": "+publication.getId();
|
127 |
}
|
| 125 |
}
|
128 |
}
|
| 126 |
return titre;
|
129 |
panneauFormulaire.setHeading(titre);
|
| Line 127... |
Line 130... |
| 127 |
}
|
130 |
}
|
| 128 |
|
131 |
|
| 129 |
private void creerZoneAuteurs() {
|
132 |
private void creerZoneAuteurs() {
|
| Line 362... |
Line 365... |
| 362 |
}
|
365 |
}
|
| Line 363... |
Line 366... |
| 363 |
|
366 |
|
| 364 |
private void rafraichirPublication(Publication publi) {
|
367 |
private void rafraichirPublication(Publication publi) {
|
| 365 |
publication = publi;
|
368 |
publication = publi;
|
| - |
|
369 |
peuplerFormulaire();
|
| 366 |
peuplerFormulaire();
|
370 |
genererTitreFormulaire();
|
| Line 367... |
Line 371... |
| 367 |
}
|
371 |
}
|
| 368 |
|
372 |
|
| 369 |
private void rafraichirListeEditeurs(StructureListe editeurs) {
|
373 |
private void rafraichirListeEditeurs(StructureListe editeurs) {
|
| Line 380... |
Line 384... |
| 380 |
publicationAPersonneListe = auteurs;
|
384 |
publicationAPersonneListe = auteurs;
|
| 381 |
publicationAPersonneListeChargementOk = true;
|
385 |
publicationAPersonneListeChargementOk = true;
|
| 382 |
}
|
386 |
}
|
| Line 383... |
Line 387... |
| 383 |
|
387 |
|
| - |
|
388 |
private void rafraichirInformation(Information info) {
|
| - |
|
389 |
String type = info.getType();
|
| - |
|
390 |
if (type.equals("ajout_publication") || type.equals("modif_publication")) {
|
| - |
|
391 |
publicationValideOk = true;
|
| - |
|
392 |
if (vueExterneARafraichirApresValidation != null) {
|
| - |
|
393 |
publication.setId((String) info.getDonnee(0));
|
| - |
|
394 |
}
|
| - |
|
395 |
|
| - |
|
396 |
if (mode.equals(Formulaire.MODE_AJOUTER)) {
|
| - |
|
397 |
attenteAjoutAuteursOk = true;
|
| - |
|
398 |
mediateur.ajouterPublicationAPersonne(this, publication.getId(), auteursAjoutes, PublicationAPersonne.ROLE_AUTEUR);
|
| - |
|
399 |
}
|
| - |
|
400 |
}
|
| 384 |
private void rafraichirInformation(Information info) {
|
401 |
|
| 385 |
if (info.getType().equals("liste_personne")) {
|
402 |
if (info.getType().equals("liste_personne")) {
|
| Line 386... |
Line 403... |
| 386 |
PersonneListe listePersonneAuteur = (PersonneListe) info.getDonnee(0);
|
403 |
PersonneListe listePersonneAuteur = (PersonneListe) info.getDonnee(0);
|
| 387 |
|
404 |
|
| 388 |
List<Personne> liste = listePersonneAuteur.toList();
|
405 |
List<Personne> liste = listePersonneAuteur.toList();
|
| Line 389... |
Line 406... |
| 389 |
auteursStorePartage.removeAll();
|
406 |
auteursStorePartage.removeAll();
|
| 390 |
auteursStorePartage.add(liste);
|
- |
|
| 391 |
|
- |
|
| 392 |
auteurStorePartageChargementOk = true;
|
- |
|
| 393 |
} else if (info.getType().equals("publication_valide")) {
|
- |
|
| 394 |
publicationValideOk = true;
|
- |
|
| 395 |
publication.setId((String) info.getDonnee(0));
|
- |
|
| 396 |
|
- |
|
| 397 |
if (mode.equals(Formulaire.MODE_AJOUTER)) {
|
- |
|
| 398 |
attenteAjoutAuteursOk = true;
|
407 |
auteursStorePartage.add(liste);
|
| 399 |
mediateur.ajouterPublicationAPersonne(this, publication.getId(), auteursAjoutes, PublicationAPersonne.ROLE_AUTEUR);
|
408 |
|
| 400 |
}
|
409 |
auteurStorePartageChargementOk = true;
|
| 401 |
} else if (info.getType().equals("ajout_publication_a_personne")) {
|
410 |
} else if (info.getType().equals("ajout_publication_a_personne")) {
|
| 402 |
attenteAjoutAuteursOk = false;
|
411 |
attenteAjoutAuteursOk = false;
|
| 403 |
GWT.log("attenteAjoutAuteursOk", null);
|
412 |
GWT.log("attenteAjoutAuteursOk", null);
|
| - |
|
413 |
} else if (info.getType().equals("suppression_publication_a_personne")) {
|
| - |
|
414 |
attenteSuppressionAuteursOk = false;
|
| - |
|
415 |
GWT.log("attenteSuppressionAuteursOk", null);
|
| - |
|
416 |
} else if (info.getType().equals("modif_publication")) {
|
| - |
|
417 |
Info.display("Modification d'une publication", info.toString());
|
| - |
|
418 |
} else if (info.getType().equals("ajout_publication")) {
|
| - |
|
419 |
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
|
| - |
|
420 |
String publicationId = (String) info.getDonnee(0);
|
| - |
|
421 |
Info.display("Ajout d'une publication", "La publication '"+publicationId+"' a bien été ajoutée");
|
| - |
|
422 |
if (vueExterneARafraichirApresValidation != null) {
|
| - |
|
423 |
publication.setId(publicationId);
|
| - |
|
424 |
}
|
| 404 |
} else if (info.getType().equals("suppression_publication_a_personne")) {
|
425 |
} else {
|
| Line 405... |
Line 426... |
| 405 |
attenteSuppressionAuteursOk = false;
|
426 |
Info.display("Ajout d'une publication", info.toString());
|
| 406 |
GWT.log("attenteSuppressionAuteursOk", null);
|
427 |
}
|
| 407 |
}
|
428 |
}
|