| Line 10... |
Line 10... |
| 10 |
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
|
10 |
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
|
| 11 |
import org.tela_botanica.client.composants.GrillePaginable;
|
11 |
import org.tela_botanica.client.composants.GrillePaginable;
|
| 12 |
import org.tela_botanica.client.composants.InfoLogger;
|
12 |
import org.tela_botanica.client.composants.InfoLogger;
|
| 13 |
import org.tela_botanica.client.composants.pagination.ProxyPersonnes;
|
13 |
import org.tela_botanica.client.composants.pagination.ProxyPersonnes;
|
| 14 |
import org.tela_botanica.client.composants.pagination.ProxyPersonnesAPublication;
|
14 |
import org.tela_botanica.client.composants.pagination.ProxyPersonnesAPublication;
|
| 15 |
import org.tela_botanica.client.composants.pagination.ProxyProjets;
|
- |
|
| 16 |
import org.tela_botanica.client.composants.pagination.ProxyStructures;
|
15 |
import org.tela_botanica.client.composants.pagination.ProxyStructures;
|
| 17 |
import org.tela_botanica.client.images.Images;
|
16 |
import org.tela_botanica.client.images.Images;
|
| 18 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
17 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
| 19 |
import org.tela_botanica.client.modeles.Information;
|
18 |
import org.tela_botanica.client.modeles.Information;
|
| 20 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
19 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
| 21 |
import org.tela_botanica.client.modeles.aDonnee;
|
20 |
import org.tela_botanica.client.modeles.aDonnee;
|
| 22 |
import org.tela_botanica.client.modeles.personne.Personne;
|
21 |
import org.tela_botanica.client.modeles.personne.Personne;
|
| 23 |
import org.tela_botanica.client.modeles.projet.Projet;
|
- |
|
| 24 |
import org.tela_botanica.client.modeles.publication.Publication;
|
22 |
import org.tela_botanica.client.modeles.publication.Publication;
|
| 25 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
|
23 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
|
| 26 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
|
24 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
|
| 27 |
import org.tela_botanica.client.modeles.structure.Structure;
|
25 |
import org.tela_botanica.client.modeles.structure.Structure;
|
| 28 |
import org.tela_botanica.client.synchronisation.Sequenceur;
|
26 |
import org.tela_botanica.client.synchronisation.Sequenceur;
|
| Line 96... |
Line 94... |
| 96 |
private PublicationAPersonneListe auteursAjoutes = null;
|
94 |
private PublicationAPersonneListe auteursAjoutes = null;
|
| 97 |
private PublicationAPersonneListe auteursSupprimes = null;
|
95 |
private PublicationAPersonneListe auteursSupprimes = null;
|
| 98 |
private PublicationAPersonneListe auteursModifies = null;
|
96 |
private PublicationAPersonneListe auteursModifies = null;
|
| Line 99... |
Line 97... |
| 99 |
|
97 |
|
| 100 |
private ContentPanel auteursFieldset = null;
|
- |
|
| Line 101... |
Line 98... |
| 101 |
private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
|
98 |
private ContentPanel auteursFieldset = null;
|
| 102 |
|
99 |
|
| 103 |
private FieldSet generalitesFieldset = null;
|
100 |
private FieldSet generalitesFieldset = null;
|
| 104 |
private TextField<String> titreChp = null;
|
101 |
private TextField<String> titreChp = null;
|
| Line 689... |
Line 686... |
| 689 |
// Fieldset Infos Générales
|
686 |
// Fieldset Infos Générales
|
| 690 |
generalitesFieldset = new FieldSet();
|
687 |
generalitesFieldset = new FieldSet();
|
| 691 |
generalitesFieldset.setHeadingHtml("Informations générales");
|
688 |
generalitesFieldset.setHeadingHtml("Informations générales");
|
| 692 |
generalitesFieldset.setCollapsible(true);
|
689 |
generalitesFieldset.setCollapsible(true);
|
| 693 |
generalitesFieldset.setLayout(layout);
|
690 |
generalitesFieldset.setLayout(layout);
|
| 694 |
|
- |
|
| 695 |
ModelType modelTypeProjets = new ModelType();
|
- |
|
| 696 |
modelTypeProjets.setRoot("projets");
|
- |
|
| 697 |
modelTypeProjets.setTotalName("nbElements");
|
- |
|
| 698 |
modelTypeProjets.addField("cpr_nom");
|
- |
|
| 699 |
modelTypeProjets.addField("cpr_id_projet");
|
- |
|
| 700 |
|
- |
|
| 701 |
String displayNameProjets = "cpr_nom";
|
- |
|
| 702 |
ProxyProjets<ModelData> proxyProjets = new ProxyProjets<ModelData>(null);
|
- |
|
| 703 |
|
- |
|
| 704 |
projetsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyProjets, modelTypeProjets, displayNameProjets);
|
- |
|
| 705 |
projetsCombo.setWidth(200, 600);
|
- |
|
| 706 |
projetsCombo.getCombo().setTabIndex(tabIndex++);
|
- |
|
| 707 |
projetsCombo.getCombo().setFieldLabel(i18nC.projetChamp());
|
- |
|
| 708 |
projetsCombo.getCombo().setForceSelection(true);
|
- |
|
| 709 |
projetsCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
|
- |
|
| 710 |
projetsCombo.getCombo().addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
|
- |
|
| 711 |
|
- |
|
| 712 |
projetsCombo.getCombo().setValidator(new Validator() {
|
- |
|
| 713 |
public String validate(Field<?> field, String value) {
|
- |
|
| 714 |
String retour = null;
|
- |
|
| 715 |
if (field.getRawValue().equals("")) {
|
- |
|
| 716 |
field.setValue(null);
|
- |
|
| 717 |
} else if (projetsCombo.getStore().findModel("cpr_nom", field.getRawValue()) == null) {
|
- |
|
| 718 |
String contenuBrut = field.getRawValue();
|
- |
|
| 719 |
field.setValue(null);
|
- |
|
| 720 |
field.setRawValue(contenuBrut);
|
- |
|
| 721 |
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
|
- |
|
| 722 |
}
|
- |
|
| 723 |
return retour;
|
- |
|
| 724 |
}
|
- |
|
| 725 |
});
|
- |
|
| 726 |
generalitesFieldset.add(projetsCombo, new FormData(600, 0));
|
- |
|
| Line 727... |
Line 691... |
| 727 |
|
691 |
|
| 728 |
titreChp = new TextField<String>();
|
692 |
titreChp = new TextField<String>();
|
| 729 |
titreChp.setName("cpu");
|
693 |
titreChp.setName("cpu");
|
| 730 |
titreChp.setFieldLabel("Titre de l'article ou de l'ouvrage");
|
694 |
titreChp.setFieldLabel("Titre de l'article ou de l'ouvrage");
|
| Line 913... |
Line 877... |
| 913 |
|
877 |
|
| 914 |
sequenceur.enfilerRafraichissement(this, new Information("auteurs_enregistres"));
|
878 |
sequenceur.enfilerRafraichissement(this, new Information("auteurs_enregistres"));
|
| Line 915... |
Line 879... |
| 915 |
}
|
879 |
}
|
| 916 |
|
- |
|
| 917 |
private void peuplerFormulaire() {
|
880 |
|
| 918 |
setValeurComboProjets();
|
881 |
private void peuplerFormulaire() {
|
| 919 |
titreChp.setValue(publication.getTitre());
|
882 |
titreChp.setValue(publication.getTitre());
|
| 920 |
collectionChp.setValue(publication.getCollection());
|
883 |
collectionChp.setValue(publication.getCollection());
|
| 921 |
uriChp.setValue(publication.getURI());
|
884 |
uriChp.setValue(publication.getURI());
|
| Line 934... |
Line 897... |
| 934 |
}
|
897 |
}
|
| Line 935... |
Line 898... |
| 935 |
|
898 |
|
| Line 936... |
Line 899... |
| 936 |
private Publication collecterPublication() {
|
899 |
private Publication collecterPublication() {
|
| 937 |
|
- |
|
| 938 |
Publication publicationCollectee = (Publication) publication.cloner(new Publication());
|
900 |
|
| Line 939... |
Line 901... |
| 939 |
publicationCollectee.setIdProjet(getValeurComboProjets());
|
901 |
Publication publicationCollectee = (Publication) publication.cloner(new Publication());
|
| 940 |
publicationCollectee.setAuteur(construireIntituleAuteur());
|
902 |
publicationCollectee.setAuteur(construireIntituleAuteur());
|
| Line 1125... |
Line 1087... |
| 1125 |
|
1087 |
|
| 1126 |
|
1088 |
|
| Line 1127... |
Line -... |
| 1127 |
//+----------------------------------------------------------------------------------------------------------------+
|
- |
|
| 1128 |
// Accesseurs
|
- |
|
| 1129 |
|
- |
|
| 1130 |
private String getValeurComboProjets() {
|
- |
|
| 1131 |
String valeur = "";
|
- |
|
| 1132 |
if (projetsCombo.getValeur() != null) {
|
- |
|
| 1133 |
Projet projet = new Projet(projetsCombo.getValeur());
|
- |
|
| 1134 |
valeur = projet.getId();
|
- |
|
| 1135 |
}
|
- |
|
| 1136 |
return valeur;
|
- |
|
| 1137 |
}
|
- |
|
| 1138 |
private void setValeurComboProjets() {
|
- |
|
| 1139 |
if (mode.equals(Formulaire.MODE_MODIFIER) && publication != null) {
|
- |
|
| 1140 |
if (projetsCombo.getCombo().getStore() != null
|
- |
|
| 1141 |
&& publication != null
|
- |
|
| 1142 |
&& publication.getIdProjet() != null
|
- |
|
| 1143 |
&& !UtilString.isEmpty(publication.getIdProjet())) {
|
- |
|
| 1144 |
projetsCombo.chargerValeurInitiale(publication.getIdProjet(), "cpr_id_projet");
|
- |
|
| 1145 |
}
|
- |
|
| 1146 |
} else if (mode.equals(Formulaire.MODE_AJOUTER)) {
|
- |
|
| 1147 |
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", mediateur.getProjetId()));
|
- |
|
| 1148 |
} else {
|
- |
|
| 1149 |
projetsCombo.getCombo().setValue(null);
|
- |
|
| 1150 |
}
|
1089 |
//+----------------------------------------------------------------------------------------------------------------+
|
| 1151 |
}
|
1090 |
// Accesseurs
|
| Line 1152... |
Line 1091... |
| 1152 |
|
1091 |
|
| 1153 |
//+----------------------------------------------------------------------------------------------------------------+
|
1092 |
//+----------------------------------------------------------------------------------------------------------------+
|