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