Subversion Repositories eFlore/Applications.coel

Rev

Rev 1182 | Rev 1255 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1182 Rev 1218
Line 4... Line 4...
4
import java.util.Iterator;
4
import java.util.Iterator;
5
import java.util.List;
5
import java.util.List;
Line 6... Line 6...
6
 
6
 
7
import org.tela_botanica.client.ComposantClass;
7
import org.tela_botanica.client.ComposantClass;
-
 
8
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.Mediateur;
9
import org.tela_botanica.client.composants.InfoLogger;
9
import org.tela_botanica.client.images.Images;
10
import org.tela_botanica.client.images.Images;
10
import org.tela_botanica.client.interfaces.Rafraichissable;
11
import org.tela_botanica.client.interfaces.Rafraichissable;
11
import org.tela_botanica.client.modeles.Information;
12
import org.tela_botanica.client.modeles.Information;
12
import org.tela_botanica.client.modeles.MenuApplicationId;
13
import org.tela_botanica.client.modeles.MenuApplicationId;
Line 123... Line 124...
123
	private void genererTitreFormulaire() {
124
	private void genererTitreFormulaire() {
124
		String titre = i18nC.publicationTitreFormAjout();
125
		String titre = i18nC.publicationTitreFormAjout();
125
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
126
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
126
			 titre = i18nC.publicationTitreFormModif();
127
			 titre = i18nC.publicationTitreFormModif();
127
			 if (publication != null) {
128
			 if (publication != null) {
128
				 titre += " - "+i18nC.id()+": "+publication.getId();
129
				 titre += " - "+i18nC.id()+": "+publication.getId()+" - "+publication.getObjetDeLaPublication();
129
			 }
130
			 }
130
		}
131
		}
131
		panneauFormulaire.setHeading(titre);
132
		panneauFormulaire.setHeading(titre);
132
	}
133
	}
-
 
134
 
Line 133... Line 135...
133
	
135
	
134
	private void creerZoneAuteurs() {
136
	private void creerZoneAuteurs() {
135
		FormLayout layout = new FormLayout();
137
		FormLayout layout = new FormLayout();
Line 371... Line 373...
371
		}
373
		}
Line 372... Line 374...
372
		
374
		
373
		if (etreValide()) {
375
		if (etreValide()) {
374
			initialiserValidation();
376
			initialiserValidation();
375
			repandreRafraichissement();
377
			repandreRafraichissement();
376
			controlerFermetureApresRafraichissement();
378
			controlerFermeture();
377
		}
379
		}
Line 378... Line 380...
378
	}
380
	}
379
	
381
	
Line 411... Line 413...
411
		Debug.log("Réception liste des auteurs : "+auteurs.size());
413
		Debug.log("Réception liste des auteurs : "+auteurs.size());
412
		publicationAPersonneListeChargementOk = true;
414
		publicationAPersonneListeChargementOk = true;
413
	}
415
	}
Line 414... Line 416...
414
	
416
	
-
 
417
	private void rafraichirInformation(Information info) {
-
 
418
Debug.log("<8-8> BEGIN PublicationForm.rafraichirInformation()");		
415
	private void rafraichirInformation(Information info) {
419
		
416
		String type = info.getType();
420
		String type = info.getType();
417
		if (type.equals("ajout_publication") || type.equals("modif_publication")) {
421
		if (type.equals("ajout_publication") || type.equals("modif_publication")) {
418
			publicationValideOk = true;
422
			publicationValideOk = true;
419
			if (mode.equals(Formulaire.MODE_AJOUTER)) {
423
			if (mode.equals(Formulaire.MODE_AJOUTER)) {
Line 422... Line 426...
422
					if (publicationId.matches("[0-9]+")) {
426
					if (publicationId.matches("[0-9]+")) {
423
						publication.setId(publicationId);
427
						publication.setId(publicationId);
424
					}
428
					}
425
				}
429
				}
426
				attenteAjoutAuteursOk = true;
430
				attenteAjoutAuteursOk = true;
-
 
431
				
-
 
432
Debug.log("<8-8> PublicationForm.rafraichirInformation() - Appel à mediateur.ajouterPublicationAPersonne()");				
427
				mediateur.ajouterPublicationAPersonne(this, publication.getId(), auteursAjoutes, PublicationAPersonne.ROLE_AUTEUR);
433
				mediateur.ajouterPublicationAPersonne(this, publication.getId(), auteursAjoutes, PublicationAPersonne.ROLE_AUTEUR);
428
			}
434
			}
429
		}
435
		}
Line 430... Line 436...
430
		
436
		
Line 441... Line 447...
441
			Debug.log("attenteAjoutAuteursOk");
447
			Debug.log("attenteAjoutAuteursOk");
442
		} else if (info.getType().equals("suppression_publication_a_personne")) {
448
		} else if (info.getType().equals("suppression_publication_a_personne")) {
443
			attenteSuppressionAuteursOk = false;
449
			attenteSuppressionAuteursOk = false;
444
			Debug.log("attenteSuppressionAuteursOk");
450
			Debug.log("attenteSuppressionAuteursOk");
445
		} else if (info.getType().equals("modif_publication")) {
451
		} else if (info.getType().equals("modif_publication")) {
446
			Info.display("Modification d'une publication", info.toString());
452
			InfoLogger.display("Modification d'une publication", info.toString());
447
		} else if (info.getType().equals("ajout_publication")) {
453
		} else if (info.getType().equals("ajout_publication")) {
448
			if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String && ((String) info.getDonnee(0)).matches("[0-9]+")) {
454
			if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String && ((String) info.getDonnee(0)).matches("[0-9]+")) {
449
				String publicationId = (String) info.getDonnee(0);
455
				String publicationId = (String) info.getDonnee(0);
450
				Info.display("Ajout d'une publication", "La publication '"+publicationId+"' a bien été ajoutée");
456
				InfoLogger.display("Ajout d'une publication", "La publication '"+publicationId+"' a bien été ajoutée");
451
			} else {
457
			} else {
452
				Info.display("Ajout d'une publication", info.toString());
458
				InfoLogger.display("Ajout d'une publication", info.toString());
453
			}
459
			}
454
		}
460
		}
-
 
461
		
-
 
462
Debug.log("<8-8> END PublicationForm.rafraichirInformation()");		
455
	}
463
	}
Line 456... Line 464...
456
	
464
	
457
	private boolean avoirAuteursMiseAJourCorrectement() {
465
	private boolean avoirAuteursMiseAJourCorrectement() {
458
		boolean ok = false;
466
		boolean ok = false;