Subversion Repositories eFlore/Applications.coel

Rev

Rev 1114 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1114 Rev 1121
Line 5... Line 5...
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.ValeurListe;
7
import org.tela_botanica.client.modeles.ValeurListe;
8
import org.tela_botanica.client.modeles.projet.Projet;
8
import org.tela_botanica.client.modeles.projet.Projet;
9
import org.tela_botanica.client.modeles.projet.ProjetListe;
9
import org.tela_botanica.client.modeles.projet.ProjetListe;
10
import org.tela_botanica.client.util.Pattern;
-
 
11
import org.tela_botanica.client.util.UtilString;
10
import org.tela_botanica.client.util.UtilString;
12
import org.tela_botanica.client.vues.DetailVue;
11
import org.tela_botanica.client.vues.DetailVue;
Line 13... Line 12...
13
 
12
 
14
import com.extjs.gxt.ui.client.util.Format;
13
import com.extjs.gxt.ui.client.util.Format;
Line 20... Line 19...
20
 
19
 
Line 21... Line 20...
21
public class ProjetDetailVue extends DetailVue implements Rafraichissable {
20
public class ProjetDetailVue extends DetailVue implements Rafraichissable {
22
	
21
	
-
 
22
	private String enteteTpl = null;
Line 23... Line 23...
23
	private String enteteTpl = null;
23
	private String contenuTpl = null;
24
	private String contenuTpl = null;
24
	private String indexationTpl = null;
25
		
25
		
Line 68... Line 68...
68
	}
68
	}
Line 69... Line 69...
69
 
69
 
70
	private void initialiserTousLesTpl() {
70
	private void initialiserTousLesTpl() {
71
		initialiserEnteteHtmlTpl();
71
		initialiserEnteteHtmlTpl();
-
 
72
		initialiserGeneralTpl();
72
		initialiserGeneralTpl();
73
		initialiserIndexationTpl();
Line 73... Line 74...
73
	}
74
	}
74
	
75
	
75
	private void initialiserEnteteHtmlTpl() {
76
	private void initialiserEnteteHtmlTpl() {
Line 87... Line 88...
87
			"		<h2>{i18n_titre_info_generale}</h2>"+
88
			"		<h2>{i18n_titre_info_generale}</h2>"+
88
			"		<span class='{css_label}'>{i18n_nom} :</span> {nom}<br />"+
89
			"		<span class='{css_label}'>{i18n_nom} :</span> {nom}<br />"+
89
			"		<span class='{css_label}'>{i18n_abreviation} :</span> {abreviation}<br />"+
90
			"		<span class='{css_label}'>{i18n_abreviation} :</span> {abreviation}<br />"+
90
			"		<span class='{css_label}'>{i18n_resume} :</span> {resume}<br />"+
91
			"		<span class='{css_label}'>{i18n_resume} :</span> {resume}<br />"+
91
			"		<span class='{css_label}'>{i18n_description} :</span> {description}<br />"+
92
			"		<span class='{css_label}'>{i18n_description} :</span> {description}<br />"+
-
 
93
			"		<span class='{css_label}'>{i18n_url} :</span> <a class='{css_lien_ext}' href='{url}' onclick='window.open(this.href); return false;'>{url}</a><br />"+
92
			"	</div>"+
94
			"	</div>"+
93
			"	<div class='{css_fieldset}'>"+
95
			"	<div class='{css_fieldset}'>"+
94
			"		<h2>{i18n_titre_complement}</h2>"+
96
			"		<h2>{i18n_titre_complement}</h2>"+
95
			"		<span class='{css_label}'>{i18n_mot_cles} :</span> {mot_cles}<br />"+
97
			"		<span class='{css_label}'>{i18n_mot_cles} :</span> {mot_cles}<br />"+
96
			"		<span class='{css_label}'>{i18n_citation} :</span> {citation}<br />"+
98
			"		<span class='{css_label}'>{i18n_citation} :</span> {citation}<br />"+
Line 98... Line 100...
98
			"		<span class='{css_label}'>{i18n_langue} :</span> {langue}<br />"+
100
			"		<span class='{css_label}'>{i18n_langue} :</span> {langue}<br />"+
99
			"	</div>"+
101
			"	</div>"+
100
			"	<hr class='{css_clear}'/>"+
102
			"	<hr class='{css_clear}'/>"+
101
			"	<div class='{css_fieldset}'>"+
103
			"	<div class='{css_fieldset}'>"+
102
			"		<h2>{i18n_titre_indexation}</h2>"+
104
			"		<h2>{i18n_titre_indexation}</h2>"+
103
			"		<span class='{css_label}'>{i18n_indexation_heure} :</span> {indexation_heure}<br />"+
-
 
104
			"		<span class='{css_label}'>{i18n_indexation_duree} :</span> {indexation_duree}<br />"+
-
 
105
			"		<span class='{css_label}'>{i18n_indexation_frequence} :</span> {indexation_frequence}<br />"+
-
 
106
			"		<span class='{css_label}'>{i18n_mark_public} :</span> {mark_public}<br />"+
105
			"		<span class='{css_label}'>{i18n_mark_public} :</span> {mark_public}<br />"+
-
 
106
			"		{indexation}"+
107
			"	</div>"+
107
			"	</div>"+
108
			"</div>";
108
			"</div>";
109
	}
109
	}
Line -... Line 110...
-
 
110
	
-
 
111
	private void initialiserIndexationTpl() {
-
 
112
		indexationTpl =
-
 
113
			"		<span class='{css_label}'>{i18n_indexation_heure} :</span> {indexation_heure}<br />"+
-
 
114
			"		<span class='{css_label}'>{i18n_indexation_duree} :</span> {indexation_duree}<br />"+
-
 
115
			"		<span class='{css_label}'>{i18n_indexation_frequence} :</span> {indexation_frequence}<br />";
-
 
116
	}
110
	
117
	
111
	public void afficherDetail() {
118
	public void afficherDetail() {
112
		if (projet != null) {
119
		if (projet != null) {
113
			afficherEntete();
120
			afficherEntete();
114
			afficherDetailProjet();
121
			afficherDetailProjet();
Line 154... Line 161...
154
		contenuParams.set("resume", projet.getResume());
161
		contenuParams.set("resume", projet.getResume());
Line 155... Line 162...
155
		
162
		
156
		contenuParams.set("i18n_description", i18nC.projetDescription());
163
		contenuParams.set("i18n_description", i18nC.projetDescription());
Line -... Line 164...
-
 
164
		contenuParams.set("description", projet.getDescription());
-
 
165
		
-
 
166
		contenuParams.set("i18n_url", i18nC.projetUrl());
157
		contenuParams.set("description", projet.getDescription());
167
		contenuParams.set("url", projet.getUrl());
Line 158... Line 168...
158
		
168
		
159
		contenuParams.set("i18n_titre_complement", i18nC.projetTitreComplement());
169
		contenuParams.set("i18n_titre_complement", i18nC.projetTitreComplement());
Line 170... Line 180...
170
		contenuParams.set("i18n_langue", i18nC.projetLangue());
180
		contenuParams.set("i18n_langue", i18nC.projetLangue());
171
		contenuParams.set("langue", obtenirValeurLangue(projet.getLangue()));
181
		contenuParams.set("langue", obtenirValeurLangue(projet.getLangue()));
Line 172... Line 182...
172
		
182
		
Line 173... Line -...
173
		contenuParams.set("i18n_titre_indexation", i18nC.projetTitreIndexation());
-
 
174
		
-
 
175
		contenuParams.set("i18n_indexation_heure", i18nC.projetIndexationHeure());
-
 
176
		contenuParams.set("indexation_heure", corrigerIndexationHeure(projet.getIndexationHeure()));
-
 
177
		
-
 
178
		contenuParams.set("i18n_indexation_duree", i18nC.projetIndexationDuree());
-
 
179
		contenuParams.set("indexation_duree", obtenirValeurIndexationDuree(projet.getIndexationDuree()));
-
 
180
		
-
 
181
		contenuParams.set("i18n_indexation_frequence", i18nC.projetIndexationFrequence());
-
 
182
		contenuParams.set("indexation_frequence", obtenirValeurIndexationFrequence(projet.getIndexationFreq()));
183
		contenuParams.set("i18n_titre_indexation", i18nC.projetTitreIndexation());
183
		
184
		
Line -... Line 185...
-
 
185
		contenuParams.set("i18n_mark_public", i18nC.projetMarkPublic());
-
 
186
		contenuParams.set("mark_public", obtenirValeurPublic(projet.getMarkPublic()));
184
		contenuParams.set("i18n_mark_public", i18nC.projetMarkPublic());
187
		
185
		contenuParams.set("mark_public", obtenirValeurPublic(projet.getMarkPublic()));
188
		contenuParams.set("indexation", creerIndexation());
186
		
189
		
Line 187... Line 190...
187
		String gHtml = formaterContenu(contenuTpl, contenuParams);
190
		String gHtml = formaterContenu(contenuTpl, contenuParams);
Line 194... Line 197...
194
			heureMinute = heureMinuteSecondeEnBdd.replaceAll(":00$", "");
197
			heureMinute = heureMinuteSecondeEnBdd.replaceAll(":00$", "");
195
		}
198
		}
196
		return heureMinute;
199
		return heureMinute;
197
	}
200
	}
Line -... Line 201...
-
 
201
	
-
 
202
	private String creerIndexation() {
-
 
203
		String html = "";
-
 
204
		if (projet.getMarkPublic().equals("1")) {
-
 
205
			Params indexationParams = new Params();
-
 
206
			
-
 
207
			indexationParams.set("i18n_indexation_heure", i18nC.projetIndexationHeure());
-
 
208
			indexationParams.set("indexation_heure", corrigerIndexationHeure(projet.getIndexationHeure()));
-
 
209
			
-
 
210
			indexationParams.set("i18n_indexation_duree", i18nC.projetIndexationDuree());
-
 
211
			indexationParams.set("indexation_duree", obtenirValeurIndexationDuree(projet.getIndexationDuree()));
-
 
212
			
-
 
213
			indexationParams.set("i18n_indexation_frequence", i18nC.projetIndexationFrequence());
-
 
214
			indexationParams.set("indexation_frequence", obtenirValeurIndexationFrequence(projet.getIndexationFreq()));
-
 
215
			
-
 
216
			html = Format.substitute(indexationTpl, indexationParams);
-
 
217
		}
-
 
218
		return html;
-
 
219
	}
198
	
220
	
199
	public void rafraichir(Object nouvellesDonnees) {
221
	public void rafraichir(Object nouvellesDonnees) {
200
		if (nouvellesDonnees instanceof Projet) {
222
		if (nouvellesDonnees instanceof Projet) {
201
			projet = (Projet) nouvellesDonnees;
223
			projet = (Projet) nouvellesDonnees;
202
			projetChargementOk = true;
224
			projetChargementOk = true;