3,6 → 3,7 |
import java.util.ArrayList; |
import java.util.HashMap; |
import java.util.Iterator; |
import java.util.Map; |
|
import org.tela_botanica.client.cel2; |
import org.tela_botanica.client.interfaces.Rafraichissable; |
255,4 → 256,49 |
protected static String obtenirNomPageChampEtendu(String cle) { |
return prefixePageChampEtendu+Util.convertirEnChaMot(cle); |
} |
|
public static String getUrlRequeteValeursChampEtendu(String cle) { |
return Configuration.getServiceBaseUrl() + |
"/NomsChampsEtendus/valeur"+ |
"?cle="+URL.encode(cle)+"&recherche="; |
} |
|
public static String getUrlRequeteNomsChampsEtendus() { |
return Configuration.getServiceBaseUrl()+ |
"/NomsChampsEtendus/cle?recherche="; |
} |
|
public static Map<String, String> parserRetourListeValeursChampsEtendus(Response response) { |
|
Map<String, String> valeurs = new HashMap<String, String>(); |
final JSONValue responseValue = JSONParser.parse(response.getText()); |
|
JSONArray reponse = null; |
if ((reponse = responseValue.isArray()) != null) { |
for(int i = 0; i < reponse.size(); i++) { |
valeurs.put(reponse.get(i).isString().stringValue(), reponse.get(i).isString().stringValue()); |
} |
} |
|
return valeurs; |
} |
|
public static Map<String, String> parserRetourListeNomsChampsEtendus(Response response) { |
final JSONValue responseValue = JSONParser.parse(response.getText()); |
|
JSONObject reponse = null; |
|
cacheClesLabels = new HashMap<String, String>(); |
if ((reponse = responseValue.isObject()) != null) { |
Iterator<String> it = reponse.keySet().iterator(); |
|
while(it.hasNext()) { |
String cle = it.next(); |
String valeur = reponse.get(cle).isString().stringValue(); |
cacheClesLabels.put(cle, valeur); |
} |
} |
|
return cacheClesLabels; |
} |
} |