Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 933 → Rev 938

/trunk/src/org/tela_botanica/del/client/config/Config.java
28,8 → 28,6
Dictionary configuration = Dictionary.getDictionary("configuration");
urls.put("base", configuration.get("serviceBaseUrl"));
urls.put("nomSciCompletionService", configuration.get("nomSciCompletionService"));
urls.put("communeCompletionService", configuration.get("communeCompletionService"));
urls.put("utilisateurService", configuration.get("utilisateurService"));
urls.put("del", configuration.get("delUrl"));
urls.put("bogue", configuration.get("bogueUrl"));
urls.put("commentaire", configuration.get("commentaireUrl"));
/trunk/src/org/tela_botanica/del/client/composants/moteurrecherche/MoteurRecherchePresenteur.java
17,6 → 17,7
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.http.client.Response;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.IsWidget;
 
169,9 → 170,10
}
 
private void creerCompletionCommunes() {
String url = this.config.getUrl("communeCompletionService");
String url = this.config.getServiceBaseUrl() + "communes";
completionCommunesPresenteur = new AutoCompletionComboBoxPresenteur(new AutoCompletionComboBoxVue(), url) {
protected String effectuerPreTraitementChaineRequete(String requete) {
requete = "?masque.nom=" + requete;
return requete;
}
 
185,7 → 187,7
 
@Override
protected String[] parserResultatRequete(Response response) {
return UtilitairesAutoCompletionService.parserRetourSimple(response);
return UtilitairesAutoCompletionService.parserResultatRetourSimple(response);
}
};
}
/trunk/src/org/tela_botanica/del/client/utils/UtilitairesAutoCompletionService.java
2,6 → 2,7
 
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
 
27,6 → 28,19
return chaineTraitee;
}
public static String[] parserResultatRetourSimple(Response response) {
JSONObject responseValue = JSONParser.parseStrict(response.getText()).isObject();
JSONArray noms = responseValue.get("resultats").isArray();
String[] valeurs = new String[0];
final int taillemax = noms.size();
valeurs = new String[taillemax];
for (int i = 0; i < taillemax; i++) {
valeurs[i] = (noms.get(i).isArray().get(0).isString().stringValue());
}
return valeurs;
}
public static String[] parserRetourSimple(Response response) {
final JSONValue responseValue = JSONParser.parseStrict(response.getText());
JSONArray noms;
40,7 → 54,6
valeurs[i] = (noms.get(i).isArray().get(0).isString().stringValue());
}
}
return valeurs;
}