Subversion Repositories eFlore/Archives.cel-v2

Rev

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

Rev 31 Rev 36
Line 1... Line 1...
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
Line 2... Line 2...
2
 
2
 
-
 
3
import org.tela_botanica.client.image.ImageMediateur;
3
import org.tela_botanica.client.image.ImageMediateur;
4
import org.tela_botanica.client.image.ImageModele;
Line 4... Line 5...
4
import org.tela_botanica.client.interfaces.iMediateur;
5
import org.tela_botanica.client.interfaces.iMediateur;
5
 
6
 
6
import com.google.gwt.core.client.JavaScriptObject;
7
import com.google.gwt.core.client.JavaScriptObject;
Line 23... Line 24...
23
 * 
24
 * 
24
 * 
25
 * 
25
 */
26
 */
26
public class ImageUploaderAsynchroneDAO {
27
public class ImageUploaderAsynchroneDAO {
Line -... Line 28...
-
 
28
	
-
 
29
	/**
-
 
30
	 * Modele associé au DAO
27
	
31
	 */
Line -... Line 32...
-
 
32
	private static ImageModele iModele ;
-
 
33
	
-
 
34
	/**
-
 
35
	 * Setteur pour le modele 
28
	private static ImageMediateur iMediateur ;
36
	 * @param im le modèle à associer au DAO
29
	
37
	 */
30
	public void setIMediateur(ImageMediateur im)
38
	public void setIModele(ImageModele im)
31
	{
39
	{
Line -... Line 40...
-
 
40
		iModele = im ;
-
 
41
	}
-
 
42
	
-
 
43
	/**
32
		iMediateur = im ;
44
	 * Crée un panel d'upload simple aux fonctions réduites mais utilisant uniquement javascript
33
	}
45
	 * (pour les utilisateurs qui n'ont pas java)
Line 34... Line 46...
34
	
46
	 */
35
	private static void appelerUploadSimple()
47
	private static void appelerUploadSimple()
36
	{
48
	{
37
		
49
		
38
		 UploadDialog up = new UploadDialog("Upload simple de fichiers") ;
50
		 UploadDialog up = new UploadDialog("Upload simple de fichiers") ;
Line 39... Line 51...
39
		 up.setUrl("jrest/InventoryImage"); 
51
		 up.setUrl("jrest/InventoryImage"); 
Line 40... Line 52...
40
		 UrlParam id = new UrlParam("identifiant",iMediateur.getIdentifiant()) ;
52
		 UrlParam id = new UrlParam("identifiant",iModele.getIdentifiant()) ;
Line 41... Line 53...
41
		 UrlParam[] params = {id} ;
53
		 UrlParam[] params = {id} ;
42
		 up.setBaseParams(params);
54
		 up.setBaseParams(params);
43
		 
55
		 
Line 44... Line 56...
44
		 up.addListener(new UploadDialogListenerAdapter() {
56
		 up.addListener(new UploadDialogListenerAdapter() {
Line 45... Line 57...
45
 
57
 
Line -... Line 58...
-
 
58
 
-
 
59
			public void onClose(Panel panel) {
-
 
60
				
-
 
61
				iModele.requeteTerminee() ;			
46
 
62
			}		 
47
			public void onClose(Panel panel) {
63
		 });
48
				
64
		 
49
				iMediateur.rafraichirToutesVues() ;			
65
		 up.show();
Line 86... Line 102...
86
				+paramFormdata
102
				+paramFormdata
87
				+ finApplet;
103
				+ finApplet;
Line 88... Line 104...
88
		
104
		
89
		final String htmlForm = 
105
		final String htmlForm = 
90
			"<form method=\"post\" name=\"postid\">"
106
			"<form method=\"post\" name=\"postid\">"
91
			+"<input type=\"hidden\" name=\"identifiant\" value=\""+iMediateur.getIdentifiant()+"\">"
107
			+"<input type=\"hidden\" name=\"identifiant\" value=\""+iModele.getIdentifiant()+"\">"
Line 92... Line 108...
92
			+"</form>" ;
108
			+"</form>" ;
Line 93... Line 109...
93
 
109
 
Line 94... Line 110...
94
		nPan.setHtml(appelApplet+htmlForm);
110
		nPan.setHtml(appelApplet+htmlForm);
Line 95... Line 111...
95
		
111
		
Line 96... Line 112...
96
		nPan.addListener(new WindowListenerAdapter() {
112
		nPan.addListener(new WindowListenerAdapter() {
Line 97... Line 113...
97
 
113
 
Line 98... Line 114...
98
 
114
 
99
			public void onClose(Panel panel) {
115
			public void onClose(Panel panel) {
Line -... Line 116...
-
 
116
				
-
 
117
				iModele.requeteTerminee() ;
-
 
118
				
-
 
119
			}
100
				
120
			
Line 101... Line 121...
101
				iMediateur.rafraichirToutesVues() ;
121
			
102
				
122
		});
103
			}
123