| Line 1... |
Line 1... |
| 1 |
package org.tela_botanica.client.vues;
|
1 |
package org.tela_botanica.client.vues;
|
| Line 2... |
Line 2... |
| 2 |
|
2 |
|
| 3 |
import java.util.ArrayList;
|
3 |
import java.util.ArrayList;
|
| 4 |
import java.util.Iterator;
|
- |
|
| Line 5... |
Line 4... |
| 5 |
import java.util.List;
|
4 |
import java.util.Iterator;
|
| 6 |
|
- |
|
| 7 |
import org.tela_botanica.client.Mediateur;
|
- |
|
| 8 |
import org.tela_botanica.client.configuration.Configuration;
|
- |
|
| 9 |
import org.tela_botanica.client.i18n.Constantes;
|
5 |
|
| 10 |
import org.tela_botanica.client.images.Images;
|
6 |
import org.tela_botanica.client.Mediateur;
|
| 11 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
7 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
| 12 |
import org.tela_botanica.client.modeles.Information;
|
- |
|
| 13 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
- |
|
| 14 |
import org.tela_botanica.client.modeles.Personne;
|
8 |
import org.tela_botanica.client.modeles.Information;
|
| 15 |
import org.tela_botanica.client.modeles.PersonneListe;
|
- |
|
| 16 |
import org.tela_botanica.client.modeles.Projet;
|
- |
|
| 17 |
import org.tela_botanica.client.modeles.Structure;
|
9 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
| 18 |
import org.tela_botanica.client.modeles.StructureListe;
|
10 |
import org.tela_botanica.client.modeles.Projet;
|
| 19 |
import org.tela_botanica.client.modeles.Valeur;
|
11 |
import org.tela_botanica.client.modeles.Valeur;
|
| 20 |
import org.tela_botanica.client.modeles.ValeurListe;
|
12 |
import org.tela_botanica.client.modeles.ValeurListe;
|
| Line 21... |
Line 13... |
| 21 |
import org.tela_botanica.client.util.Pattern;
|
13 |
import org.tela_botanica.client.util.Pattern;
|
| 22 |
import org.tela_botanica.client.util.UtilArray;
|
14 |
import org.tela_botanica.client.util.UtilArray;
|
| 23 |
|
15 |
|
| 24 |
import com.extjs.gxt.ui.client.Style.SortDir;
|
16 |
import com.extjs.gxt.ui.client.Style.SortDir;
|
| 25 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
- |
|
| 26 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
- |
|
| 27 |
import com.extjs.gxt.ui.client.store.ListStore;
|
17 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
| 28 |
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
18 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
| 29 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
19 |
import com.extjs.gxt.ui.client.store.ListStore;
|
| 30 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
20 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
| 31 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
- |
|
| 32 |
import com.extjs.gxt.ui.client.widget.form.CheckBox;
|
21 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
| 33 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
22 |
import com.extjs.gxt.ui.client.widget.form.CheckBox;
|
| 34 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
23 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
| 35 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
- |
|
| 36 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
24 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
| 37 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
25 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
| 38 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
26 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
| 39 |
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
|
27 |
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
|
| 40 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
- |
|
| Line 41... |
Line 28... |
| 41 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
28 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
| Line 42... |
Line 29... |
| 42 |
import com.google.gwt.core.client.GWT;
|
29 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
| Line 279... |
Line 266... |
| 279 |
public void rafraichir(Object nouvellesDonnees) {
|
266 |
public void rafraichir(Object nouvellesDonnees) {
|
| 280 |
if (nouvellesDonnees instanceof Projet) {
|
267 |
if (nouvellesDonnees instanceof Projet) {
|
| 281 |
// Si on a reçu les details d'une projet
|
268 |
// Si on a reçu les details d'une projet
|
| 282 |
rafraichirProjet((Projet) nouvellesDonnees);
|
269 |
rafraichirProjet((Projet) nouvellesDonnees);
|
| 283 |
GWT.log("Un projet est arrivé : "+((Projet) nouvellesDonnees).getNom(), null);
|
270 |
GWT.log("Un projet est arrivé : "+((Projet) nouvellesDonnees).getNom(), null);
|
| 284 |
}
|
- |
|
| 285 |
|
- |
|
| 286 |
if(nouvellesDonnees instanceof ValeurListe) {
|
271 |
} else if (nouvellesDonnees instanceof ValeurListe) {
|
| 287 |
ValeurListe nValeurListe = (ValeurListe)nouvellesDonnees;
|
272 |
ValeurListe nValeurListe = (ValeurListe)nouvellesDonnees;
|
| Line 288... |
Line 273... |
| 288 |
|
273 |
|
| 289 |
if(nValeurListe.getId() == listeValeurIndexationDureeInt) {
|
- |
|
| 290 |
|
274 |
if (nValeurListe.getId() == listeValeurIndexationDureeInt) {
|
| Line 291... |
Line 275... |
| 291 |
valeurListeIndexationDuree = nValeurListe;
|
275 |
valeurListeIndexationDuree = nValeurListe;
|
| 292 |
|
276 |
|
| 293 |
for(Iterator<String> it = nValeurListe.keySet().iterator(); it.hasNext();) {
|
277 |
for (Iterator<String> it = nValeurListe.keySet().iterator(); it.hasNext();) {
|
| 294 |
listeIndexationDuree.add(nValeurListe.get(it.next()));
|
278 |
listeIndexationDuree.add(nValeurListe.get(it.next()));
|
| 295 |
listeIndexationDuree.sort("id_valeur", SortDir.ASC);
|
- |
|
| 296 |
}
|
279 |
listeIndexationDuree.sort("id_valeur", SortDir.ASC);
|
| Line 297... |
Line 280... |
| 297 |
|
280 |
}
|
| 298 |
listeIndexationDureeChargee = true;
|
281 |
listeIndexationDureeChargee = true;
|
| 299 |
|
282 |
|
| 300 |
if(mode.equals(MODE_MODIFIER)) {
|
283 |
if (mode.equals(MODE_MODIFIER)) {
|
| 301 |
if(valeurListeIndexationDuree.get(projet.getIndexationDuree()) != null) {
|
284 |
if (valeurListeIndexationDuree.get(projet.getIndexationDuree()) != null) {
|
| 302 |
indexationDureeChp.setValue(valeurListeIndexationDuree.get(projet.getIndexationDuree()));
|
285 |
indexationDureeChp.setValue(valeurListeIndexationDuree.get(projet.getIndexationDuree()));
|
| 303 |
indexationDureeChp.validate();
|
- |
|
| 304 |
}
|
286 |
indexationDureeChp.validate();
|
| 305 |
}
|
- |
|
| 306 |
|
- |
|
| 307 |
indexationDureeChp.expand();
|
- |
|
| 308 |
|
287 |
}
|
| 309 |
}
|
- |
|
| 310 |
|
288 |
}
|
| 311 |
if(nValeurListe.getId() == listeValeurIndexationFrequenceInt) {
|
- |
|
| 312 |
|
289 |
indexationDureeChp.expand();
|
| 313 |
valeurListeIndexationFrequence = nValeurListe;
|
290 |
} else if (nValeurListe.getId() == listeValeurIndexationFrequenceInt) {
|
| 314 |
|
291 |
valeurListeIndexationFrequence = nValeurListe;
|
| 315 |
for(Iterator<String> it = nValeurListe.keySet().iterator(); it.hasNext();) {
|
292 |
for (Iterator<String> it = nValeurListe.keySet().iterator(); it.hasNext();) {
|
| 316 |
listeIndexationFrequence.add(nValeurListe.get(it.next()));
|
- |
|
| 317 |
listeIndexationFrequence.sort("id_valeur", SortDir.ASC);
|
293 |
listeIndexationFrequence.add(nValeurListe.get(it.next()));
|
| Line 318... |
Line 294... |
| 318 |
}
|
294 |
listeIndexationFrequence.sort("id_valeur", SortDir.ASC);
|
| 319 |
|
295 |
}
|
| 320 |
listeIndexationFrequenceChargee = true;
|
296 |
listeIndexationFrequenceChargee = true;
|
| 321 |
|
297 |
|
| 322 |
if(mode.equals(MODE_MODIFIER)) {
|
298 |
if (mode.equals(MODE_MODIFIER)) {
|
| 323 |
if(valeurListeIndexationFrequence.get(projet.getIndexationFreq()) != null) {
|
299 |
if (valeurListeIndexationFrequence.get(projet.getIndexationFreq()) != null) {
|
| 324 |
indexationFrequenceChp.setValue(valeurListeIndexationFrequence.get(projet.getIndexationFreq()));
|
- |
|
| 325 |
indexationFrequenceChp.validate();
|
300 |
indexationFrequenceChp.setValue(valeurListeIndexationFrequence.get(projet.getIndexationFreq()));
|
| 326 |
}
|
- |
|
| 327 |
}
|
- |
|
| 328 |
|
301 |
indexationFrequenceChp.validate();
|
| Line 329... |
Line 302... |
| 329 |
indexationFrequenceChp.expand();
|
302 |
}
|
| Line 330... |
Line 303... |
| 330 |
}
|
303 |
}
|
| 331 |
|
304 |
indexationFrequenceChp.expand();
|
| 332 |
if(nValeurListe.getId() == listeLanguesInt) {
|
305 |
} else if (nValeurListe.getId() == listeLanguesInt) {
|
| 333 |
|
306 |
|
| Line 334... |
Line 307... |
| 334 |
valeurListeLangue = nValeurListe;
|
307 |
valeurListeLangue = nValeurListe;
|
| Line 335... |
Line 308... |
| 335 |
|
308 |
|
| 336 |
for(Iterator<String> it = nValeurListe.keySet().iterator(); it.hasNext();) {
|
309 |
for (Iterator<String> it = nValeurListe.keySet().iterator(); it.hasNext();) {
|
| 337 |
listeLangue.add(nValeurListe.get(it.next()));
|
310 |
listeLangue.add(nValeurListe.get(it.next()));
|
| 338 |
listeLangue.sort("id_valeur", SortDir.ASC);
|
311 |
listeLangue.sort("id_valeur", SortDir.ASC);
|
| 339 |
}
|
312 |
}
|
| 340 |
|
313 |
|
| 341 |
listeLangueChargee = true;
|
314 |
listeLangueChargee = true;
|
| Line 452... |
Line 425... |
| 452 |
}
|
425 |
}
|
| 453 |
return valide;
|
426 |
return valide;
|
| 454 |
}
|
427 |
}
|
| Line 455... |
Line 428... |
| 455 |
|
428 |
|
| 456 |
private void peuplerFormulaire() {
|
- |
|
| 457 |
|
429 |
private void peuplerFormulaire() {
|
| 458 |
nomChp.setValue(projet.getNom());
|
430 |
nomChp.setValue(projet.getNom());
|
| 459 |
abreviationChp.setValue(projet.getAbreviation());
|
431 |
abreviationChp.setValue(projet.getAbreviation());
|
| 460 |
descriptionChp.setValue(projet.getDescription());
|
432 |
descriptionChp.setValue(projet.getDescription());
|
| 461 |
resumeChp.setValue(projet.getResume());
|
433 |
resumeChp.setValue(projet.getResume());
|
| Line 462... |
Line 434... |
| 462 |
urlChp.setValue(projet.getUrl());
|
434 |
urlChp.setValue(projet.getUrl());
|
| 463 |
|
435 |
|
| 464 |
motsClesChp.setValue(projet.getMotsCles());
|
436 |
motsClesChp.setValue(projet.getMotsCles());
|
| Line 465... |
Line 437... |
| 465 |
citationChp.setValue(projet.getCitation());
|
437 |
citationChp.setValue(projet.getCitation());
|
| 466 |
licenceChp.setValue(projet.getLicence());
|
438 |
licenceChp.setValue(projet.getLicence());
|
| 467 |
|
439 |
|
| 468 |
if(projet.getMarkPublic().equals("1")) {
|
440 |
if (projet.getMarkPublic().equals("1")) {
|
| 469 |
markPublicChp.setValue(true);
|
441 |
markPublicChp.setValue(true);
|
| Line 470... |
Line 442... |
| 470 |
} else {
|
442 |
} else {
|
| 471 |
markPublicChp.setValue(false);
|
- |
|
| 472 |
}
|
443 |
markPublicChp.setValue(false);
|
| 473 |
|
444 |
}
|
| 474 |
if(listeLangueChargee) {
|
445 |
|
| 475 |
|
446 |
if (listeLangueChargee) {
|
| 476 |
if(valeurListeLangue.get(projet.getLangue()) != null) {
|
447 |
if(valeurListeLangue.get(projet.getLangue()) != null) {
|
| Line 477... |
Line 448... |
| 477 |
langueChp.setValue(valeurListeLangue.get(projet.getLangue()));
|
448 |
langueChp.setValue(valeurListeLangue.get(projet.getLangue()));
|
| 478 |
langueChp.validate();
|
449 |
langueChp.validate();
|
| 479 |
}
|
450 |
}
|
| 480 |
}
|
451 |
}
|
| 481 |
|
452 |
|
| 482 |
if(listeIndexationFrequenceChargee) {
|
453 |
if (listeIndexationFrequenceChargee) {
|
| Line 483... |
Line 454... |
| 483 |
if(valeurListeIndexationFrequence.get(projet.getIndexationFreq()) != null) {
|
454 |
if (valeurListeIndexationFrequence.get(projet.getIndexationFreq()) != null) {
|
| 484 |
indexationFrequenceChp.setValue(valeurListeIndexationFrequence.get(projet.getIndexationFreq()));
|
455 |
indexationFrequenceChp.setValue(valeurListeIndexationFrequence.get(projet.getIndexationFreq()));
|
| 485 |
indexationFrequenceChp.validate();
|
456 |
indexationFrequenceChp.validate();
|
| 486 |
}
|
457 |
}
|
| 487 |
}
|
458 |
}
|
| 488 |
|
459 |
|
| Line 489... |
Line 460... |
| 489 |
if(listeIndexationDureeChargee) {
|
460 |
if (listeIndexationDureeChargee) {
|
| 490 |
if(valeurListeIndexationDuree.get(projet.getIndexationDuree()) != null) {
|
461 |
if (valeurListeIndexationDuree.get(projet.getIndexationDuree()) != null) {
|
| 491 |
indexationDureeChp.setValue(valeurListeIndexationDuree.get(projet.getIndexationDuree()));
|
462 |
indexationDureeChp.setValue(valeurListeIndexationDuree.get(projet.getIndexationDuree()));
|
| 492 |
indexationDureeChp.validate();
|
463 |
indexationDureeChp.validate();
|
| 493 |
}
|
464 |
}
|
| 494 |
}
|
465 |
}
|
| 495 |
|
466 |
|
| Line 496... |
Line 467... |
| 496 |
String[] heureTab = projet.getIndexationHeure().split(":");
|
467 |
String[] heureTab = projet.getIndexationHeure().split(":");
|
| 497 |
if(heureTab.length > 1) {
|
- |
|
| 498 |
String heure = heureTab[0]+":"+heureTab[1];
|
468 |
if (heureTab.length > 1) {
|
| Line 499... |
Line 469... |
| 499 |
if(heure.matches(Pattern.heureMinute)) {
|
469 |
String heure = heureTab[0]+":"+heureTab[1];
|
| 500 |
indexationHeureChp.setValue(heure);
|
470 |
if (heure.matches(Pattern.heureMinute)) {
|
| 501 |
}
|
471 |
indexationHeureChp.setValue(heure);
|
| Line 517... |
Line 487... |
| 517 |
|
487 |
|
| 518 |
projetARetourner.setMotsCles(motsClesChp.getValue());
|
488 |
projetARetourner.setMotsCles(motsClesChp.getValue());
|
| 519 |
projetARetourner.setCitation(citationChp.getValue());
|
489 |
projetARetourner.setCitation(citationChp.getValue());
|
| Line 520... |
Line 490... |
| 520 |
projetARetourner.setLicence(licenceChp.getValue());
|
490 |
projetARetourner.setLicence(licenceChp.getValue());
|
| 521 |
|
491 |
|
| 522 |
if(markPublicChp.getValue()) {
|
492 |
if (markPublicChp.getValue()) {
|
| 523 |
projetCollecte.setMarkPublic("1");
|
493 |
projetCollecte.setMarkPublic("1");
|
| 524 |
} else {
|
494 |
} else {
|