| Line 65... |
Line 65... |
| 65 |
|
65 |
|
| 66 |
public void modifierPublication(String utilisateurId, Publication pubAModifier) {
|
66 |
public void modifierPublication(String utilisateurId, Publication pubAModifier) {
|
| 67 |
// Demande de toutes les structures
|
67 |
// Demande de toutes les structures
|
| Line 68... |
Line 68... |
| 68 |
final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl()+SERVICE_NOM+"/"+pubAModifier.getId();
|
68 |
final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl()+SERVICE_NOM+"/"+pubAModifier.getId();
|
| 69 |
|
69 |
|
| Line 70... |
Line 70... |
| 70 |
JsonRestRequestBuilder rb = new JsonRestRequestBuilder(RequestBuilder.GET, url);
|
70 |
JsonRestRequestBuilder rb = new JsonRestRequestBuilder(RequestBuilder.POST, url);
|
| 71 |
String postDonneesEncodees = pubAModifier.toReqString();
|
71 |
String postDonneesEncodees = pubAModifier.toReqString();
|
| 72 |
|
72 |
|
| Line 79... |
Line 79... |
| 79 |
}
|
79 |
}
|
| Line 80... |
Line 80... |
| 80 |
|
80 |
|
| Line 81... |
Line 81... |
| 81 |
public void ajouterPublication(String utilisateurId, Publication pubAAjouter) {
|
81 |
public void ajouterPublication(String utilisateurId, Publication pubAAjouter) {
|
| 82 |
|
- |
|
| 83 |
final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl()+SERVICE_NOM+"/";
|
82 |
|
| 84 |
// auteur 2360
|
83 |
final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl()+SERVICE_NOM+"/";
|
| Line 85... |
Line 84... |
| 85 |
JsonRestRequestBuilder rb = new JsonRestRequestBuilder(RequestBuilder.POST, url);
|
84 |
JsonRestRequestBuilder rb = new JsonRestRequestBuilder(RequestBuilder.POST, url);
|
| 86 |
String postDonneesEncodees = pubAAjouter.toReqString()+"&cmhl_ce_modifier_par="+utilisateurId;
|
85 |
String postDonneesEncodees = pubAAjouter.toReqString()+"&cmhl_ce_modifier_par="+utilisateurId;
|
| Line 107... |
Line 106... |
| 107 |
|
106 |
|
| 108 |
private void traiterReponse(JSONValue reponseValeur, String type) {
|
107 |
private void traiterReponse(JSONValue reponseValeur, String type) {
|
| 109 |
Information info = new Information(type);
|
108 |
Information info = new Information(type);
|
| 110 |
// Si la requête est un succès, reception d'une chaine
|
109 |
// Si la requête est un succès, reception d'une chaine
|
| 111 |
if (reponseValeur.isString() != null) {
|
110 |
if (reponseValeur.isString() != null) {
|
| 112 |
info.setMessage(reponseValeur.isString().stringValue());
|
111 |
info.setDonnee(reponseValeur.isString().stringValue());
|
| 113 |
} else {
|
112 |
} else {
|
| 114 |
info.setDeboguage("La réponse n'est pas une chaine JSON.");
|
113 |
info.setDeboguage("La réponse n'est pas une chaine JSON.");
|
| 115 |
}
|
114 |
}
|
| 116 |
vueARafraichir.rafraichir(info);
|
115 |
vueARafraichir.rafraichir(info);
|