Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 803 Rev 813
Line 2... Line 2...
2
 
2
 
3
import org.tela_botanica.client.ComposantClass;
3
import org.tela_botanica.client.ComposantClass;
4
import org.tela_botanica.client.ComposantId;
4
import org.tela_botanica.client.ComposantId;
5
import org.tela_botanica.client.Mediateur;
5
import org.tela_botanica.client.Mediateur;
-
 
6
import org.tela_botanica.client.interfaces.Rafraichissable;
6
import org.tela_botanica.client.interfaces.Rafraichissable;
7
import org.tela_botanica.client.modeles.ProjetListe;
Line 7... Line 8...
7
import org.tela_botanica.client.modeles.Publication;
8
import org.tela_botanica.client.modeles.Publication;
8
 
9
 
9
import com.extjs.gxt.ui.client.util.Format;
10
import com.extjs.gxt.ui.client.util.Format;
Line 21... Line 22...
21
	private ContentPanel panneauPrincipal = null;
22
	private ContentPanel panneauPrincipal = null;
22
	private Html entete = null;
23
	private Html entete = null;
23
	private Html contenu = null;
24
	private Html contenu = null;
Line 24... Line 25...
24
	
25
	
-
 
26
	private Publication publication = null;
Line 25... Line 27...
25
	private Publication publication = null;
27
	private boolean publicationChargementOk = false;
26
 
28
 
Line 27... Line 29...
27
	public PublicationDetailVue(Mediateur mediateurCourant) {
29
	public PublicationDetailVue(Mediateur mediateurCourant) {
Line 51... Line 53...
51
	
53
	
52
	private void initialiserEnteteHtmlTpl() {
54
	private void initialiserEnteteHtmlTpl() {
53
		enteteTpl = 	
55
		enteteTpl = 	
54
			"<div id='{css_id}'>"+
56
			"<div id='{css_id}'>"+
55
			"	<h1>{titre}</h1>"+
57
			"	<h1>{titre}</h1>"+
56
			"	<h2>{auteurs} ({annee})<span class='{css_meta}'>{projet} - {id} - {guid}</span></h2>" +
58
			"	<h2>{auteurs} ({annee})<span class='{css_meta}'>{projet} <br /> {i18n_id}:{id} - {guid}</span></h2>" +
57
			"</div>";
59
			"</div>";
Line 58... Line 60...
58
	}
60
	}
59
	
61
	
Line 86... Line 88...
86
	private void afficherEntete() {
88
	private void afficherEntete() {
87
		Params enteteParams = new Params();
89
		Params enteteParams = new Params();
88
		enteteParams.set("css_id", ComposantId.ZONE_DETAIL_ENTETE);
90
		enteteParams.set("css_id", ComposantId.ZONE_DETAIL_ENTETE);
89
		enteteParams.set("css_meta", ComposantClass.META);
91
		enteteParams.set("css_meta", ComposantClass.META);
Line -... Line 92...
-
 
92
		
-
 
93
		enteteParams.set("i18n_id", i18nC.id());
90
		
94
		
91
		enteteParams.set("titre", publication.getTitre());
95
		enteteParams.set("titre", publication.getTitre());
92
		enteteParams.set("auteurs", publication.getAuteur());
96
		enteteParams.set("auteurs", publication.getAuteur());
93
		enteteParams.set("annee", publication.getAnneeParution());
97
		enteteParams.set("annee", publication.getAnneeParution());
94
		enteteParams.set("id", publication.getId());
98
		enteteParams.set("id", publication.getId());
95
		enteteParams.set("guid", getGuid());
99
		enteteParams.set("guid", getGuid());
96
		enteteParams.set("projet", construireTxtProjet(publication.getIdProjet()));
-
 
-
 
100
		enteteParams.set("projet", construireTxtProjet(publication.getIdProjet()));
97
		
101
		GWT.log("entete généré", null);
98
		String eHtml = Format.substitute(enteteTpl, enteteParams);
102
		String eHtml = Format.substitute(enteteTpl, enteteParams);
99
		entete.getElement().setInnerHTML(eHtml);
103
		entete.getElement().setInnerHTML(eHtml);
Line 100... Line 104...
100
	}
104
	}
Line 133... Line 137...
133
	}
137
	}
Line 134... Line 138...
134
	
138
	
135
	public void rafraichir(Object nouvellesDonnees) {
139
	public void rafraichir(Object nouvellesDonnees) {
136
		if (nouvellesDonnees instanceof Publication) {
140
		if (nouvellesDonnees instanceof Publication) {
-
 
141
			publication = (Publication) nouvellesDonnees;
-
 
142
			publicationChargementOk = true;
-
 
143
		} else if (nouvellesDonnees instanceof ProjetListe) {
137
			publication = (Publication) nouvellesDonnees;
144
			projets = (ProjetListe) nouvellesDonnees;
-
 
145
			projetsChargementOk = true;
138
			afficherDetail();
146
			GWT.log("projets recu", null);
139
		} else {
147
		} else {
140
			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
148
			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
-
 
149
		}
-
 
150
		
-
 
151
		if (avoirDonneesChargees()) {
-
 
152
			afficherDetail();
141
		}
153
		}
142
	}
154
	}
-
 
155
	
-
 
156
	private boolean avoirDonneesChargees() {
-
 
157
		boolean ok = false;
-
 
158
		if (projetsChargementOk && publicationChargementOk) {
-
 
159
			ok = true;
-
 
160
		}
-
 
161
		return ok;
143
 
162
	}
144
}
163
}