Line 3... |
Line 3... |
3 |
import java.util.ArrayList;
|
3 |
import java.util.ArrayList;
|
Line 4... |
Line 4... |
4 |
|
4 |
|
5 |
import org.tela_botanica.client.ComposantClass;
|
5 |
import org.tela_botanica.client.ComposantClass;
|
6 |
import org.tela_botanica.client.Mediateur;
|
6 |
import org.tela_botanica.client.Mediateur;
|
- |
|
7 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
7 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
8 |
import org.tela_botanica.client.composants.InfoLogger;
|
8 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
9 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
9 |
import org.tela_botanica.client.modeles.Information;
|
10 |
import org.tela_botanica.client.modeles.Information;
|
10 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
11 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
11 |
import org.tela_botanica.client.modeles.Valeur;
|
12 |
import org.tela_botanica.client.modeles.Valeur;
|
Line 240... |
Line 241... |
240 |
commentaireOnglet = new CollectionFormCommentaire(this);
|
241 |
commentaireOnglet = new CollectionFormCommentaire(this);
|
241 |
return commentaireOnglet;
|
242 |
return commentaireOnglet;
|
242 |
}
|
243 |
}
|
Line 243... |
Line 244... |
243 |
|
244 |
|
- |
|
245 |
public void rafraichir(Object nouvellesDonnees) {
|
- |
|
246 |
Debug.log("<$$$> BEGIN CollectionForm.rafraichir()");
|
244 |
public void rafraichir(Object nouvellesDonnees) {
|
247 |
|
245 |
if (nouvellesDonnees instanceof Information) {
|
248 |
if (nouvellesDonnees instanceof Information) {
|
246 |
Information info = (Information) nouvellesDonnees;
|
249 |
Information info = (Information) nouvellesDonnees;
|
247 |
rafraichirInformation(info);
|
250 |
rafraichirInformation(info);
|
248 |
} else {
|
251 |
} else {
|
249 |
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
|
252 |
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
|
- |
|
253 |
}
|
- |
|
254 |
Debug.log("<$$$> CollectionForm.rafraichir() : appel à controlerFermeture()");
|
Line 250... |
Line 255... |
250 |
}
|
255 |
controlerFermeture();
|
251 |
|
256 |
|
Line 252... |
Line 257... |
252 |
controlerFermetureApresRafraichissement();
|
257 |
Debug.log("<$$$> END CollectionForm.rafraichir()");
|
253 |
}
|
258 |
}
|
254 |
|
259 |
|
255 |
private void rafraichirInformation(Information info) {
|
260 |
private void rafraichirInformation(Information info) {
|
256 |
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
|
261 |
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
|
Line 257... |
Line 262... |
257 |
Debug.log("MESSAGES:\n"+info.getMessages().toString());
|
262 |
Debug.log("MESSAGES:\n"+info.getMessages().toString());
|
258 |
}
|
263 |
}
|
259 |
String infoType = info.getType();
|
264 |
String infoType = info.getType();
|
260 |
|
265 |
|
261 |
if (infoType.equals("modif_collection")) {
|
266 |
if (infoType.equals("modif_collection")) {
|
262 |
Info.display("Modification d'une collection", info.toString());
|
267 |
InfoLogger.display("Modification d'une collection", info.toString());
|
263 |
} else if (infoType.equals("selection_collection")) {
|
268 |
} else if (infoType.equals("selection_collection")) {
|
264 |
Info.display("Modification d'une collection", info.toString());
|
269 |
InfoLogger.display("Modification d'une collection", info.toString());
|
265 |
if (info.getDonnee(0) != null) {
|
270 |
if (info.getDonnee(0) != null) {
|
266 |
collection = (Collection) info.getDonnee(0);
|
271 |
collection = (Collection) info.getDonnee(0);
|
267 |
}
|
272 |
}
|
268 |
peupler();
|
273 |
peupler();
|
269 |
genererTitreFormulaire();
|
274 |
genererTitreFormulaire();
|
Line 270... |
Line 275... |
270 |
} else if (infoType.equals("ajout_collection")) {
|
275 |
} else if (infoType.equals("ajout_collection")) {
|
271 |
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
|
276 |
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
|
272 |
String collectionId = (String) info.getDonnee(0);
|
277 |
String collectionId = (String) info.getDonnee(0);
|
273 |
Info.display("Ajout d'une collection", "La collection '"+collectionId+"' a bien été ajoutée");
|
278 |
InfoLogger.display("Ajout d'une collection", "La collection '"+collectionId+"' a bien été ajoutée");
|
274 |
|
279 |
|
275 |
// Suite à la récupération de l'id de l'institution nouvellement ajoutée nous ajoutons les personnes et les publications liées
|
280 |
// Suite à la récupération de l'id de l'institution nouvellement ajoutée nous ajoutons les personnes et les publications liées
|
276 |
personneOnglet.rafraichir(info);
|
281 |
personneOnglet.rafraichir(info);
|
277 |
publicationOnglet.rafraichir(info);
|
282 |
publicationOnglet.rafraichir(info);
|
278 |
commentaireOnglet.rafraichir(info);
|
283 |
commentaireOnglet.rafraichir(info);
|
279 |
} else {
|
284 |
} else {
|
280 |
Info.display("Ajout d'une collection", info.toString());
|
285 |
InfoLogger.display("Ajout d'une collection", info.toString());
|
Line 304... |
Line 309... |
304 |
inventaireOnglet.peupler();
|
309 |
inventaireOnglet.peupler();
|
305 |
commentaireOnglet.peupler();
|
310 |
commentaireOnglet.peupler();
|
306 |
}
|
311 |
}
|
Line 307... |
Line 312... |
307 |
|
312 |
|
- |
|
313 |
public boolean soumettreFormulaire() {
|
- |
|
314 |
|
- |
|
315 |
Debug.log("<$$$> BEGIN CollectionForm.soumettreFormulaire()");
|
308 |
public boolean soumettreFormulaire() {
|
316 |
|
309 |
// Vérification de la validité des champs du formulaire
|
317 |
// Vérification de la validité des champs du formulaire
|
310 |
boolean formulaireValide = verifierFormulaire();
|
318 |
boolean formulaireValide = verifierFormulaire();
|
311 |
if (formulaireValide) {
|
319 |
if (formulaireValide) {
|
312 |
// Collecte des données du formulaire
|
320 |
// Collecte des données du formulaire
|
313 |
Collection collectionAEnregistrer = collecterCollection();
|
321 |
Collection collectionAEnregistrer = collecterCollection();
|
314 |
if (mode.equals(MODE_AJOUTER)) {
|
322 |
if (mode.equals(MODE_AJOUTER)) {
|
315 |
mediateur.ajouterCollection(this, collectionAEnregistrer);
|
323 |
mediateur.ajouterCollection(this, collectionAEnregistrer);
|
316 |
} else if (mode.equals(MODE_MODIFIER)) {
|
324 |
} else if (mode.equals(MODE_MODIFIER)) {
|
317 |
if (collectionAEnregistrer == null) {
|
325 |
if (collectionAEnregistrer == null) {
|
- |
|
326 |
InfoLogger.display("Modification d'une collection", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
|
318 |
Info.display("Modification d'une collection", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
|
327 |
this.controlerFermeture();
|
319 |
} else {
|
328 |
} else {
|
320 |
mediateur.modifierCollection(this, collectionAEnregistrer);
|
329 |
mediateur.modifierCollection(this, collectionAEnregistrer);
|
321 |
}
|
330 |
}
|
Line 322... |
Line 331... |
322 |
}
|
331 |
}
|
323 |
|
332 |
|
- |
|
333 |
soumettreOnglets();
|
- |
|
334 |
}
|
- |
|
335 |
|
324 |
soumettreOnglets();
|
336 |
Debug.log("<$$$> END CollectionForm.soumettreFormulaire()");
|
325 |
}
|
337 |
|
Line 326... |
Line 338... |
326 |
return formulaireValide;
|
338 |
return formulaireValide;
|
327 |
}
|
339 |
}
|