Subversion Repositories eFlore/Applications.cel

Rev

Rev 2568 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2568 Rev 2609
Line 42... Line 42...
42
 
42
 
43
	/**
43
	/**
44
	 * Booleen indiquant si le médiateur est instancié (l'instance doit être unique donc le booleen est static)
44
	 * Booleen indiquant si le médiateur est instancié (l'instance doit être unique donc le booleen est static)
45
	 */
45
	 */
46
	private static boolean estInstancie = false ;
-
 
47
	
46
	private static boolean estInstancie = false ;
Line 48... Line 47...
48
	private static ObservationModele thisModele = null ;
47
	private static ObservationModele thisModele = null ;
49
	
48
	
50
	/**
49
	/**
51
	 * La configuration en cours
50
	 * La configuration en cours
Line 52... Line 51...
52
	 */
51
	 */
53
	private Configuration config = null;
52
	private Configuration config = null;
54
 
53
 
55
	/**
-
 
56
	 * Le médiateur associé au modèle
54
	/**
Line 57... Line 55...
57
	 */
55
	 * Le médiateur associé au modèle
58
	
56
	 */
59
	private ObservationMediateur observationMediateur = null ;
57
	private ObservationMediateur observationMediateur = null ;
60
	
58
	
61
	/**
-
 
62
	 * La liste des mots clés en cours 
59
	/**
Line 63... Line 60...
63
	 */
60
	 * La liste des mots clés en cours 
64
	private HashMap<String, String> motsCles = new HashMap<String, String>(0);
61
	 */
65
	
62
	private HashMap<String, String> motsCles = new HashMap<String, String>(0);	
66
	private Tree arbreMotsCles = new Tree() ;
-
 
67
	
63
	private Tree arbreMotsCles = new Tree() ;
Line 68... Line 64...
68
	/**
64
	
69
	 * La liste des observations affichées en cours (verifier utilité)
-
 
70
	 */
-
 
71
	
-
 
72
	private ListeObservation cacheObservation = new ListeObservation(0) ;
-
 
73
	
-
 
74
	/**
-
 
75
	 * DAO dont le resultat peut etre mis en cache 
-
 
76
	 * 
-
 
77
	 */
-
 
78
	
65
	/**
79
	private ListeReferentielNomAsynchroneDAO nomDAO=null;
66
	 * La liste des observations affichées en cours (verifier utilité)
80
	private ListeReferentielLocaliteAsynchroneDAO refDAO=null;
67
	 */
81
	private ListeReferentielPersoAsynchroneDAO refPersoDAO=null;
68
	private ListeObservation cacheObservation = new ListeObservation(0) ;
Line 165... Line 152...
165
			// et on crée un DAO auquel on les transmet et qui envoie une requete pour recevoir les images
152
			// et on crée un DAO auquel on les transmet et qui envoie une requete pour recevoir les images
166
			ListeObservationAsynchroneDAO loaDAO = new ListeObservationAsynchroneDAO(this);
153
			ListeObservationAsynchroneDAO loaDAO = new ListeObservationAsynchroneDAO(this);
167
			loaDAO.obtenirListeObservation(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), criteres2);		
154
			loaDAO.obtenirListeObservation(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), criteres2);		
168
	}
155
	}
Line 169... Line -...
169
	
-
 
170
 
-
 
171
	/**
-
 
172
	 * Obtenir une liste de localites 
-
 
173
	 * @param r
-
 
174
	 * @param critere
-
 
175
	 */
-
 
176
	
-
 
177
	public void obtenirListeReferentielLocalite(Rafraichissable r, String critere) {
-
 
178
		
-
 
179
		if (refDAO==null) {
-
 
180
			refDAO=new ListeReferentielLocaliteAsynchroneDAO(this);
-
 
181
		}
-
 
182
		refDAO.obtenirListeDonnees(r, critere);
-
 
183
 
-
 
184
	}
-
 
185
	
-
 
186
	/**
-
 
187
	 * Obtenir une liste de valeur vis à vis d'un champ donné pour un utilisateur 
-
 
188
	 * @param r
-
 
189
	 * @param critere
-
 
190
	 */
-
 
191
	public void obtenirListeReferentielPerso(Rafraichissable r, TypesReferentiels referentiel, String critere) {
-
 
192
		
-
 
193
		if (refPersoDAO==null) {
-
 
194
			refPersoDAO=new ListeReferentielPersoAsynchroneDAO(this);
-
 
195
		}
-
 
196
		
-
 
197
		refPersoDAO.setRefDemande(referentiel);
-
 
198
		refPersoDAO.obtenirListeDonnees(r,Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), critere);
-
 
199
 
-
 
200
	}
-
 
201
	
-
 
202
	/**
-
 
203
	 * Obtenir une liste de nom scientifique de plante
-
 
204
	 * @param r
-
 
205
	 * @param critere
-
 
206
	 */	
-
 
207
	public void obtenirListeReferentielNom(Rafraichissable r, String referentiel, String critere) {
-
 
208
		
-
 
209
		if (nomDAO==null) {
-
 
210
			nomDAO=new ListeReferentielNomAsynchroneDAO(this);
-
 
211
		}
-
 
212
		nomDAO.obtenirListeDonnees(r, referentiel, critere);
-
 
213
 
-
 
214
	}
-
 
215
	
-
 
216
	
156
	
217
	/**
157
	/**
218
	 *  
158
	 *  
219
	 * Lance la creation d'une observation  
159
	 * Lance la creation d'une observation  
220
	 * @param r : la vue demandeuse de donnee
160
	 * @param r : la vue demandeuse de donnee
221
	 * @param critere : les criteres de selection
161
	 * @param critere : les criteres de selection
Line 222... Line 162...
222
	 */
162
	 */
223
	
-
 
224
	public void ajouterObservation(Rafraichissable r, Observation obs) {
163
	
225
		
164
	public void ajouterObservation(Rafraichissable r, Observation obs) {		
226
		ObservationAsynchroneDAO obsDAO=new ObservationAsynchroneDAO(this);
-
 
227
		obsDAO.ajouter(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), obs);
165
		ObservationAsynchroneDAO obsDAO=new ObservationAsynchroneDAO(this);
Line 228... Line 166...
228
			
166
		obsDAO.ajouter(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), obs);			
229
	}
167
	}
230
 
168
 
231
	/**
169
	/**
232
	 *  
170
	 *  
233
	 * Lance la creation d'une observation  
171
	 * Lance la creation d'une observation  
234
	 * @param r : la vue demandeuse de donnee
172
	 * @param r : la vue demandeuse de donnee
235
	 * @param critere : les criteres de selection
-
 
236
	 */
173
	 * @param critere : les criteres de selection
237
	public void modifierObservation(Rafraichissable r, Observation obs) {
174
	 */
238
		
-
 
239
		ObservationAsynchroneDAO obsDAO=new ObservationAsynchroneDAO(this);
175
	public void modifierObservation(Rafraichissable r, Observation obs) {	
Line 240... Line -...
240
		obsDAO.modifier(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), obs);
-
 
241
			
-
 
242
	}
176
		ObservationAsynchroneDAO obsDAO=new ObservationAsynchroneDAO(this);
243
	
177
		obsDAO.modifier(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), obs);		
244
 
178
	}
245
 
179
	
246
	public void modifierObservationEnMasse(
-
 
247
			Rafraichissable r, Observation obs) {
180
	public void modifierObservationEnMasse(
Line 248... Line -...
248
		ListeObservationAsynchroneDAO liObsDAO=new ListeObservationAsynchroneDAO(this);
-
 
249
		liObsDAO.modifierEnMasse(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), obs);
-
 
250
		
181
			Rafraichissable r, Observation obs) {
Line 251... Line 182...
251
	}
182
		ListeObservationAsynchroneDAO liObsDAO=new ListeObservationAsynchroneDAO(this);
252
 
183
		liObsDAO.modifierEnMasse(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), obs);	
Line 253... Line 184...
253
 
184
	}
Line 254... Line -...
254
	
-
 
255
	public void supprimerObservation(Rafraichissable r, String numeroOrdre) {
-
 
256
		
185
 
257
		ObservationAsynchroneDAO obsDao = new ObservationAsynchroneDAO(this) ;
186
	public void supprimerObservation(Rafraichissable r, String numeroOrdre) {
258
		obsDao.supprimer(r,Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(),numeroOrdre) ;
187
		
259
		
188
		ObservationAsynchroneDAO obsDao = new ObservationAsynchroneDAO(this) ;
260
		
189
		obsDao.supprimer(r,Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(),numeroOrdre) ;
261
	}
190
		
262
	
-
 
263
	
191
		
264
 
192
	}
265
 
-
 
Line 266... Line 193...
266
	/**
193
	
267
	 * Accesseur pour la configuration en cours d'utilisation
194
	
268
	 * 
195
	/**
269
	 * @return la configuration
196
	 * Accesseur pour la configuration en cours d'utilisation
270
	 */
197
	 * 
271
	public Configuration getConfig() {
-
 
272
 
-
 
273
		return config;
198
	 * @return la configuration
Line 274... Line 199...
274
	}
199
	 */
275
 
200
	public Configuration getConfig() {
Line 292... Line 217...
292
	/**
217
	/**
293
	 * Obtenir une image generique associee a un numero nomenclatural
218
	 * Obtenir une image generique associee a un numero nomenclatural
294
	 * @param r
219
	 * @param r
295
	 * @param numeroNomenclaturalSaisiObservation
220
	 * @param numeroNomenclaturalSaisiObservation
296
	 */
221
	 */
297
 
-
 
298
	public void obtenirImageGenerique( Rafraichissable r, String referentielTaxo, String numeroNomenclaturalSaisiObservation) {
222
	public void obtenirImageGenerique( Rafraichissable r, String referentielTaxo, String numeroNomenclaturalSaisiObservation) {		
299
		
-
 
300
		ImageGeneriqueVueAsynchroneDAO imgDAO= new ImageGeneriqueVueAsynchroneDAO(this);
223
		ImageGeneriqueVueAsynchroneDAO imgDAO= new ImageGeneriqueVueAsynchroneDAO(this);
301
		imgDAO.obtenirURLImage(r, referentielTaxo, numeroNomenclaturalSaisiObservation);
224
		imgDAO.obtenirURLImage(r, referentielTaxo, numeroNomenclaturalSaisiObservation);	
302
		
-
 
303
		
-
 
304
	}
225
	}
Line 305... Line 226...
305
 
226
 
306
 
227
 
307
	/**
228
	/**
308
	 * Obtenir la liste de l'ensemble des entites geographiques associes aux observation d'un utilisateur 
229
	 * Obtenir la liste de l'ensemble des entites geographiques associes aux observation d'un utilisateur 
309
	 * @param r
-
 
310
	 */
230
	 * @param r
311
 
-
 
312
	public void obtenirListeEntiteGeographique(Rafraichissable r) {
231
	 */
313
 
232
	public void obtenirListeEntiteGeographique(Rafraichissable r) {
314
	    ListeEntiteGeographiqueObservationAsynchroneDAO entDAO = new ListeEntiteGeographiqueObservationAsynchroneDAO(this);
-
 
315
	    entDAO.obtenirListeEntitesGeographiques(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte());
233
	    ListeEntiteGeographiqueObservationAsynchroneDAO entDAO = new ListeEntiteGeographiqueObservationAsynchroneDAO(this);
Line 316... Line 234...
316
 
234
	    entDAO.obtenirListeEntitesGeographiques(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte());
317
	}
235
	}
318
 
236
 
319
 
237
 
320
 
-
 
321
	public void obtenirDatesObservation(
238
 
Line 322... Line 239...
322
			Rafraichissable r) {
239
	public void obtenirDatesObservation(
323
	    ListeDateObservationAsynchroneDAO ldoDAO = new ListeDateObservationAsynchroneDAO(this);
-
 
324
	    ldoDAO.obtenirListeDate(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte());
-
 
325
		
240
			Rafraichissable r) {
326
	}
241
	    ListeDateObservationAsynchroneDAO ldoDAO = new ListeDateObservationAsynchroneDAO(this);
327
 
-
 
328
 
242
	    ldoDAO.obtenirListeDate(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte());	
Line 329... Line 243...
329
 
243
	}
Line 363... Line 277...
363
		exoDAO.exporterObservations(Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), tous_criteres, "pdf", "standard") ;
277
		exoDAO.exporterObservations(Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), tous_criteres, "pdf", "standard") ;
364
	}
278
	}
Line 365... Line 279...
365
 
279
 
366
 
-
 
367
 
280
 
368
	public void supprimerLiaisonImages(String idImg, String idObs) {
281
 
369
		
-
 
370
		LienImageAsynchroneDAO lienDAO = new LienImageAsynchroneDAO(this) ;
282
	public void supprimerLiaisonImages(String idImg, String idObs) {	
Line 371... Line 283...
371
		lienDAO.supprimerLienImageObservation(idImg, idObs) ;		
283
		LienImageAsynchroneDAO lienDAO = new LienImageAsynchroneDAO(this) ;
372
		
-
 
373
	}
284
		lienDAO.supprimerLienImageObservation(idImg, idObs) ;			
374
 
285
	}
375
	public void supprimerListeObservation(Rafraichissable r,
-
 
376
			String numObs) {
286
 
Line 377... Line -...
377
		ListeObservationAsynchroneDAO lioaDAO = new ListeObservationAsynchroneDAO(this);
-
 
378
		lioaDAO.supprimerListeObservation(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), numObs);
287
	public void supprimerListeObservation(Rafraichissable r, String numObs) {
379
		
288
		ListeObservationAsynchroneDAO lioaDAO = new ListeObservationAsynchroneDAO(this);
380
	}
289
		lioaDAO.supprimerListeObservation(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), numObs);	
381
 
-
 
382
	public void transmettreListeObservation(
290
	}
Line 383... Line 291...
383
			Rafraichissable r, String numObsapl, boolean publier) {
291
 
384
		TransmissionObservationAsynchroneDAO toaDAO = new TransmissionObservationAsynchroneDAO(this);
-
 
385
		toaDAO.transmettreObservations(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), numObsapl, publier);
292
	public void transmettreListeObservation(Rafraichissable r, String numObsapl, boolean publier) {
386
		
293
		TransmissionObservationAsynchroneDAO toaDAO = new TransmissionObservationAsynchroneDAO(this);
387
	}
-
 
388
 
294
		toaDAO.transmettreObservations(r, Utilisateur.getInstance().getIdentifiantUtilisateurConsulte(), numObsapl, publier);	
Line 389... Line 295...
389
	public void analyserHistorique(Rafraichissable r,String anum) {
295
	}
390
		
296
 
391
		NomRetenuAsynchroneDAO nraDAO = new NomRetenuAsynchroneDAO(this);
297
	public void analyserHistorique(Rafraichissable r,String anum) {	
392
		nraDAO.obtenirNomRetenu(r, anum);
-
 
393
		
298
		NomRetenuAsynchroneDAO nraDAO = new NomRetenuAsynchroneDAO(this);
Line 394... Line 299...
394
	}
299
		nraDAO.obtenirNomRetenu(r, anum);	
395
 
-
 
396
 
300
	}
397
 
301
 
398
	public void importerObservations() {
-
 
399
		ImportObservationAsynchroneDAO ioDAO = new ImportObservationAsynchroneDAO(this);
302
 
Line 400... Line 303...
400
		ioDAO.importerObservations();
303
 
401
		
304
	public void importerObservations() {
402
	}
-
 
403
 
305
		ImportObservationAsynchroneDAO ioDAO = new ImportObservationAsynchroneDAO(this);
404
 
-
 
405
 
306
		ioDAO.importerObservations();	
406
	public void obtenirArbreMotsCles(Rafraichissable r) {
307
	}
Line 407... Line 308...
407
		
308
 
408
		MotsClesAsynchroneDAO mcoDAO = new MotsClesAsynchroneDAO("obs");
309
 
Line 429... Line 330...
429
		}
330
		}
Line 430... Line 331...
430
		
331
		
431
		if(nouvelleDonnees instanceof Observation) {
332
		if(nouvelleDonnees instanceof Observation) {
432
			observationMediateur.obtenirNombreObservation();
333
			observationMediateur.obtenirNombreObservation();
433
		}
-
 
434
		
334
		}
Line 435... Line 335...
435
	}
335
	}
436
 
336
 
437
	/**
337
	/**