Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1612 → Rev 1613

/trunk/src/org/tela_botanica/client/vues/Formulaire.java
127,7 → 127,7
InfoLogger.display(i18nC.modeAnonyme(), i18nC.identificationNecessaire());
}
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
mediateur.clicMenu(menuIdCourant);
fermerFormulaire();
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_REINITIALISER)) {
reinitialiserFormulaire();
}
160,9 → 160,14
public void fermerFormulaire() {
clicBoutonvalidation = false;
panneauFormulaire.setEnabled(false);
mediateur.clicMenu(menuIdCourant);
surFermetureFormulaire();
//mediateur.clicMenu(menuIdCourant);
}
public void surFermetureFormulaire() {
// A surcharger si jamais une action spécifique doit être entreprise
}
/** Méthode simplifiant la création de FormLayout.
* Chacun des paramètres peut prendre la valeur null pour utiliser la valeur par défaut.
*
/trunk/src/org/tela_botanica/client/vues/personne/PersonneListeVue.java
13,6 → 13,7
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.personne.PersonneListe;
import org.tela_botanica.client.modeles.projet.Projet;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.BarrePaginationVue;
 
49,6 → 50,9
private Button modifier = null;
private Button supprimer = null;
private int indexElementSelectionne = 0;
private Personne personneSelectionnee = null;
public PersonneListeVue() {
mediateur = Registry.get(RegistreId.MEDIATEUR);
105,7 → 109,8
GridSelectionModel<Personne> gsmSelectionGrille = new GridSelectionModel<Personne>();
gsmSelectionGrille.addSelectionChangedListener(new SelectionChangedListener<Personne>() {
public void selectionChanged(SelectionChangedEvent<Personne> event) {
Personne personneSelectionnee = (Personne) event.getSelectedItem();
personneSelectionnee = (Personne) event.getSelectedItem();
indexElementSelectionne = store.indexOf(personneSelectionnee);
clicListe(personneSelectionnee);
}
});
181,7 → 186,21
}
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("suppression_personne")) {
if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if(info.getType().equals("personne_modifiee")) {
if(personneSelectionnee != null) {
store.remove(indexElementSelectionne);
personneSelectionnee = null;
}
Personne personneModifiee = (Personne)info.getDonnee(0);
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(personneModifiee);
store.insert(personneModifiee, indexElementSelectionne);
grille.repaint();
grille.getSelectionModel().select(indexElementSelectionne, true);
clicListe(personneModifiee);
} else if (info.getType().equals("suppression_personne")) {
InfoLogger.display("Suppression de personne", info.getMessages().toString());
pagination.getlistePaginable().recharger();
gererEtatActivationBouton();
/trunk/src/org/tela_botanica/client/vues/personne/PersonneForm.java
893,9 → 893,7
} else if (info.getType().equals("modification_personne")) {
InfoLogger.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées.");
repandreRafraichissement();
if (clicBoutonvalidation) {
mediateur.clicMenu(menuIdCourant);
}
controlerFermeture();
} else if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getDonnee(0) instanceof PersonneListe) {
/trunk/src/org/tela_botanica/client/vues/collection/CollectionListeVue.java
14,6 → 14,7
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionListe;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.util.Debug;
30,7 → 31,6
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
38,7 → 38,6
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
 
public class CollectionListeVue extends ContentPanel implements Rafraichissable {
53,6 → 52,9
private Button ajouter;
private BarrePaginationVue pagination = null;
private int indexElementSelectionne = 0;
private Collection collectionSelectionnee = null;
public CollectionListeVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
100,7 → 102,8
GridSelectionModel<Collection> modeleDeSelection = new GridSelectionModel<Collection>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Collection>() {
public void selectionChanged(SelectionChangedEvent<Collection> event) {
Collection collectionSelectionnee = (Collection) event.getSelectedItem();
collectionSelectionnee = (Collection) event.getSelectedItem();
indexElementSelectionne = store.indexOf(collectionSelectionnee);
clicListe(collectionSelectionnee);
}
});
177,6 → 180,18
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getType().equals("modif_collection")) {
if(collectionSelectionnee != null) {
store.remove(indexElementSelectionne);
collectionSelectionnee = null;
}
Collection collecModifiee = (Collection)info.getDonnee(0);
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(collecModifiee);
store.insert(collecModifiee, indexElementSelectionne);
grille.repaint();
grille.getSelectionModel().select(indexElementSelectionne, true);
clicListe(collecModifiee);
} else if (info.getType().equals("suppression_collection")) {
// Affichage d'un message d'information
InfoLogger.display(i18nC.suppressionCollection(), info.toString().replaceAll("\n", "<br />"));
/trunk/src/org/tela_botanica/client/vues/collection/CollectionFormGeneral.java
366,7 → 366,8
public void collecter() {
initialiserCollection();
if (etreAccede()) {
// l'onglet collection est obligatoirement rempli lors d'un ajout
if (this.mode == Formulaire.MODE_AJOUTER || etreAccede()) {
collectionCollectee.setId(idCollectionChp.getValue());
collectionCollectee.setIdProjet(getValeurComboProjets());
collectionCollectee.setIdStructure(getValeurComboStructures());
/trunk/src/org/tela_botanica/client/vues/collection/CollectionForm.java
21,7 → 21,6
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
29,7 → 28,7
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class CollectionForm extends Formulaire implements Rafraichissable {
 
262,6 → 261,7
if (infoType.equals("modif_collection")) {
InfoLogger.display("Modification d'une collection", info.toString());
repandreRafraichissement();
} else if (infoType.equals("selection_collection")) {
InfoLogger.display("Modification d'une collection", info.toString());
if (info.getDonnee(0) != null) {
315,7 → 315,7
if (formulaireValide) {
// Collecte des données du formulaire
Collection collectionAEnregistrer = collecterCollection();
//Window.alert(collectionAEnregistrer.getDescription());
if (mode.equals(MODE_AJOUTER)) {
mediateur.ajouterCollection(this, collectionAEnregistrer);
} else if (mode.equals(MODE_MODIFIER)) {
408,4 → 408,16
messages.addAll(personneOnglet.verifier());
return messages;
}
private void repandreRafraichissement() {
if (vueExterneARafraichirApresValidation != null) {
String type = "modif_collection";
if (mode.equals(Formulaire.MODE_AJOUTER)) {
type = "ajout_collection";
}
Information info = new Information(type);
info.setDonnee(0, collection);
vueExterneARafraichirApresValidation.rafraichir(info);
}
}
}
/trunk/src/org/tela_botanica/client/vues/collection/CollectionFormPersonne.java
365,8 → 365,8
&& !cap.getId().equals("")) {
personnesSupprimees.put("id"+idGenere++, cap);
grille.getStore().remove(relationCollectionPersonne);
}
grille.getStore().remove(relationCollectionPersonne);
}
}
 
/trunk/src/org/tela_botanica/client/vues/collection/CollectionVue.java
3,6 → 3,7
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionListe;
import org.tela_botanica.client.synchronisation.Sequenceur;
13,6 → 14,7
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.google.gwt.user.client.Window;
 
public class CollectionVue extends LayoutContainer implements Rafraichissable {
 
53,6 → 55,10
detailCollectionPanneau.rafraichir(nouvellesDonnees);
} else if (info.getType().equals("suppression_collection")) {
listeCollectionPanneau.rafraichir(nouvellesDonnees);
} else if (info.getType().equals("modif_collection")) {
listeCollectionPanneau.rafraichir(nouvellesDonnees);
} else if(info.getType().equals("collection_ajoutee")) {
mediateur.clicMenu(MenuApplicationId.COLLECTION);
}
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
/trunk/src/org/tela_botanica/client/vues/structure/StructureVue.java
3,6 → 3,7
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.synchronisation.Sequenceur;
13,6 → 14,7
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class StructureVue extends LayoutContainer implements Rafraichissable {
 
49,6 → 51,13
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("liste_structure_a_personne")) {
panneauInstitutionDetail.rafraichir(nouvellesDonnees);
} else {
if(info.getType().equals("structure_ajoutee")) {
mediateur.clicMenu(MenuApplicationId.STRUCTURE);
} else {
panneauInstitutionListe.rafraichir(nouvellesDonnees);
}
 
}
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
/trunk/src/org/tela_botanica/client/vues/structure/StructureListeVue.java
11,6 → 11,8
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.vues.BarrePaginationVue;
50,6 → 52,9
private Button ajouter;
private BarrePaginationVue pagination = null;
private int indexElementSelectionne = 0;
private Structure structureSelectionnee = null;
 
public StructureListeVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
96,7 → 101,8
GridSelectionModel<Structure> modeleDeSelection = new GridSelectionModel<Structure>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Structure>() {
public void selectionChanged(SelectionChangedEvent<Structure> event) {
Structure structureSelectionnee = (Structure) event.getSelectedItem();
structureSelectionnee = (Structure) event.getSelectedItem();
indexElementSelectionne = store.indexOf(structureSelectionnee);
clicListe(structureSelectionnee);
}
});
185,6 → 191,18
}
gererEtatActivationBouton();
} else if(info.getType().equals("structure_modifiee")) {
if(structureSelectionnee != null) {
store.remove(indexElementSelectionne);
structureSelectionnee = null;
}
Structure structureModifiee = (Structure)info.getDonnee(0);
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(structureModifiee);
store.insert(structureModifiee, indexElementSelectionne);
grille.repaint();
grille.getSelectionModel().select(indexElementSelectionne, true);
clicListe(structureModifiee);
} else if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getType().equals("suppression_structure_a_personne")) {
/trunk/src/org/tela_botanica/client/vues/structure/StructureForm.java
237,6 → 237,10
private Sequenceur sequenceur;
private Structure structure = null;
public Rafraichissable vueExterneARafraichirApresValidation = null;
public StructureForm(Mediateur mediateurCourrant, String modeDeCreation, Sequenceur sequenceur) {
initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.STRUCTURE);
this.sequenceur = sequenceur;
281,17 → 285,55
}
}
private void repandreRafraichissement() {
if (vueExterneARafraichirApresValidation != null) {
String type = "structure_modifiee";
if (mode.equals(Formulaire.MODE_AJOUTER)) {
type = "structure_ajoutee";
}
Information info = new Information(type);
info.setDonnee(0, structure);
vueExterneARafraichirApresValidation.rafraichir(info);
}
}
public boolean soumettreFormulaire() {
// Vérification de la validité des champs du formulaire
boolean fomulaireValide = verifierFormulaire();
Structure identification = collecterStructureIdentification();
structure = this.identification;
if(identification != null) {
structure = identification;
} else {
identification = this.identification;
}
 
structure.setConservation(this.conservation);
structure.setValorisation(this.valorisation);
if (fomulaireValide) {
// Collecte des données du formulaire
Structure structure = collecterStructureIdentification();
StructureConservation conservation = collecterStructureConservation();
StructureValorisation valorisation = collecterStructureValorisation();
if(conservation != null) {
structure.setConservation(conservation);
}
if(valorisation != null) {
structure.setValorisation(valorisation);
}
collecterStructurePersonnel();
structure.setPersonnel(personnel);
structure.setConservation(conservation);
structure.setValorisation(valorisation);
if (mode.equals(MODE_AJOUTER)) {
// Ajout des informations sur la Structure
mediateur.ajouterStructure(this, structure, conservation, valorisation);
742,6 → 784,8
structureARetourner = identification = structureCollectee;
}
} else {
}
return structureARetourner;
}
2033,6 → 2077,7
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
repandreRafraichissement();
} else if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
2053,6 → 2098,7
if (info.getType().equals("modif_structure")) {
InfoLogger.display("Modification d'une institution", info.toString());
controlerFermeture();
} else if (info.getType().equals("ajout_structure")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
String structureId = (String) info.getDonnee(0);
/trunk/src/org/tela_botanica/client/vues/projet/ProjetListeVue.java
15,6 → 15,7
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.projet.Projet;
import org.tela_botanica.client.modeles.projet.ProjetListe;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
40,6 → 41,7
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class ProjetListeVue extends ContentPanel implements Rafraichissable {
 
55,6 → 57,9
private Button modifier;
private Button supprimer;
private int indexElementSelectionne = 0;
private Projet projetSelectionne = null;
public ProjetListeVue(Mediateur mediateurCourant) {
super();
mediateur = mediateurCourant;
78,6 → 83,7
modifier.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
mediateur.clicModifierProjet(grille.getSelectionModel().getSelectedItems());
indexElementSelectionne = store.indexOf(grille.getSelectionModel().getSelectedItem());
}
});
toolBar.add(modifier);
107,8 → 113,8
GridSelectionModel<Projet> modeleDeSelection = new GridSelectionModel<Projet>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Projet>() {
public void selectionChanged(SelectionChangedEvent<Projet> event) {
Projet projet = (Projet) event.getSelectedItem();
clicListe(projet);
projetSelectionne = (Projet) event.getSelectedItem();
clicListe(projetSelectionne);
}
});
188,6 → 194,18
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getType().equals("projet_modifie")) {
if(projetSelectionne != null) {
store.remove(indexElementSelectionne);
projetSelectionne = null;
}
Projet projetModifie = (Projet)info.getDonnee(0);
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(projetModifie);
store.insert(projetModifie, indexElementSelectionne);
grille.repaint();
grille.getSelectionModel().select(indexElementSelectionne, true);
clicListe(projetModifie);
} else if (info.getType().equals("suppression_projet")) {
String message = info.toString();
if (info.getDonnee(0) != null) {
/trunk/src/org/tela_botanica/client/vues/projet/ProjetForm.java
35,6 → 35,7
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.google.gwt.user.client.Window;
 
public class ProjetForm extends Formulaire implements Rafraichissable {
68,7 → 69,7
private Sequenceur sequenceur = new Sequenceur();
 
private Rafraichissable vueExterneARafraichirApresValidation = null;
public Rafraichissable vueExterneARafraichirApresValidation = null;
 
 
public ProjetForm(Mediateur mediateurCourrant, String projetId) {
299,10 → 300,13
if (type.equals("ajout_projet") || type.equals("modif_projet")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
projetValideOk = true;
String projetId = (String) info.getDonnee(0);
if (vueExterneARafraichirApresValidation != null) {
projet.setId(projetId);
if(!type.equals("modif_projet")) {
String projetId = (String) info.getDonnee(0);
if (vueExterneARafraichirApresValidation != null) {
projet.setId(projetId);
}
}
controlerFermeture();
}
}
310,7 → 314,7
if (type.equals("selection_projet")) {
InfoLogger.display(i18nC.projetTitreFormModif(), info.toString());
} else if (type.equals("modif_projet")) {
InfoLogger.display(i18nC.projetTitreFormModif(), info.toString());
//InfoLogger.display(i18nC.projetTitreFormModif(), info.toString());
} else if (type.equals("ajout_projet")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
String projetId = (String) info.getDonnee(0);
/trunk/src/org/tela_botanica/client/vues/commentaire/CommentaireVue.java
12,6 → 12,7
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class CommentaireVue extends LayoutContainer implements Rafraichissable {
/trunk/src/org/tela_botanica/client/vues/commentaire/CommentaireListeVue.java
17,6 → 17,7
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
import org.tela_botanica.client.modeles.structure.StructureListe;
51,6 → 52,7
import com.extjs.gxt.ui.client.widget.menu.Menu;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class CommentaireListeVue extends ContentPanel implements Rafraichissable {
 
73,6 → 75,9
protected HashMap<String, Valeur> ontologie = null;
protected boolean ontologieChargementOk = false;
private int indexElementSelectionne = 0;
private Commentaire commentaireSelectionne = null;
public CommentaireListeVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
127,8 → 132,9
GridSelectionModel<Commentaire> modeleDeSelection = new GridSelectionModel<Commentaire>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Commentaire>() {
public void selectionChanged(SelectionChangedEvent<Commentaire> event) {
Commentaire commentaire = (Commentaire) event.getSelectedItem();
clicListe(commentaire);
commentaireSelectionne = (Commentaire) event.getSelectedItem();
indexElementSelectionne = store.indexOf(commentaireSelectionne);
clicListe(commentaireSelectionne);
}
});
278,6 → 284,15
InfoLogger.display(i18nC.commentaireTitreSuppression(), message);
supprimerCommentairesSelectionnees();
gererEtatActivationBouton();
} else if (info.getType().equals("commentaire_modifiee")) {
// GXT c'est pourri et la grille ne prend en compte les modifications
// du store, donc en attendant, on recharge tout, comme pour la suppression
/*Commentaire commModifie = (Commentaire)info.getDonnee(0);
store.remove(indexElementSelectionne);
store.insert(commModifie, indexElementSelectionne);
grille.reconfigure(store, modeleDesColonnes);
grille.repaint();*/
mediateur.clicMenu(MenuApplicationId.COMMENTAIRE);
}
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
/trunk/src/org/tela_botanica/client/vues/commentaire/CommentaireForm.java
30,6 → 30,7
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.google.gwt.user.client.Window;
 
 
public class CommentaireForm extends Formulaire implements Rafraichissable {
/trunk/src/org/tela_botanica/client/vues/accueil/AccueilVue.java
13,11 → 13,9
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.custom.Portal;
74,9 → 72,7
portail = creerPortail();
panneauPrincipal.add(portail);
chargerParametres();
 
add(panneauPrincipal);
mediateur.desactiverChargement(this);
}
101,7 → 97,6
private void chargerParametres() {
viderPortail();
Document paramXml = XMLParser.parse(mediateur.getUtilisateur().getParametre());
NodeList listeAccueilNoeud = paramXml.getElementsByTagName("accueil");
int nbreAccueilNoeud = listeAccueilNoeud.getLength();
109,37 → 104,41
// Récupération du noeud accueil
Node accueilNoeud = null;
if (nbreAccueilNoeud == 0) {
ajouterPortlet();
ajouterPortletsDefaut();
} else if (nbreAccueilNoeud == 1) {
accueilNoeud = listeAccueilNoeud.item(0);
// Lecture des noeuds "applette"
NodeList listeAppletteNoeud = accueilNoeud.getChildNodes();
int nbreAppletteNoeud = listeAppletteNoeud.getLength();
TreeMap<String, HashMap<String, String>> tableApplettes = new TreeMap<String, HashMap<String, String>>();
for (int i = 0; i < nbreAppletteNoeud ; i++) {
Element appletteNoeud = (Element) listeAppletteNoeud.item(i);
int colonne = Integer.parseInt(appletteNoeud.getAttribute("colonne"));
int index = Integer.parseInt(appletteNoeud.getAttribute("index"));
HashMap<String, String> infoApplette = new HashMap<String, String>();
infoApplette.put("reduite", appletteNoeud.getAttribute("reduite"));
infoApplette.put("epingle", appletteNoeud.getAttribute("epingle"));
infoApplette.put("type", appletteNoeud.getAttribute("type"));
infoApplette.put("colonne", appletteNoeud.getAttribute("colonne"));
infoApplette.put("index", appletteNoeud.getAttribute("index"));
infoApplette.put("contenu", appletteNoeud.getAttribute("contenu"));
tableApplettes.put(colonne+"-"+index, infoApplette);
// un noeud de type vide indique que l'utilisateur a explicité effacé les applettes de la page d'accueil
if(listeAppletteNoeud.getLength() > 0 && !listeAppletteNoeud.item(0).getNodeName().equals("vide")) {
// Lecture des noeuds "applette"
int nbreAppletteNoeud = listeAppletteNoeud.getLength();
TreeMap<String, HashMap<String, String>> tableApplettes = new TreeMap<String, HashMap<String, String>>();
for (int i = 0; i < nbreAppletteNoeud ; i++) {
Element appletteNoeud = (Element) listeAppletteNoeud.item(i);
int colonne = Integer.parseInt(appletteNoeud.getAttribute("colonne"));
int index = Integer.parseInt(appletteNoeud.getAttribute("index"));
HashMap<String, String> infoApplette = new HashMap<String, String>();
infoApplette.put("reduite", appletteNoeud.getAttribute("reduite"));
infoApplette.put("epingle", appletteNoeud.getAttribute("epingle"));
infoApplette.put("type", appletteNoeud.getAttribute("type"));
infoApplette.put("colonne", appletteNoeud.getAttribute("colonne"));
infoApplette.put("index", appletteNoeud.getAttribute("index"));
infoApplette.put("contenu", appletteNoeud.getAttribute("contenu"));
tableApplettes.put(colonne+"-"+index, infoApplette);
}
Iterator<String> it = tableApplettes.keySet().iterator();
while (it.hasNext()) {
String id = it.next();
HashMap<String, String> infoApplette = tableApplettes.get(id);
boolean reduite = (infoApplette.get("reduite") != null && infoApplette.get("reduite").equals("true")) ? true : false;
boolean epingle = (infoApplette.get("epingle") != null && infoApplette.get("epingle").equals("true")) ? true : false;
int index = Integer.parseInt(infoApplette.get("index"));
int colonne = Integer.parseInt(infoApplette.get("colonne"));
ajouterPortlet(reduite, epingle, infoApplette.get("type"), colonne, index, infoApplette.get("contenu"));
}
} else if(listeAppletteNoeud.getLength() == 0) {
ajouterPortletsDefaut();
}
Iterator<String> it = tableApplettes.keySet().iterator();
while (it.hasNext()) {
String id = it.next();
HashMap<String, String> infoApplette = tableApplettes.get(id);
boolean reduite = (infoApplette.get("reduite") != null && infoApplette.get("reduite").equals("true")) ? true : false;
boolean epingle = (infoApplette.get("epingle") != null && infoApplette.get("epingle").equals("true")) ? true : false;
int index = Integer.parseInt(infoApplette.get("index"));
int colonne = Integer.parseInt(infoApplette.get("colonne"));
ajouterPortlet(reduite, epingle, infoApplette.get("type"), colonne, index, infoApplette.get("contenu"));
}
}
layout();
}
172,24 → 171,31
accueilNoeud = paramXml.getElementsByTagName("accueil").item(0);
}
// Ajout des noeuds "applette" au noeud "accueil"
while (it.hasNext()) {
Portlet applette = it.next();
String reduite = (applette.isCollapsed() ? "true" : "false");
String epingle = (applette.isPinned() ? "true" : "false");
String index = Integer.toString(portail.getPortletIndex(applette));
String colonne = Integer.toString(portail.getPortletColumn(applette));
String contenu = applette.getData("contenu");
Element appletteElement = paramXml.createElement("applette");
appletteElement.setAttribute("reduite", reduite);
appletteElement.setAttribute("epingle", epingle);
appletteElement.setAttribute("type", "statistique");
appletteElement.setAttribute("colonne", colonne);
appletteElement.setAttribute("index", index);
appletteElement.setAttribute("contenu", contenu);
accueilNoeud.appendChild(appletteElement);
// si il existe des applettes ouvertes
if(it.hasNext()) {
// Ajout des noeuds "applette" au noeud "accueil"
while (it.hasNext()) {
Portlet applette = it.next();
String reduite = (applette.isCollapsed() ? "true" : "false");
String epingle = (applette.isPinned() ? "true" : "false");
String index = Integer.toString(portail.getPortletIndex(applette));
String colonne = Integer.toString(portail.getPortletColumn(applette));
String contenu = applette.getData("contenu");
Element appletteElement = paramXml.createElement("applette");
appletteElement.setAttribute("reduite", reduite);
appletteElement.setAttribute("epingle", epingle);
appletteElement.setAttribute("type", "statistique");
appletteElement.setAttribute("colonne", colonne);
appletteElement.setAttribute("index", index);
appletteElement.setAttribute("contenu", contenu);
accueilNoeud.appendChild(appletteElement);
}
} else {
// sinon ajout d'un noeud vide
Element videElement = paramXml.createElement("vide");
accueilNoeud.appendChild(videElement);
}
enregistrementEnCours = true;
227,6 → 233,24
layout();
}
private void ajouterPortletsDefaut() {
//TODO créer une énum des différents types de portlet puis faire une boucle
// dessus
Applette applette = new AppletteStatistique(mediateur, "NombreDonnees");
portail.insert(applette, 0, 0);
applette.setEpingler(true);
applette = new AppletteStatistique(mediateur, "MesDonnees");
portail.insert(applette, 0, 1);
applette = new AppletteStatistique(mediateur, "TypeDepot");
portail.insert(applette, 0, 2);
applette = new AppletteStatistique(mediateur, "NombreCollectionParStructure");
portail.insert(applette, 1, 0);
layout();
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
/trunk/src/org/tela_botanica/client/vues/publication/PublicationForm.java
530,7 → 530,13
}
private void supprimerDansGrille() {
ModelData donneeSelectionnee = grilleAuteurs.getSelectionModel().getSelectedItem();
List<ModelData> listeDonneesSelectionnees = grilleAuteurs.getSelectionModel().getSelectedItems();
for (ModelData donneeSelectionnee : listeDonneesSelectionnees) {
supprimerAuteurDansGrille(donneeSelectionnee);
}
}
private void supprimerAuteurDansGrille(ModelData donneeSelectionnee) {
PublicationAPersonne personneSelectionnee = new PublicationAPersonne(donneeSelectionnee, aDonnee.GARDER_PREFIXE);
Log.debug("Début supprimer auteur dans grille : "+personneSelectionnee.toString());
if (personneSelectionnee.getId() == null) {
1229,5 → 1235,4
vueExterneARafraichirApresValidation.rafraichir(info);
}
}
}
/trunk/src/org/tela_botanica/client/vues/publication/PublicationListeVue.java
30,7 → 30,6
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
41,7 → 40,6
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class PublicationListeVue extends ContentPanel implements Rafraichissable {
 
58,6 → 56,9
private BarrePaginationVue pagination = null;
private int indexElementSelectionne = 0;
private Publication publicationSelectionnee = null;
public PublicationListeVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
111,8 → 112,9
GridSelectionModel<Publication> modeleDeSelection = new GridSelectionModel<Publication>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Publication>() {
public void selectionChanged(SelectionChangedEvent<Publication> event) {
Publication publication = (Publication) event.getSelectedItem();
clicListe(publication);
publicationSelectionnee = (Publication) event.getSelectedItem();
indexElementSelectionne = store.indexOf(publicationSelectionnee);
clicListe(publicationSelectionnee);
}
});
206,6 → 208,19
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getType().equals("publication_modifiee")) {
if(publicationSelectionnee != null) {
store.remove(indexElementSelectionne);
publicationSelectionnee = null;
}
Publication publiModifee = (Publication)info.getDonnee(0);
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(publiModifee);
store.insert(publiModifee, indexElementSelectionne);
grille.repaint();
grille.getSelectionModel().select(indexElementSelectionne, true);
clicListe(publiModifee);
} else if (info.getType().equals("suppression_publication")) {
InfoLogger.display(i18nC.publicationTitreSuppression(), info.getMessages().toString());
supprimerPublicationsSelectionnees();