/trunk/src/org/tela_botanica/del/client/modeles/InformationsRecherche.java |
---|
1,5 → 1,7 |
package org.tela_botanica.del.client.modeles; |
import com.google.gwt.http.client.URL; |
public class InformationsRecherche { |
private String rechercheLibre; |
122,4 → 124,27 |
this.triParDate = triParDate; |
} |
public String versChaineRequete() { |
String chaine = ""; |
chaine += estNonNull(rechercheLibre) ? "&recherche="+URL.encode(rechercheLibre) : "" ; |
chaine += estNonNull(departement) ? "&dpt="+URL.encode(departement) : "" ; |
chaine += estNonNull(taxon) ? "&taxon="+URL.encode(taxon) : "" ; |
chaine += estNonNull(genre) ? "&genre="+URL.encode(genre) : "" ; |
chaine += estNonNull(motClef) ? "&mot_cle="+URL.encode(motClef) : "" ; |
chaine += estNonNull(date) ? "&date_observation="+URL.encode(date) : "" ; |
chaine += estNonNull(commune) ? "&commune="+URL.encode(commune) : "" ; |
chaine += estNonNull(famille) ? "&famille="+URL.encode(famille) : "" ; |
chaine += estNonNull(tag) ? "&tag="+URL.encode(tag) : "" ; |
chaine += estNonNull(auteur) ? "&auteur="+URL.encode(auteur) : "" ; |
chaine += triParDate != ModeTri.PAS_DE_TRI ? "&tri=date_observation" : "" ; |
chaine += triParNbVotes != ModeTri.PAS_DE_TRI ? "&tri=nb_votes" : "" ; |
chaine += triParDate != ModeTri.PAS_DE_TRI ? "&ordre="+triParDate : "" ; |
chaine += triParNbVotes != ModeTri.PAS_DE_TRI ? "&ordre="+triParNbVotes : "" ; |
return chaine; |
} |
private boolean estNonNull(String critere) { |
return critere != null && !critere.trim().isEmpty(); |
} |
} |
/trunk/src/org/tela_botanica/del/client/modeles/ModeTri.java |
---|
13,7 → 13,7 |
}, |
PAS_DE_TRI { |
public String toString() { |
return ""; |
return "naturel"; |
}; |
} |
} |
/trunk/src/org/tela_botanica/del/client/services/rest/ImageServiceConcret.java |
---|
47,13 → 47,7 |
private String assemblerChaineRequete(InformationsRecherche infos, int debut, int fin) { |
String chaineRequete = "?debut=" + debut + "&limite=" + (fin - debut); |
if (infos != null && infos.getTaxon() != null && !infos.getTaxon().trim().isEmpty()) { |
chaineRequete += "nom_taxon=" + infos.getTaxon() + chaineRequete; |
} |
if(infos != null && infos.getTriParDate() != null) { |
chaineRequete += "&tri=date_observation&ordre="+infos.getTriParDate().toString(); |
} |
chaineRequete+= infos.versChaineRequete(); |
return chaineRequete; |
} |
/trunk/src/org/tela_botanica/del/client/services/rest/ObservationServiceConcret.java |
---|
24,15 → 24,8 |
private String assemblerChaineRequete(InformationsRecherche infos, int debut, int fin) { |
String chaineRequete = "?debut=" + debut + "&limite=" + (fin - debut); |
if (infos != null && infos.getTaxon() != null && !infos.getTaxon().trim().isEmpty()) { |
chaineRequete += "nom_taxon=" + infos.getTaxon() + chaineRequete; |
} |
if(infos != null && infos.getTriParDate() != null) { |
chaineRequete += "&tri=date_observation&ordre="+infos.getTriParDate().toString(); |
} |
chaineRequete+= infos.versChaineRequete(); |
return chaineRequete; |
} |
} |