1 |
package org.tela_botanica.client.vues.collection;
|
1 |
package org.tela_botanica.client.vues.collection;
|
2 |
|
2 |
|
3 |
import java.util.HashMap;
|
3 |
import java.util.HashMap;
|
4 |
import java.util.Iterator;
|
4 |
import java.util.Iterator;
|
5 |
|
5 |
|
6 |
import org.tela_botanica.client.Mediateur;
|
6 |
import org.tela_botanica.client.Mediateur;
|
7 |
import org.tela_botanica.client.composants.ChampCaseACocher;
|
7 |
import org.tela_botanica.client.composants.ChampCaseACocher;
|
8 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
8 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
9 |
import org.tela_botanica.client.composants.ChampSliderPourcentage;
|
9 |
import org.tela_botanica.client.composants.ChampSliderPourcentage;
|
10 |
import org.tela_botanica.client.composants.ConteneurMultiChamps;
|
- |
|
11 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
10 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
12 |
import org.tela_botanica.client.modeles.aDonnee;
|
11 |
import org.tela_botanica.client.modeles.aDonnee;
|
13 |
import org.tela_botanica.client.modeles.collection.Collection;
|
12 |
import org.tela_botanica.client.modeles.collection.Collection;
|
14 |
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
|
13 |
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
|
15 |
import org.tela_botanica.client.util.Debug;
|
14 |
import org.tela_botanica.client.util.Debug;
|
16 |
import org.tela_botanica.client.util.Pattern;
|
15 |
import org.tela_botanica.client.util.Pattern;
|
17 |
import org.tela_botanica.client.util.UtilDate;
|
- |
|
18 |
import org.tela_botanica.client.util.UtilString;
|
16 |
import org.tela_botanica.client.util.UtilString;
|
19 |
import org.tela_botanica.client.vues.Formulaire;
|
17 |
import org.tela_botanica.client.vues.Formulaire;
|
20 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
18 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
21 |
|
- |
|
22 |
import com.extjs.gxt.ui.client.util.Margins;
|
19 |
|
23 |
import com.extjs.gxt.ui.client.widget.Text;
|
- |
|
24 |
import com.extjs.gxt.ui.client.widget.form.DateField;
|
20 |
import com.extjs.gxt.ui.client.widget.Text;
|
25 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
21 |
import com.extjs.gxt.ui.client.widget.form.FieldSet;
|
26 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
22 |
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
27 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
23 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
28 |
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
|
- |
|
29 |
|
24 |
|
30 |
public class CollectionFormContenu extends FormulaireOnglet implements Rafraichissable {
|
25 |
public class CollectionFormContenu extends FormulaireOnglet implements Rafraichissable {
|
31 |
|
26 |
|
32 |
public static final String ID = "contenu";
|
27 |
public static final String ID = "contenu";
|
33 |
private Collection collection = null;
|
28 |
private Collection collection = null;
|
34 |
private CollectionBotanique collectionBotanique = null;
|
29 |
private CollectionBotanique collectionBotanique = null;
|
35 |
private Collection collectionCollectee = null;
|
30 |
private Collection collectionCollectee = null;
|
36 |
private CollectionBotanique collectionBotaniqueCollectee = null;
|
31 |
private CollectionBotanique collectionBotaniqueCollectee = null;
|
37 |
|
32 |
|
38 |
private ChampCaseACocher natureChp = null;
|
33 |
private ChampCaseACocher natureChp = null;
|
39 |
private TextArea specialiteChp = null;
|
34 |
private TextArea specialiteChp = null;
|
40 |
private ChampComboBoxListeValeurs dateDebutCombo = null;
|
- |
|
41 |
private ChampComboBoxListeValeurs dateFinCombo = null;
|
- |
|
42 |
private DateField dateDebutChp = null;
|
- |
|
43 |
private DateField dateFinChp = null;
|
- |
|
44 |
private TextArea annotationClassementChp = null;
|
35 |
private TextArea annotationClassementChp = null;
|
45 |
private ChampComboBoxListeValeurs etatClassementCombo = null;
|
36 |
private ChampComboBoxListeValeurs etatClassementCombo = null;
|
46 |
private ChampComboBoxListeValeurs precisionDateCombo = null;
|
37 |
private ChampComboBoxListeValeurs precisionDateCombo = null;
|
47 |
private ChampComboBoxListeValeurs precisionLocaliteCombo = null;
|
38 |
private ChampComboBoxListeValeurs precisionLocaliteCombo = null;
|
48 |
private TextArea etiquetteAnnotationChp = null;
|
39 |
private TextArea etiquetteAnnotationChp = null;
|
49 |
private ChampComboBoxListeValeurs integreCollectionCombo = null;
|
40 |
private ChampComboBoxListeValeurs integreCollectionCombo = null;
|
50 |
private ChampComboBoxListeValeurs infoIntegreCollectionCombo = null;
|
41 |
private ChampComboBoxListeValeurs infoIntegreCollectionCombo = null;
|
51 |
private ChampSliderPourcentage auteurTitrePourcentChp;
|
42 |
private ChampSliderPourcentage auteurTitrePourcentChp;
|
52 |
private ChampSliderPourcentage famillePourcentChp;
|
43 |
private ChampSliderPourcentage famillePourcentChp;
|
53 |
private ChampSliderPourcentage genrePourcentChp;
|
44 |
private ChampSliderPourcentage genrePourcentChp;
|
54 |
private ChampSliderPourcentage spPourcentChp;
|
45 |
private ChampSliderPourcentage spPourcentChp;
|
55 |
private ChampSliderPourcentage auteurSpPourcentChp;
|
46 |
private ChampSliderPourcentage auteurSpPourcentChp;
|
56 |
private ChampSliderPourcentage localitePourcentChp;
|
47 |
private ChampSliderPourcentage localitePourcentChp;
|
57 |
private ChampSliderPourcentage datePourcentChp;
|
48 |
private ChampSliderPourcentage datePourcentChp;
|
58 |
|
49 |
|
59 |
public CollectionFormContenu(Formulaire formulaireCourrant) {
|
50 |
public CollectionFormContenu(Formulaire formulaireCourrant) {
|
60 |
initialiserOnglet(formulaireCourrant);
|
51 |
initialiserOnglet(formulaireCourrant);
|
61 |
setId(ID);
|
52 |
setId(ID);
|
62 |
setText(Mediateur.i18nC.collectionContenu());
|
53 |
setText(Mediateur.i18nC.collectionContenu());
|
63 |
|
54 |
|
64 |
creerFieldsetNature();
|
55 |
creerFieldsetNature();
|
65 |
// TODO : réaliser un champ couverture géographique détaillé
|
56 |
// TODO : réaliser un champ couverture géographique détaillé
|
66 |
creerFieldsetPeriode();
|
- |
|
67 |
creerFieldsetClassement();
|
57 |
creerFieldsetClassement();
|
68 |
creerFieldsetEtiquette();
|
58 |
creerFieldsetEtiquette();
|
69 |
creerFieldsetIntegration();
|
59 |
creerFieldsetIntegration();
|
70 |
}
|
60 |
}
|
71 |
|
61 |
|
72 |
private void creerFieldsetNature() {
|
62 |
private void creerFieldsetNature() {
|
73 |
FieldSet natureFieldSet = new FieldSet();
|
63 |
FieldSet natureFieldSet = new FieldSet();
|
74 |
natureFieldSet.setHeadingHtml(i18nC.collectionNatureTitre());
|
64 |
natureFieldSet.setHeadingHtml(i18nC.collectionNatureTitre());
|
75 |
natureFieldSet.setCollapsible(true);
|
65 |
natureFieldSet.setCollapsible(true);
|
76 |
natureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
66 |
natureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
77 |
|
67 |
|
78 |
natureChp = new ChampCaseACocher(i18nC.natureVegetaleContenu(), "natureVegetale", false);
|
68 |
natureChp = new ChampCaseACocher(i18nC.natureVegetaleContenu(), "natureVegetale", false);
|
79 |
natureFieldSet.add(natureChp);
|
69 |
natureFieldSet.add(natureChp);
|
80 |
|
70 |
|
81 |
specialiteChp = new TextArea();
|
71 |
specialiteChp = new TextArea();
|
82 |
specialiteChp.setFieldLabel(i18nC.specialiteCollection());
|
72 |
specialiteChp.setFieldLabel(i18nC.specialiteCollection());
|
83 |
specialiteChp.setToolTip(i18nC.specialiteCollectionInfo());
|
73 |
specialiteChp.setToolTip(i18nC.specialiteCollectionInfo());
|
84 |
natureFieldSet.add(specialiteChp, new FormData(550, 0));
|
74 |
natureFieldSet.add(specialiteChp, new FormData(550, 0));
|
85 |
|
75 |
|
86 |
add(natureFieldSet);
|
76 |
add(natureFieldSet);
|
87 |
}
|
77 |
}
|
88 |
|
- |
|
89 |
private void creerFieldsetPeriode() {
|
- |
|
90 |
FieldSet periodeFieldSet = new FieldSet();
|
- |
|
91 |
periodeFieldSet.setHeadingHtml(i18nC.collectionConstitutionTitre());
|
- |
|
92 |
periodeFieldSet.setCollapsible(true);
|
- |
|
93 |
periodeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
- |
|
94 |
|
- |
|
95 |
ConteneurMultiChamps dateDebutConteneur = new ConteneurMultiChamps(i18nC.dateDebutCollection());
|
- |
|
96 |
|
- |
|
97 |
dateDebutChp = new DateField();
|
- |
|
98 |
dateDebutChp.getPropertyEditor().setFormat(UtilDate.formatDateFr);
|
- |
|
99 |
dateDebutChp.getPropertyEditor().setParseStrict(false);
|
- |
|
100 |
dateDebutChp.setFormatValue(true);
|
- |
|
101 |
dateDebutConteneur.ajouterChamp(dateDebutChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
|
- |
|
102 |
|
- |
|
103 |
dateDebutCombo = new ChampComboBoxListeValeurs(null, "dateDebut");
|
- |
|
104 |
dateDebutCombo.setTrie("id_valeur");
|
- |
|
105 |
dateDebutConteneur.ajouterChamp(dateDebutCombo);
|
- |
|
106 |
|
- |
|
107 |
periodeFieldSet.add(dateDebutConteneur);
|
- |
|
108 |
|
- |
|
109 |
ConteneurMultiChamps dateFinConteneur = new ConteneurMultiChamps(i18nC.dateFinCollection());
|
- |
|
110 |
|
- |
|
111 |
dateFinChp = new DateField();
|
- |
|
112 |
dateFinChp.getPropertyEditor().setFormat(UtilDate.formatDateFr);
|
- |
|
113 |
dateFinChp.getPropertyEditor().setParseStrict(false);
|
- |
|
114 |
dateFinChp.setFormatValue(true);
|
- |
|
115 |
dateFinConteneur.ajouterChamp(dateFinChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
|
- |
|
116 |
|
- |
|
117 |
dateFinCombo = new ChampComboBoxListeValeurs(null, "dateFin");
|
- |
|
118 |
dateFinCombo.setTrie("id_valeur");
|
- |
|
119 |
dateFinConteneur.ajouterChamp(dateFinCombo);
|
- |
|
120 |
|
- |
|
121 |
periodeFieldSet.add(dateFinConteneur);
|
- |
|
122 |
|
- |
|
123 |
Text infoDate = new Text(i18nC.dateApproximativeInfo());
|
- |
|
124 |
periodeFieldSet.add(infoDate);
|
78 |
|
125 |
|
- |
|
126 |
add(periodeFieldSet);
|
- |
|
127 |
}
|
79 |
|
128 |
|
80 |
|
129 |
private void creerFieldsetClassement() {
|
81 |
private void creerFieldsetClassement() {
|
130 |
FieldSet classementFieldSet = new FieldSet();
|
82 |
FieldSet classementFieldSet = new FieldSet();
|
131 |
classementFieldSet.setHeadingHtml(i18nC.collectionClassementTitre());
|
83 |
classementFieldSet.setHeadingHtml(i18nC.collectionClassementTitre());
|
132 |
classementFieldSet.setCollapsible(true);
|
84 |
classementFieldSet.setCollapsible(true);
|
133 |
classementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
85 |
classementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
134 |
|
86 |
|
135 |
etatClassementCombo = new ChampComboBoxListeValeurs(i18nC.etatClassementCollection(), "etatClassement", tabIndex++);
|
87 |
etatClassementCombo = new ChampComboBoxListeValeurs(i18nC.etatClassementCollection(), "etatClassement", tabIndex++);
|
136 |
classementFieldSet.add(etatClassementCombo, new FormData(550, 0));
|
88 |
classementFieldSet.add(etatClassementCombo, new FormData(550, 0));
|
137 |
|
89 |
|
138 |
annotationClassementChp = new TextArea();
|
90 |
annotationClassementChp = new TextArea();
|
139 |
annotationClassementChp.setFieldLabel(i18nC.annotationClassementCollection());
|
91 |
annotationClassementChp.setFieldLabel(i18nC.annotationClassementCollection());
|
140 |
classementFieldSet.add(annotationClassementChp, new FormData(550, 0));
|
92 |
classementFieldSet.add(annotationClassementChp, new FormData(550, 0));
|
141 |
|
93 |
|
142 |
Text infoClassement = new Text(i18nC.annotationClassementCollectionInfo());
|
94 |
Text infoClassement = new Text(i18nC.annotationClassementCollectionInfo());
|
143 |
classementFieldSet.add(infoClassement);
|
95 |
classementFieldSet.add(infoClassement);
|
144 |
|
96 |
|
145 |
add(classementFieldSet);
|
97 |
add(classementFieldSet);
|
146 |
}
|
98 |
}
|
147 |
|
99 |
|
148 |
private void creerFieldsetEtiquette() {
|
100 |
private void creerFieldsetEtiquette() {
|
149 |
FieldSet etiquetteFieldSet = new FieldSet();
|
101 |
FieldSet etiquetteFieldSet = new FieldSet();
|
150 |
etiquetteFieldSet.setHeadingHtml(i18nC.collectionEtiquetteTitre());
|
102 |
etiquetteFieldSet.setHeadingHtml(i18nC.collectionEtiquetteTitre());
|
151 |
etiquetteFieldSet.setCollapsible(true);
|
103 |
etiquetteFieldSet.setCollapsible(true);
|
152 |
etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
104 |
etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
|
153 |
|
105 |
|
154 |
Text renseignementPoucentLabel = new Text(i18nC.renseignementEtiquetteCollection());
|
106 |
Text renseignementPoucentLabel = new Text(i18nC.renseignementEtiquetteCollection());
|
155 |
renseignementPoucentLabel.setTagName("label");
|
107 |
renseignementPoucentLabel.setTagName("label");
|
156 |
renseignementPoucentLabel.setStyleName("x-form-item-label");
|
108 |
renseignementPoucentLabel.setStyleName("x-form-item-label");
|
157 |
etiquetteFieldSet.add(renseignementPoucentLabel);
|
109 |
etiquetteFieldSet.add(renseignementPoucentLabel);
|
158 |
|
110 |
|
159 |
auteurTitrePourcentChp = new ChampSliderPourcentage(i18nC.auteurTitrePourcentCollection());
|
111 |
auteurTitrePourcentChp = new ChampSliderPourcentage(i18nC.auteurTitrePourcentCollection());
|
160 |
etiquetteFieldSet.add(auteurTitrePourcentChp, new FormData(200, 0));
|
112 |
etiquetteFieldSet.add(auteurTitrePourcentChp, new FormData(200, 0));
|
161 |
|
113 |
|
162 |
famillePourcentChp = new ChampSliderPourcentage(i18nC.famillePourcentCollection());
|
114 |
famillePourcentChp = new ChampSliderPourcentage(i18nC.famillePourcentCollection());
|
163 |
etiquetteFieldSet.add(famillePourcentChp, new FormData(200, 0));
|
115 |
etiquetteFieldSet.add(famillePourcentChp, new FormData(200, 0));
|
164 |
|
116 |
|
165 |
genrePourcentChp = new ChampSliderPourcentage(i18nC.genrePourcentCollection());
|
117 |
genrePourcentChp = new ChampSliderPourcentage(i18nC.genrePourcentCollection());
|
166 |
etiquetteFieldSet.add(genrePourcentChp, new FormData(200, 0));
|
118 |
etiquetteFieldSet.add(genrePourcentChp, new FormData(200, 0));
|
167 |
|
119 |
|
168 |
spPourcentChp = new ChampSliderPourcentage(i18nC.spPourcentCollection());
|
120 |
spPourcentChp = new ChampSliderPourcentage(i18nC.spPourcentCollection());
|
169 |
etiquetteFieldSet.add(spPourcentChp, new FormData(200, 0));
|
121 |
etiquetteFieldSet.add(spPourcentChp, new FormData(200, 0));
|
170 |
|
122 |
|
171 |
auteurSpPourcentChp = new ChampSliderPourcentage(i18nC.auteurSpPourcentCollection());
|
123 |
auteurSpPourcentChp = new ChampSliderPourcentage(i18nC.auteurSpPourcentCollection());
|
172 |
etiquetteFieldSet.add(auteurSpPourcentChp, new FormData(200, 0));
|
124 |
etiquetteFieldSet.add(auteurSpPourcentChp, new FormData(200, 0));
|
173 |
|
125 |
|
174 |
localitePourcentChp = new ChampSliderPourcentage(i18nC.localitePourcentCollection());
|
126 |
localitePourcentChp = new ChampSliderPourcentage(i18nC.localitePourcentCollection());
|
175 |
etiquetteFieldSet.add(localitePourcentChp, new FormData(200, 0));
|
127 |
etiquetteFieldSet.add(localitePourcentChp, new FormData(200, 0));
|
176 |
|
128 |
|
177 |
datePourcentChp = new ChampSliderPourcentage(i18nC.datePourcentCollection());
|
129 |
datePourcentChp = new ChampSliderPourcentage(i18nC.datePourcentCollection());
|
178 |
etiquetteFieldSet.add(datePourcentChp, new FormData(200, 0));
|
130 |
etiquetteFieldSet.add(datePourcentChp, new FormData(200, 0));
|
179 |
|
131 |
|
180 |
precisionLocaliteCombo = new ChampComboBoxListeValeurs(i18nC.precisionLocaliteCollection(), "onep", tabIndex++);
|
132 |
precisionLocaliteCombo = new ChampComboBoxListeValeurs(i18nC.precisionLocaliteCollection(), "onep", tabIndex++);
|
181 |
etiquetteFieldSet.add(precisionLocaliteCombo);
|
133 |
etiquetteFieldSet.add(precisionLocaliteCombo);
|
182 |
|
134 |
|
183 |
precisionDateCombo = new ChampComboBoxListeValeurs(i18nC.precisionDateCollection(), "onep", tabIndex++);
|
135 |
precisionDateCombo = new ChampComboBoxListeValeurs(i18nC.precisionDateCollection(), "onep", tabIndex++);
|
184 |
etiquetteFieldSet.add(precisionDateCombo);
|
136 |
etiquetteFieldSet.add(precisionDateCombo);
|
185 |
|
137 |
|
186 |
etiquetteAnnotationChp = new TextArea();
|
138 |
etiquetteAnnotationChp = new TextArea();
|
187 |
etiquetteAnnotationChp.setFieldLabel(i18nC.etiquetteAnnotationCollection());
|
139 |
etiquetteAnnotationChp.setFieldLabel(i18nC.etiquetteAnnotationCollection());
|
188 |
etiquetteAnnotationChp.setToolTip(i18nC.etiquetteAnnotationCollectionInfo());
|
140 |
etiquetteAnnotationChp.setToolTip(i18nC.etiquetteAnnotationCollectionInfo());
|
189 |
etiquetteFieldSet.add(etiquetteAnnotationChp, new FormData(550, 0));
|
141 |
etiquetteFieldSet.add(etiquetteAnnotationChp, new FormData(550, 0));
|
190 |
|
142 |
|
191 |
add(etiquetteFieldSet);
|
143 |
add(etiquetteFieldSet);
|
192 |
}
|
144 |
}
|
193 |
|
145 |
|
194 |
private String collecterEtiquetteRenseignement() {
|
146 |
private String collecterEtiquetteRenseignement() {
|
195 |
String renseignement = "";
|
147 |
String renseignement = "";
|
196 |
renseignement += creerTypeValeur("AT", auteurTitrePourcentChp.getValeur());
|
148 |
renseignement += creerTypeValeur("AT", auteurTitrePourcentChp.getValeur());
|
197 |
renseignement += creerTypeValeur("F", famillePourcentChp.getValeur());
|
149 |
renseignement += creerTypeValeur("F", famillePourcentChp.getValeur());
|
198 |
renseignement += creerTypeValeur("G", genrePourcentChp.getValeur());
|
150 |
renseignement += creerTypeValeur("G", genrePourcentChp.getValeur());
|
199 |
renseignement += creerTypeValeur("SP", spPourcentChp.getValeur());
|
151 |
renseignement += creerTypeValeur("SP", spPourcentChp.getValeur());
|
200 |
renseignement += creerTypeValeur("ASP", auteurSpPourcentChp.getValeur());
|
152 |
renseignement += creerTypeValeur("ASP", auteurSpPourcentChp.getValeur());
|
201 |
renseignement += creerTypeValeur("L", localitePourcentChp.getValeur());
|
153 |
renseignement += creerTypeValeur("L", localitePourcentChp.getValeur());
|
202 |
renseignement += creerTypeValeur("D", datePourcentChp.getValeur());
|
154 |
renseignement += creerTypeValeur("D", datePourcentChp.getValeur());
|
203 |
renseignement = renseignement.replaceFirst(aDonnee.SEPARATEUR_VALEURS+"$", "");
|
155 |
renseignement = renseignement.replaceFirst(aDonnee.SEPARATEUR_VALEURS+"$", "");
|
204 |
return renseignement;
|
156 |
return renseignement;
|
205 |
}
|
157 |
}
|
206 |
|
158 |
|
207 |
private String creerTypeValeur(String type, String valeur) {
|
159 |
private String creerTypeValeur(String type, String valeur) {
|
208 |
String retour = "";
|
160 |
String retour = "";
|
209 |
if (!UtilString.isEmpty(valeur)) {
|
161 |
if (!UtilString.isEmpty(valeur)) {
|
210 |
retour = type+aDonnee.SEPARATEUR_TYPE_VALEUR+valeur+aDonnee.SEPARATEUR_VALEURS;
|
162 |
retour = type+aDonnee.SEPARATEUR_TYPE_VALEUR+valeur+aDonnee.SEPARATEUR_VALEURS;
|
211 |
}
|
163 |
}
|
212 |
return retour;
|
164 |
return retour;
|
213 |
}
|
165 |
}
|
214 |
|
166 |
|
215 |
private void peuplerEtiquetteRenseignement(String valeurTruk) {
|
167 |
private void peuplerEtiquetteRenseignement(String valeurTruk) {
|
216 |
HashMap<String,String> infos = parserEtiquetteRenseignement(valeurTruk);
|
168 |
HashMap<String,String> infos = parserEtiquetteRenseignement(valeurTruk);
|
217 |
if (infos != null) {
|
169 |
if (infos != null) {
|
218 |
Iterator<String> it = infos.keySet().iterator();
|
170 |
Iterator<String> it = infos.keySet().iterator();
|
219 |
while (it.hasNext()) {
|
171 |
while (it.hasNext()) {
|
220 |
String cle = it.next();
|
172 |
String cle = it.next();
|
221 |
if (cle.equals("AT")) {
|
173 |
if (cle.equals("AT")) {
|
222 |
auteurTitrePourcentChp.peupler(infos.get(cle));
|
174 |
auteurTitrePourcentChp.peupler(infos.get(cle));
|
223 |
} else if (cle.equals("F")) {
|
175 |
} else if (cle.equals("F")) {
|
224 |
famillePourcentChp.peupler(infos.get(cle));
|
176 |
famillePourcentChp.peupler(infos.get(cle));
|
225 |
} else if (cle.equals("G")) {
|
177 |
} else if (cle.equals("G")) {
|
226 |
genrePourcentChp.peupler(infos.get(cle));
|
178 |
genrePourcentChp.peupler(infos.get(cle));
|
227 |
} else if (cle.equals("SP")) {
|
179 |
} else if (cle.equals("SP")) {
|
228 |
spPourcentChp.peupler(infos.get(cle));
|
180 |
spPourcentChp.peupler(infos.get(cle));
|
229 |
} else if (cle.equals("ASP")) {
|
181 |
} else if (cle.equals("ASP")) {
|
230 |
auteurSpPourcentChp.peupler(infos.get(cle));
|
182 |
auteurSpPourcentChp.peupler(infos.get(cle));
|
231 |
} else if (cle.equals("L")) {
|
183 |
} else if (cle.equals("L")) {
|
232 |
localitePourcentChp.peupler(infos.get(cle));
|
184 |
localitePourcentChp.peupler(infos.get(cle));
|
233 |
} else if (cle.equals("D")) {
|
185 |
} else if (cle.equals("D")) {
|
234 |
datePourcentChp.peupler(infos.get(cle));
|
186 |
datePourcentChp.peupler(infos.get(cle));
|
235 |
}
|
187 |
}
|
236 |
}
|
188 |
}
|
237 |
}
|
189 |
}
|
238 |
}
|
190 |
}
|
239 |
|
191 |
|
240 |
public static HashMap<String,String> parserEtiquetteRenseignement(String valeurTruk) {
|
192 |
public static HashMap<String,String> parserEtiquetteRenseignement(String valeurTruk) {
|
241 |
HashMap<String,String> infos = null;
|
193 |
HashMap<String,String> infos = null;
|
242 |
if (!UtilString.isEmpty(valeurTruk)) {
|
194 |
if (!UtilString.isEmpty(valeurTruk)) {
|
243 |
infos = new HashMap<String,String>();
|
195 |
infos = new HashMap<String,String>();
|
244 |
String[] pourcentages = valeurTruk.split(Pattern.quote(aDonnee.SEPARATEUR_VALEURS));
|
196 |
String[] pourcentages = valeurTruk.split(Pattern.quote(aDonnee.SEPARATEUR_VALEURS));
|
245 |
for (int i = 0; i < pourcentages.length; i++) {
|
197 |
for (int i = 0; i < pourcentages.length; i++) {
|
246 |
String[] pourcentageIdValeur = pourcentages[i].split(Pattern.quote(aDonnee.SEPARATEUR_TYPE_VALEUR));
|
198 |
String[] pourcentageIdValeur = pourcentages[i].split(Pattern.quote(aDonnee.SEPARATEUR_TYPE_VALEUR));
|
247 |
String id = pourcentageIdValeur[0];
|
199 |
String id = pourcentageIdValeur[0];
|
248 |
String valeur = pourcentageIdValeur[1];
|
200 |
String valeur = pourcentageIdValeur[1];
|
249 |
infos.put(id, valeur);
|
201 |
infos.put(id, valeur);
|
250 |
}
|
202 |
}
|
251 |
}
|
203 |
}
|
252 |
return infos;
|
204 |
return infos;
|
253 |
}
|
205 |
}
|
254 |
|
206 |
|
255 |
private void creerFieldsetIntegration() {
|
207 |
private void creerFieldsetIntegration() {
|
256 |
FieldSet integrationFieldSet = new FieldSet();
|
208 |
FieldSet integrationFieldSet = new FieldSet();
|
257 |
integrationFieldSet.setHeadingHtml(i18nC.collectionIntegreeTitre());
|
209 |
integrationFieldSet.setHeadingHtml(i18nC.collectionIntegreeTitre());
|
258 |
integrationFieldSet.setCollapsible(true);
|
210 |
integrationFieldSet.setCollapsible(true);
|
259 |
integrationFieldSet.setLayout(Formulaire.creerFormLayout(350, alignementLabelDefaut));
|
211 |
integrationFieldSet.setLayout(Formulaire.creerFormLayout(350, alignementLabelDefaut));
|
260 |
|
212 |
|
261 |
integreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.integreCollection(), "onpi", tabIndex++);
|
213 |
integreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.integreCollection(), "onpi", tabIndex++);
|
262 |
integrationFieldSet.add(integreCollectionCombo);
|
214 |
integrationFieldSet.add(integreCollectionCombo);
|
263 |
|
215 |
|
264 |
infoIntegreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.infoIntegreCollection(), "onp", tabIndex++);
|
216 |
infoIntegreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.infoIntegreCollection(), "onp", tabIndex++);
|
265 |
integrationFieldSet.add(infoIntegreCollectionCombo);
|
217 |
integrationFieldSet.add(infoIntegreCollectionCombo);
|
266 |
|
218 |
|
267 |
Text infoIntegration = new Text(i18nC.infoIntegrationCollection());
|
219 |
Text infoIntegration = new Text(i18nC.infoIntegrationCollection());
|
268 |
integrationFieldSet.add(infoIntegration);
|
220 |
integrationFieldSet.add(infoIntegration);
|
269 |
|
221 |
|
270 |
add(integrationFieldSet);
|
222 |
add(integrationFieldSet);
|
271 |
}
|
223 |
}
|
272 |
|
224 |
|
273 |
public void peupler() {
|
225 |
public void peupler() {
|
274 |
initialiserCollection();
|
226 |
initialiserCollection();
|
275 |
if (collectionBotanique != null) {
|
227 |
if (collectionBotanique != null) {
|
276 |
natureChp.peupler(collectionBotanique.getNature());
|
228 |
natureChp.peupler(collectionBotanique.getNature());
|
277 |
specialiteChp.setValue(collectionBotanique.getSpecialite());
|
229 |
specialiteChp.setValue(collectionBotanique.getSpecialite());
|
278 |
|
- |
|
279 |
dateDebutChp.setValue(UtilString.formaterEnDate(collectionBotanique.getRecolteDateDebut()));
|
- |
|
280 |
dateDebutCombo.peupler(collectionBotanique.getRecolteDateDebutType());
|
- |
|
281 |
dateFinChp.setValue(UtilString.formaterEnDate(collectionBotanique.getRecolteDateFin()));
|
- |
|
282 |
dateFinCombo.peupler(collectionBotanique.getRecolteDateFinType());
|
- |
|
283 |
|
230 |
|
284 |
etatClassementCombo.peupler(collectionBotanique.getClassementEtat());
|
231 |
etatClassementCombo.peupler(collectionBotanique.getClassementEtat());
|
285 |
annotationClassementChp.setValue(collectionBotanique.getClassementAnnotation());
|
232 |
annotationClassementChp.setValue(collectionBotanique.getClassementAnnotation());
|
286 |
|
233 |
|
287 |
peuplerEtiquetteRenseignement(collectionBotanique.getEtiquetteRenseignement());
|
234 |
peuplerEtiquetteRenseignement(collectionBotanique.getEtiquetteRenseignement());
|
288 |
precisionLocaliteCombo.peupler(collectionBotanique.getPrecisionLocalite());
|
235 |
precisionLocaliteCombo.peupler(collectionBotanique.getPrecisionLocalite());
|
289 |
precisionDateCombo.peupler(collectionBotanique.getPrecisionDate());
|
236 |
precisionDateCombo.peupler(collectionBotanique.getPrecisionDate());
|
290 |
etiquetteAnnotationChp.setValue(collectionBotanique.getAnnotationsDiverses());
|
237 |
etiquetteAnnotationChp.setValue(collectionBotanique.getAnnotationsDiverses());
|
291 |
|
238 |
|
292 |
integreCollectionCombo.peupler(collectionBotanique.getCollectionIntegre());
|
239 |
integreCollectionCombo.peupler(collectionBotanique.getCollectionIntegre());
|
293 |
infoIntegreCollectionCombo.peupler(collectionBotanique.getCollectionIntegreInfo());
|
240 |
infoIntegreCollectionCombo.peupler(collectionBotanique.getCollectionIntegreInfo());
|
294 |
}
|
241 |
}
|
295 |
}
|
242 |
}
|
296 |
|
243 |
|
297 |
public void collecter() {
|
244 |
public void collecter() {
|
298 |
initialiserCollection();
|
245 |
initialiserCollection();
|
299 |
if (etreAccede()) {
|
246 |
if (etreAccede()) {
|
300 |
collectionBotaniqueCollectee.setNature(natureChp.getValeur());
|
247 |
collectionBotaniqueCollectee.setNature(natureChp.getValeur());
|
301 |
collectionBotaniqueCollectee.setSpecialite(specialiteChp.getValue());
|
248 |
collectionBotaniqueCollectee.setSpecialite(specialiteChp.getValue());
|
302 |
|
- |
|
303 |
collectionBotaniqueCollectee.setRecolteDateDebut(UtilDate.formaterEnString(dateDebutChp.getValue()));
|
- |
|
304 |
collectionBotaniqueCollectee.setRecolteDateDebutType(dateDebutCombo.getValeur());
|
- |
|
305 |
collectionBotaniqueCollectee.setRecolteDateFin(UtilDate.formaterEnString(dateFinChp.getValue()));
|
- |
|
306 |
collectionBotaniqueCollectee.setRecolteDateFinType(dateFinCombo.getValeur());
|
- |
|
307 |
|
249 |
|
308 |
collectionBotaniqueCollectee.setClassementEtat(etatClassementCombo.getValeur());
|
250 |
collectionBotaniqueCollectee.setClassementEtat(etatClassementCombo.getValeur());
|
309 |
collectionBotaniqueCollectee.setClassementAnnotation(annotationClassementChp.getValue());
|
251 |
collectionBotaniqueCollectee.setClassementAnnotation(annotationClassementChp.getValue());
|
310 |
|
252 |
|
311 |
collectionBotaniqueCollectee.setEtiquetteRenseignement(collecterEtiquetteRenseignement());
|
253 |
collectionBotaniqueCollectee.setEtiquetteRenseignement(collecterEtiquetteRenseignement());
|
312 |
collectionBotaniqueCollectee.setPrecisionLocalite(precisionLocaliteCombo.getValeur());
|
254 |
collectionBotaniqueCollectee.setPrecisionLocalite(precisionLocaliteCombo.getValeur());
|
313 |
collectionBotaniqueCollectee.setPrecisionDate(precisionDateCombo.getValeur());
|
255 |
collectionBotaniqueCollectee.setPrecisionDate(precisionDateCombo.getValeur());
|
314 |
collectionBotaniqueCollectee.setAnnotationsDiverses(etiquetteAnnotationChp.getValue());
|
256 |
collectionBotaniqueCollectee.setAnnotationsDiverses(etiquetteAnnotationChp.getValue());
|
315 |
|
257 |
|
316 |
collectionBotaniqueCollectee.setCollectionIntegre(integreCollectionCombo.getValeur());
|
258 |
collectionBotaniqueCollectee.setCollectionIntegre(integreCollectionCombo.getValeur());
|
317 |
collectionBotaniqueCollectee.setCollectionIntegreInfo(infoIntegreCollectionCombo.getValeur());
|
259 |
collectionBotaniqueCollectee.setCollectionIntegreInfo(infoIntegreCollectionCombo.getValeur());
|
318 |
}
|
260 |
}
|
319 |
}
|
261 |
}
|
320 |
|
262 |
|
321 |
private void initialiserCollection() {
|
263 |
private void initialiserCollection() {
|
322 |
collection = ((CollectionForm) formulaire).collection;
|
264 |
collection = ((CollectionForm) formulaire).collection;
|
323 |
if (collection != null) {
|
265 |
if (collection != null) {
|
324 |
collectionBotanique = collection.getBotanique();
|
266 |
collectionBotanique = collection.getBotanique();
|
325 |
}
|
267 |
}
|
326 |
|
268 |
|
327 |
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
|
269 |
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
|
328 |
if (collectionCollectee != null) {
|
270 |
if (collectionCollectee != null) {
|
329 |
collectionBotaniqueCollectee = collectionCollectee.getBotanique();
|
271 |
collectionBotaniqueCollectee = collectionCollectee.getBotanique();
|
330 |
}
|
272 |
}
|
331 |
}
|
273 |
}
|
332 |
|
274 |
|
333 |
public void rafraichir(Object nouvellesDonnees) {
|
275 |
public void rafraichir(Object nouvellesDonnees) {
|
334 |
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
|
276 |
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
|
335 |
}
|
277 |
}
|
336 |
}
|
278 |
}
|