Subversion Repositories eFlore/Applications.del

Rev

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

Rev 553 Rev 938
Line 1... Line 1...
1
package org.tela_botanica.del.client.utils;
1
package org.tela_botanica.del.client.utils;
Line 2... Line 2...
2
 
2
 
3
import com.google.gwt.http.client.Response;
3
import com.google.gwt.http.client.Response;
-
 
4
import com.google.gwt.json.client.JSONArray;
4
import com.google.gwt.json.client.JSONArray;
5
import com.google.gwt.json.client.JSONObject;
5
import com.google.gwt.json.client.JSONParser;
6
import com.google.gwt.json.client.JSONParser;
Line 6... Line 7...
6
import com.google.gwt.json.client.JSONValue;
7
import com.google.gwt.json.client.JSONValue;
Line 25... Line 26...
25
		
26
		
26
		String chaineTraitee = "?recherche=etendue&ns.structure=au&retour.format=oss&masque="+requete;
27
		String chaineTraitee = "?recherche=etendue&ns.structure=au&retour.format=oss&masque="+requete;
27
		return chaineTraitee;
28
		return chaineTraitee;
Line -... Line 29...
-
 
29
	}
-
 
30
	
-
 
31
	public static String[] parserResultatRetourSimple(Response response) {
-
 
32
		JSONObject responseValue = JSONParser.parseStrict(response.getText()).isObject();
-
 
33
		JSONArray noms = responseValue.get("resultats").isArray();
-
 
34
		
-
 
35
		String[] valeurs = new String[0];
-
 
36
		final int taillemax = noms.size();	
-
 
37
		valeurs = new String[taillemax];
-
 
38
		for (int i = 0; i < taillemax; i++) {
-
 
39
			valeurs[i] = (noms.get(i).isArray().get(0).isString().stringValue());
-
 
40
		}
-
 
41
		return valeurs;
28
	}
42
	}
29
	
43
	
30
	public static String[] parserRetourSimple(Response response) {
44
	public static String[] parserRetourSimple(Response response) {
31
		final JSONValue responseValue = JSONParser.parseStrict(response.getText());
45
		final JSONValue responseValue = JSONParser.parseStrict(response.getText());
Line 38... Line 52...
38
			valeurs = new String[taillemax];
52
			valeurs = new String[taillemax];
39
			for (int i = 0; i < taillemax; i++) {
53
			for (int i = 0; i < taillemax; i++) {
40
				valeurs[i] = (noms.get(i).isArray().get(0).isString().stringValue());
54
				valeurs[i] = (noms.get(i).isArray().get(0).isString().stringValue());
41
			}
55
			}
42
		}
56
		}
43
		
-
 
44
		return valeurs;
57
		return valeurs;
45
	}
58
	}
Line 46... Line 59...
46
	
59
	
47
	public static String[] parserRetourOss(Response response) {
60
	public static String[] parserRetourOss(Response response) {