Subversion Repositories eFlore/Archives.cel-v2

Rev

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

Rev 25 Rev 28
Line 7... Line 7...
7
import org.tela_botanica.client.modeles.ImageAsynchroneDAO;
7
import org.tela_botanica.client.modeles.ImageAsynchroneDAO;
8
import org.tela_botanica.client.modeles.ImageCarnet;
8
import org.tela_botanica.client.modeles.ImageCarnet;
9
import org.tela_botanica.client.modeles.ImageUploaderAsynchroneDAO;
9
import org.tela_botanica.client.modeles.ImageUploaderAsynchroneDAO;
10
import org.tela_botanica.client.modeles.ListeImageCarnet;
10
import org.tela_botanica.client.modeles.ListeImageCarnet;
11
import org.tela_botanica.client.modeles.ListeImageAsynchroneDAO;
11
import org.tela_botanica.client.modeles.ListeImageAsynchroneDAO;
-
 
12
import org.tela_botanica.client.modeles.MotsClesAsynchroneDAO;
Line 12... Line -...
12
 
-
 
13
import com.google.gwt.user.client.ui.Tree;
13
 
14
import com.gwtext.client.data.ArrayReader;
14
import com.gwtext.client.data.ArrayReader;
15
import com.gwtext.client.data.FieldDef;
15
import com.gwtext.client.data.FieldDef;
16
import com.gwtext.client.data.IntegerFieldDef;
16
import com.gwtext.client.data.IntegerFieldDef;
17
import com.gwtext.client.data.MemoryProxy;
17
import com.gwtext.client.data.MemoryProxy;
-
 
18
import com.gwtext.client.data.Node;
18
import com.gwtext.client.data.Node;
19
import com.gwtext.client.data.NodeTraversalCallback;
19
import com.gwtext.client.data.RecordDef;
20
import com.gwtext.client.data.RecordDef;
20
import com.gwtext.client.data.Store;
21
import com.gwtext.client.data.Store;
-
 
22
import com.gwtext.client.data.StringFieldDef;
21
import com.gwtext.client.data.StringFieldDef;
23
import com.gwtext.client.data.Tree;
Line 22... Line 24...
22
import com.gwtext.client.widgets.tree.TreeNode;
24
import com.gwtext.client.widgets.tree.TreeNode;
23
 
25
 
24
/**
26
/**
Line 33... Line 35...
33
	
35
	
Line 34... Line 36...
34
	private ImageMediateur iMediateur = null ;
36
	private ImageMediateur iMediateur = null ;
Line 35... Line 37...
35
	
37
	
Line 36... Line 38...
36
	private ListeImageCarnet cacheImage = new ListeImageCarnet(0) ;
38
	private ListeImageCarnet cacheImage = new ListeImageCarnet(0) ;
Line -... Line 39...
-
 
39
	
-
 
40
	private HashMap motsCles = new HashMap(0) ;
37
	
41
	
Line 38... Line 42...
38
	private HashMap motcles = new HashMap(0) ;
42
	private Store st = null ;
39
	
43
	
40
	private Store st = null ;
44
	private com.gwtext.client.data.Tree arbreMotsCles = null ;
41
	
45
	
Line 81... Line 85...
81
		cacheImage = (ListeImageCarnet)o ;
85
		cacheImage = (ListeImageCarnet)o ;
82
	}
86
	}
Line 83... Line 87...
83
	
87
	
84
	public void rafraichirArbreMotsCles(Object o)
88
	public void rafraichirArbreMotsCles(Object o)
85
	{
89
	{
86
		arbreMotsCles = (Tree)o ;
90
		arbreMotsCles = (com.gwtext.client.data.Tree)o ;
Line 87... Line 91...
87
	}
91
	}
88
	
92
	
89
	public void rafraichirMotsCles(Object o)
93
	public void rafraichirMotsCles(Object o)
90
	{
94
	{
Line 91... Line 95...
91
		motcles = (HashMap)o ;
95
		motsCles = (HashMap)o ;
92
	}
96
	}
Line 119... Line 123...
119
			for (int i = 0; i < ids.length; i++) 
123
			for (int i = 0; i < ids.length; i++) 
120
			{	
124
			{	
121
				String key = ids[i] ;
125
				String key = ids[i] ;
122
				ImageCarnet ic = (ImageCarnet)cacheImage.get(key) ;
126
				ImageCarnet ic = (ImageCarnet)cacheImage.get(key) ;
123
				ic.miseAJourInfoGenerales(commentaires, date) ;
127
				ic.miseAJourInfoGenerales(commentaires, date) ;
124
				mettreAjourImageCarnet(ic) ;	
128
				mettreAjourBaseDeDonneesImageCarnet(ic) ;	
125
			}
129
			}
126
	}
130
	}
Line 127... Line 131...
127
	
131
	
128
	public void mettreAjourMotsClesId(String text, String id)
132
	public void mettreAjourMotsClesId(String text, String id)
129
	{
133
	{
130
				 motcles.put(id, text) ;
134
				 motsCles.put(id, text) ;
Line 131... Line 135...
131
	}
135
	}
-
 
136
	
-
 
137
	public void mettreAjourBaseDeDonneesMotsClesId()
-
 
138
	{
-
 
139
		
-
 
140
	}
132
	
141
	
133
	public void mettreAJourBaseDeDonnees()
142
	public void mettreAJourBaseDeDonneesListeImageCarnet()
134
	{
143
	{
Line 135... Line 144...
135
		ListeImageAsynchroneDAO liDaO = new ListeImageAsynchroneDAO();
144
		ListeImageAsynchroneDAO liDaO = new ListeImageAsynchroneDAO();
136
		liDaO.setIMediateur(iMediateur);
145
		liDaO.setIMediateur(iMediateur);
Line 137... Line 146...
137
		
146
		
138
		liDaO.SynchroniserBaseDeDonnees(cacheImage);
147
		liDaO.SynchroniserBaseDeDonnees(cacheImage);
139
	}
148
	}
140
	
149
	
141
	public void mettreAjourImageCarnet(ImageCarnet ic)
150
	public void mettreAjourBaseDeDonneesImageCarnet(ImageCarnet ic)
142
	{
151
	{
Line 214... Line 223...
214
		
223
		
Line 215... Line 224...
215
	}
224
	}
216
	
225
	
217
	public void afficherMotsCles()
226
	public void afficherMotsCles()
218
	{
227
	{
219
		for(Iterator it = motcles.keySet().iterator() ; it.hasNext() ;)
228
		for(Iterator it = motsCles.keySet().iterator() ; it.hasNext() ;)
220
		{
229
		{
221
			String key = (String)it.next() ;
230
			String key = (String)it.next() ;
222
			String valeur = (String)motcles.get(key) ; 
231
			String valeur = (String)motsCles.get(key) ; 
223
			System.out.println("clé : "+key+" valeur : "+valeur);
232
			System.out.println("clé : "+key+" valeur : "+valeur);
Line 224... Line 233...
224
		}
233
		}
Line 225... Line 234...
225
	}
234
	}
Line 226... Line 235...
226
 
235
 
227
	public void mettreAjourMotsCles(String[] ids, String motsClesEnCours) {
236
	public void mettreAjourMotsCles(String[] ids, String motsClesEnCours, com.gwtext.client.data.Tree arbreMC) {
228
		
237
		
229
		for (int i = 0; i < ids.length; i++) {
238
		for (int i = 0; i < ids.length; i++) {
230
			
239
			
231
			if(cacheImage.containsKey(ids[i]))
240
			if(cacheImage.containsKey(ids[i]))
Line -... Line 241...
-
 
241
			{
-
 
242
				ImageCarnet ic = (ImageCarnet)cacheImage.get(ids[i]) ;
-
 
243
				ic.mettreAjourMotsCles(motsClesEnCours) ;	
-
 
244
			}
-
 
245
		}
-
 
246
		
-
 
247
		rafraichirArbreMotsCles(arbreMC) ;
-
 
248
	}
-
 
249
	
-
 
250
 
-
 
251
	public void ajouterMotCleDansArbre(TreeNode n, com.gwtext.client.data.Tree arbreMC) {
-
 
252
		
-
 
253
		MotsClesAsynchroneDAO MCDao = new MotsClesAsynchroneDAO() ;
-
 
254
		MCDao.setIMediateur(getIMediateur()) ;
-
 
255
		
-
 
256
		String[] usObj = (String[])n.getUserObject() ;
-
 
257
		String motCle = usObj[0] ;
-
 
258
		String id = usObj[1] ;
-
 
259
		String parentId = ""
-
 
260
 ;		
-
 
261
		if(!id.equals("racine"))
-
 
262
		{
-
 
263
			String[] parentUsObj = (String[])n.getParentNode().getUserObject() ;
-
 
264
			parentId = parentUsObj[1] ;
-
 
265
		}
-
 
266
		else
-
 
267
		{
-
 
268
			parentId = "racine" ;
-
 
269
		}
232
			{
270
		
-
 
271
		rafraichirArbreMotsCles(arbreMC) ;
-
 
272
		
-
 
273
		String nouveauMotCle = "&motcle="+motCle+"&id="+id+"&parent="+parentId ;
-
 
274
		MCDao.ajouterBaseDeDonnees(nouveauMotCle) ;
-
 
275
		
-
 
276
	}
-
 
277
 
-
 
278
	public void supprimerMotCleDansArbre(TreeNode n, Tree arbreMC) {
-
 
279
		
-
 
280
		MotsClesAsynchroneDAO MCDao = new MotsClesAsynchroneDAO() ;
-
 
281
		MCDao.setIMediateur(getIMediateur()) ;
-
 
282
		
-
 
283
		String[] usObj = (String[])n.getUserObject() ;
-
 
284
		String motCle = usObj[0] ;
-
 
285
		String id = usObj[1] ;
-
 
286
		
-
 
287
		String motCleASupprimer = id ;
-
 
288
		
-
 
289
		MCDao.supprimerBaseDeDonnees(id) ;
-
 
290
		
-
 
291
	}
-
 
292
 
-
 
293
	public void modifierMotCleDansArbre(TreeNode n, Tree arbreMC) {
-
 
294
		
-
 
295
		MotsClesAsynchroneDAO MCDao = new MotsClesAsynchroneDAO() ;
-
 
296
		MCDao.setIMediateur(getIMediateur()) ;
-
 
297
		
-
 
298
		String[] usObj = (String[])n.getUserObject() ;
-
 
299
		String motCle = usObj[0] ;
-
 
300
		String id = usObj[1] ;
-
 
301
		String parentId = ""
-
 
302
 ;		
-
 
303
		if(!id.equals("racine"))
-
 
304
		{
-
 
305
			String[] parentUsObj = (String[])n.getParentNode().getUserObject() ;
-
 
306
			parentId = parentUsObj[1] ;
-
 
307
		}
-
 
308
		else
-
 
309
		{
-
 
310
			parentId = "racine" ;
-
 
311
		}
-
 
312
		
-
 
313
		rafraichirArbreMotsCles(arbreMC) ;
-
 
314
		
-
 
315
		String motCleModifie = "&motcle="+motCle+"&id="+id+"&parent="+parentId ;
-
 
316
		
-
 
317
		MCDao.modifierBaseDeDonnees(motCleModifie) ;
-
 
318
		
-
 
319
	}
-
 
320
	
-
 
321
	public void deplacerMotCleDansArbre(TreeNode n, Tree arbreMC)
-
 
322
	{
-
 
323
		MotsClesAsynchroneDAO MCDao = new MotsClesAsynchroneDAO() ;
-
 
324
		MCDao.setIMediateur(getIMediateur()) ;
-
 
325
		
-
 
326
		String[] usObj = (String[])n.getUserObject() ;
-
 
327
		String motCle = usObj[0] ;
-
 
328
		String id = usObj[1] ;
-
 
329
		String parentId = ""
-
 
330
 ;		
-
 
331
		if(!id.equals("racine"))
-
 
332
		{
-
 
333
			String[] parentUsObj = (String[])n.getParentNode().getUserObject() ;
-
 
334
			parentId = parentUsObj[1] ;
-
 
335
		}
-
 
336
		else
-
 
337
		{
-
 
338
			parentId = "racine" ;
-
 
339
		}
-
 
340
		
-
 
341
		rafraichirArbreMotsCles(arbreMC) ;
233
				ImageCarnet ic = (ImageCarnet)cacheImage.get(ids[i]) ;
342