Subversion Repositories eFlore/Archives.cel-v2

Rev

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

Rev 28 Rev 30
Line 4... Line 4...
4
import java.util.Iterator;
4
import java.util.Iterator;
Line 5... Line 5...
5
 
5
 
6
import org.tela_botanica.client.image.ImageMediateur;
6
import org.tela_botanica.client.image.ImageMediateur;
Line -... Line 7...
-
 
7
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
8
 
-
 
9
import com.google.gwt.json.client.JSONArray;
-
 
10
import com.google.gwt.json.client.JSONObject;
7
import org.tela_botanica.client.interfaces.Rafraichissable;
11
import com.google.gwt.json.client.JSONParser;
8
 
12
import com.google.gwt.json.client.JSONValue;
9
import com.google.gwt.user.client.HTTPRequest;
13
import com.google.gwt.user.client.HTTPRequest;
-
 
14
import com.google.gwt.user.client.ResponseTextHandler;
-
 
15
import com.google.gwt.user.client.Window;
10
import com.google.gwt.user.client.ResponseTextHandler;
16
import com.gwtext.client.data.Node;
Line 11... Line 17...
11
import com.google.gwt.user.client.Window;
17
import com.gwtext.client.data.Tree;
Line 12... Line 18...
12
import com.gwtext.client.widgets.tree.TreeNode;
18
import com.gwtext.client.widgets.tree.TreeNode;
Line 18... Line 24...
18
	public void setIMediateur(ImageMediateur im)
24
	public void setIMediateur(ImageMediateur im)
19
	{
25
	{
20
		iMediateur = im ; 
26
		iMediateur = im ; 
21
	}
27
	}
Line 22... Line 28...
22
	
28
	
23
	public void obtenirListeMotsCles(Rafraichissable r)
29
	public void obtenirListeMotsCles(final Rafraichissable r)
24
	{
30
	{
Line 25... Line 31...
25
		HTTPRequest.asyncGet("jrest/InventoryKeyWordList/"+iMediateur.getIdentifiant(), new ResponseTextHandler() {
31
		HTTPRequest.asyncGet("jrest/InventoryKeyWordList/"+iMediateur.getIdentifiant(), new ResponseTextHandler() {
26
 
-
 
Line -... Line 32...
-
 
32
 
-
 
33
			public void onCompletion(String responseText) {
27
			public void onCompletion(String responseText) {
34
				
-
 
35
				final JSONValue responseValue = JSONParser.parse(responseText);
28
				// TODO Auto-generated method stub
36
				if (responseValue.isArray() != null) {
-
 
37
					
-
 
38
					final JSONArray reponse = responseValue.isArray();
-
 
39
 
29
				
40
						r.rafraichir(reponse, true) ;		
30
			}
41
				}					
Line 31... Line 42...
31
			
42
			}			
Line 41... Line 52...
41
			
52
			
Line 42... Line 53...
42
			HTTPRequest.asyncPost("jrest/InventoryKeyWordList/","&identifiant="+iMediateur.getIdentifiant()+postData, new ResponseTextHandler() {
53
			HTTPRequest.asyncPost("jrest/InventoryKeyWordList/","&identifiant="+iMediateur.getIdentifiant()+postData, new ResponseTextHandler() {
Line -... Line 54...
-
 
54
	
-
 
55
				public void onCompletion(String responseText) {
-
 
56
				
-
 
57
					
-
 
58
					if(responseText.equals("ERROR"))
-
 
59
					{
43
	
60
						Window.alert("Attention, la base de données des mots clés n'est plus synchronisée avec l'application," +
Line 44... Line 61...
44
				public void onCompletion(String responseText) {
61
								"nous vous invitons à recharger la page. ") ;
45
				
62
					}
46
				}
63
				}
Line 58... Line 75...
58
			
75
			
Line 59... Line 76...
59
			HTTPRequest.asyncPost("jrest/InventoryKeyWordList/"+iMediateur.getIdentifiant()+"/"+motcle,postData, new ResponseTextHandler() {
76
			HTTPRequest.asyncPost("jrest/InventoryKeyWordList/"+iMediateur.getIdentifiant()+"/"+motcle,postData, new ResponseTextHandler() {
Line -... Line 77...
-
 
77
	
-
 
78
				public void onCompletion(String responseText) {
-
 
79
					
-
 
80
					if(responseText.equals("ERROR"))
60
	
81
					{
61
				public void onCompletion(String responseText) {
82
						Window.alert("Attention, la base de données des mots clés n'est plus synchronisée avec l'application," +
Line 62... Line 83...
62
					
83
								"nous vous invitons à recharger la page. ") ;
63
					
84
					}
64
				}
85
				}
Line 77... Line 98...
77
			
98
			
Line 78... Line 99...
78
		HTTPRequest.asyncPost("jrest/InventoryKeyWordList/"+iMediateur.getIdentifiant() ,postData, new ResponseTextHandler() {
99
		HTTPRequest.asyncPost("jrest/InventoryKeyWordList/"+iMediateur.getIdentifiant() ,postData, new ResponseTextHandler() {
Line 79... Line -...
79
	
-
 
Line 80... Line 100...
80
				public void onCompletion(String responseText) {
100
	
Line 81... Line 101...
81
					
101
				public void onCompletion(String responseText) {
82
					Window.alert(responseText) ;
102
					
Line 83... Line 103...
83
					
103
					
Line 84... Line 104...
84
				}
104
				}
Line 85... Line 105...
85
				
105
				
86
			}) ;
106
			}) ;
Line 87... Line 107...
87
		}
107
		}
Line 98... Line 118...
98
			
118
			
Line 99... Line 119...
99
		HTTPRequest.asyncPost("jrest/InventoryKeyWordList/"+iMediateur.getIdentifiant() ,postData, new ResponseTextHandler() {
119
		HTTPRequest.asyncPost("jrest/InventoryKeyWordList/"+iMediateur.getIdentifiant() ,postData, new ResponseTextHandler() {
Line 100... Line -...
100
	
-
 
Line 101... Line 120...
101
				public void onCompletion(String responseText) {
120
	
Line 102... Line 121...
102
					
121
				public void onCompletion(String responseText) {
103
					Window.alert(responseText) ;
122