Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 989 Rev 1293
Line 7... Line 7...
7
import org.tela_botanica.client.modeles.objets.Observation;
7
import org.tela_botanica.client.modeles.objets.Observation;
8
import org.tela_botanica.client.modeles.objets.Utilisateur;
8
import org.tela_botanica.client.modeles.objets.Utilisateur;
9
import org.tela_botanica.client.observation.ObservationModele;
9
import org.tela_botanica.client.observation.ObservationModele;
10
import org.tela_botanica.client.util.Util;
10
import org.tela_botanica.client.util.Util;
Line 11... Line -...
11
 
-
 
12
import com.google.gwt.core.client.GWT;
11
 
13
import com.google.gwt.http.client.Request;
12
import com.google.gwt.http.client.Request;
14
import com.google.gwt.http.client.RequestBuilder;
13
import com.google.gwt.http.client.RequestBuilder;
15
import com.google.gwt.http.client.RequestCallback;
14
import com.google.gwt.http.client.RequestCallback;
16
import com.google.gwt.http.client.RequestException;
15
import com.google.gwt.http.client.RequestException;
17
import com.google.gwt.http.client.Response;
16
import com.google.gwt.http.client.Response;
18
import com.google.gwt.json.client.JSONArray;
17
import com.google.gwt.json.client.JSONArray;
19
import com.google.gwt.json.client.JSONObject;
18
import com.google.gwt.json.client.JSONObject;
20
import com.google.gwt.json.client.JSONParser;
-
 
21
import com.google.gwt.json.client.JSONString;
19
import com.google.gwt.json.client.JSONParser;
22
import com.google.gwt.json.client.JSONValue;
-
 
Line 23... Line 20...
23
import com.google.gwt.user.client.Window;
20
import com.google.gwt.json.client.JSONValue;
Line 24... Line 21...
24
 
21
 
Line 58... Line 55...
58
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()
55
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()
59
				+ "/inventoryImageLink/" + Utilisateur.getInstance().getIdentifiantUtilisateurConsulte() + "/" + paramGet);
56
				+ "/inventoryImageLink/" + Utilisateur.getInstance().getIdentifiantUtilisateurConsulte() + "/" + paramGet);
60
			try {
57
			try {
61
				rb.sendRequest(null, new RequestCallback() {
58
				rb.sendRequest(null, new RequestCallback() {
Line -... Line 59...
-
 
59
	
62
	
60
					@Override
63
					public void onError(Request request, Throwable exception) {
61
					public void onError(Request request, Throwable exception) {
Line 64... Line 62...
64
						// TODO Auto-generated method stub
62
						// TODO Auto-generated method stub
Line -... Line 63...
-
 
63
	
65
	
64
					}
66
					}
65
	
Line 67... Line 66...
67
	
66
					@Override
68
					public void onResponseReceived(Request request,
67
					public void onResponseReceived(Request request,
Line 117... Line 116...
117
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()
116
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()
118
				+ "/inventoryImageLink/" + utilisateur + "/" + paramGet);
117
				+ "/inventoryImageLink/" + utilisateur + "/" + paramGet);
119
			try {
118
			try {
120
				rb.sendRequest(null, new RequestCallback() {
119
				rb.sendRequest(null, new RequestCallback() {
Line -... Line 120...
-
 
120
	
121
	
121
					@Override
122
					public void onError(Request request, Throwable exception) {
122
					public void onError(Request request, Throwable exception) {
Line 123... Line 123...
123
						// TODO Auto-generated method stub
123
						// TODO Auto-generated method stub
Line -... Line 124...
-
 
124
	
124
	
125
					}
125
					}
126
	
Line 126... Line 127...
126
	
127
					@Override
Line 142... Line 143...
142
							
143
							
143
							for(int i = 0 ;i<taillemax ;i++)
144
							for(int i = 0 ;i<taillemax ;i++)
Line 144... Line 145...
144
							{
145
							{
145
								
146
								
146
								final JSONObject reponseInt = reponse.get(i).isObject();
147
								final JSONObject reponseInt = reponse.get(i).isObject();
147
								String idImg = ((JSONString)reponseInt.get("id_image")).stringValue() ;
148
								String idImg = Util.getValeurJsonOuVide(reponseInt, "id_image") ;
148
								String X = ((JSONString)reponseInt.get("hauteur")).stringValue() ;
149
								String X = Util.getValeurJsonOuVide(reponseInt, "hauteur") ;
149
								String Y = ((JSONString)reponseInt.get("largeur")).stringValue() ;
150
								String Y = Util.getValeurJsonOuVide(reponseInt, "largeur") ;
150
								imgTab[i][0] = idImg ;
151
								imgTab[i][0] = idImg ;
Line 151... Line 152...
151
								imgTab[i][1] = X ;
152
								imgTab[i][1] = X ;
Line 182... Line 183...
182
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
183
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
183
				+ "/inventoryImageLink/");
184
				+ "/inventoryImageLink/");
184
		try {
185
		try {
185
			rb.sendRequest(postData, new RequestCallback() {
186
			rb.sendRequest(postData, new RequestCallback() {
Line -... Line 187...
-
 
187
 
186
 
188
				@Override
187
				public void onError(Request request, Throwable exception) {
189
				public void onError(Request request, Throwable exception) {
Line 188... Line 190...
188
					// TODO Auto-generated method stub
190
					// TODO Auto-generated method stub
Line -... Line 191...
-
 
191
 
189
 
192
				}
190
				}
193
 
Line 191... Line 194...
191
 
194
				@Override
Line 217... Line 220...
217
				+ "/inventoryImageLink/"+identifiant+"/"+idImg+"/"+idObs);
220
				+ "/inventoryImageLink/"+identifiant+"/"+idImg+"/"+idObs);
Line 218... Line 221...
218
		
221
		
219
			try {
222
			try {
Line -... Line 223...
-
 
223
				rb.sendRequest(postData, new RequestCallback() {
220
				rb.sendRequest(postData, new RequestCallback() {
224
	
221
	
225
					@Override
Line 222... Line 226...
222
					public void onError(Request request, Throwable exception) {
226
					public void onError(Request request, Throwable exception) {
Line -... Line 227...
-
 
227
						// TODO Auto-generated method stub
223
						// TODO Auto-generated method stub
228
	
224
	
229
					}
Line 225... Line 230...
225
					}
230
	
226
	
231
					@Override