1 |
package org.tela_botanica.client;
|
1 |
package org.tela_botanica.client;
|
2 |
|
2 |
|
3 |
import java.util.Iterator;
|
3 |
import java.util.Iterator;
|
4 |
import java.util.List;
|
4 |
import java.util.List;
|
5 |
|
5 |
|
6 |
import org.tela_botanica.client.composants.AideFenetre;
|
6 |
import org.tela_botanica.client.composants.AideFenetre;
|
7 |
import org.tela_botanica.client.composants.IdentificationFenetre;
|
7 |
import org.tela_botanica.client.composants.IdentificationFenetre;
|
8 |
import org.tela_botanica.client.composants.LicenceFenetre;
|
8 |
import org.tela_botanica.client.composants.LicenceFenetre;
|
9 |
import org.tela_botanica.client.composants.AproposFenetre;
|
9 |
import org.tela_botanica.client.composants.AproposFenetre;
|
10 |
import org.tela_botanica.client.configuration.APropos;
|
10 |
import org.tela_botanica.client.configuration.APropos;
|
11 |
import org.tela_botanica.client.configuration.Configuration;
|
11 |
import org.tela_botanica.client.configuration.Configuration;
|
12 |
import org.tela_botanica.client.i18n.Constantes;
|
12 |
import org.tela_botanica.client.i18n.Constantes;
|
13 |
import org.tela_botanica.client.i18n.ErrorMessages;
|
13 |
import org.tela_botanica.client.i18n.ErrorMessages;
|
14 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
14 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
15 |
import org.tela_botanica.client.modeles.Information;
|
15 |
import org.tela_botanica.client.modeles.Information;
|
16 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
16 |
import org.tela_botanica.client.modeles.MenuApplicationId;
|
17 |
import org.tela_botanica.client.modeles.Utilisateur;
|
17 |
import org.tela_botanica.client.modeles.Utilisateur;
|
18 |
import org.tela_botanica.client.modeles.Valeur;
|
18 |
import org.tela_botanica.client.modeles.Valeur;
|
19 |
import org.tela_botanica.client.modeles.ValeurListe;
|
19 |
import org.tela_botanica.client.modeles.ValeurListe;
|
20 |
import org.tela_botanica.client.modeles.collection.Collection;
|
20 |
import org.tela_botanica.client.modeles.collection.Collection;
|
21 |
import org.tela_botanica.client.modeles.collection.CollectionACommentaire;
|
21 |
import org.tela_botanica.client.modeles.collection.CollectionACommentaire;
|
22 |
import org.tela_botanica.client.modeles.collection.CollectionACommentaireAsyncDao;
|
22 |
import org.tela_botanica.client.modeles.collection.CollectionACommentaireAsyncDao;
|
23 |
import org.tela_botanica.client.modeles.collection.CollectionACommentaireListe;
|
23 |
import org.tela_botanica.client.modeles.collection.CollectionACommentaireListe;
|
24 |
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
|
24 |
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
|
25 |
import org.tela_botanica.client.modeles.collection.CollectionAPersonneListe;
|
25 |
import org.tela_botanica.client.modeles.collection.CollectionAPersonneListe;
|
26 |
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
|
26 |
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
|
27 |
import org.tela_botanica.client.modeles.collection.CollectionAPublicationListe;
|
27 |
import org.tela_botanica.client.modeles.collection.CollectionAPublicationListe;
|
28 |
import org.tela_botanica.client.modeles.collection.CollectionListe;
|
28 |
import org.tela_botanica.client.modeles.collection.CollectionListe;
|
29 |
import org.tela_botanica.client.modeles.commentaire.Commentaire;
|
29 |
import org.tela_botanica.client.modeles.commentaire.Commentaire;
|
30 |
import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
|
30 |
import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
|
31 |
import org.tela_botanica.client.modeles.personne.Personne;
|
31 |
import org.tela_botanica.client.modeles.personne.Personne;
|
32 |
import org.tela_botanica.client.modeles.personne.PersonneListe;
|
32 |
import org.tela_botanica.client.modeles.personne.PersonneListe;
|
33 |
import org.tela_botanica.client.modeles.projet.Projet;
|
33 |
import org.tela_botanica.client.modeles.projet.Projet;
|
34 |
import org.tela_botanica.client.modeles.projet.ProjetListe;
|
34 |
import org.tela_botanica.client.modeles.projet.ProjetListe;
|
35 |
import org.tela_botanica.client.modeles.publication.Publication;
|
35 |
import org.tela_botanica.client.modeles.publication.Publication;
|
36 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
|
36 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
|
37 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
|
37 |
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
|
38 |
import org.tela_botanica.client.modeles.publication.PublicationListe;
|
38 |
import org.tela_botanica.client.modeles.publication.PublicationListe;
|
39 |
import org.tela_botanica.client.modeles.structure.Structure;
|
39 |
import org.tela_botanica.client.modeles.structure.Structure;
|
40 |
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
|
40 |
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
|
41 |
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
|
41 |
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
|
42 |
import org.tela_botanica.client.modeles.structure.StructureConservation;
|
42 |
import org.tela_botanica.client.modeles.structure.StructureConservation;
|
43 |
import org.tela_botanica.client.modeles.structure.StructureListe;
|
43 |
import org.tela_botanica.client.modeles.structure.StructureListe;
|
44 |
import org.tela_botanica.client.modeles.structure.StructureValorisation;
|
44 |
import org.tela_botanica.client.modeles.structure.StructureValorisation;
|
45 |
import org.tela_botanica.client.util.Debug;
|
45 |
import org.tela_botanica.client.util.Debug;
|
46 |
import org.tela_botanica.client.vues.ContenuVue;
|
46 |
import org.tela_botanica.client.vues.ContenuVue;
|
47 |
import org.tela_botanica.client.vues.EnteteVue;
|
47 |
import org.tela_botanica.client.vues.EnteteVue;
|
48 |
import org.tela_botanica.client.vues.Formulaire;
|
48 |
import org.tela_botanica.client.vues.Formulaire;
|
49 |
import org.tela_botanica.client.vues.NavigationVue;
|
49 |
import org.tela_botanica.client.vues.NavigationVue;
|
50 |
import org.tela_botanica.client.vues.PopupChargement;
|
50 |
import org.tela_botanica.client.vues.PopupChargement;
|
51 |
import org.tela_botanica.client.vues.StatutVue;
|
51 |
import org.tela_botanica.client.vues.StatutVue;
|
52 |
import org.tela_botanica.client.vues.MenuVue;
|
52 |
import org.tela_botanica.client.vues.MenuVue;
|
53 |
import org.tela_botanica.client.vues.accueil.AccueilVue;
|
53 |
import org.tela_botanica.client.vues.accueil.AccueilVue;
|
54 |
import org.tela_botanica.client.vues.collection.CollectionForm;
|
54 |
import org.tela_botanica.client.vues.collection.CollectionForm;
|
55 |
import org.tela_botanica.client.vues.collection.CollectionListeVue;
|
55 |
import org.tela_botanica.client.vues.collection.CollectionListeVue;
|
56 |
import org.tela_botanica.client.vues.collection.CollectionVue;
|
56 |
import org.tela_botanica.client.vues.collection.CollectionVue;
|
57 |
import org.tela_botanica.client.vues.commentaire.CommentaireForm;
|
57 |
import org.tela_botanica.client.vues.commentaire.CommentaireForm;
|
58 |
import org.tela_botanica.client.vues.commentaire.CommentaireVue;
|
58 |
import org.tela_botanica.client.vues.commentaire.CommentaireVue;
|
59 |
import org.tela_botanica.client.vues.personne.PersonneForm;
|
59 |
import org.tela_botanica.client.vues.personne.PersonneForm;
|
60 |
import org.tela_botanica.client.vues.personne.PersonneVue;
|
60 |
import org.tela_botanica.client.vues.personne.PersonneVue;
|
61 |
import org.tela_botanica.client.vues.projet.ProjetForm;
|
61 |
import org.tela_botanica.client.vues.projet.ProjetForm;
|
62 |
import org.tela_botanica.client.vues.projet.ProjetVue;
|
62 |
import org.tela_botanica.client.vues.projet.ProjetVue;
|
63 |
import org.tela_botanica.client.vues.publication.PublicationForm;
|
63 |
import org.tela_botanica.client.vues.publication.PublicationForm;
|
64 |
import org.tela_botanica.client.vues.publication.PublicationVue;
|
64 |
import org.tela_botanica.client.vues.publication.PublicationVue;
|
65 |
import org.tela_botanica.client.vues.structure.StructureForm;
|
65 |
import org.tela_botanica.client.vues.structure.StructureForm;
|
66 |
import org.tela_botanica.client.vues.structure.StructureVue;
|
66 |
import org.tela_botanica.client.vues.structure.StructureVue;
|
67 |
|
67 |
|
68 |
import com.extjs.gxt.ui.client.Registry;
|
68 |
import com.extjs.gxt.ui.client.Registry;
|
69 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
69 |
import com.extjs.gxt.ui.client.Style.LayoutRegion;
|
70 |
import com.extjs.gxt.ui.client.event.Listener;
|
70 |
import com.extjs.gxt.ui.client.event.Listener;
|
71 |
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
71 |
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
72 |
import com.extjs.gxt.ui.client.util.Margins;
|
72 |
import com.extjs.gxt.ui.client.util.Margins;
|
73 |
import com.extjs.gxt.ui.client.widget.Component;
|
73 |
import com.extjs.gxt.ui.client.widget.Component;
|
74 |
import com.extjs.gxt.ui.client.widget.Dialog;
|
74 |
import com.extjs.gxt.ui.client.widget.Dialog;
|
75 |
import com.extjs.gxt.ui.client.widget.Info;
|
75 |
import com.extjs.gxt.ui.client.widget.Info;
|
76 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
76 |
import com.extjs.gxt.ui.client.widget.MessageBox;
|
77 |
import com.extjs.gxt.ui.client.widget.Viewport;
|
77 |
import com.extjs.gxt.ui.client.widget.Viewport;
|
78 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
78 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
79 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
|
79 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
|
80 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
80 |
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
81 |
import com.google.gwt.core.client.GWT;
|
81 |
import com.google.gwt.core.client.GWT;
|
82 |
import com.google.gwt.i18n.client.Dictionary;
|
82 |
import com.google.gwt.i18n.client.Dictionary;
|
83 |
import com.google.gwt.user.client.Window;
|
83 |
import com.google.gwt.user.client.Window;
|
84 |
import com.google.gwt.user.client.ui.RootPanel;
|
84 |
import com.google.gwt.user.client.ui.RootPanel;
|
85 |
|
85 |
|
86 |
public class Mediateur implements Rafraichissable {
|
86 |
public class Mediateur implements Rafraichissable {
|
87 |
|
87 |
|
88 |
private Viewport viewport;
|
88 |
private Viewport viewport;
|
89 |
private Modele modele = null;
|
89 |
private Modele modele = null;
|
90 |
public static final Constantes i18nC = getI18nConstante();
|
90 |
public static final Constantes i18nC = getI18nConstante();
|
91 |
public static final ErrorMessages i18nM = getI18nMessage();
|
91 |
public static final ErrorMessages i18nM = getI18nMessage();
|
92 |
|
92 |
|
93 |
private EnteteVue panneauNord = null;
|
93 |
private EnteteVue panneauNord = null;
|
94 |
private NavigationVue panneauOuest = null;
|
94 |
private NavigationVue panneauOuest = null;
|
95 |
private ContenuVue panneauCentre = null;
|
95 |
private ContenuVue panneauCentre = null;
|
96 |
private StatutVue panneauSud = null;
|
96 |
private StatutVue panneauSud = null;
|
97 |
|
97 |
|
98 |
private IdentificationFenetre fenetreIdentification = null;
|
98 |
private IdentificationFenetre fenetreIdentification = null;
|
99 |
private int nbElements = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
|
99 |
private int nbElements = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
|
- |
|
100 |
|
100 |
public Mediateur() {
|
101 |
public Mediateur() {
|
101 |
// Enregistrement du Médiateur dans le Registre
|
102 |
// Enregistrement du Médiateur dans le Registre
|
102 |
Registry.register(RegistreId.MEDIATEUR, this);
|
103 |
Registry.register(RegistreId.MEDIATEUR, this);
|
103 |
|
104 |
|
104 |
//Initialisation du Registre
|
105 |
//Initialisation du Registre
|
105 |
initialiserRegistre();
|
106 |
initialiserRegistre();
|
106 |
|
107 |
|
107 |
// Création du Modèle qui s'enregistre lui même dans le Registre
|
108 |
// Création du Modèle qui s'enregistre lui même dans le Registre
|
108 |
modele = new Modele();
|
109 |
modele = new Modele();
|
109 |
|
110 |
|
110 |
// Création du Viewport qui contient la disposition globale de l'application
|
111 |
// Création du Viewport qui contient la disposition globale de l'application
|
111 |
viewport = new Viewport();
|
112 |
viewport = new Viewport();
|
112 |
viewport.setLayout(new BorderLayout());
|
113 |
viewport.setLayout(new BorderLayout());
|
113 |
|
114 |
|
114 |
// Création des différents panneaux
|
115 |
// Création des différents panneaux
|
115 |
creerPanneauNord();
|
116 |
creerPanneauNord();
|
116 |
creerPanneauOuest();
|
117 |
creerPanneauOuest();
|
117 |
creerPanneauCentral();
|
118 |
creerPanneauCentral();
|
118 |
creerPanneauSud();
|
119 |
creerPanneauSud();
|
119 |
|
120 |
|
120 |
// Connection de l'utilisateur
|
121 |
// Connection de l'utilisateur
|
121 |
connecterUtilisateur(null, null);
|
122 |
connecterUtilisateur(null, null);
|
122 |
|
123 |
|
123 |
// Retour à GWT du Viewport une fois constuit
|
124 |
// Retour à GWT du Viewport une fois constuit
|
124 |
RootPanel.get().add(viewport);
|
125 |
RootPanel.get().add(viewport);
|
125 |
}
|
126 |
}
|
126 |
|
127 |
|
127 |
//+----------------------------------------------------------------------------------------------------------------+
|
128 |
//+----------------------------------------------------------------------------------------------------------------+
|
128 |
// GESTION de l'I18N et du REGISTRE
|
129 |
// GESTION de l'I18N et du REGISTRE
|
129 |
//+----------------------------------------------------------------------------------------------------------------+
|
130 |
//+----------------------------------------------------------------------------------------------------------------+
|
130 |
protected static Constantes getI18nConstante() {
|
131 |
protected static Constantes getI18nConstante() {
|
131 |
return GWT.create(Constantes.class);
|
132 |
return GWT.create(Constantes.class);
|
132 |
}
|
133 |
}
|
133 |
|
134 |
|
134 |
protected static ErrorMessages getI18nMessage() {
|
135 |
protected static ErrorMessages getI18nMessage() {
|
135 |
return GWT.create(ErrorMessages.class);
|
136 |
return GWT.create(ErrorMessages.class);
|
136 |
}
|
137 |
}
|
137 |
|
138 |
|
138 |
protected void initialiserRegistre() {
|
139 |
protected void initialiserRegistre() {
|
139 |
APropos apropos = new APropos();
|
140 |
APropos apropos = new APropos();
|
140 |
|
141 |
|
141 |
Registry.register(RegistreId.APPLI_NOM, apropos.getAppliNom());
|
142 |
Registry.register(RegistreId.APPLI_NOM, apropos.getAppliNom());
|
142 |
Registry.register(RegistreId.APPLI_CODE, apropos.getAppliCode());
|
143 |
Registry.register(RegistreId.APPLI_CODE, apropos.getAppliCode());
|
143 |
Registry.register(RegistreId.APPLI_VERSION, apropos.getAppliVersionCode());
|
144 |
Registry.register(RegistreId.APPLI_VERSION, apropos.getAppliVersionCode());
|
144 |
Registry.register(RegistreId.APPLI_VERSION_NOM, apropos.getAppliVersionNom());
|
145 |
Registry.register(RegistreId.APPLI_VERSION_NOM, apropos.getAppliVersionNom());
|
145 |
|
146 |
|
146 |
Registry.register(RegistreId.APPLI_DEVELOPPEURS, apropos.getDeveloppeurs());
|
147 |
Registry.register(RegistreId.APPLI_DEVELOPPEURS, apropos.getDeveloppeurs());
|
147 |
Registry.register(RegistreId.APPLI_TRADUCTEURS, apropos.getTraducteurs());
|
148 |
Registry.register(RegistreId.APPLI_TRADUCTEURS, apropos.getTraducteurs());
|
148 |
Registry.register(RegistreId.APPLI_LICENCE, apropos.getLicence());
|
149 |
Registry.register(RegistreId.APPLI_LICENCE, apropos.getLicence());
|
149 |
Registry.register(RegistreId.APPLI_REVISION, apropos.getRevisionGlobale());
|
150 |
Registry.register(RegistreId.APPLI_REVISION, apropos.getRevisionGlobale());
|
150 |
Registry.register(RegistreId.APPLI_COMPILATION_JAVA_VERSION, apropos.getVersionJavaCompilation());
|
151 |
Registry.register(RegistreId.APPLI_COMPILATION_JAVA_VERSION, apropos.getVersionJavaCompilation());
|
151 |
Registry.register(RegistreId.APPLI_COMPILATION_DATE_HEURE, apropos.getDateHeureCompilation());
|
152 |
Registry.register(RegistreId.APPLI_COMPILATION_DATE_HEURE, apropos.getDateHeureCompilation());
|
152 |
|
153 |
|
153 |
Registry.register(RegistreId.CONFIG, new Configuration());
|
154 |
Registry.register(RegistreId.CONFIG, new Configuration());
|
154 |
Registry.register(RegistreId.POPUP_CHARGEMENT, new PopupChargement(this));
|
155 |
Registry.register(RegistreId.POPUP_CHARGEMENT, new PopupChargement(this));
|
155 |
Registry.register(RegistreId.UTILISATEUR_COURANT, new Utilisateur());
|
156 |
Registry.register(RegistreId.UTILISATEUR_COURANT, new Utilisateur());
|
156 |
Registry.register(RegistreId.PROJET_COURANT, new Projet());
|
157 |
Registry.register(RegistreId.PROJET_COURANT, new Projet());
|
157 |
}
|
158 |
}
|
158 |
|
159 |
|
159 |
//+----------------------------------------------------------------------------------------------------------------+
|
160 |
//+----------------------------------------------------------------------------------------------------------------+
|
160 |
// GESTION des PANNEAUX PRINCIPAUX
|
161 |
// GESTION des PANNEAUX PRINCIPAUX
|
161 |
//+----------------------------------------------------------------------------------------------------------------+
|
162 |
//+----------------------------------------------------------------------------------------------------------------+
|
162 |
|
163 |
|
163 |
private void creerPanneauNord() {
|
164 |
private void creerPanneauNord() {
|
164 |
panneauNord = new EnteteVue(this);
|
165 |
panneauNord = new EnteteVue(this);
|
165 |
|
166 |
|
166 |
BorderLayoutData regionNord = new BorderLayoutData(LayoutRegion.NORTH, 100);
|
167 |
BorderLayoutData regionNord = new BorderLayoutData(LayoutRegion.NORTH, 100);
|
167 |
regionNord.setCollapsible(true);
|
168 |
regionNord.setCollapsible(true);
|
168 |
regionNord.setFloatable(true);
|
169 |
regionNord.setFloatable(true);
|
169 |
regionNord.setSplit(false);
|
170 |
regionNord.setSplit(false);
|
170 |
regionNord.setMargins(new Margins(5, 5, 0, 5));
|
171 |
regionNord.setMargins(new Margins(5, 5, 0, 5));
|
171 |
|
172 |
|
172 |
viewport.add(panneauNord, regionNord);
|
173 |
viewport.add(panneauNord, regionNord);
|
173 |
}
|
174 |
}
|
174 |
|
175 |
|
175 |
private void creerPanneauOuest() {
|
176 |
private void creerPanneauOuest() {
|
176 |
panneauOuest = new NavigationVue(this);
|
177 |
panneauOuest = new NavigationVue(this);
|
177 |
|
178 |
|
178 |
BorderLayoutData regionOuest = new BorderLayoutData(LayoutRegion.WEST, 200);
|
179 |
BorderLayoutData regionOuest = new BorderLayoutData(LayoutRegion.WEST, 200);
|
179 |
regionOuest.setSplit(true);
|
180 |
regionOuest.setSplit(true);
|
180 |
regionOuest.setCollapsible(true);
|
181 |
regionOuest.setCollapsible(true);
|
181 |
regionOuest.setMargins(new Margins(5));
|
182 |
regionOuest.setMargins(new Margins(5));
|
182 |
|
183 |
|
183 |
viewport.add(panneauOuest, regionOuest);
|
184 |
viewport.add(panneauOuest, regionOuest);
|
184 |
}
|
185 |
}
|
185 |
|
186 |
|
186 |
private void creerPanneauCentral() {
|
187 |
private void creerPanneauCentral() {
|
187 |
panneauCentre = new ContenuVue(this);
|
188 |
panneauCentre = new ContenuVue(this);
|
188 |
|
189 |
|
189 |
BorderLayoutData regionCentre = new BorderLayoutData(LayoutRegion.CENTER);
|
190 |
BorderLayoutData regionCentre = new BorderLayoutData(LayoutRegion.CENTER);
|
190 |
regionCentre.setMargins(new Margins(5, 5, 5, 0));
|
191 |
regionCentre.setMargins(new Margins(5, 5, 5, 0));
|
191 |
|
192 |
|
192 |
viewport.add(panneauCentre, regionCentre);
|
193 |
viewport.add(panneauCentre, regionCentre);
|
193 |
}
|
194 |
}
|
194 |
|
195 |
|
195 |
private void creerPanneauSud() {
|
196 |
private void creerPanneauSud() {
|
196 |
panneauSud = new StatutVue();
|
197 |
panneauSud = new StatutVue();
|
197 |
|
198 |
|
198 |
BorderLayoutData regionSud = new BorderLayoutData(LayoutRegion.SOUTH, 20);
|
199 |
BorderLayoutData regionSud = new BorderLayoutData(LayoutRegion.SOUTH, 20);
|
199 |
regionSud.setCollapsible(true);
|
200 |
regionSud.setCollapsible(true);
|
200 |
regionSud.setFloatable(true);
|
201 |
regionSud.setFloatable(true);
|
201 |
regionSud.setSplit(false);
|
202 |
regionSud.setSplit(false);
|
202 |
regionSud.setMargins(new Margins(0));
|
203 |
regionSud.setMargins(new Margins(0));
|
203 |
|
204 |
|
204 |
viewport.add(panneauSud, regionSud);
|
205 |
viewport.add(panneauSud, regionSud);
|
205 |
}
|
206 |
}
|
206 |
|
207 |
|
207 |
public void actualiserPanneauCentral() {
|
208 |
public void actualiserPanneauCentral() {
|
208 |
panneauCentre.layout();
|
209 |
panneauCentre.layout();
|
209 |
}
|
210 |
}
|
210 |
|
211 |
|
211 |
//+----------------------------------------------------------------------------------------------------------------+
|
212 |
//+----------------------------------------------------------------------------------------------------------------+
|
212 |
// GESTION du MENU
|
213 |
// GESTION du MENU
|
213 |
//+----------------------------------------------------------------------------------------------------------------+
|
214 |
//+----------------------------------------------------------------------------------------------------------------+
|
214 |
|
215 |
|
215 |
public void clicMenu(String codeMenuClique) {
|
216 |
public void clicMenu(String codeMenuClique) {
|
216 |
activerChargement(codeMenuClique);
|
217 |
activerChargement(codeMenuClique);
|
217 |
panneauOuest.getMenu().selectionMenu(codeMenuClique);
|
218 |
panneauOuest.getMenu().selectionMenu(codeMenuClique);
|
218 |
if (codeMenuClique.equals(MenuApplicationId.ACCUEIL)) {
|
219 |
if (codeMenuClique.equals(MenuApplicationId.ACCUEIL)) {
|
219 |
afficherAccueil();
|
220 |
afficherAccueil();
|
220 |
} else if (codeMenuClique.equals(MenuApplicationId.PROJET)) {
|
221 |
} else if (codeMenuClique.equals(MenuApplicationId.PROJET)) {
|
221 |
selectionnerProjet(panneauCentre, null);
|
222 |
selectionnerProjet(panneauCentre, null);
|
222 |
} else if (codeMenuClique.equals(MenuApplicationId.STRUCTURE)) {
|
223 |
} else if (codeMenuClique.equals(MenuApplicationId.STRUCTURE)) {
|
223 |
selectionnerStructure(panneauCentre, null);
|
224 |
selectionnerStructure(panneauCentre, null);
|
224 |
} else if (codeMenuClique.equals(MenuApplicationId.COLLECTION)) {
|
225 |
} else if (codeMenuClique.equals(MenuApplicationId.COLLECTION)) {
|
225 |
selectionnerCollection(panneauCentre, null, null);
|
226 |
selectionnerCollection(panneauCentre, null, null);
|
226 |
} else if (codeMenuClique.equals(MenuApplicationId.PERSONNE)) {
|
227 |
} else if (codeMenuClique.equals(MenuApplicationId.PERSONNE)) {
|
227 |
selectionnerPersonne(panneauCentre, null, getProjetId());
|
228 |
selectionnerPersonne(panneauCentre, null, getProjetId());
|
228 |
} else if (codeMenuClique.equals(MenuApplicationId.PUBLICATION)) {
|
229 |
} else if (codeMenuClique.equals(MenuApplicationId.PUBLICATION)) {
|
229 |
selectionnerPublication(panneauCentre, null);
|
230 |
selectionnerPublication(panneauCentre, null);
|
230 |
} else if (codeMenuClique.equals(MenuApplicationId.COMMENTAIRE)) {
|
231 |
} else if (codeMenuClique.equals(MenuApplicationId.COMMENTAIRE)) {
|
231 |
selectionnerCommentaire(panneauCentre, null);
|
232 |
selectionnerCommentaire(panneauCentre, null);
|
232 |
} else {
|
233 |
} else {
|
233 |
GWT.log(i18nM.nonImplemente(codeMenuClique), null);
|
234 |
GWT.log(i18nM.nonImplemente(codeMenuClique), null);
|
234 |
}
|
235 |
}
|
235 |
panneauCentre.layout();
|
236 |
panneauCentre.layout();
|
236 |
}
|
237 |
}
|
237 |
|
238 |
|
238 |
public void activerChargement(String message) {
|
239 |
public void activerChargement(String message) {
|
239 |
afficherPopinChargement();
|
240 |
afficherPopinChargement();
|
240 |
panneauCentre.disable();
|
241 |
panneauCentre.disable();
|
241 |
panneauSud.showBusy(i18nC.chargement()+" "+message);
|
242 |
panneauSud.showBusy(i18nC.chargement()+" "+message);
|
242 |
}
|
243 |
}
|
243 |
|
244 |
|
244 |
public void desactiverChargement() {
|
245 |
public void desactiverChargement() {
|
245 |
masquerPopinChargement();
|
246 |
masquerPopinChargement();
|
246 |
panneauCentre.enable();
|
247 |
panneauCentre.enable();
|
247 |
panneauSud.clear();
|
248 |
panneauSud.clear();
|
248 |
}
|
249 |
}
|
249 |
|
250 |
|
250 |
//+----------------------------------------------------------------------------------------------------------------+
|
251 |
//+----------------------------------------------------------------------------------------------------------------+
|
251 |
// GESTION DES FENÊTRES
|
252 |
// GESTION DES FENÊTRES
|
252 |
//+----------------------------------------------------------------------------------------------------------------+
|
253 |
//+----------------------------------------------------------------------------------------------------------------+
|
253 |
|
254 |
|
254 |
public void ouvrirAide() {
|
255 |
public void ouvrirAide() {
|
255 |
AideFenetre aideFenetre = new AideFenetre();
|
256 |
AideFenetre aideFenetre = new AideFenetre();
|
256 |
aideFenetre.show();
|
257 |
aideFenetre.show();
|
257 |
// FIXME : apparament le fade In/Fade Out pose problème sur les navigateurs...
|
258 |
// FIXME : apparament le fade In/Fade Out pose problème sur les navigateurs...
|
258 |
//aideFenetre.el().fadeIn(FxConfig.NONE);
|
259 |
//aideFenetre.el().fadeIn(FxConfig.NONE);
|
259 |
}
|
260 |
}
|
260 |
|
261 |
|
261 |
public void ouvrirParametres() {
|
262 |
public void ouvrirParametres() {
|
262 |
AproposFenetre parametresFenetre = new AproposFenetre();
|
263 |
AproposFenetre parametresFenetre = new AproposFenetre();
|
263 |
parametresFenetre.show();
|
264 |
parametresFenetre.show();
|
264 |
}
|
265 |
}
|
265 |
|
266 |
|
266 |
public void ouvrirIdentification() {
|
267 |
public void ouvrirIdentification() {
|
267 |
fenetreIdentification = new IdentificationFenetre(this);
|
268 |
fenetreIdentification = new IdentificationFenetre(this);
|
268 |
fenetreIdentification.show();
|
269 |
fenetreIdentification.show();
|
269 |
}
|
270 |
}
|
270 |
|
271 |
|
271 |
public void ouvrirUrlExterne(String id) {
|
272 |
public void ouvrirUrlExterne(String id) {
|
272 |
if (id.equals(ComposantId.MENU_CEL)) {
|
273 |
if (id.equals(ComposantId.MENU_CEL)) {
|
273 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("cel"), "Carnet en ligne", "");
|
274 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("cel"), "Carnet en ligne", "");
|
274 |
} else if (id.equals(ComposantId.MENU_BEL)) {
|
275 |
} else if (id.equals(ComposantId.MENU_BEL)) {
|
275 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("cel"), "Biblio en ligne", "");
|
276 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("cel"), "Biblio en ligne", "");
|
276 |
} else if (id.equals(ComposantId.MENU_BOGUE)) {
|
277 |
} else if (id.equals(ComposantId.MENU_BOGUE)) {
|
277 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("bogue"), "Bogue", "");
|
278 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("bogue"), "Bogue", "");
|
278 |
} else if (id.equals(ComposantId.MENU_COMMENTAIRE)) {
|
279 |
} else if (id.equals(ComposantId.MENU_COMMENTAIRE)) {
|
279 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("commentaire"), "Commentaire", "");
|
280 |
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("commentaire"), "Commentaire", "");
|
280 |
}
|
281 |
}
|
281 |
}
|
282 |
}
|
282 |
|
283 |
|
283 |
public void afficherFenetreLicence(IdentificationFenetre vue) {
|
284 |
public void afficherFenetreLicence(IdentificationFenetre vue) {
|
284 |
LicenceFenetre lf = new LicenceFenetre(vue);
|
285 |
LicenceFenetre lf = new LicenceFenetre(vue);
|
285 |
}
|
286 |
}
|
286 |
|
287 |
|
287 |
public void accepterLicence(Rafraichissable vue) {
|
288 |
public void accepterLicence(Rafraichissable vue) {
|
288 |
modele.accepterLicence(vue);
|
289 |
modele.accepterLicence(vue);
|
289 |
}
|
290 |
}
|
290 |
//+----------------------------------------------------------------------------------------------------------------+
|
291 |
//+----------------------------------------------------------------------------------------------------------------+
|
291 |
// GESTION de l'UTILISATEUR et de l'IDENTIFICATION
|
292 |
// GESTION de l'UTILISATEUR et de l'IDENTIFICATION
|
292 |
//+----------------------------------------------------------------------------------------------------------------+
|
293 |
//+----------------------------------------------------------------------------------------------------------------+
|
293 |
/**
|
294 |
/**
|
294 |
* Retourne l'identifiant de l'utilisateur courrant de l'application.
|
295 |
* Retourne l'identifiant de l'utilisateur courrant de l'application.
|
295 |
*/
|
296 |
*/
|
296 |
public String getUtilisateurId() {
|
297 |
public String getUtilisateurId() {
|
297 |
String id = null;
|
298 |
String id = null;
|
298 |
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
|
299 |
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
|
299 |
if (!utilisateurCourant.getId().equals("")) {
|
300 |
if (!utilisateurCourant.getId().equals("")) {
|
300 |
id = utilisateurCourant.getId();
|
301 |
id = utilisateurCourant.getId();
|
301 |
}
|
302 |
}
|
302 |
return id;
|
303 |
return id;
|
303 |
}
|
304 |
}
|
304 |
|
305 |
|
305 |
public Utilisateur getUtilisateur() {
|
306 |
public Utilisateur getUtilisateur() {
|
306 |
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
|
307 |
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
|
307 |
return utilisateurCourant;
|
308 |
return utilisateurCourant;
|
308 |
}
|
309 |
}
|
309 |
|
310 |
|
310 |
public void connecterUtilisateur(String login, String mdp) {
|
311 |
public void connecterUtilisateur(String login, String mdp) {
|
311 |
modele.connecterUtilisateur(this, login, mdp);
|
312 |
modele.connecterUtilisateur(this, login, mdp);
|
312 |
}
|
313 |
}
|
313 |
|
314 |
|
314 |
public void deconnecterUtilisateur() {
|
315 |
public void deconnecterUtilisateur() {
|
315 |
modele.deconnecterUtilisateur(this);
|
316 |
modele.deconnecterUtilisateur(this);
|
316 |
}
|
317 |
}
|
317 |
|
318 |
|
318 |
public void repandreEtatIdentification(Utilisateur utilisateur) {
|
319 |
public void repandreEtatIdentification(Utilisateur utilisateur) {
|
319 |
// Mise à jour du registre
|
320 |
// Mise à jour du registre
|
320 |
Registry.register(RegistreId.UTILISATEUR_COURANT, utilisateur);
|
321 |
Registry.register(RegistreId.UTILISATEUR_COURANT, utilisateur);
|
321 |
// Propagation de l'information de mise à jour de l'utilisateur
|
322 |
// Propagation de l'information de mise à jour de l'utilisateur
|
322 |
repandreInfoMiseAJourUtilisateur();
|
323 |
repandreInfoMiseAJourUtilisateur();
|
323 |
}
|
324 |
}
|
324 |
|
325 |
|
325 |
public void repandreInfoMiseAJourUtilisateur() {
|
326 |
public void repandreInfoMiseAJourUtilisateur() {
|
326 |
// Création de l'information de mise à jour de l'utilisateur
|
327 |
// Création de l'information de mise à jour de l'utilisateur
|
327 |
Information info = new Information("maj_utilisateur");
|
328 |
Information info = new Information("maj_utilisateur");
|
328 |
|
329 |
|
329 |
// Rafraichissement de la fenêtre d'Identification
|
330 |
// Rafraichissement de la fenêtre d'Identification
|
330 |
if (fenetreIdentification != null && fenetreIdentification.isVisible()) {
|
331 |
if (fenetreIdentification != null && fenetreIdentification.isVisible()) {
|
331 |
fenetreIdentification.rafraichir(info);
|
332 |
fenetreIdentification.rafraichir(info);
|
332 |
}
|
333 |
}
|
333 |
|
334 |
|
334 |
// Rafraichissement du panneau Nord
|
335 |
// Rafraichissement du panneau Nord
|
335 |
panneauNord.rafraichir(info);
|
336 |
panneauNord.rafraichir(info);
|
336 |
|
337 |
|
337 |
// Rafraichissement du panneau Centre
|
338 |
// Rafraichissement du panneau Centre
|
338 |
if (panneauCentre != null) {
|
339 |
if (panneauCentre != null) {
|
339 |
panneauCentre.rafraichir(info);
|
340 |
panneauCentre.rafraichir(info);
|
340 |
}
|
341 |
}
|
341 |
}
|
342 |
}
|
342 |
|
343 |
|
343 |
public void modifierUtilisateur() {
|
344 |
public void modifierUtilisateur() {
|
344 |
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
|
345 |
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
|
345 |
panneauNord.rafraichir(utilisateurCourant);
|
346 |
panneauNord.rafraichir(utilisateurCourant);
|
346 |
modele.modifierUtilisateur(this, utilisateurCourant);
|
347 |
modele.modifierUtilisateur(this, utilisateurCourant);
|
347 |
}
|
348 |
}
|
348 |
|
349 |
|
349 |
public void mettreAJourPersonneAnnuaire(Utilisateur utilisateur) {
|
350 |
public void mettreAJourPersonneAnnuaire(Utilisateur utilisateur) {
|
350 |
panneauNord.rafraichir(utilisateur);
|
351 |
panneauNord.rafraichir(utilisateur);
|
351 |
modele.mettreAJourPersonneAnnuaire(this, utilisateur);
|
352 |
modele.mettreAJourPersonneAnnuaire(this, utilisateur);
|
352 |
}
|
353 |
}
|
353 |
|
354 |
|
354 |
//+----------------------------------------------------------------------------------------------------------------+
|
355 |
//+----------------------------------------------------------------------------------------------------------------+
|
355 |
// GESTION DES VALEURS ET LISTES
|
356 |
// GESTION DES VALEURS ET LISTES
|
356 |
//+----------------------------------------------------------------------------------------------------------------+
|
357 |
//+----------------------------------------------------------------------------------------------------------------+
|
357 |
|
358 |
|
358 |
public void obtenirListeValeurEtRafraichir(Rafraichissable vueARafraichir, String listeId) {
|
359 |
public void obtenirListeValeurEtRafraichir(Rafraichissable vueARafraichir, String listeId) {
|
359 |
modele.obtenirListeValeurs(vueARafraichir, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId));
|
360 |
modele.obtenirListeValeurs(vueARafraichir, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId));
|
360 |
}
|
361 |
}
|
361 |
|
362 |
|
362 |
public void obtenirValeurEtRafraichir(Rafraichissable vue, String listeId, String identifiantValeur) {
|
363 |
public void obtenirValeurEtRafraichir(Rafraichissable vue, String listeId, String identifiantValeur) {
|
363 |
modele.obtenirValeur(vue, "abv", ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId), identifiantValeur);
|
364 |
modele.obtenirValeur(vue, "abv", ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId), identifiantValeur);
|
364 |
}
|
365 |
}
|
365 |
|
366 |
|
366 |
public void obtenirListeRegionsEtRafraichir(Rafraichissable vue, String strListeId, String strPays) {
|
367 |
public void obtenirListeRegionsEtRafraichir(Rafraichissable vue, String strListeId, String strPays) {
|
367 |
modele.obtenirListeRegion(vue, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(strListeId), strPays+".__");
|
368 |
modele.obtenirListeRegion(vue, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(strListeId), strPays+".__");
|
368 |
}
|
369 |
}
|
369 |
|
370 |
|
370 |
//+----------------------------------------------------------------------------------------------------------------+
|
371 |
//+----------------------------------------------------------------------------------------------------------------+
|
371 |
// GESTION des APPLETS de l'ACCUEIL
|
372 |
// GESTION des APPLETS de l'ACCUEIL
|
372 |
//+----------------------------------------------------------------------------------------------------------------+
|
373 |
//+----------------------------------------------------------------------------------------------------------------+
|
373 |
|
374 |
|
374 |
public void afficherAccueil() {
|
375 |
public void afficherAccueil() {
|
375 |
if (!(panneauCentre.getContenu() instanceof AccueilVue)) {
|
376 |
if (!(panneauCentre.getContenu() instanceof AccueilVue)) {
|
376 |
panneauCentre.removeAll();
|
377 |
panneauCentre.removeAll();
|
377 |
panneauCentre.add(new AccueilVue(this));
|
378 |
panneauCentre.add(new AccueilVue(this));
|
378 |
}
|
379 |
}
|
379 |
}
|
380 |
}
|
380 |
|
381 |
|
381 |
//+----------------------------------------------------------------------------------------------------------------+
|
382 |
//+----------------------------------------------------------------------------------------------------------------+
|
382 |
// GESTION des PROJETS
|
383 |
// GESTION des PROJETS
|
383 |
//+----------------------------------------------------------------------------------------------------------------+
|
384 |
//+----------------------------------------------------------------------------------------------------------------+
|
384 |
|
385 |
|
385 |
public void afficherFormProjet(String projetId) {
|
386 |
public void afficherFormProjet(String projetId) {
|
386 |
panneauCentre.removeAll();
|
387 |
panneauCentre.removeAll();
|
387 |
ProjetForm projetForm = new ProjetForm(this, projetId);
|
388 |
ProjetForm projetForm = new ProjetForm(this, projetId);
|
388 |
panneauCentre.add(projetForm);
|
389 |
panneauCentre.add(projetForm);
|
389 |
|
390 |
|
390 |
panneauCentre.layout();
|
391 |
panneauCentre.layout();
|
391 |
}
|
392 |
}
|
392 |
|
393 |
|
393 |
public void afficherListeProjets(ProjetListe projetsACharger) {
|
394 |
public void afficherListeProjets(ProjetListe projetsACharger) {
|
394 |
if (!(panneauCentre.getContenu() instanceof ProjetVue)) {
|
395 |
if (!(panneauCentre.getContenu() instanceof ProjetVue)) {
|
395 |
panneauCentre.removeAll();
|
396 |
panneauCentre.removeAll();
|
396 |
panneauCentre.add(new ProjetVue(this));
|
397 |
panneauCentre.add(new ProjetVue(this));
|
397 |
panneauCentre.setId(ComposantId.PANNEAU_PROJET_LISTE);
|
398 |
panneauCentre.setId(ComposantId.PANNEAU_PROJET_LISTE);
|
398 |
panneauCentre.layout();
|
399 |
panneauCentre.layout();
|
399 |
}
|
400 |
}
|
400 |
|
401 |
|
401 |
panneauCentre.getContenu().rafraichir(projetsACharger);
|
402 |
panneauCentre.getContenu().rafraichir(projetsACharger);
|
402 |
mettreFiltreAJour(projetsACharger);
|
403 |
mettreFiltreAJour(projetsACharger);
|
403 |
}
|
404 |
}
|
404 |
|
405 |
|
405 |
public void mettreFiltreAJour(ProjetListe projetsACharger) {
|
406 |
public void mettreFiltreAJour(ProjetListe projetsACharger) {
|
406 |
panneauOuest.getFiltre().rafraichir(projetsACharger);
|
407 |
panneauOuest.getFiltre().rafraichir(projetsACharger);
|
407 |
}
|
408 |
}
|
408 |
|
409 |
|
409 |
public void mettreFiltreAJour(List<Projet> projetsACharger) {
|
410 |
public void mettreFiltreAJour(List<Projet> projetsACharger) {
|
410 |
panneauOuest.getFiltre().rafraichir(projetsACharger);
|
411 |
panneauOuest.getFiltre().rafraichir(projetsACharger);
|
411 |
}
|
412 |
}
|
412 |
|
413 |
|
413 |
public void clicListeProjet(Projet projet) {
|
414 |
public void clicListeProjet(Projet projet) {
|
414 |
panneauCentre.getContenu().rafraichir(projet);
|
415 |
panneauCentre.getContenu().rafraichir(projet);
|
415 |
}
|
416 |
}
|
416 |
|
417 |
|
417 |
public void clicSupprimerProjet(final List<Projet> projetListe) {
|
418 |
public void clicSupprimerProjet(final List<Projet> projetListe) {
|
418 |
if (projetListe.size() <= 0) {
|
419 |
if (projetListe.size() <= 0) {
|
419 |
MessageBox.alert("Attention", "Vous devez sélectionner un projet", null);
|
420 |
MessageBox.alert("Attention", "Vous devez sélectionner un projet", null);
|
420 |
} else {
|
421 |
} else {
|
421 |
String message = "Voulez-vous vraiment supprimer ces projets ?";
|
422 |
String message = "Voulez-vous vraiment supprimer ces projets ?";
|
422 |
if (projetListe.size() == 1) {
|
423 |
if (projetListe.size() == 1) {
|
423 |
message = "Voulez-vous vraiment supprimer ce projet ?";
|
424 |
message = "Voulez-vous vraiment supprimer ce projet ?";
|
424 |
}
|
425 |
}
|
425 |
|
426 |
|
426 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
427 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
427 |
public void handleEvent(MessageBoxEvent ce) {
|
428 |
public void handleEvent(MessageBoxEvent ce) {
|
428 |
Dialog dialog = (Dialog) ce.getComponent();
|
429 |
Dialog dialog = (Dialog) ce.getComponent();
|
429 |
Button btn = ce.getButtonClicked();
|
430 |
Button btn = ce.getButtonClicked();
|
430 |
|
431 |
|
431 |
if (btn.getText().equals(dialog.yesText)) {
|
432 |
if (btn.getText().equals(dialog.yesText)) {
|
432 |
modele.supprimerProjet(panneauCentre.getContenu(), projetListe);
|
433 |
modele.supprimerProjet(panneauCentre.getContenu(), projetListe);
|
433 |
}
|
434 |
}
|
434 |
}
|
435 |
}
|
435 |
};
|
436 |
};
|
436 |
|
437 |
|
437 |
MessageBox.confirm("Supprimer un projet", message, listenerSuppression);
|
438 |
MessageBox.confirm("Supprimer un projet", message, listenerSuppression);
|
438 |
}
|
439 |
}
|
439 |
|
440 |
|
440 |
}
|
441 |
}
|
441 |
|
442 |
|
442 |
public void clicModifierProjet(List<Projet> projetsSelectionnes) {
|
443 |
public void clicModifierProjet(List<Projet> projetsSelectionnes) {
|
443 |
if (projetsSelectionnes.size() == 0) {
|
444 |
if (projetsSelectionnes.size() == 0) {
|
444 |
Info.display("Information", "Veuillez sélectionner un projet.");
|
445 |
Info.display("Information", "Veuillez sélectionner un projet.");
|
445 |
} else if (projetsSelectionnes.size() > 1) {
|
446 |
} else if (projetsSelectionnes.size() > 1) {
|
446 |
Info.display("Information", "Veuillez sélectionner un seul projet à la fois.");
|
447 |
Info.display("Information", "Veuillez sélectionner un seul projet à la fois.");
|
447 |
} else if (projetsSelectionnes.size() == 1) {
|
448 |
} else if (projetsSelectionnes.size() == 1) {
|
448 |
afficherFormProjet(projetsSelectionnes.get(0).getId());
|
449 |
afficherFormProjet(projetsSelectionnes.get(0).getId());
|
449 |
} else {
|
450 |
} else {
|
450 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierProjet() du Médiateur.");
|
451 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierProjet() du Médiateur.");
|
451 |
}
|
452 |
}
|
452 |
}
|
453 |
}
|
453 |
|
454 |
|
454 |
public void clicAjouterProjet() {
|
455 |
public void clicAjouterProjet() {
|
455 |
afficherFormProjet(null);
|
456 |
afficherFormProjet(null);
|
456 |
}
|
457 |
}
|
457 |
|
458 |
|
458 |
public void selectionnerProjet(Rafraichissable vueARafraichir, String projetId) {
|
459 |
public void selectionnerProjet(Rafraichissable vueARafraichir, String projetId) {
|
459 |
selectionnerProjet(vueARafraichir, projetId, null, 0, nbElements);
|
460 |
selectionnerProjet(vueARafraichir, projetId, null, 0, nbElements);
|
460 |
}
|
461 |
}
|
461 |
|
462 |
|
462 |
public void selectionnerProjet(Rafraichissable vueARafraichir, String projetId, String nom, int start, int nbElements) {
|
463 |
public void selectionnerProjet(Rafraichissable vueARafraichir, String projetId, String nom, int start, int nbElements) {
|
463 |
modele.selectionnerProjet(vueARafraichir, projetId, nom, start, this.nbElements);
|
464 |
modele.selectionnerProjet(vueARafraichir, projetId, nom, start, this.nbElements);
|
464 |
}
|
465 |
}
|
465 |
|
466 |
|
466 |
public void ajouterProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
|
467 |
public void ajouterProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
|
467 |
modele.ajouterProjet(vueARafraichir, projetCollecte);
|
468 |
modele.ajouterProjet(vueARafraichir, projetCollecte);
|
468 |
}
|
469 |
}
|
469 |
|
470 |
|
470 |
public void modifierProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
|
471 |
public void modifierProjet(Rafraichissable vueARafraichir, Projet projetCollecte) {
|
471 |
modele.modifierProjet(vueARafraichir, projetCollecte);
|
472 |
modele.modifierProjet(vueARafraichir, projetCollecte);
|
472 |
}
|
473 |
}
|
473 |
|
474 |
|
474 |
//+----------------------------------------------------------------------------------------------------------------+
|
475 |
//+----------------------------------------------------------------------------------------------------------------+
|
475 |
// SELECTION : projet
|
476 |
// SELECTION : projet
|
476 |
/**
|
477 |
/**
|
477 |
* Retourne l'identifiant du projet courrant de l'application.
|
478 |
* Retourne l'identifiant du projet courrant de l'application.
|
478 |
*/
|
479 |
*/
|
479 |
public String getProjetId() {
|
480 |
public String getProjetId() {
|
480 |
String id = null;
|
481 |
String id = null;
|
481 |
Projet projetCourant = (Projet) Registry.get(RegistreId.PROJET_COURANT);
|
482 |
Projet projetCourant = (Projet) Registry.get(RegistreId.PROJET_COURANT);
|
482 |
if (projetCourant != null && !projetCourant.getId().equals("")) {
|
483 |
if (projetCourant != null && !projetCourant.getId().equals("")) {
|
483 |
id = projetCourant.getId();
|
484 |
id = projetCourant.getId();
|
484 |
}
|
485 |
}
|
485 |
return id;
|
486 |
return id;
|
486 |
}
|
487 |
}
|
487 |
|
488 |
|
488 |
public void selectionnerProjetCourant(Projet projetSelectionne) {
|
489 |
public void selectionnerProjetCourant(Projet projetSelectionne) {
|
489 |
Registry.register(RegistreId.PROJET_COURANT, projetSelectionne);
|
490 |
Registry.register(RegistreId.PROJET_COURANT, projetSelectionne);
|
490 |
if (panneauCentre.getContenu() instanceof AccueilVue) {
|
491 |
if (panneauCentre.getContenu() instanceof AccueilVue) {
|
491 |
desactiverChargement();
|
492 |
desactiverChargement();
|
492 |
} else if (panneauCentre.getContenu() instanceof ProjetVue) {
|
493 |
} else if (panneauCentre.getContenu() instanceof ProjetVue) {
|
493 |
selectionnerProjet(panneauCentre.getContenu(), null);
|
494 |
selectionnerProjet(panneauCentre.getContenu(), null);
|
494 |
} else if (panneauCentre.getContenu() instanceof StructureVue) {
|
495 |
} else if (panneauCentre.getContenu() instanceof StructureVue) {
|
495 |
selectionnerStructure(panneauCentre.getContenu(), null);
|
496 |
selectionnerStructure(panneauCentre.getContenu(), null);
|
496 |
} else if (panneauCentre.getContenu() instanceof CollectionVue) {
|
497 |
} else if (panneauCentre.getContenu() instanceof CollectionVue) {
|
497 |
selectionnerCollection(panneauCentre.getContenu(), null, null);
|
498 |
selectionnerCollection(panneauCentre.getContenu(), null, null);
|
498 |
} else if (panneauCentre.getContenu() instanceof PersonneVue) {
|
499 |
} else if (panneauCentre.getContenu() instanceof PersonneVue) {
|
499 |
selectionnerPersonne(panneauCentre.getContenu(), null, getProjetId());
|
500 |
selectionnerPersonne(panneauCentre.getContenu(), null, getProjetId());
|
500 |
} else if (panneauCentre.getContenu() instanceof PublicationVue) {
|
501 |
} else if (panneauCentre.getContenu() instanceof PublicationVue) {
|
501 |
selectionnerPublication(panneauCentre.getContenu(), null);
|
502 |
selectionnerPublication(panneauCentre.getContenu(), null);
|
502 |
} else if (panneauCentre.getContenu() instanceof CommentaireVue) {
|
503 |
} else if (panneauCentre.getContenu() instanceof CommentaireVue) {
|
503 |
selectionnerCommentaire(panneauCentre.getContenu(), null);
|
504 |
selectionnerCommentaire(panneauCentre.getContenu(), null);
|
504 |
}
|
505 |
}
|
505 |
}
|
506 |
}
|
506 |
|
507 |
|
507 |
|
508 |
|
508 |
//+----------------------------------------------------------------------------------------------------------------+
|
509 |
//+----------------------------------------------------------------------------------------------------------------+
|
509 |
// GESTION DES STRUCTURES
|
510 |
// GESTION DES STRUCTURES
|
510 |
//+----------------------------------------------------------------------------------------------------------------+
|
511 |
//+----------------------------------------------------------------------------------------------------------------+
|
511 |
|
512 |
|
512 |
public void afficherListeStructures(StructureListe structuresACharger) {
|
513 |
public void afficherListeStructures(StructureListe structuresACharger) {
|
513 |
if (!(panneauCentre.getContenu() instanceof StructureVue)) {
|
514 |
if (!(panneauCentre.getContenu() instanceof StructureVue)) {
|
514 |
panneauCentre.removeAll();
|
515 |
panneauCentre.removeAll();
|
515 |
panneauCentre.add(new StructureVue(this));
|
516 |
panneauCentre.add(new StructureVue(this));
|
516 |
}
|
517 |
}
|
517 |
panneauCentre.getContenu().rafraichir(structuresACharger);
|
518 |
panneauCentre.getContenu().rafraichir(structuresACharger);
|
518 |
}
|
519 |
}
|
519 |
|
520 |
|
520 |
public void afficherFormStructure(String structureId) {
|
521 |
public void afficherFormStructure(String structureId) {
|
521 |
String mode = Formulaire.MODE_AJOUTER;
|
522 |
String mode = Formulaire.MODE_AJOUTER;
|
522 |
if (structureId != null) {
|
523 |
if (structureId != null) {
|
523 |
mode = Formulaire.MODE_MODIFIER;
|
524 |
mode = Formulaire.MODE_MODIFIER;
|
524 |
}
|
525 |
}
|
525 |
|
526 |
|
526 |
panneauCentre.removeAll();
|
527 |
panneauCentre.removeAll();
|
527 |
StructureForm structureForm = new StructureForm(this, mode);
|
528 |
StructureForm structureForm = new StructureForm(this, mode);
|
528 |
panneauCentre.add(structureForm);
|
529 |
panneauCentre.add(structureForm);
|
529 |
|
530 |
|
530 |
if (mode.equals(Formulaire.MODE_MODIFIER)) {
|
531 |
if (mode.equals(Formulaire.MODE_MODIFIER)) {
|
531 |
selectionnerStructure(structureForm, structureId);
|
532 |
selectionnerStructure(structureForm, structureId);
|
532 |
selectionnerStructureAPersonne(structureForm, structureId, StructureAPersonne.ROLE_EQUIPE);
|
533 |
selectionnerStructureAPersonne(structureForm, structureId, StructureAPersonne.ROLE_EQUIPE);
|
533 |
}
|
534 |
}
|
534 |
|
535 |
|
535 |
panneauCentre.layout();
|
536 |
panneauCentre.layout();
|
536 |
}
|
537 |
}
|
537 |
|
538 |
|
538 |
public void clicListeStructure(Structure structure) {
|
539 |
public void clicListeStructure(Structure structure) {
|
539 |
panneauCentre.getContenu().rafraichir(structure);
|
540 |
panneauCentre.getContenu().rafraichir(structure);
|
540 |
if (structure != null && structure.getPersonnel() == null) {
|
541 |
if (structure != null && structure.getPersonnel() == null) {
|
541 |
selectionnerStructureAPersonne(panneauCentre.getContenu(), structure.getId(), StructureAPersonne.ROLE_EQUIPE);
|
542 |
selectionnerStructureAPersonne(panneauCentre.getContenu(), structure.getId(), StructureAPersonne.ROLE_EQUIPE);
|
542 |
}
|
543 |
}
|
543 |
}
|
544 |
}
|
544 |
|
545 |
|
545 |
public void clicAjouterStructure() {
|
546 |
public void clicAjouterStructure() {
|
546 |
afficherFormStructure(null);
|
547 |
afficherFormStructure(null);
|
547 |
}
|
548 |
}
|
548 |
|
549 |
|
549 |
public void clicModifierStructure(List<Structure> structureSelection) {
|
550 |
public void clicModifierStructure(List<Structure> structureSelection) {
|
550 |
if (structureSelection.size() == 0) {
|
551 |
if (structureSelection.size() == 0) {
|
551 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
552 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
552 |
} else if (structureSelection.size() > 1) {
|
553 |
} else if (structureSelection.size() > 1) {
|
553 |
Info.display("Information", "Veuillez sélectionner une seule structure à la fois.");
|
554 |
Info.display("Information", "Veuillez sélectionner une seule structure à la fois.");
|
554 |
} else if (structureSelection.size() == 1) {
|
555 |
} else if (structureSelection.size() == 1) {
|
555 |
afficherFormStructure(structureSelection.get(0).getId());
|
556 |
afficherFormStructure(structureSelection.get(0).getId());
|
556 |
} else {
|
557 |
} else {
|
557 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierStructure() du Médiateur.");
|
558 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierStructure() du Médiateur.");
|
558 |
}
|
559 |
}
|
559 |
}
|
560 |
}
|
560 |
|
561 |
|
561 |
public void clicSupprimerStructure(final Rafraichissable vue, final List<Structure> structureSelection) {
|
562 |
public void clicSupprimerStructure(final Rafraichissable vue, final List<Structure> structureSelection) {
|
562 |
if (structureSelection.size() == 0) {
|
563 |
if (structureSelection.size() == 0) {
|
563 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
564 |
Info.display("Information", "Veuillez sélectionner une structure.");
|
564 |
} else if(structureSelection.size() > 0) {
|
565 |
} else if(structureSelection.size() > 0) {
|
565 |
String titre = "Supprimer des structures";
|
566 |
String titre = "Supprimer des structures";
|
566 |
String message = "Êtes vous sur de vouloir supprimer les structures sélectionnées ?";
|
567 |
String message = "Êtes vous sur de vouloir supprimer les structures sélectionnées ?";
|
567 |
if (structureSelection.size() == 1) {
|
568 |
if (structureSelection.size() == 1) {
|
568 |
titre = "Supprimer une structure";
|
569 |
titre = "Supprimer une structure";
|
569 |
message = "Êtes vous sur de vouloir supprimer la structure sélectionnée ?";
|
570 |
message = "Êtes vous sur de vouloir supprimer la structure sélectionnée ?";
|
570 |
}
|
571 |
}
|
571 |
|
572 |
|
572 |
final Listener<MessageBoxEvent> suppressionEcouteur = new Listener<MessageBoxEvent>() {
|
573 |
final Listener<MessageBoxEvent> suppressionEcouteur = new Listener<MessageBoxEvent>() {
|
573 |
public void handleEvent(MessageBoxEvent ce) {
|
574 |
public void handleEvent(MessageBoxEvent ce) {
|
574 |
Dialog dialog = (Dialog) ce.getComponent();
|
575 |
Dialog dialog = (Dialog) ce.getComponent();
|
575 |
Button btn = ce.getButtonClicked();
|
576 |
Button btn = ce.getButtonClicked();
|
576 |
|
577 |
|
577 |
if (btn.getText().equals(dialog.yesText)) {
|
578 |
if (btn.getText().equals(dialog.yesText)) {
|
578 |
String idStr = "" ;
|
579 |
String idStr = "" ;
|
579 |
for(int i = 0 ; i < structureSelection.size() ; i++) {
|
580 |
for(int i = 0 ; i < structureSelection.size() ; i++) {
|
580 |
idStr += structureSelection.get(i).getId()+",";
|
581 |
idStr += structureSelection.get(i).getId()+",";
|
581 |
}
|
582 |
}
|
582 |
supprimerStructure(vue, idStr);
|
583 |
supprimerStructure(vue, idStr);
|
583 |
}
|
584 |
}
|
584 |
}
|
585 |
}
|
585 |
};
|
586 |
};
|
586 |
|
587 |
|
587 |
MessageBox.confirm(titre, message, suppressionEcouteur);
|
588 |
MessageBox.confirm(titre, message, suppressionEcouteur);
|
588 |
} else {
|
589 |
} else {
|
589 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerStructure() du Médiateur.");
|
590 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerStructure() du Médiateur.");
|
590 |
}
|
591 |
}
|
591 |
}
|
592 |
}
|
592 |
|
593 |
|
593 |
public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId) {
|
594 |
public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId) {
|
594 |
modele.selectionnerStructure(vueARafraichir, getProjetId(), structureId, null, 0, nbElements);
|
595 |
modele.selectionnerStructure(vueARafraichir, getProjetId(), structureId, null, 0, nbElements);
|
595 |
}
|
596 |
}
|
596 |
|
597 |
|
597 |
public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId, String projetId, String nom, int start, int nbElements) {
|
598 |
public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId, String projetId, String nom, int start, int nbElements) {
|
598 |
modele.selectionnerStructure(vueARafraichir, getProjetId(), structureId, nom, start, nbElements);
|
599 |
modele.selectionnerStructure(vueARafraichir, getProjetId(), structureId, nom, start, nbElements);
|
599 |
}
|
600 |
}
|
600 |
|
601 |
|
601 |
public void selectionnerStructureParProjet(Rafraichissable vueARafraichir, String projetId) {
|
602 |
public void selectionnerStructureParProjet(Rafraichissable vueARafraichir, String projetId) {
|
602 |
modele.selectionnerStructure(vueARafraichir, projetId, null, null, 0, -1);
|
603 |
modele.selectionnerStructure(vueARafraichir, projetId, null, null, 0, -1);
|
603 |
}
|
604 |
}
|
604 |
|
605 |
|
605 |
public void ajouterStructure(Rafraichissable vueARafraichir, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
|
606 |
public void ajouterStructure(Rafraichissable vueARafraichir, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
|
606 |
modele.ajouterStructure(vueARafraichir, structure, conservation, valorisation);
|
607 |
modele.ajouterStructure(vueARafraichir, structure, conservation, valorisation);
|
607 |
}
|
608 |
}
|
608 |
|
609 |
|
609 |
public void modifierStructure(Rafraichissable vueARafraichir, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
|
610 |
public void modifierStructure(Rafraichissable vueARafraichir, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
|
610 |
modele.modifierStructure(vueARafraichir, structureId, structure, conservation, valorisation);
|
611 |
modele.modifierStructure(vueARafraichir, structureId, structure, conservation, valorisation);
|
611 |
}
|
612 |
}
|
612 |
|
613 |
|
613 |
public void supprimerStructure(Rafraichissable vueARafraichir, String IdentifiantsStructureSepareParVirgule) {
|
614 |
public void supprimerStructure(Rafraichissable vueARafraichir, String IdentifiantsStructureSepareParVirgule) {
|
614 |
modele.supprimerStructure(vueARafraichir, IdentifiantsStructureSepareParVirgule);
|
615 |
modele.supprimerStructure(vueARafraichir, IdentifiantsStructureSepareParVirgule);
|
615 |
}
|
616 |
}
|
616 |
|
617 |
|
617 |
//+----------------------------------------------------------------------------------------------------------------+
|
618 |
//+----------------------------------------------------------------------------------------------------------------+
|
618 |
// GESTION de la relation STRUCTURE A PERSONNE
|
619 |
// GESTION de la relation STRUCTURE A PERSONNE
|
619 |
public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId) {
|
620 |
public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId) {
|
620 |
modele.selectionnerStructureAPersonne(vueARafraichir, structureId, roleId);
|
621 |
modele.selectionnerStructureAPersonne(vueARafraichir, structureId, roleId);
|
621 |
}
|
622 |
}
|
622 |
|
623 |
|
623 |
public void ajouterStructureAPersonne(Rafraichissable vueARafraichir, String structureId, StructureAPersonneListe personnelAjoute) {
|
624 |
public void ajouterStructureAPersonne(Rafraichissable vueARafraichir, String structureId, StructureAPersonneListe personnelAjoute) {
|
624 |
if (personnelAjoute != null && personnelAjoute.size() > 0) {
|
625 |
if (personnelAjoute != null && personnelAjoute.size() > 0) {
|
625 |
for (Iterator<String> it = personnelAjoute.keySet().iterator(); it.hasNext();) {
|
626 |
for (Iterator<String> it = personnelAjoute.keySet().iterator(); it.hasNext();) {
|
626 |
modele.ajouterStructureAPersonne(vueARafraichir, structureId, (StructureAPersonne) personnelAjoute.get(it.next()));
|
627 |
modele.ajouterStructureAPersonne(vueARafraichir, structureId, (StructureAPersonne) personnelAjoute.get(it.next()));
|
627 |
}
|
628 |
}
|
628 |
}
|
629 |
}
|
629 |
}
|
630 |
}
|
630 |
|
631 |
|
631 |
public void modifierStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelModifie) {
|
632 |
public void modifierStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelModifie) {
|
632 |
if (personnelModifie != null && personnelModifie.size() > 0) {
|
633 |
if (personnelModifie != null && personnelModifie.size() > 0) {
|
633 |
for (Iterator<String> it = personnelModifie.keySet().iterator(); it.hasNext();) {
|
634 |
for (Iterator<String> it = personnelModifie.keySet().iterator(); it.hasNext();) {
|
634 |
modele.modifierStructureAPersonne(vueARafraichir, (StructureAPersonne) personnelModifie.get(it.next()));
|
635 |
modele.modifierStructureAPersonne(vueARafraichir, (StructureAPersonne) personnelModifie.get(it.next()));
|
635 |
}
|
636 |
}
|
636 |
}
|
637 |
}
|
637 |
}
|
638 |
}
|
638 |
|
639 |
|
639 |
public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelSupprime) {
|
640 |
public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelSupprime) {
|
640 |
if (personnelSupprime != null && personnelSupprime.size() > 0) {
|
641 |
if (personnelSupprime != null && personnelSupprime.size() > 0) {
|
641 |
String idStructureAPersonneSepareParVirgule = "" ;
|
642 |
String idStructureAPersonneSepareParVirgule = "" ;
|
642 |
Iterator<String> it = personnelSupprime.keySet().iterator();
|
643 |
Iterator<String> it = personnelSupprime.keySet().iterator();
|
643 |
while (it.hasNext()) {
|
644 |
while (it.hasNext()) {
|
644 |
idStructureAPersonneSepareParVirgule += personnelSupprime.get(it.next()).getId();
|
645 |
idStructureAPersonneSepareParVirgule += personnelSupprime.get(it.next()).getId();
|
645 |
idStructureAPersonneSepareParVirgule += (it.hasNext()) ? "," : "";
|
646 |
idStructureAPersonneSepareParVirgule += (it.hasNext()) ? "," : "";
|
646 |
}
|
647 |
}
|
647 |
supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSepareParVirgule);
|
648 |
supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSepareParVirgule);
|
648 |
}
|
649 |
}
|
649 |
}
|
650 |
}
|
650 |
|
651 |
|
651 |
public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, String idStructureAPersonneSeparesParVirgule) {
|
652 |
public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, String idStructureAPersonneSeparesParVirgule) {
|
652 |
modele.supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSeparesParVirgule);
|
653 |
modele.supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSeparesParVirgule);
|
653 |
}
|
654 |
}
|
654 |
|
655 |
|
655 |
public void supprimerStructureAPersonne(final Rafraichissable vueARafraichir, final List<Structure> structuresListe) {
|
656 |
public void supprimerStructureAPersonne(final Rafraichissable vueARafraichir, final List<Structure> structuresListe) {
|
656 |
if (structuresListe.size() != 0) {
|
657 |
if (structuresListe.size() != 0) {
|
657 |
String idStructureSepareParVirgule = "" ;
|
658 |
String idStructureSepareParVirgule = "" ;
|
658 |
Iterator<Structure> it = structuresListe.iterator();
|
659 |
Iterator<Structure> it = structuresListe.iterator();
|
659 |
while (it.hasNext()) {
|
660 |
while (it.hasNext()) {
|
660 |
Structure structure = it.next();
|
661 |
Structure structure = it.next();
|
661 |
idStructureSepareParVirgule += structure.getId();
|
662 |
idStructureSepareParVirgule += structure.getId();
|
662 |
idStructureSepareParVirgule += it.hasNext() ? "," : "";
|
663 |
idStructureSepareParVirgule += it.hasNext() ? "," : "";
|
663 |
}
|
664 |
}
|
664 |
supprimerStructureAPersonne(vueARafraichir, idStructureSepareParVirgule);
|
665 |
supprimerStructureAPersonne(vueARafraichir, idStructureSepareParVirgule);
|
665 |
}
|
666 |
}
|
666 |
}
|
667 |
}
|
667 |
|
668 |
|
668 |
//+----------------------------------------------------------------------------------------------------------------+
|
669 |
//+----------------------------------------------------------------------------------------------------------------+
|
669 |
// GESTION des COLLECTIONS
|
670 |
// GESTION des COLLECTIONS
|
670 |
//+----------------------------------------------------------------------------------------------------------------+
|
671 |
//+----------------------------------------------------------------------------------------------------------------+
|
671 |
|
672 |
|
672 |
public void afficherListeCollections(CollectionListe collectionsACharger) {
|
673 |
public void afficherListeCollections(CollectionListe collectionsACharger) {
|
673 |
if (!(panneauCentre.getContenu() instanceof CollectionVue)) {
|
674 |
if (!(panneauCentre.getContenu() instanceof CollectionVue)) {
|
674 |
panneauCentre.removeAll();
|
675 |
panneauCentre.removeAll();
|
675 |
panneauCentre.add(new CollectionVue(this));
|
676 |
panneauCentre.add(new CollectionVue(this));
|
676 |
}
|
677 |
}
|
677 |
|
678 |
|
678 |
panneauCentre.getContenu().rafraichir(collectionsACharger);
|
679 |
panneauCentre.getContenu().rafraichir(collectionsACharger);
|
679 |
}
|
680 |
}
|
680 |
|
681 |
|
681 |
public void afficherFormCollection(String collectionId) {
|
682 |
public void afficherFormCollection(String collectionId) {
|
682 |
panneauCentre.removeAll();
|
683 |
panneauCentre.removeAll();
|
683 |
CollectionForm collectionForm = new CollectionForm(this, collectionId);
|
684 |
CollectionForm collectionForm = new CollectionForm(this, collectionId);
|
684 |
panneauCentre.add(collectionForm);
|
685 |
panneauCentre.add(collectionForm);
|
685 |
|
686 |
|
686 |
panneauCentre.layout();
|
687 |
panneauCentre.layout();
|
687 |
}
|
688 |
}
|
688 |
|
689 |
|
689 |
public void clicListeCollection(Collection collectionCliquee) {
|
690 |
public void clicListeCollection(Collection collectionCliquee) {
|
690 |
panneauCentre.getContenu().rafraichir(collectionCliquee);
|
691 |
panneauCentre.getContenu().rafraichir(collectionCliquee);
|
691 |
if (collectionCliquee != null) {
|
692 |
if (collectionCliquee != null) {
|
692 |
selectionnerCollectionAPersonne(panneauCentre.getContenu(), collectionCliquee.getId(), null);
|
693 |
selectionnerCollectionAPersonne(panneauCentre.getContenu(), collectionCliquee.getId(), null);
|
693 |
selectionnerCollectionAPublication(panneauCentre.getContenu(), collectionCliquee.getId());
|
694 |
selectionnerCollectionAPublication(panneauCentre.getContenu(), collectionCliquee.getId());
|
694 |
selectionnerCollectionACommentaire(panneauCentre.getContenu(), collectionCliquee.getId());
|
695 |
selectionnerCollectionACommentaire(panneauCentre.getContenu(), collectionCliquee.getId());
|
695 |
}
|
696 |
}
|
696 |
}
|
697 |
}
|
697 |
|
698 |
|
698 |
public void clicAjouterCollection() {
|
699 |
public void clicAjouterCollection() {
|
699 |
afficherFormCollection(null);
|
700 |
afficherFormCollection(null);
|
700 |
}
|
701 |
}
|
701 |
|
702 |
|
702 |
public void clicModifierCollection(List<Collection> selection) {
|
703 |
public void clicModifierCollection(List<Collection> selection) {
|
703 |
if (selection.size() == 0) {
|
704 |
if (selection.size() == 0) {
|
704 |
Info.display("Information", "Veuillez sélectionner une collection.");
|
705 |
Info.display("Information", "Veuillez sélectionner une collection.");
|
705 |
} else if (selection.size() > 1) {
|
706 |
} else if (selection.size() > 1) {
|
706 |
Info.display("Information", "Veuillez sélectionner une seule collection à la fois.");
|
707 |
Info.display("Information", "Veuillez sélectionner une seule collection à la fois.");
|
707 |
} else if (selection.size() == 1) {
|
708 |
} else if (selection.size() == 1) {
|
708 |
afficherFormCollection(selection.get(0).getId());
|
709 |
afficherFormCollection(selection.get(0).getId());
|
709 |
} else {
|
710 |
} else {
|
710 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCollection() du Médiateur.");
|
711 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCollection() du Médiateur.");
|
711 |
}
|
712 |
}
|
712 |
}
|
713 |
}
|
713 |
|
714 |
|
714 |
public void clicSupprimerCollection(CollectionListeVue collectionListeVue, final List<Collection> collectionsASupprimer) {
|
715 |
public void clicSupprimerCollection(CollectionListeVue collectionListeVue, final List<Collection> collectionsASupprimer) {
|
715 |
if (collectionsASupprimer.size() <= 0) {
|
716 |
if (collectionsASupprimer.size() <= 0) {
|
716 |
MessageBox.alert("Attention", "Vous devez sélectionner au moins une collection", null);
|
717 |
MessageBox.alert("Attention", "Vous devez sélectionner au moins une collection", null);
|
717 |
} else {
|
718 |
} else {
|
718 |
String message = "Voulez-vous vraiment supprimer ces collections ?";
|
719 |
String message = "Voulez-vous vraiment supprimer ces collections ?";
|
719 |
if (collectionsASupprimer.size() == 1) {
|
720 |
if (collectionsASupprimer.size() == 1) {
|
720 |
message = "Voulez-vous vraiment supprimer cette collection ?";
|
721 |
message = "Voulez-vous vraiment supprimer cette collection ?";
|
721 |
}
|
722 |
}
|
722 |
|
723 |
|
723 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
724 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
724 |
public void handleEvent(MessageBoxEvent ce) {
|
725 |
public void handleEvent(MessageBoxEvent ce) {
|
725 |
Dialog dialog = (Dialog) ce.getComponent();
|
726 |
Dialog dialog = (Dialog) ce.getComponent();
|
726 |
Button btn = ce.getButtonClicked();
|
727 |
Button btn = ce.getButtonClicked();
|
727 |
|
728 |
|
728 |
if (btn.getText().equals(dialog.yesText)) {
|
729 |
if (btn.getText().equals(dialog.yesText)) {
|
729 |
supprimerCollection(panneauCentre.getContenu(), collectionsASupprimer);
|
730 |
supprimerCollection(panneauCentre.getContenu(), collectionsASupprimer);
|
730 |
}
|
731 |
}
|
731 |
}
|
732 |
}
|
732 |
};
|
733 |
};
|
733 |
|
734 |
|
734 |
MessageBox.confirm("Supprimer une collection", message, listenerSuppression);
|
735 |
MessageBox.confirm("Supprimer une collection", message, listenerSuppression);
|
735 |
}
|
736 |
}
|
736 |
}
|
737 |
}
|
737 |
|
738 |
|
738 |
public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom) {
|
739 |
public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom) {
|
739 |
|
- |
|
740 |
System.out.println(nbElements);
|
- |
|
741 |
selectionnerCollection(vueARafraichir, collectionId, nom, 0, nbElements);
|
740 |
selectionnerCollection(vueARafraichir, collectionId, nom, 0, -1);
|
742 |
}
|
741 |
}
|
743 |
|
742 |
|
744 |
public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom, int start, int nbElements) {
|
743 |
public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom, int start, int nbElements) {
|
745 |
modele.selectionnerCollection(vueARafraichir, getProjetId(), collectionId, nom, start, this.nbElements);
|
744 |
modele.selectionnerCollection(vueARafraichir, getProjetId(), collectionId, nom, start, nbElements);
|
746 |
}
|
745 |
}
|
747 |
|
746 |
|
748 |
public void selectionnerCollectionParProjet(Rafraichissable vueARafraichir, String projetId) {
|
747 |
public void selectionnerCollectionParProjet(Rafraichissable vueARafraichir, String projetId) {
|
749 |
modele.selectionnerCollection(vueARafraichir, projetId, null, null, 0, nbElements);
|
748 |
modele.selectionnerCollection(vueARafraichir, projetId, null, null, 0, -1);
|
750 |
}
|
749 |
}
|
751 |
|
750 |
|
752 |
public void ajouterCollection(Rafraichissable vueARafraichir, Collection collection) {
|
751 |
public void ajouterCollection(Rafraichissable vueARafraichir, Collection collection) {
|
753 |
modele.ajouterCollection(vueARafraichir, collection);
|
752 |
modele.ajouterCollection(vueARafraichir, collection);
|
754 |
}
|
753 |
}
|
755 |
|
754 |
|
756 |
public void modifierCollection(Rafraichissable vueARafraichir, Collection collection) {
|
755 |
public void modifierCollection(Rafraichissable vueARafraichir, Collection collection) {
|
757 |
modele.modifierCollection(vueARafraichir, collection);
|
756 |
modele.modifierCollection(vueARafraichir, collection);
|
758 |
}
|
757 |
}
|
759 |
|
758 |
|
760 |
public void supprimerCollection(Rafraichissable vueARafraichir, List<Collection> collectionsListe) {
|
759 |
public void supprimerCollection(Rafraichissable vueARafraichir, List<Collection> collectionsListe) {
|
761 |
if (collectionsListe != null && collectionsListe.size() > 0) {
|
760 |
if (collectionsListe != null && collectionsListe.size() > 0) {
|
762 |
String idCollectionSeparesParVirgule = "" ;
|
761 |
String idCollectionSeparesParVirgule = "" ;
|
763 |
Iterator<Collection> it = collectionsListe.iterator();
|
762 |
Iterator<Collection> it = collectionsListe.iterator();
|
764 |
while (it.hasNext()) {
|
763 |
while (it.hasNext()) {
|
765 |
idCollectionSeparesParVirgule += it.next().getId();
|
764 |
idCollectionSeparesParVirgule += it.next().getId();
|
766 |
if (it.hasNext()) {
|
765 |
if (it.hasNext()) {
|
767 |
idCollectionSeparesParVirgule += ",";
|
766 |
idCollectionSeparesParVirgule += ",";
|
768 |
}
|
767 |
}
|
769 |
}
|
768 |
}
|
770 |
modele.supprimerCollection(vueARafraichir, idCollectionSeparesParVirgule);
|
769 |
modele.supprimerCollection(vueARafraichir, idCollectionSeparesParVirgule);
|
771 |
modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionSeparesParVirgule);
|
770 |
modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionSeparesParVirgule);
|
772 |
modele.supprimerCollectionAPublication(vueARafraichir, idCollectionSeparesParVirgule);
|
771 |
modele.supprimerCollectionAPublication(vueARafraichir, idCollectionSeparesParVirgule);
|
773 |
//modele.supprimerCollectionACommentaire(vueARafraichir, idCollectionSeparesParVirgule);
|
772 |
//modele.supprimerCollectionACommentaire(vueARafraichir, idCollectionSeparesParVirgule);
|
774 |
}
|
773 |
}
|
775 |
|
774 |
|
776 |
}
|
775 |
}
|
777 |
|
776 |
|
778 |
//+----------------------------------------------------------------------------------------------------------------+
|
777 |
//+----------------------------------------------------------------------------------------------------------------+
|
779 |
// GESTION de la relation COLLECTION A PERSONNE
|
778 |
// GESTION de la relation COLLECTION A PERSONNE
|
780 |
|
779 |
|
781 |
public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId) {
|
780 |
public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId) {
|
782 |
modele.selectionnerCollectionAPersonne(vueARafraichir, collectionId, roleId);
|
781 |
modele.selectionnerCollectionAPersonne(vueARafraichir, collectionId, roleId);
|
783 |
}
|
782 |
}
|
784 |
|
783 |
|
785 |
public void ajouterCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, CollectionAPersonneListe personnesAjoutees) {
|
784 |
public void ajouterCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, CollectionAPersonneListe personnesAjoutees) {
|
786 |
if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
|
785 |
if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
|
787 |
for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
|
786 |
for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
|
788 |
modele.ajouterCollectionAPersonne(vueARafraichir, collectionId, (CollectionAPersonne) personnesAjoutees.get(it.next()));
|
787 |
modele.ajouterCollectionAPersonne(vueARafraichir, collectionId, (CollectionAPersonne) personnesAjoutees.get(it.next()));
|
789 |
}
|
788 |
}
|
790 |
}
|
789 |
}
|
791 |
}
|
790 |
}
|
792 |
|
791 |
|
793 |
public void modifierCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesModifiees) {
|
792 |
public void modifierCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesModifiees) {
|
794 |
if (personnesModifiees != null && personnesModifiees.size() > 0) {
|
793 |
if (personnesModifiees != null && personnesModifiees.size() > 0) {
|
795 |
for (Iterator<String> it = personnesModifiees.keySet().iterator(); it.hasNext();) {
|
794 |
for (Iterator<String> it = personnesModifiees.keySet().iterator(); it.hasNext();) {
|
796 |
modele.modifierCollectionAPersonne(vueARafraichir, (CollectionAPersonne) personnesModifiees.get(it.next()));
|
795 |
modele.modifierCollectionAPersonne(vueARafraichir, (CollectionAPersonne) personnesModifiees.get(it.next()));
|
797 |
}
|
796 |
}
|
798 |
}
|
797 |
}
|
799 |
}
|
798 |
}
|
800 |
|
799 |
|
801 |
public void supprimerCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesSupprimees) {
|
800 |
public void supprimerCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesSupprimees) {
|
802 |
if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
|
801 |
if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
|
803 |
String idCollectionAPersonneSeparesParVirgule = "" ;
|
802 |
String idCollectionAPersonneSeparesParVirgule = "" ;
|
804 |
for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
|
803 |
for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
|
805 |
idCollectionAPersonneSeparesParVirgule += personnesSupprimees.get(it.next()).getId();
|
804 |
idCollectionAPersonneSeparesParVirgule += personnesSupprimees.get(it.next()).getId();
|
806 |
if (it.hasNext()) {
|
805 |
if (it.hasNext()) {
|
807 |
idCollectionAPersonneSeparesParVirgule += ",";
|
806 |
idCollectionAPersonneSeparesParVirgule += ",";
|
808 |
}
|
807 |
}
|
809 |
}
|
808 |
}
|
810 |
modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionAPersonneSeparesParVirgule);
|
809 |
modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionAPersonneSeparesParVirgule);
|
811 |
}
|
810 |
}
|
812 |
}
|
811 |
}
|
813 |
|
812 |
|
814 |
//+----------------------------------------------------------------------------------------------------------------+
|
813 |
//+----------------------------------------------------------------------------------------------------------------+
|
815 |
// GESTION de la relation COLLECTION A PUBLICATION
|
814 |
// GESTION de la relation COLLECTION A PUBLICATION
|
816 |
|
815 |
|
817 |
public void selectionnerCollectionAPublication(Rafraichissable vueARafraichir, String collectionId) {
|
816 |
public void selectionnerCollectionAPublication(Rafraichissable vueARafraichir, String collectionId) {
|
818 |
modele.selectionnerCollectionAPublication(vueARafraichir, collectionId);
|
817 |
modele.selectionnerCollectionAPublication(vueARafraichir, collectionId);
|
819 |
}
|
818 |
}
|
820 |
|
819 |
|
821 |
public void ajouterCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, CollectionAPublicationListe publicationsAjoutees) {
|
820 |
public void ajouterCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, CollectionAPublicationListe publicationsAjoutees) {
|
822 |
if (publicationsAjoutees != null && publicationsAjoutees.size() > 0) {
|
821 |
if (publicationsAjoutees != null && publicationsAjoutees.size() > 0) {
|
823 |
for (Iterator<String> it = publicationsAjoutees.keySet().iterator(); it.hasNext();) {
|
822 |
for (Iterator<String> it = publicationsAjoutees.keySet().iterator(); it.hasNext();) {
|
824 |
modele.ajouterCollectionAPublication(vueARafraichir, collectionId, (CollectionAPublication) publicationsAjoutees.get(it.next()));
|
823 |
modele.ajouterCollectionAPublication(vueARafraichir, collectionId, (CollectionAPublication) publicationsAjoutees.get(it.next()));
|
825 |
}
|
824 |
}
|
826 |
}
|
825 |
}
|
827 |
}
|
826 |
}
|
828 |
|
827 |
|
829 |
public void modifierCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublicationListe publicationsModifiees) {
|
828 |
public void modifierCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublicationListe publicationsModifiees) {
|
830 |
if (publicationsModifiees != null && publicationsModifiees.size() > 0) {
|
829 |
if (publicationsModifiees != null && publicationsModifiees.size() > 0) {
|
831 |
for (Iterator<String> it = publicationsModifiees.keySet().iterator(); it.hasNext();) {
|
830 |
for (Iterator<String> it = publicationsModifiees.keySet().iterator(); it.hasNext();) {
|
832 |
modele.modifierCollectionAPublication(vueARafraichir, (CollectionAPublication) publicationsModifiees.get(it.next()));
|
831 |
modele.modifierCollectionAPublication(vueARafraichir, (CollectionAPublication) publicationsModifiees.get(it.next()));
|
833 |
}
|
832 |
}
|
834 |
}
|
833 |
}
|
835 |
}
|
834 |
}
|
836 |
|
835 |
|
837 |
public void supprimerCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublicationListe publicationsSupprimees) {
|
836 |
public void supprimerCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublicationListe publicationsSupprimees) {
|
838 |
if (publicationsSupprimees != null && publicationsSupprimees.size() > 0) {
|
837 |
if (publicationsSupprimees != null && publicationsSupprimees.size() > 0) {
|
839 |
String idCollectionAPublicationSeparesParVirgule = "" ;
|
838 |
String idCollectionAPublicationSeparesParVirgule = "" ;
|
840 |
for (Iterator<String> it = publicationsSupprimees.keySet().iterator(); it.hasNext();) {
|
839 |
for (Iterator<String> it = publicationsSupprimees.keySet().iterator(); it.hasNext();) {
|
841 |
idCollectionAPublicationSeparesParVirgule += publicationsSupprimees.get(it.next()).getId();
|
840 |
idCollectionAPublicationSeparesParVirgule += publicationsSupprimees.get(it.next()).getId();
|
842 |
if (it.hasNext()) {
|
841 |
if (it.hasNext()) {
|
843 |
idCollectionAPublicationSeparesParVirgule += ",";
|
842 |
idCollectionAPublicationSeparesParVirgule += ",";
|
844 |
}
|
843 |
}
|
845 |
}
|
844 |
}
|
846 |
modele.supprimerCollectionAPublication(vueARafraichir, idCollectionAPublicationSeparesParVirgule);
|
845 |
modele.supprimerCollectionAPublication(vueARafraichir, idCollectionAPublicationSeparesParVirgule);
|
847 |
}
|
846 |
}
|
848 |
}
|
847 |
}
|
849 |
|
848 |
|
850 |
//+----------------------------------------------------------------------------------------------------------------+
|
849 |
//+----------------------------------------------------------------------------------------------------------------+
|
851 |
// GESTION de la relation COLLECTION A COMMENTAIRE
|
850 |
// GESTION de la relation COLLECTION A COMMENTAIRE
|
852 |
|
851 |
|
853 |
public void selectionnerCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId) {
|
852 |
public void selectionnerCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId) {
|
854 |
modele.selectionnerCollectionACommentaire(vueARafraichir, collectionId);
|
853 |
modele.selectionnerCollectionACommentaire(vueARafraichir, collectionId);
|
855 |
}
|
854 |
}
|
856 |
|
855 |
|
857 |
public void ajouterCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId, CollectionACommentaireListe commentairesAjoutees) {
|
856 |
public void ajouterCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId, CollectionACommentaireListe commentairesAjoutees) {
|
858 |
if (commentairesAjoutees != null && commentairesAjoutees.size() > 0) {
|
857 |
if (commentairesAjoutees != null && commentairesAjoutees.size() > 0) {
|
859 |
for (Iterator<String> it = commentairesAjoutees.keySet().iterator(); it.hasNext();) {
|
858 |
for (Iterator<String> it = commentairesAjoutees.keySet().iterator(); it.hasNext();) {
|
860 |
modele.ajouterCollectionACommentaire(vueARafraichir, collectionId, (CollectionACommentaire) commentairesAjoutees.get(it.next()));
|
859 |
modele.ajouterCollectionACommentaire(vueARafraichir, collectionId, (CollectionACommentaire) commentairesAjoutees.get(it.next()));
|
861 |
}
|
860 |
}
|
862 |
}
|
861 |
}
|
863 |
}
|
862 |
}
|
864 |
|
863 |
|
865 |
public void modifierCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaireListe commentairesModifiees) {
|
864 |
public void modifierCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaireListe commentairesModifiees) {
|
866 |
if (commentairesModifiees != null && commentairesModifiees.size() > 0) {
|
865 |
if (commentairesModifiees != null && commentairesModifiees.size() > 0) {
|
867 |
for (Iterator<String> it = commentairesModifiees.keySet().iterator(); it.hasNext();) {
|
866 |
for (Iterator<String> it = commentairesModifiees.keySet().iterator(); it.hasNext();) {
|
868 |
modele.modifierCollectionACommentaire(vueARafraichir, (CollectionACommentaire) commentairesModifiees.get(it.next()));
|
867 |
modele.modifierCollectionACommentaire(vueARafraichir, (CollectionACommentaire) commentairesModifiees.get(it.next()));
|
869 |
}
|
868 |
}
|
870 |
}
|
869 |
}
|
871 |
}
|
870 |
}
|
872 |
|
871 |
|
873 |
public void supprimerCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaireListe commentairesSupprimees) {
|
872 |
public void supprimerCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaireListe commentairesSupprimees) {
|
874 |
if (commentairesSupprimees != null && commentairesSupprimees.size() > 0) {
|
873 |
if (commentairesSupprimees != null && commentairesSupprimees.size() > 0) {
|
875 |
String idCollectionACommentaireSeparesParVirgule = "" ;
|
874 |
String idCollectionACommentaireSeparesParVirgule = "" ;
|
876 |
for (Iterator<String> it = commentairesSupprimees.keySet().iterator(); it.hasNext();) {
|
875 |
for (Iterator<String> it = commentairesSupprimees.keySet().iterator(); it.hasNext();) {
|
877 |
idCollectionACommentaireSeparesParVirgule += commentairesSupprimees.get(it.next()).getId();
|
876 |
idCollectionACommentaireSeparesParVirgule += commentairesSupprimees.get(it.next()).getId();
|
878 |
if (it.hasNext()) {
|
877 |
if (it.hasNext()) {
|
879 |
idCollectionACommentaireSeparesParVirgule += ",";
|
878 |
idCollectionACommentaireSeparesParVirgule += ",";
|
880 |
}
|
879 |
}
|
881 |
}
|
880 |
}
|
882 |
modele.supprimerCollectionACommentaire(vueARafraichir, idCollectionACommentaireSeparesParVirgule, CollectionACommentaireAsyncDao.SUPPRESSION_PAR_COLLECTION);
|
881 |
modele.supprimerCollectionACommentaire(vueARafraichir, idCollectionACommentaireSeparesParVirgule, CollectionACommentaireAsyncDao.SUPPRESSION_PAR_COLLECTION);
|
883 |
}
|
882 |
}
|
884 |
}
|
883 |
}
|
885 |
//+----------------------------------------------------------------------------------------------------------------+
|
884 |
//+----------------------------------------------------------------------------------------------------------------+
|
886 |
// GESTION DES PERSONNES
|
885 |
// GESTION DES PERSONNES
|
887 |
//+----------------------------------------------------------------------------------------------------------------+
|
886 |
//+----------------------------------------------------------------------------------------------------------------+
|
888 |
|
887 |
|
889 |
public void afficherListePersonnes(PersonneListe personnesACharger) {
|
888 |
public void afficherListePersonnes(PersonneListe personnesACharger) {
|
890 |
if (!(panneauCentre.getContenu() instanceof PersonneVue)) {
|
889 |
if (!(panneauCentre.getContenu() instanceof PersonneVue)) {
|
891 |
panneauCentre.removeAll();
|
890 |
panneauCentre.removeAll();
|
892 |
panneauCentre.add(new PersonneVue(this));
|
891 |
panneauCentre.add(new PersonneVue(this));
|
893 |
panneauCentre.setId(ComposantId.PANNEAU_PERSONNE_LISTES);
|
892 |
panneauCentre.setId(ComposantId.PANNEAU_PERSONNE_LISTES);
|
894 |
}
|
893 |
}
|
895 |
|
894 |
|
896 |
panneauCentre.getContenu().rafraichir(personnesACharger);
|
895 |
panneauCentre.getContenu().rafraichir(personnesACharger);
|
897 |
}
|
896 |
}
|
898 |
|
897 |
|
899 |
public void afficherFormPersonne(String personneId) {
|
898 |
public void afficherFormPersonne(String personneId) {
|
900 |
panneauCentre.removeAll();
|
899 |
panneauCentre.removeAll();
|
901 |
PersonneForm personneForm = new PersonneForm(this, personneId);
|
900 |
PersonneForm personneForm = new PersonneForm(this, personneId);
|
902 |
panneauCentre.add(personneForm);
|
901 |
panneauCentre.add(personneForm);
|
903 |
|
902 |
|
904 |
panneauCentre.layout();
|
903 |
panneauCentre.layout();
|
905 |
}
|
904 |
}
|
906 |
|
905 |
|
907 |
public void clicListePersonne(Personne personne) {
|
906 |
public void clicListePersonne(Personne personne) {
|
908 |
panneauCentre.getContenu().rafraichir(personne);
|
907 |
panneauCentre.getContenu().rafraichir(personne);
|
909 |
}
|
908 |
}
|
910 |
|
909 |
|
911 |
public void clicAjouterPersonne() {
|
910 |
public void clicAjouterPersonne() {
|
912 |
afficherFormPersonne(null);
|
911 |
afficherFormPersonne(null);
|
913 |
}
|
912 |
}
|
914 |
|
913 |
|
915 |
public void clicModifierPersonne(List<Personne> selection) {
|
914 |
public void clicModifierPersonne(List<Personne> selection) {
|
916 |
if (selection.size() == 0) {
|
915 |
if (selection.size() == 0) {
|
917 |
Info.display("Information", "Veuillez sélectionner une personne.");
|
916 |
Info.display("Information", "Veuillez sélectionner une personne.");
|
918 |
} else if (selection.size() > 1) {
|
917 |
} else if (selection.size() > 1) {
|
919 |
Info.display("Information", "Veuillez sélectionner une seule personne à la fois.");
|
918 |
Info.display("Information", "Veuillez sélectionner une seule personne à la fois.");
|
920 |
} else if (selection.size() == 1) {
|
919 |
} else if (selection.size() == 1) {
|
921 |
afficherFormPersonne(selection.get(0).getId());
|
920 |
afficherFormPersonne(selection.get(0).getId());
|
922 |
} else {
|
921 |
} else {
|
923 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPersonne() du Médiateur.");
|
922 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPersonne() du Médiateur.");
|
924 |
}
|
923 |
}
|
925 |
}
|
924 |
}
|
926 |
|
925 |
|
927 |
|
926 |
|
928 |
public void clicSupprimerPersonne(final Rafraichissable vue, final List<Personne> personneSelection) {
|
927 |
public void clicSupprimerPersonne(final Rafraichissable vue, final List<Personne> personneSelection) {
|
929 |
//Empecher suppression utilisateur
|
928 |
//Empecher suppression utilisateur
|
930 |
for (int i=0; i < personneSelection.size(); i++) {
|
929 |
for (int i=0; i < personneSelection.size(); i++) {
|
931 |
Personne courante = personneSelection.get(i);
|
930 |
Personne courante = personneSelection.get(i);
|
932 |
if (courante.getId().equals(getUtilisateurId())) {
|
931 |
if (courante.getId().equals(getUtilisateurId())) {
|
933 |
Info.display("Information", "Vous ne pouvez pas supprimer votre compte");
|
932 |
Info.display("Information", "Vous ne pouvez pas supprimer votre compte");
|
934 |
personneSelection.remove(courante);
|
933 |
personneSelection.remove(courante);
|
935 |
}
|
934 |
}
|
936 |
}
|
935 |
}
|
937 |
|
936 |
|
938 |
if (personneSelection.size() == 0) {
|
937 |
if (personneSelection.size() == 0) {
|
939 |
Info.display("Information", "Veuillez sélectionner une personne.");
|
938 |
Info.display("Information", "Veuillez sélectionner une personne.");
|
940 |
} else if(personneSelection.size() > 0) {
|
939 |
} else if(personneSelection.size() > 0) {
|
941 |
String message = "Êtes vous sur de vouloir supprimer les personnes sélectionnées ?";
|
940 |
String message = "Êtes vous sur de vouloir supprimer les personnes sélectionnées ?";
|
942 |
if (personneSelection.size() == 1) {
|
941 |
if (personneSelection.size() == 1) {
|
943 |
message = "Êtes vous sur de vouloir supprimer la personne sélectionnée ?";
|
942 |
message = "Êtes vous sur de vouloir supprimer la personne sélectionnée ?";
|
944 |
}
|
943 |
}
|
945 |
|
944 |
|
946 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
945 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
947 |
public void handleEvent(MessageBoxEvent ce) {
|
946 |
public void handleEvent(MessageBoxEvent ce) {
|
948 |
Dialog dialog = (Dialog) ce.getComponent();
|
947 |
Dialog dialog = (Dialog) ce.getComponent();
|
949 |
Button btn = ce.getButtonClicked();
|
948 |
Button btn = ce.getButtonClicked();
|
950 |
|
949 |
|
951 |
if (btn.getText().equals(dialog.yesText)) {
|
950 |
if (btn.getText().equals(dialog.yesText)) {
|
952 |
String idPersonneSepareParVirgule = "" ;
|
951 |
String idPersonneSepareParVirgule = "" ;
|
953 |
Iterator<Personne> itPersonne = personneSelection.iterator();
|
952 |
Iterator<Personne> itPersonne = personneSelection.iterator();
|
954 |
while (itPersonne.hasNext()) {
|
953 |
while (itPersonne.hasNext()) {
|
955 |
Personne personneCourante = itPersonne.next();
|
954 |
Personne personneCourante = itPersonne.next();
|
956 |
idPersonneSepareParVirgule += personneCourante.getId();
|
955 |
idPersonneSepareParVirgule += personneCourante.getId();
|
957 |
idPersonneSepareParVirgule +=",";
|
956 |
idPersonneSepareParVirgule +=",";
|
958 |
}
|
957 |
}
|
959 |
modele.supprimerPersonne(vue, idPersonneSepareParVirgule);
|
958 |
modele.supprimerPersonne(vue, idPersonneSepareParVirgule);
|
960 |
}
|
959 |
}
|
961 |
}
|
960 |
}
|
962 |
};
|
961 |
};
|
963 |
|
962 |
|
964 |
MessageBox.confirm("Supprimer une personne", message, listenerSuppression);
|
963 |
MessageBox.confirm("Supprimer une personne", message, listenerSuppression);
|
965 |
} else {
|
964 |
} else {
|
966 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerPersonne() du Médiateur.");
|
965 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerPersonne() du Médiateur.");
|
967 |
}
|
966 |
}
|
968 |
}
|
967 |
}
|
969 |
|
968 |
|
970 |
public void selectionnerPersonne(Rafraichissable vueARafraichir, Personne personne, String projetId) {
|
969 |
public void selectionnerPersonne(Rafraichissable vueARafraichir, Personne personne, String projetId) {
|
971 |
selectionnerPersonne(vueARafraichir, personne, projetId, 0, nbElements);
|
970 |
selectionnerPersonne(vueARafraichir, personne, projetId, 0, nbElements);
|
972 |
}
|
971 |
}
|
973 |
|
972 |
|
974 |
public void selectionnerPersonne(Rafraichissable vueARafraichir, Personne personne, String projetId, int start, int nbElements) {
|
973 |
public void selectionnerPersonne(Rafraichissable vueARafraichir, Personne personne, String projetId, int start, int nbElements) {
|
975 |
String personneId = null;
|
974 |
String personneId = null;
|
976 |
String personneNom = null;
|
975 |
String personneNom = null;
|
977 |
if (personne != null) {
|
976 |
if (personne != null) {
|
978 |
personneId = personne.getId();
|
977 |
personneId = personne.getId();
|
979 |
personneNom = personne.getNom();
|
978 |
personneNom = personne.getNom();
|
980 |
}
|
979 |
}
|
981 |
modele.selectionnerPersonne(vueARafraichir, personneId, projetId, personneNom, start, nbElements);
|
980 |
modele.selectionnerPersonne(vueARafraichir, personneId, projetId, personneNom, start, nbElements);
|
982 |
}
|
981 |
}
|
983 |
|
982 |
|
984 |
public void selectionnerPersonneParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
|
983 |
public void selectionnerPersonneParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
|
985 |
modele.selectionnerPersonne(vueARafraichir, null, projetId, nomComplet, 0, -1);
|
984 |
modele.selectionnerPersonne(vueARafraichir, null, projetId, nomComplet, 0, -1);
|
986 |
}
|
985 |
}
|
987 |
|
986 |
|
988 |
public void selectionnerPersonneParProjet(Rafraichissable vueARafraichir, String projetId) {
|
987 |
public void selectionnerPersonneParProjet(Rafraichissable vueARafraichir, String projetId) {
|
989 |
modele.selectionnerPersonne(vueARafraichir, null, projetId, null, 0, -1);
|
988 |
modele.selectionnerPersonne(vueARafraichir, null, projetId, null, 0, -1);
|
990 |
}
|
989 |
}
|
991 |
|
990 |
|
992 |
public void enregistrerPersonne(Rafraichissable vue, Personne personne){
|
991 |
public void enregistrerPersonne(Rafraichissable vue, Personne personne){
|
993 |
if (personne.getId() != null && !personne.getId().trim().equals("")) {
|
992 |
if (personne.getId() != null && !personne.getId().trim().equals("")) {
|
994 |
modele.modifierPersonne(vue, personne);
|
993 |
modele.modifierPersonne(vue, personne);
|
995 |
} else {
|
994 |
} else {
|
996 |
modele.ajouterPersonne(vue, personne);
|
995 |
modele.ajouterPersonne(vue, personne);
|
997 |
}
|
996 |
}
|
998 |
}
|
997 |
}
|
999 |
|
998 |
|
1000 |
//+----------------------------------------------------------------------------------------------------------------+
|
999 |
//+----------------------------------------------------------------------------------------------------------------+
|
1001 |
// GESTION DES PUBLICATIONS
|
1000 |
// GESTION DES PUBLICATIONS
|
1002 |
//+----------------------------------------------------------------------------------------------------------------+
|
1001 |
//+----------------------------------------------------------------------------------------------------------------+
|
1003 |
|
1002 |
|
1004 |
public void afficherListePublication(PublicationListe nouvelleDonnees) {
|
1003 |
public void afficherListePublication(PublicationListe nouvelleDonnees) {
|
1005 |
if (!(panneauCentre.getContenu() instanceof PublicationVue)) {
|
1004 |
if (!(panneauCentre.getContenu() instanceof PublicationVue)) {
|
1006 |
panneauCentre.removeAll();
|
1005 |
panneauCentre.removeAll();
|
1007 |
panneauCentre.add(new PublicationVue(this));
|
1006 |
panneauCentre.add(new PublicationVue(this));
|
1008 |
}
|
1007 |
}
|
1009 |
|
1008 |
|
1010 |
panneauCentre.getContenu().rafraichir(nouvelleDonnees);
|
1009 |
panneauCentre.getContenu().rafraichir(nouvelleDonnees);
|
1011 |
}
|
1010 |
}
|
1012 |
|
1011 |
|
1013 |
public void afficherFormPublication(String publicationId) {
|
1012 |
public void afficherFormPublication(String publicationId) {
|
1014 |
panneauCentre.removeAll();
|
1013 |
panneauCentre.removeAll();
|
1015 |
PublicationForm publicationForm = new PublicationForm(this, publicationId);
|
1014 |
PublicationForm publicationForm = new PublicationForm(this, publicationId);
|
1016 |
panneauCentre.add(publicationForm);
|
1015 |
panneauCentre.add(publicationForm);
|
1017 |
|
1016 |
|
1018 |
panneauCentre.layout();
|
1017 |
panneauCentre.layout();
|
1019 |
}
|
1018 |
}
|
1020 |
|
1019 |
|
1021 |
public void clicListePublication(Publication publication) {
|
1020 |
public void clicListePublication(Publication publication) {
|
1022 |
if (publication != null) {
|
1021 |
if (publication != null) {
|
1023 |
panneauCentre.getContenu().rafraichir(publication);
|
1022 |
panneauCentre.getContenu().rafraichir(publication);
|
1024 |
}
|
1023 |
}
|
1025 |
}
|
1024 |
}
|
1026 |
|
1025 |
|
1027 |
public void clicAjouterPublication() {
|
1026 |
public void clicAjouterPublication() {
|
1028 |
afficherFormPublication(null);
|
1027 |
afficherFormPublication(null);
|
1029 |
}
|
1028 |
}
|
1030 |
|
1029 |
|
1031 |
public void clicModifierPublication(List<Publication> selection) {
|
1030 |
public void clicModifierPublication(List<Publication> selection) {
|
1032 |
if (selection.size() == 0) {
|
1031 |
if (selection.size() == 0) {
|
1033 |
Info.display("Information", "Veuillez sélectionner une publication.");
|
1032 |
Info.display("Information", "Veuillez sélectionner une publication.");
|
1034 |
} else if (selection.size() > 1) {
|
1033 |
} else if (selection.size() > 1) {
|
1035 |
Info.display("Information", "Veuillez sélectionner une seule publication à la fois.");
|
1034 |
Info.display("Information", "Veuillez sélectionner une seule publication à la fois.");
|
1036 |
} else if (selection.size() == 1) {
|
1035 |
} else if (selection.size() == 1) {
|
1037 |
afficherFormPublication(selection.get(0).getId());
|
1036 |
afficherFormPublication(selection.get(0).getId());
|
1038 |
} else {
|
1037 |
} else {
|
1039 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPublication() du Médiateur.");
|
1038 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPublication() du Médiateur.");
|
1040 |
}
|
1039 |
}
|
1041 |
}
|
1040 |
}
|
1042 |
|
1041 |
|
1043 |
public void clicSupprimerPublication(final List<Publication> publicationListe) {
|
1042 |
public void clicSupprimerPublication(final List<Publication> publicationListe) {
|
1044 |
if (publicationListe.size() <= 0) {
|
1043 |
if (publicationListe.size() <= 0) {
|
1045 |
MessageBox.alert("Attention", "Vous devez sélectionner une publication", null);
|
1044 |
MessageBox.alert("Attention", "Vous devez sélectionner une publication", null);
|
1046 |
} else {
|
1045 |
} else {
|
1047 |
String message = "Voulez-vous vraiment supprimer ces publications ?";
|
1046 |
String message = "Voulez-vous vraiment supprimer ces publications ?";
|
1048 |
if (publicationListe.size() == 1) {
|
1047 |
if (publicationListe.size() == 1) {
|
1049 |
message = "Voulez-vous vraiment supprimer cette publication ?";
|
1048 |
message = "Voulez-vous vraiment supprimer cette publication ?";
|
1050 |
}
|
1049 |
}
|
1051 |
|
1050 |
|
1052 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
1051 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
1053 |
public void handleEvent(MessageBoxEvent ce) {
|
1052 |
public void handleEvent(MessageBoxEvent ce) {
|
1054 |
Dialog dialog = (Dialog) ce.getComponent();
|
1053 |
Dialog dialog = (Dialog) ce.getComponent();
|
1055 |
Button btn = ce.getButtonClicked();
|
1054 |
Button btn = ce.getButtonClicked();
|
1056 |
|
1055 |
|
1057 |
if (btn.getText().equals(dialog.yesText)) {
|
1056 |
if (btn.getText().equals(dialog.yesText)) {
|
1058 |
supprimerPublication(panneauCentre.getContenu(), publicationListe);
|
1057 |
supprimerPublication(panneauCentre.getContenu(), publicationListe);
|
1059 |
}
|
1058 |
}
|
1060 |
}
|
1059 |
}
|
1061 |
};
|
1060 |
};
|
1062 |
|
1061 |
|
1063 |
MessageBox.confirm("Supprimer une publication", message, listenerSuppression);
|
1062 |
MessageBox.confirm("Supprimer une publication", message, listenerSuppression);
|
1064 |
}
|
1063 |
}
|
1065 |
}
|
1064 |
}
|
1066 |
|
1065 |
|
1067 |
public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId) {
|
1066 |
public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId) {
|
1068 |
selectionnerPublication(vueARafraichir, getProjetId(), publicationId, null, 0, nbElements);
|
1067 |
selectionnerPublication(vueARafraichir, getProjetId(), publicationId, null, 0, nbElements);
|
1069 |
}
|
1068 |
}
|
1070 |
|
1069 |
|
1071 |
public void selectionnerPublicationParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
|
1070 |
public void selectionnerPublicationParNomComplet(Rafraichissable vueARafraichir, String projetId, String nomComplet) {
|
1072 |
selectionnerPublication(vueARafraichir, projetId, null, nomComplet, 0, nbElements);
|
1071 |
selectionnerPublication(vueARafraichir, projetId, null, nomComplet, 0, nbElements);
|
1073 |
}
|
1072 |
}
|
1074 |
|
1073 |
|
1075 |
public void selectionnerPublication(Rafraichissable vueARafraichir, String projetId, String publicationId, String nomComplet, int pageCourante, int nbElements) {
|
1074 |
public void selectionnerPublication(Rafraichissable vueARafraichir, String projetId, String publicationId, String nomComplet, int pageCourante, int nbElements) {
|
1076 |
modele.selectionnerPublication(vueARafraichir, publicationId, projetId, nomComplet, nbElements, pageCourante);
|
1075 |
modele.selectionnerPublication(vueARafraichir, publicationId, projetId, nomComplet, nbElements, pageCourante);
|
1077 |
}
|
1076 |
}
|
1078 |
|
1077 |
|
1079 |
public void ajouterPublication(Rafraichissable vueARafraichir, Publication publication) {
|
1078 |
public void ajouterPublication(Rafraichissable vueARafraichir, Publication publication) {
|
1080 |
modele.ajouterPublication(vueARafraichir, publication);
|
1079 |
modele.ajouterPublication(vueARafraichir, publication);
|
1081 |
}
|
1080 |
}
|
1082 |
|
1081 |
|
1083 |
public void modifierPublication(Rafraichissable vueARafraichir, Publication publication) {
|
1082 |
public void modifierPublication(Rafraichissable vueARafraichir, Publication publication) {
|
1084 |
modele.modifierPublication(vueARafraichir, publication);
|
1083 |
modele.modifierPublication(vueARafraichir, publication);
|
1085 |
}
|
1084 |
}
|
1086 |
|
1085 |
|
1087 |
public void supprimerPublication(Rafraichissable vueARafraichir, List<Publication> publicationsListe) {
|
1086 |
public void supprimerPublication(Rafraichissable vueARafraichir, List<Publication> publicationsListe) {
|
1088 |
if (publicationsListe != null && publicationsListe.size() > 0) {
|
1087 |
if (publicationsListe != null && publicationsListe.size() > 0) {
|
1089 |
String idPublicationSeparesParVirgule = "" ;
|
1088 |
String idPublicationSeparesParVirgule = "" ;
|
1090 |
Iterator<Publication> it = publicationsListe.iterator();
|
1089 |
Iterator<Publication> it = publicationsListe.iterator();
|
1091 |
while (it.hasNext()) {
|
1090 |
while (it.hasNext()) {
|
1092 |
idPublicationSeparesParVirgule += it.next().getId();
|
1091 |
idPublicationSeparesParVirgule += it.next().getId();
|
1093 |
if (it.hasNext()) {
|
1092 |
if (it.hasNext()) {
|
1094 |
idPublicationSeparesParVirgule += ",";
|
1093 |
idPublicationSeparesParVirgule += ",";
|
1095 |
}
|
1094 |
}
|
1096 |
}
|
1095 |
}
|
1097 |
modele.supprimerPublication(vueARafraichir, idPublicationSeparesParVirgule);
|
1096 |
modele.supprimerPublication(vueARafraichir, idPublicationSeparesParVirgule);
|
1098 |
modele.supprimerPublicationAPersonne(vueARafraichir, idPublicationSeparesParVirgule);
|
1097 |
modele.supprimerPublicationAPersonne(vueARafraichir, idPublicationSeparesParVirgule);
|
1099 |
}
|
1098 |
}
|
1100 |
}
|
1099 |
}
|
1101 |
|
1100 |
|
1102 |
public void clicObtenirListeEditeurs(Rafraichissable vueARafraichir) {
|
1101 |
public void clicObtenirListeEditeurs(Rafraichissable vueARafraichir) {
|
1103 |
selectionnerStructureParProjet(vueARafraichir, null);
|
1102 |
selectionnerStructureParProjet(vueARafraichir, null);
|
1104 |
}
|
1103 |
}
|
1105 |
|
1104 |
|
1106 |
public void clicObtenirListeAuteurs(Rafraichissable vueARafraichir) {
|
1105 |
public void clicObtenirListeAuteurs(Rafraichissable vueARafraichir) {
|
1107 |
selectionnerPersonneParProjet(vueARafraichir, null);
|
1106 |
selectionnerPersonneParProjet(vueARafraichir, null);
|
1108 |
}
|
1107 |
}
|
1109 |
|
1108 |
|
1110 |
//+----------------------------------------------------------------------------------------------------------------+
|
1109 |
//+----------------------------------------------------------------------------------------------------------------+
|
1111 |
// GESTION de la relation PUBLICATION A PERSONNE
|
1110 |
// GESTION de la relation PUBLICATION A PERSONNE
|
1112 |
|
1111 |
|
1113 |
public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
|
1112 |
public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId) {
|
1114 |
modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleId);
|
1113 |
modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleId);
|
1115 |
}
|
1114 |
}
|
1116 |
|
1115 |
|
1117 |
public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, List<Valeur> roleId) {
|
1116 |
public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, List<Valeur> roleId) {
|
1118 |
String roleIds = "";
|
1117 |
String roleIds = "";
|
1119 |
Iterator<Valeur> itRole = roleId.iterator();
|
1118 |
Iterator<Valeur> itRole = roleId.iterator();
|
1120 |
while (itRole.hasNext()) {
|
1119 |
while (itRole.hasNext()) {
|
1121 |
roleIds+= itRole.next().getId();
|
1120 |
roleIds+= itRole.next().getId();
|
1122 |
if (itRole.hasNext()) {
|
1121 |
if (itRole.hasNext()) {
|
1123 |
roleIds+=",";
|
1122 |
roleIds+=",";
|
1124 |
}
|
1123 |
}
|
1125 |
}
|
1124 |
}
|
1126 |
modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleIds);
|
1125 |
modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleIds);
|
1127 |
}
|
1126 |
}
|
1128 |
|
1127 |
|
1129 |
public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, PublicationAPersonneListe personnesAjoutees, String roleId) {
|
1128 |
public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, PublicationAPersonneListe personnesAjoutees, String roleId) {
|
1130 |
if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
|
1129 |
if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
|
1131 |
String idPublicationAPersonneSepareParVirgule = "" ;
|
1130 |
String idPublicationAPersonneSepareParVirgule = "" ;
|
1132 |
for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
|
1131 |
for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
|
1133 |
idPublicationAPersonneSepareParVirgule += personnesAjoutees.get(it.next()).getIdPersonne();
|
1132 |
idPublicationAPersonneSepareParVirgule += personnesAjoutees.get(it.next()).getIdPersonne();
|
1134 |
if (it.hasNext()) {
|
1133 |
if (it.hasNext()) {
|
1135 |
idPublicationAPersonneSepareParVirgule += ",";
|
1134 |
idPublicationAPersonneSepareParVirgule += ",";
|
1136 |
}
|
1135 |
}
|
1137 |
}
|
1136 |
}
|
1138 |
modele.ajouterPublicationAPersonne(vueARafraichir, publicationId, idPublicationAPersonneSepareParVirgule, roleId);
|
1137 |
modele.ajouterPublicationAPersonne(vueARafraichir, publicationId, idPublicationAPersonneSepareParVirgule, roleId);
|
1139 |
}
|
1138 |
}
|
1140 |
}
|
1139 |
}
|
1141 |
|
1140 |
|
1142 |
public void supprimerPublicationAPersonne(Rafraichissable vueARafraichir, PublicationAPersonneListe personnesSupprimees) {
|
1141 |
public void supprimerPublicationAPersonne(Rafraichissable vueARafraichir, PublicationAPersonneListe personnesSupprimees) {
|
1143 |
if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
|
1142 |
if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
|
1144 |
String idPublicationAPersonneSepareParVirgule = "" ;
|
1143 |
String idPublicationAPersonneSepareParVirgule = "" ;
|
1145 |
for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
|
1144 |
for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
|
1146 |
idPublicationAPersonneSepareParVirgule += personnesSupprimees.get(it.next()).getId();
|
1145 |
idPublicationAPersonneSepareParVirgule += personnesSupprimees.get(it.next()).getId();
|
1147 |
if (it.hasNext()) {
|
1146 |
if (it.hasNext()) {
|
1148 |
idPublicationAPersonneSepareParVirgule += ",";
|
1147 |
idPublicationAPersonneSepareParVirgule += ",";
|
1149 |
}
|
1148 |
}
|
1150 |
}
|
1149 |
}
|
1151 |
modele.supprimerPublicationAPersonne(vueARafraichir, idPublicationAPersonneSepareParVirgule);
|
1150 |
modele.supprimerPublicationAPersonne(vueARafraichir, idPublicationAPersonneSepareParVirgule);
|
1152 |
}
|
1151 |
}
|
1153 |
}
|
1152 |
}
|
1154 |
|
1153 |
|
1155 |
//Lier plusieurs publication à une personne
|
1154 |
//Lier plusieurs publication à une personne
|
1156 |
public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, PublicationAPersonneListe listePublications, String personneId, String roleId) {
|
1155 |
public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, PublicationAPersonneListe listePublications, String personneId, String roleId) {
|
1157 |
if (listePublications!=null && listePublications.size()>0) {
|
1156 |
if (listePublications!=null && listePublications.size()>0) {
|
1158 |
String idsPubli = "";
|
1157 |
String idsPubli = "";
|
1159 |
String rolesIds = "";
|
1158 |
String rolesIds = "";
|
1160 |
for (Iterator<String> it = listePublications.keySet().iterator(); it.hasNext();) {
|
1159 |
for (Iterator<String> it = listePublications.keySet().iterator(); it.hasNext();) {
|
1161 |
PublicationAPersonne publi = listePublications.get(it.next());
|
1160 |
PublicationAPersonne publi = listePublications.get(it.next());
|
1162 |
idsPubli += publi.getId();
|
1161 |
idsPubli += publi.getId();
|
1163 |
rolesIds += publi.getRole();
|
1162 |
rolesIds += publi.getRole();
|
1164 |
if (it.hasNext()) {
|
1163 |
if (it.hasNext()) {
|
1165 |
idsPubli += ",";
|
1164 |
idsPubli += ",";
|
1166 |
rolesIds += ",";
|
1165 |
rolesIds += ",";
|
1167 |
}
|
1166 |
}
|
1168 |
}
|
1167 |
}
|
1169 |
modele.ajouterPublicationAPersonne(vueARafraichir, idsPubli, personneId, rolesIds);
|
1168 |
modele.ajouterPublicationAPersonne(vueARafraichir, idsPubli, personneId, rolesIds);
|
1170 |
}
|
1169 |
}
|
1171 |
}
|
1170 |
}
|
1172 |
|
1171 |
|
1173 |
//+----------------------------------------------------------------------------------------------------------------+
|
1172 |
//+----------------------------------------------------------------------------------------------------------------+
|
1174 |
// GESTION DES COMMENTAIRES
|
1173 |
// GESTION DES COMMENTAIRES
|
1175 |
//+----------------------------------------------------------------------------------------------------------------+
|
1174 |
//+----------------------------------------------------------------------------------------------------------------+
|
1176 |
|
1175 |
|
1177 |
public void afficherListeCommentaire(CommentaireListe nouvelleDonnees) {
|
1176 |
public void afficherListeCommentaire(CommentaireListe nouvelleDonnees) {
|
1178 |
if (!(panneauCentre.getContenu() instanceof CommentaireVue)) {
|
1177 |
if (!(panneauCentre.getContenu() instanceof CommentaireVue)) {
|
1179 |
panneauCentre.removeAll();
|
1178 |
panneauCentre.removeAll();
|
1180 |
panneauCentre.add(new CommentaireVue(this));
|
1179 |
panneauCentre.add(new CommentaireVue(this));
|
1181 |
}
|
1180 |
}
|
1182 |
|
1181 |
|
1183 |
panneauCentre.getContenu().rafraichir(nouvelleDonnees);
|
1182 |
panneauCentre.getContenu().rafraichir(nouvelleDonnees);
|
1184 |
}
|
1183 |
}
|
1185 |
|
1184 |
|
1186 |
public void afficherFormCommentaire(String commentaireId) {
|
1185 |
public void afficherFormCommentaire(String commentaireId) {
|
1187 |
panneauCentre.removeAll();
|
1186 |
panneauCentre.removeAll();
|
1188 |
CommentaireForm commentaireForm = new CommentaireForm(this, commentaireId);
|
1187 |
CommentaireForm commentaireForm = new CommentaireForm(this, commentaireId);
|
1189 |
panneauCentre.add(commentaireForm);
|
1188 |
panneauCentre.add(commentaireForm);
|
1190 |
|
1189 |
|
1191 |
panneauCentre.layout();
|
1190 |
panneauCentre.layout();
|
1192 |
}
|
1191 |
}
|
1193 |
|
1192 |
|
1194 |
public void clicListeCommentaire(Commentaire commentaire) {
|
1193 |
public void clicListeCommentaire(Commentaire commentaire) {
|
1195 |
if (commentaire != null) {
|
1194 |
if (commentaire != null) {
|
1196 |
panneauCentre.getContenu().rafraichir(commentaire);
|
1195 |
panneauCentre.getContenu().rafraichir(commentaire);
|
1197 |
}
|
1196 |
}
|
1198 |
}
|
1197 |
}
|
1199 |
|
1198 |
|
1200 |
public void clicAjouterCommentaire() {
|
1199 |
public void clicAjouterCommentaire() {
|
1201 |
afficherFormCommentaire(null);
|
1200 |
afficherFormCommentaire(null);
|
1202 |
}
|
1201 |
}
|
1203 |
|
1202 |
|
1204 |
public void clicModifierCommentaire(List<Commentaire> selection) {
|
1203 |
public void clicModifierCommentaire(List<Commentaire> selection) {
|
1205 |
if (selection.size() == 0) {
|
1204 |
if (selection.size() == 0) {
|
1206 |
Info.display("Information", "Veuillez sélectionner un commentaire.");
|
1205 |
Info.display("Information", "Veuillez sélectionner un commentaire.");
|
1207 |
} else if (selection.size() > 1) {
|
1206 |
} else if (selection.size() > 1) {
|
1208 |
Info.display("Information", "Veuillez sélectionner un seul commentaire à la fois.");
|
1207 |
Info.display("Information", "Veuillez sélectionner un seul commentaire à la fois.");
|
1209 |
} else if (selection.size() == 1) {
|
1208 |
} else if (selection.size() == 1) {
|
1210 |
afficherFormCommentaire(selection.get(0).getId());
|
1209 |
afficherFormCommentaire(selection.get(0).getId());
|
1211 |
} else {
|
1210 |
} else {
|
1212 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCommentaire() du Médiateur.");
|
1211 |
Info.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCommentaire() du Médiateur.");
|
1213 |
}
|
1212 |
}
|
1214 |
}
|
1213 |
}
|
1215 |
|
1214 |
|
1216 |
public void clicSupprimerCommentaire(final List<Commentaire> commentaireListe) {
|
1215 |
public void clicSupprimerCommentaire(final List<Commentaire> commentaireListe) {
|
1217 |
if (commentaireListe.size() <= 0) {
|
1216 |
if (commentaireListe.size() <= 0) {
|
1218 |
MessageBox.alert("Attention", "Vous devez sélectionner un commentaire", null);
|
1217 |
MessageBox.alert("Attention", "Vous devez sélectionner un commentaire", null);
|
1219 |
} else {
|
1218 |
} else {
|
1220 |
String message = "Voulez-vous vraiment supprimer ces commentaires ?";
|
1219 |
String message = "Voulez-vous vraiment supprimer ces commentaires ?";
|
1221 |
if (commentaireListe.size() == 1) {
|
1220 |
if (commentaireListe.size() == 1) {
|
1222 |
message = "Voulez-vous vraiment supprimer ce commentaire ?";
|
1221 |
message = "Voulez-vous vraiment supprimer ce commentaire ?";
|
1223 |
}
|
1222 |
}
|
1224 |
|
1223 |
|
1225 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
1224 |
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
|
1226 |
public void handleEvent(MessageBoxEvent ce) {
|
1225 |
public void handleEvent(MessageBoxEvent ce) {
|
1227 |
Dialog dialog = (Dialog) ce.getComponent();
|
1226 |
Dialog dialog = (Dialog) ce.getComponent();
|
1228 |
Button btn = ce.getButtonClicked();
|
1227 |
Button btn = ce.getButtonClicked();
|
1229 |
|
1228 |
|
1230 |
if (btn.getText().equals(dialog.yesText)) {
|
1229 |
if (btn.getText().equals(dialog.yesText)) {
|
1231 |
supprimerCommentaire(panneauCentre.getContenu(), commentaireListe);
|
1230 |
supprimerCommentaire(panneauCentre.getContenu(), commentaireListe);
|
1232 |
}
|
1231 |
}
|
1233 |
}
|
1232 |
}
|
1234 |
};
|
1233 |
};
|
1235 |
|
1234 |
|
1236 |
MessageBox.confirm("Supprimer un commentaire", message, listenerSuppression);
|
1235 |
MessageBox.confirm("Supprimer un commentaire", message, listenerSuppression);
|
1237 |
}
|
1236 |
}
|
1238 |
}
|
1237 |
}
|
1239 |
|
1238 |
|
1240 |
public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId) {
|
1239 |
public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId) {
|
1241 |
selectionnerCommentaire(vueARafraichir, commentaireId, null, 0, nbElements);
|
1240 |
selectionnerCommentaire(vueARafraichir, commentaireId, null, 0, nbElements);
|
1242 |
}
|
1241 |
}
|
1243 |
public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId, String titre, int pageCourante, int nbElements) {
|
1242 |
public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId, String titre, int pageCourante, int nbElements) {
|
1244 |
modele.selectionnerCommentaire(vueARafraichir, commentaireId, getProjetId(), titre, pageCourante, nbElements);
|
1243 |
modele.selectionnerCommentaire(vueARafraichir, commentaireId, getProjetId(), titre, pageCourante, nbElements);
|
1245 |
}
|
1244 |
}
|
1246 |
|
1245 |
|
1247 |
public void selectionnerCommentaireParTitre(Rafraichissable vueARafraichir, String titre) {
|
1246 |
public void selectionnerCommentaireParTitre(Rafraichissable vueARafraichir, String titre) {
|
1248 |
selectionnerCommentaire(vueARafraichir, null, titre, 0, nbElements);
|
1247 |
selectionnerCommentaire(vueARafraichir, null, titre, 0, nbElements);
|
1249 |
}
|
1248 |
}
|
1250 |
|
1249 |
|
1251 |
public void ajouterCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
|
1250 |
public void ajouterCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
|
1252 |
modele.ajouterCommentaire(vueARafraichir, commentaire);
|
1251 |
modele.ajouterCommentaire(vueARafraichir, commentaire);
|
1253 |
}
|
1252 |
}
|
1254 |
|
1253 |
|
1255 |
public void modifierCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
|
1254 |
public void modifierCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
|
1256 |
modele.modifierCommentaire(vueARafraichir, commentaire);
|
1255 |
modele.modifierCommentaire(vueARafraichir, commentaire);
|
1257 |
}
|
1256 |
}
|
1258 |
|
1257 |
|
1259 |
public void supprimerCommentaire(Rafraichissable vueARafraichir, List<Commentaire> commentairesListe) {
|
1258 |
public void supprimerCommentaire(Rafraichissable vueARafraichir, List<Commentaire> commentairesListe) {
|
1260 |
if (commentairesListe != null && commentairesListe.size() > 0) {
|
1259 |
if (commentairesListe != null && commentairesListe.size() > 0) {
|
1261 |
String idCommentaireSeparesParVirgule = "" ;
|
1260 |
String idCommentaireSeparesParVirgule = "" ;
|
1262 |
Iterator<Commentaire> it = commentairesListe.iterator();
|
1261 |
Iterator<Commentaire> it = commentairesListe.iterator();
|
1263 |
while (it.hasNext()) {
|
1262 |
while (it.hasNext()) {
|
1264 |
idCommentaireSeparesParVirgule += it.next().getId();
|
1263 |
idCommentaireSeparesParVirgule += it.next().getId();
|
1265 |
if (it.hasNext()) {
|
1264 |
if (it.hasNext()) {
|
1266 |
idCommentaireSeparesParVirgule += ",";
|
1265 |
idCommentaireSeparesParVirgule += ",";
|
1267 |
}
|
1266 |
}
|
1268 |
}
|
1267 |
}
|
1269 |
modele.supprimerCommentaire(vueARafraichir, idCommentaireSeparesParVirgule);
|
1268 |
modele.supprimerCommentaire(vueARafraichir, idCommentaireSeparesParVirgule);
|
1270 |
modele.supprimerCollectionACommentaire(vueARafraichir, idCommentaireSeparesParVirgule, CollectionACommentaireAsyncDao.SUPPRESSION_PAR_COMMENTAIRE);
|
1269 |
modele.supprimerCollectionACommentaire(vueARafraichir, idCommentaireSeparesParVirgule, CollectionACommentaireAsyncDao.SUPPRESSION_PAR_COMMENTAIRE);
|
1271 |
}
|
1270 |
}
|
1272 |
}
|
1271 |
}
|
1273 |
|
1272 |
|
1274 |
//+----------------------------------------------------------------------------------------------------------------+
|
1273 |
//+----------------------------------------------------------------------------------------------------------------+
|
1275 |
// RAFRAICHISSEMENT
|
1274 |
// RAFRAICHISSEMENT
|
1276 |
//+----------------------------------------------------------------------------------------------------------------+
|
1275 |
//+----------------------------------------------------------------------------------------------------------------+
|
1277 |
|
1276 |
|
1278 |
public void rafraichir(Object nouvellesDonnees) {
|
1277 |
public void rafraichir(Object nouvellesDonnees) {
|
1279 |
if (nouvellesDonnees instanceof Utilisateur) {
|
1278 |
if (nouvellesDonnees instanceof Utilisateur) {
|
1280 |
repandreEtatIdentification((Utilisateur) nouvellesDonnees);
|
1279 |
repandreEtatIdentification((Utilisateur) nouvellesDonnees);
|
1281 |
} else if (nouvellesDonnees instanceof Information) {
|
1280 |
} else if (nouvellesDonnees instanceof Information) {
|
1282 |
Information info = (Information) nouvellesDonnees;
|
1281 |
Information info = (Information) nouvellesDonnees;
|
1283 |
if (info.getType().equals("modification_personne")) {
|
1282 |
if (info.getType().equals("modification_personne")) {
|
1284 |
repandreInfoMiseAJourUtilisateur();
|
1283 |
repandreInfoMiseAJourUtilisateur();
|
1285 |
}
|
1284 |
}
|
1286 |
} else {
|
1285 |
} else {
|
1287 |
GWT.log(i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
1286 |
GWT.log(i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
|
1288 |
}
|
1287 |
}
|
1289 |
}
|
1288 |
}
|
1290 |
|
1289 |
|
1291 |
//+----------------------------------------------------------------------------------------------------------------+
|
1290 |
//+----------------------------------------------------------------------------------------------------------------+
|
1292 |
// GESTION du STATUT
|
1291 |
// GESTION du STATUT
|
1293 |
//+----------------------------------------------------------------------------------------------------------------+
|
1292 |
//+----------------------------------------------------------------------------------------------------------------+
|
1294 |
|
1293 |
|
1295 |
public void afficherPopinChargement() {
|
1294 |
public void afficherPopinChargement() {
|
1296 |
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).center();
|
1295 |
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).center();
|
1297 |
}
|
1296 |
}
|
1298 |
|
1297 |
|
1299 |
public void masquerPopinChargement() {
|
1298 |
public void masquerPopinChargement() {
|
1300 |
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).hide();
|
1299 |
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).hide();
|
1301 |
}
|
1300 |
}
|
1302 |
|
1301 |
|
1303 |
public String obtenirClasseContenu() {
|
1302 |
public String obtenirClasseContenu() {
|
1304 |
String classeContenu = null;
|
1303 |
String classeContenu = null;
|
1305 |
if (panneauCentre.getContenu() != null) {
|
1304 |
if (panneauCentre.getContenu() != null) {
|
1306 |
classeContenu = panneauCentre.getContenu().getClass().toString();
|
1305 |
classeContenu = panneauCentre.getContenu().getClass().toString();
|
1307 |
}
|
1306 |
}
|
1308 |
return classeContenu;
|
1307 |
return classeContenu;
|
1309 |
}
|
1308 |
}
|
1310 |
|
1309 |
|
1311 |
}
|
1310 |
}
|