Line 1... |
Line 1... |
1 |
package org.tela_botanica.del.client.services.rest;
|
1 |
package org.tela_botanica.del.client.services.rest;
|
Line 2... |
Line 2... |
2 |
|
2 |
|
- |
|
3 |
import org.tela_botanica.del.client.config.Config;
|
3 |
import org.tela_botanica.del.client.config.Config;
|
4 |
import org.tela_botanica.del.client.modeles.PropositionDetermination;
|
4 |
import org.tela_botanica.del.client.modeles.VoteDetermination;
|
5 |
import org.tela_botanica.del.client.modeles.VoteDetermination;
|
5 |
import org.tela_botanica.del.client.services.rest.async.VoteDeterminationCallback;
|
6 |
import org.tela_botanica.del.client.services.rest.async.VoteDeterminationCallback;
|
Line 6... |
Line 7... |
6 |
import org.tela_botanica.del.client.services.rest.async.VoteDeterminationCallback.ModeRequete;
|
7 |
import org.tela_botanica.del.client.services.rest.async.VoteDeterminationCallback.ModeRequete;
|
Line 69... |
Line 70... |
69 |
private String assemblerChaineRequeteAjoutModif(VoteDetermination voteDetermination) {
|
70 |
private String assemblerChaineRequeteAjoutModif(VoteDetermination voteDetermination) {
|
70 |
String chaineRequete = "utilisateur="+voteDetermination.getContributeur()+"&"+
|
71 |
String chaineRequete = "utilisateur="+voteDetermination.getContributeur()+"&"+
|
71 |
"valeur="+voteDetermination.getVote();
|
72 |
"valeur="+voteDetermination.getVote();
|
72 |
return chaineRequete;
|
73 |
return chaineRequete;
|
73 |
}
|
74 |
}
|
- |
|
75 |
|
- |
|
76 |
@Override
|
- |
|
77 |
public void consulterVotesPourPropositionDetermination(PropositionDetermination propositionDetermination, VoteDeterminationCallback callback) {
|
- |
|
78 |
String idObservation = propositionDetermination.getObservation().getId();
|
- |
|
79 |
String idProposition = propositionDetermination.getId();
|
- |
|
80 |
//cas de la proposition de détermination crée automatiquement à partir de l'obs
|
- |
|
81 |
if(idProposition == null) {
|
- |
|
82 |
idProposition = "0";
|
- |
|
83 |
}
|
- |
|
84 |
|
- |
|
85 |
String urlService = baseUrl+"observations/"+idObservation+"/"+idProposition+"/vote/";
|
- |
|
86 |
RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, urlService);
|
- |
|
87 |
|
- |
|
88 |
callback.setMode(ModeRequete.LECTURE);
|
- |
|
89 |
try {
|
- |
|
90 |
rb.sendRequest(null, callback);
|
- |
|
91 |
} catch (Exception e) {
|
- |
|
92 |
//TODO: quoi faire si la requete est mal formée coté client avant d'être envoyée ?
|
- |
|
93 |
}
|
- |
|
94 |
}
|
74 |
}
|
95 |
}
|