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