934 |
jpm |
1 |
package org.tela_botanica.client.vues.collection;
|
687 |
jp_milcent |
2 |
|
875 |
jpm |
3 |
import java.util.ArrayList;
|
|
|
4 |
|
975 |
jpm |
5 |
import org.tela_botanica.client.ComposantClass;
|
687 |
jp_milcent |
6 |
import org.tela_botanica.client.Mediateur;
|
1018 |
jpm |
7 |
import org.tela_botanica.client.composants.ChampCaseACocher;
|
859 |
jpm |
8 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
1329 |
cyprien |
9 |
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
|
687 |
jp_milcent |
10 |
import org.tela_botanica.client.composants.ChampMultiValeurs;
|
859 |
jpm |
11 |
import org.tela_botanica.client.composants.ConteneurMultiChamps;
|
1329 |
cyprien |
12 |
import org.tela_botanica.client.composants.pagination.ProxyCollections;
|
|
|
13 |
import org.tela_botanica.client.composants.pagination.ProxyStructures;
|
687 |
jp_milcent |
14 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
|
|
15 |
import org.tela_botanica.client.modeles.ValeurListe;
|
935 |
jpm |
16 |
import org.tela_botanica.client.modeles.collection.Collection;
|
|
|
17 |
import org.tela_botanica.client.modeles.structure.Structure;
|
1367 |
cyprien |
18 |
import org.tela_botanica.client.synchronisation.Sequenceur;
|
951 |
jpm |
19 |
import org.tela_botanica.client.util.Debug;
|
1428 |
cyprien |
20 |
import org.tela_botanica.client.util.UtilString;
|
934 |
jpm |
21 |
import org.tela_botanica.client.vues.Formulaire;
|
|
|
22 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
858 |
jpm |
23 |
|
1329 |
cyprien |
24 |
import com.extjs.gxt.ui.client.data.ModelData;
|
|
|
25 |
import com.extjs.gxt.ui.client.data.ModelType;
|
968 |
jpm |
26 |
import com.extjs.gxt.ui.client.event.Events;
|
859 |
jpm |
27 |
import com.extjs.gxt.ui.client.util.Margins;
|
|
|
28 |
import com.extjs.gxt.ui.client.widget.Text;
|
687 |
jp_milcent |
29 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
|
|
30 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
|
|
31 |
import com.extjs.gxt.ui.client.widget.form.HiddenField;
|
859 |
jpm |
32 |
import com.extjs.gxt.ui.client.widget.form.NumberField;
|
687 |
jp_milcent |
33 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
862 |
jpm |
34 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
687 |
jp_milcent |
35 |
import com.extjs.gxt.ui.client.widget.form.Validator;
|
|
|
36 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
859 |
jpm |
37 |
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
|
|
|
38 |
import com.google.gwt.i18n.client.NumberFormat;
|
687 |
jp_milcent |
39 |
|
|
|
40 |
public class CollectionFormGeneral extends FormulaireOnglet implements Rafraichissable {
|
|
|
41 |
|
1083 |
jpm |
42 |
public static final String ID = "general";
|
867 |
jpm |
43 |
private Collection collection = null;
|
|
|
44 |
private Collection collectionCollectee = null;
|
|
|
45 |
|
1018 |
jpm |
46 |
private HiddenField<String> idCollectionChp = null;
|
687 |
jp_milcent |
47 |
|
1329 |
cyprien |
48 |
private ChampComboBoxRechercheTempsReelPaginable structuresCombo = null;
|
|
|
49 |
private ChampComboBoxRechercheTempsReelPaginable collectionsCombo = null;
|
858 |
jpm |
50 |
|
1018 |
jpm |
51 |
private ChampCaseACocher periodeConstitutionChp = null;
|
|
|
52 |
private ChampComboBoxListeValeurs groupementPrincipeCombo = null;
|
862 |
jpm |
53 |
private ChampMultiValeurs lieuCouvertureChp = null;
|
687 |
jp_milcent |
54 |
|
859 |
jpm |
55 |
private ChampComboBoxListeValeurs specimenTypeCombo = null;
|
|
|
56 |
private ChampComboBoxListeValeurs precisionTypeNbreCombo = null;
|
|
|
57 |
private NumberField nbreTypeChp = null;
|
1018 |
jpm |
58 |
private ChampComboBoxListeValeurs classementSpecimenTypeCombo = null;
|
858 |
jpm |
59 |
|
867 |
jpm |
60 |
private ChampComboBoxListeValeurs typeDepotCombo = null;
|
865 |
jpm |
61 |
private TextField<String> coteChp = null;
|
|
|
62 |
private ChampMultiValeurs idAlternatifsChp = null;
|
|
|
63 |
private ChampMultiValeurs nomsAlternatifsChp = null;
|
|
|
64 |
private ChampMultiValeurs codesAlternatifsChp = null;
|
862 |
jpm |
65 |
|
865 |
jpm |
66 |
private TextArea descriptionSpecialisteChp = null;
|
|
|
67 |
private TextArea descriptionChp = null;
|
|
|
68 |
private TextArea historiqueChp = null;
|
|
|
69 |
private ChampMultiValeurs urlsChp = null;
|
862 |
jpm |
70 |
|
865 |
jpm |
71 |
private ChampComboBoxListeValeurs butRealisationCombo = null;
|
862 |
jpm |
72 |
|
1367 |
cyprien |
73 |
private Sequenceur sequenceur = new Sequenceur();
|
|
|
74 |
|
687 |
jp_milcent |
75 |
public CollectionFormGeneral(Formulaire formulaireCourrant) {
|
|
|
76 |
initialiserOnglet(formulaireCourrant);
|
1083 |
jpm |
77 |
setId(ID);
|
687 |
jp_milcent |
78 |
setText(Mediateur.i18nC.collectionGeneral());
|
|
|
79 |
|
|
|
80 |
creerChampsCache();
|
|
|
81 |
creerFieldsetLiaison();
|
|
|
82 |
creerFieldsetAdministratif();
|
|
|
83 |
creerFieldsetDescription();
|
858 |
jpm |
84 |
creerFieldsetCouverture();
|
859 |
jpm |
85 |
creerFieldsetType();
|
687 |
jp_milcent |
86 |
}
|
|
|
87 |
|
875 |
jpm |
88 |
private void initialiserCollection() {
|
|
|
89 |
collection = ((CollectionForm) formulaire).collection;
|
|
|
90 |
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
|
|
|
91 |
}
|
|
|
92 |
|
687 |
jp_milcent |
93 |
private void creerChampsCache() {
|
|
|
94 |
// Champs cachés
|
|
|
95 |
idCollectionChp = new HiddenField<String>();
|
|
|
96 |
this.add(idCollectionChp);
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
private void creerFieldsetLiaison() {
|
1428 |
cyprien |
100 |
|
687 |
jp_milcent |
101 |
FieldSet liaisonFieldSet = new FieldSet();
|
1680 |
raphael |
102 |
liaisonFieldSet.setHeadingHtml(i18nC.liaisonTitreCollection());
|
687 |
jp_milcent |
103 |
liaisonFieldSet.setCollapsible(true);
|
858 |
jpm |
104 |
liaisonFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
687 |
jp_milcent |
105 |
|
1329 |
cyprien |
106 |
|
1526 |
jpm |
107 |
//+-----------------------------------------------------------------------------------------------------------+
|
|
|
108 |
// Champ Structures
|
1329 |
cyprien |
109 |
|
|
|
110 |
ModelType modelTypeStructures = new ModelType();
|
|
|
111 |
modelTypeStructures.setRoot("structures");
|
|
|
112 |
modelTypeStructures.setTotalName("nbElements");
|
|
|
113 |
modelTypeStructures.addField("cs_nom");
|
|
|
114 |
modelTypeStructures.addField("cs_id_structure");
|
|
|
115 |
|
|
|
116 |
String displayNameStructures = "cs_nom";
|
1468 |
jpm |
117 |
ProxyStructures<ModelData> proxyStructures = new ProxyStructures<ModelData>(null);
|
1329 |
cyprien |
118 |
|
|
|
119 |
structuresCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyStructures, modelTypeStructures, displayNameStructures);
|
|
|
120 |
structuresCombo.setWidth(250, 600);
|
|
|
121 |
structuresCombo.getCombo().setTabIndex(tabIndex++);
|
|
|
122 |
structuresCombo.getCombo().setFieldLabel(i18nC.lienStructureCollection());
|
|
|
123 |
structuresCombo.getCombo().setForceSelection(true);
|
|
|
124 |
|
|
|
125 |
structuresCombo.getCombo().setValidator(new Validator() {
|
687 |
jp_milcent |
126 |
public String validate(Field<?> field, String value) {
|
|
|
127 |
String retour = null;
|
|
|
128 |
if (field.getRawValue().equals("")) {
|
|
|
129 |
field.setValue(null);
|
1329 |
cyprien |
130 |
} else if (structuresCombo.getStore().findModel("cs_nom", field.getRawValue()) == null) {
|
687 |
jp_milcent |
131 |
String contenuBrut = field.getRawValue();
|
|
|
132 |
field.setValue(null);
|
|
|
133 |
field.setRawValue(contenuBrut);
|
|
|
134 |
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
|
|
|
135 |
}
|
|
|
136 |
return retour;
|
|
|
137 |
}
|
|
|
138 |
});
|
1329 |
cyprien |
139 |
|
|
|
140 |
liaisonFieldSet.add(structuresCombo, new FormData(600, 0));
|
687 |
jp_milcent |
141 |
|
1329 |
cyprien |
142 |
|
1526 |
jpm |
143 |
//+-----------------------------------------------------------------------------------------------------------+
|
|
|
144 |
// Champ Collections
|
1329 |
cyprien |
145 |
|
|
|
146 |
ModelType modelTypeCollections = new ModelType();
|
|
|
147 |
modelTypeCollections.setRoot("collections");
|
|
|
148 |
modelTypeCollections.setTotalName("nbElements");
|
|
|
149 |
modelTypeCollections.addField("cc_nom");
|
|
|
150 |
modelTypeCollections.addField("cc_id_collection");
|
1367 |
cyprien |
151 |
modelTypeCollections.addField("cc_ce_mere");
|
1329 |
cyprien |
152 |
|
|
|
153 |
String displayNameCollections = "cc_nom";
|
1468 |
jpm |
154 |
ProxyCollections<ModelData> proxyCollections = new ProxyCollections<ModelData>(null);
|
1329 |
cyprien |
155 |
|
|
|
156 |
collectionsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyCollections, modelTypeCollections, displayNameCollections);
|
|
|
157 |
collectionsCombo.setWidth(250, 600);
|
|
|
158 |
collectionsCombo.getCombo().setTabIndex(tabIndex++);
|
|
|
159 |
collectionsCombo.getCombo().setFieldLabel(i18nC.lienMereCollection());
|
1428 |
cyprien |
160 |
collectionsCombo.getCombo().setForceSelection(true);
|
1329 |
cyprien |
161 |
|
|
|
162 |
collectionsCombo.getCombo().setValidator(new Validator() {
|
687 |
jp_milcent |
163 |
public String validate(Field<?> field, String value) {
|
|
|
164 |
String retour = null;
|
|
|
165 |
if (field.getRawValue().equals("")) {
|
|
|
166 |
field.setValue(null);
|
1329 |
cyprien |
167 |
} else if (collectionsCombo.getStore().findModel("cc_nom", field.getRawValue()) == null) {
|
687 |
jp_milcent |
168 |
String contenuBrut = field.getRawValue();
|
|
|
169 |
field.setValue(null);
|
|
|
170 |
field.setRawValue(contenuBrut);
|
|
|
171 |
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
|
|
|
172 |
}
|
|
|
173 |
return retour;
|
|
|
174 |
}
|
|
|
175 |
});
|
1329 |
cyprien |
176 |
|
|
|
177 |
liaisonFieldSet.add(collectionsCombo, new FormData(600, 0));
|
687 |
jp_milcent |
178 |
|
|
|
179 |
this.add(liaisonFieldSet);
|
|
|
180 |
}
|
|
|
181 |
|
|
|
182 |
private void creerFieldsetAdministratif() {
|
|
|
183 |
// Fieldset ADMINISTRATIF
|
|
|
184 |
FieldSet administratifFieldSet = new FieldSet();
|
1680 |
raphael |
185 |
administratifFieldSet.setHeadingHtml(i18nC.collectionGeneralTitre());
|
687 |
jp_milcent |
186 |
administratifFieldSet.setCollapsible(true);
|
858 |
jpm |
187 |
administratifFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
687 |
jp_milcent |
188 |
|
859 |
jpm |
189 |
typeDepotCombo = new ChampComboBoxListeValeurs(i18nC.typeDepot(), "typeDepot", tabIndex++);
|
|
|
190 |
administratifFieldSet.add(typeDepotCombo);
|
862 |
jpm |
191 |
|
865 |
jpm |
192 |
coteChp = new TextField<String>();
|
|
|
193 |
coteChp.setTabIndex(tabIndex++);
|
|
|
194 |
coteChp.setFieldLabel(i18nC.cote());
|
|
|
195 |
administratifFieldSet.add(coteChp, new FormData(450, 0));
|
862 |
jpm |
196 |
|
|
|
197 |
idAlternatifsChp = new ChampMultiValeurs(i18nC.idAlternatifCollection());
|
|
|
198 |
administratifFieldSet.add(idAlternatifsChp);
|
|
|
199 |
|
|
|
200 |
nomsAlternatifsChp = new ChampMultiValeurs(i18nC.intituleAlternatifCollection());
|
687 |
jp_milcent |
201 |
administratifFieldSet.add(nomsAlternatifsChp);
|
|
|
202 |
|
862 |
jpm |
203 |
codesAlternatifsChp = new ChampMultiValeurs(i18nC.codeAlternatifCollection());
|
687 |
jp_milcent |
204 |
administratifFieldSet.add(codesAlternatifsChp);
|
|
|
205 |
|
|
|
206 |
this.add(administratifFieldSet);
|
|
|
207 |
}
|
|
|
208 |
|
|
|
209 |
private void creerFieldsetDescription() {
|
|
|
210 |
// Fieldset DESCRIPTION
|
862 |
jpm |
211 |
FieldSet descriptionFieldSet = new FieldSet();
|
1680 |
raphael |
212 |
descriptionFieldSet.setHeadingHtml(i18nC.collectionDescriptionTitre());
|
687 |
jp_milcent |
213 |
descriptionFieldSet.setCollapsible(true);
|
858 |
jpm |
214 |
descriptionFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
687 |
jp_milcent |
215 |
|
862 |
jpm |
216 |
descriptionChp = new TextArea();
|
687 |
jp_milcent |
217 |
descriptionChp.setFieldLabel(i18nC.description());
|
|
|
218 |
descriptionFieldSet.add(descriptionChp, new FormData(550, 0));
|
|
|
219 |
|
862 |
jpm |
220 |
descriptionSpecialisteChp = new TextArea();
|
687 |
jp_milcent |
221 |
descriptionSpecialisteChp.setFieldLabel(i18nC.descriptionSpecialiste());
|
|
|
222 |
descriptionFieldSet.add(descriptionSpecialisteChp, new FormData(550, 0));
|
|
|
223 |
|
862 |
jpm |
224 |
historiqueChp = new TextArea();
|
687 |
jp_milcent |
225 |
historiqueChp.setFieldLabel(i18nC.historique());
|
|
|
226 |
descriptionFieldSet.add(historiqueChp, new FormData(550, 0));
|
|
|
227 |
|
862 |
jpm |
228 |
urlsChp = new ChampMultiValeurs(i18nC.urlsCollection());
|
687 |
jp_milcent |
229 |
descriptionFieldSet.add(urlsChp);
|
|
|
230 |
|
|
|
231 |
this.add(descriptionFieldSet);
|
|
|
232 |
}
|
|
|
233 |
|
858 |
jpm |
234 |
private void creerFieldsetCouverture() {
|
|
|
235 |
FieldSet couvertureFieldSet = new FieldSet();
|
1680 |
raphael |
236 |
couvertureFieldSet.setHeadingHtml("Couvertures");
|
858 |
jpm |
237 |
couvertureFieldSet.setCollapsible(true);
|
|
|
238 |
couvertureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
|
|
239 |
|
1018 |
jpm |
240 |
periodeConstitutionChp = new ChampCaseACocher(i18nC.periodeConstitution(), "siecleNaturaliste", false);
|
|
|
241 |
couvertureFieldSet.add(periodeConstitutionChp);
|
|
|
242 |
|
862 |
jpm |
243 |
groupementPrincipeCombo = new ChampComboBoxListeValeurs(i18nC.groupementPrincipeCollection(), "groupementPrincipe", tabIndex++);
|
|
|
244 |
groupementPrincipeCombo.setToolTip(i18nC.groupementPrincipeCollectionInfo());
|
|
|
245 |
couvertureFieldSet.add(groupementPrincipeCombo);
|
858 |
jpm |
246 |
|
862 |
jpm |
247 |
butRealisationCombo = new ChampComboBoxListeValeurs(i18nC.butCollection(), "realisationBut", tabIndex++);
|
|
|
248 |
couvertureFieldSet.add(butRealisationCombo);
|
|
|
249 |
|
|
|
250 |
lieuCouvertureChp = new ChampMultiValeurs(i18nC.lieuCouvertureCollection());
|
|
|
251 |
couvertureFieldSet.add(lieuCouvertureChp);
|
|
|
252 |
|
858 |
jpm |
253 |
this.add(couvertureFieldSet);
|
|
|
254 |
}
|
|
|
255 |
|
859 |
jpm |
256 |
private void creerFieldsetType() {
|
|
|
257 |
FieldSet typeFieldSet = new FieldSet();
|
1680 |
raphael |
258 |
typeFieldSet.setHeadingHtml("Spécimens «types»");
|
859 |
jpm |
259 |
typeFieldSet.setCollapsible(true);
|
|
|
260 |
typeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
|
|
261 |
|
|
|
262 |
specimenTypeCombo = new ChampComboBoxListeValeurs(i18nC.specimenTypeCollection(), "onpi", tabIndex++);
|
|
|
263 |
typeFieldSet.add(specimenTypeCombo);
|
|
|
264 |
|
|
|
265 |
ConteneurMultiChamps nbreTypeConteneur = new ConteneurMultiChamps(i18nC.nbreSpecimenTypeCollection());
|
|
|
266 |
|
|
|
267 |
nbreTypeChp = new NumberField();
|
|
|
268 |
nbreTypeChp.setFormat(NumberFormat.getFormat("#"));
|
|
|
269 |
nbreTypeConteneur.ajouterChamp(nbreTypeChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
|
|
|
270 |
|
|
|
271 |
precisionTypeNbreCombo = new ChampComboBoxListeValeurs(null, "ea");
|
|
|
272 |
precisionTypeNbreCombo.setTrie("id_valeur");
|
|
|
273 |
precisionTypeNbreCombo.setEmptyText(i18nC.precisionNbreSpecimenTypeCollectionChpVide());
|
|
|
274 |
nbreTypeConteneur.ajouterChamp(precisionTypeNbreCombo);
|
|
|
275 |
|
|
|
276 |
typeFieldSet.add(nbreTypeConteneur);
|
|
|
277 |
|
|
|
278 |
classementSpecimenTypeCombo = new ChampComboBoxListeValeurs(i18nC.classementSpecimenTypeCollection(), "typeClassement", tabIndex++);
|
|
|
279 |
typeFieldSet.add(classementSpecimenTypeCombo);
|
|
|
280 |
|
|
|
281 |
Text infoType = new Text(i18nC.specimenTypeCollectionInfo());
|
|
|
282 |
typeFieldSet.add(infoType);
|
|
|
283 |
|
|
|
284 |
this.add(typeFieldSet);
|
|
|
285 |
}
|
|
|
286 |
|
867 |
jpm |
287 |
public void peupler() {
|
875 |
jpm |
288 |
initialiserCollection();
|
867 |
jpm |
289 |
if (collection != null) {
|
|
|
290 |
idCollectionChp.setValue(collection.getId());
|
875 |
jpm |
291 |
setValeurComboStructures();
|
|
|
292 |
setValeurComboCollections();
|
867 |
jpm |
293 |
|
|
|
294 |
typeDepotCombo.peupler(collection.getTypeDepot());
|
|
|
295 |
coteChp.setValue(collection.getCote());
|
|
|
296 |
idAlternatifsChp.peupler(collection.getIdAlternatif());
|
|
|
297 |
nomsAlternatifsChp.peupler(collection.getNomAlternatif());
|
|
|
298 |
codesAlternatifsChp.peupler(collection.getCode());
|
|
|
299 |
|
|
|
300 |
descriptionChp.setValue(collection.getDescription());
|
|
|
301 |
descriptionSpecialisteChp.setValue(collection.getDescriptionSpecialiste());
|
|
|
302 |
historiqueChp.setValue(collection.getHistorique());
|
|
|
303 |
urlsChp.peupler(collection.getUrls());
|
|
|
304 |
|
1239 |
cyprien |
305 |
periodeConstitutionChp.peupler(collection.getPeriodeConstitution());
|
867 |
jpm |
306 |
groupementPrincipeCombo.peupler(collection.getGroupementPrincipe());
|
|
|
307 |
butRealisationCombo.peupler(collection.getGroupementBut());
|
|
|
308 |
lieuCouvertureChp.peupler(collection.getCouvertureLieu());
|
|
|
309 |
|
|
|
310 |
specimenTypeCombo.peupler(collection.getSpecimenType());
|
875 |
jpm |
311 |
nbreTypeChp.setValue((collection.getSpecimenTypeNbre().equals("") ? 0 : Integer.parseInt(collection.getSpecimenTypeNbre())));
|
867 |
jpm |
312 |
precisionTypeNbreCombo.peupler(collection.getSpecimenTypeNbrePrecision());
|
|
|
313 |
classementSpecimenTypeCombo.peupler(collection.getSpecimenTypeClassement());
|
|
|
314 |
}
|
|
|
315 |
}
|
|
|
316 |
|
875 |
jpm |
317 |
public ArrayList<String> verifier() {
|
|
|
318 |
ArrayList<String> messages = new ArrayList<String>();
|
|
|
319 |
return messages;
|
|
|
320 |
}
|
|
|
321 |
|
867 |
jpm |
322 |
public void collecter() {
|
875 |
jpm |
323 |
initialiserCollection();
|
1613 |
aurelien |
324 |
// l'onglet collection est obligatoirement rempli lors d'un ajout
|
|
|
325 |
if (this.mode == Formulaire.MODE_AJOUTER || etreAccede()) {
|
867 |
jpm |
326 |
collectionCollectee.setId(idCollectionChp.getValue());
|
875 |
jpm |
327 |
collectionCollectee.setIdStructure(getValeurComboStructures());
|
|
|
328 |
collectionCollectee.setCollectionMereId(getValeurComboCollections());
|
867 |
jpm |
329 |
|
|
|
330 |
collectionCollectee.setTypeDepot(typeDepotCombo.getValeur());
|
|
|
331 |
collectionCollectee.setCote(coteChp.getValue());
|
|
|
332 |
collectionCollectee.setIdAlternatif(idAlternatifsChp.getValeurs());
|
|
|
333 |
collectionCollectee.setNomAlternatif(nomsAlternatifsChp.getValeurs());
|
|
|
334 |
collectionCollectee.setCode(codesAlternatifsChp.getValeurs());
|
|
|
335 |
|
|
|
336 |
collectionCollectee.setDescription(descriptionChp.getValue());
|
|
|
337 |
collectionCollectee.setDescriptionSpecialiste(descriptionSpecialisteChp.getValue());
|
|
|
338 |
collectionCollectee.setHistorique(historiqueChp.getValue());
|
|
|
339 |
collectionCollectee.setUrls(urlsChp.getValeurs());
|
|
|
340 |
|
1018 |
jpm |
341 |
collectionCollectee.setPeriodeConstitution(periodeConstitutionChp.getValeur());
|
867 |
jpm |
342 |
collectionCollectee.setGroupementPrincipe(groupementPrincipeCombo.getValeur());
|
|
|
343 |
collectionCollectee.setGroupementBut(butRealisationCombo.getValeur());
|
|
|
344 |
collectionCollectee.setCouvertureLieu(lieuCouvertureChp.getValeurs());
|
|
|
345 |
|
|
|
346 |
collectionCollectee.setSpecimenType(specimenTypeCombo.getValeur());
|
968 |
jpm |
347 |
if (nbreTypeChp.getValue() != null) {
|
|
|
348 |
collectionCollectee.setSpecimenTypeNbre(nbreTypeChp.getValue().toString());
|
|
|
349 |
}
|
867 |
jpm |
350 |
collectionCollectee.setSpecimenTypeNbrePrecision(precisionTypeNbreCombo.getValeur());
|
|
|
351 |
collectionCollectee.setSpecimenTypeClassement(classementSpecimenTypeCombo.getValeur());
|
|
|
352 |
}
|
|
|
353 |
}
|
|
|
354 |
|
875 |
jpm |
355 |
private String getValeurComboStructures() {
|
|
|
356 |
String valeur = "";
|
1329 |
cyprien |
357 |
if (structuresCombo.getCombo().getValue() != null) {
|
|
|
358 |
Structure structure = new Structure(structuresCombo.getValeur());
|
|
|
359 |
valeur = structure.getId();
|
875 |
jpm |
360 |
}
|
|
|
361 |
return valeur;
|
|
|
362 |
}
|
|
|
363 |
private void setValeurComboStructures() {
|
1513 |
jpm |
364 |
if (structuresCombo.getCombo().getStore() != null
|
1428 |
cyprien |
365 |
&& collection != null
|
|
|
366 |
&& collection.getStructureNom() != null
|
|
|
367 |
&& !UtilString.isEmpty(collection.getStructureNom())) {
|
|
|
368 |
structuresCombo.chargerValeurInitiale(collection.getStructureNom(), "cs_nom");
|
|
|
369 |
} else {
|
|
|
370 |
structuresCombo.getCombo().setValue(null);
|
867 |
jpm |
371 |
}
|
|
|
372 |
}
|
|
|
373 |
|
875 |
jpm |
374 |
private String getValeurComboCollections() {
|
|
|
375 |
String valeur = "";
|
1329 |
cyprien |
376 |
if (collectionsCombo.getCombo().getValue() != null) {
|
|
|
377 |
Collection collection = new Collection(collectionsCombo.getValeur());
|
|
|
378 |
valeur = collection.getId();
|
875 |
jpm |
379 |
}
|
|
|
380 |
return valeur;
|
|
|
381 |
}
|
1428 |
cyprien |
382 |
private void setValeurComboCollections() {
|
|
|
383 |
if (collectionsCombo.getCombo().getStore() != null
|
|
|
384 |
&& collection != null
|
|
|
385 |
&& collection.getCollectionMereNom() != null
|
|
|
386 |
&& !UtilString.isEmpty(collection.getCollectionMereNom())) {
|
|
|
387 |
collectionsCombo.chargerValeurInitiale(collection.getCollectionMereNom(), "cc_nom");
|
867 |
jpm |
388 |
}
|
|
|
389 |
}
|
|
|
390 |
|
687 |
jp_milcent |
391 |
public void rafraichir(Object nouvellesDonnees) {
|
1329 |
cyprien |
392 |
if (nouvellesDonnees instanceof ValeurListe) {
|
858 |
jpm |
393 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
|
|
394 |
rafraichirValeurListe(listeValeurs);
|
687 |
jp_milcent |
395 |
} else {
|
951 |
jpm |
396 |
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
|
687 |
jp_milcent |
397 |
}
|
|
|
398 |
}
|
|
|
399 |
|
|
|
400 |
private void rafraichirValeurListe(ValeurListe listeValeurs) {
|
858 |
jpm |
401 |
if (listeValeurs.getId().equals(config.getListeId("typeDepot"))) {
|
831 |
jpm |
402 |
Formulaire.rafraichirComboBox(listeValeurs, typeDepotCombo);
|
687 |
jp_milcent |
403 |
} else {
|
951 |
jpm |
404 |
Debug.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!");
|
687 |
jp_milcent |
405 |
}
|
|
|
406 |
}
|
|
|
407 |
|
703 |
jp_milcent |
408 |
|
687 |
jp_milcent |
409 |
|
|
|
410 |
}
|