| Line 5... |
Line 5... |
| 5 |
import org.tela_botanica.client.modeles.objets.Observation;
|
5 |
import org.tela_botanica.client.modeles.objets.Observation;
|
| 6 |
import org.tela_botanica.client.observation.ObservationModele;
|
6 |
import org.tela_botanica.client.observation.ObservationModele;
|
| 7 |
import org.tela_botanica.client.util.Util;
|
7 |
import org.tela_botanica.client.util.Util;
|
| Line 8... |
Line 8... |
| 8 |
|
8 |
|
| 9 |
import com.google.gwt.http.client.Request;
|
9 |
import com.google.gwt.http.client.Request;
|
| 10 |
import com.google.gwt.http.client.RequestBuilder;
|
10 |
import org.tela_botanica.client.util.RequestBuilderWithCredentials;
|
| 11 |
import com.google.gwt.http.client.RequestCallback;
|
11 |
import com.google.gwt.http.client.RequestCallback;
|
| 12 |
import com.google.gwt.http.client.RequestException;
|
12 |
import com.google.gwt.http.client.RequestException;
|
| 13 |
import com.google.gwt.http.client.Response;
|
13 |
import com.google.gwt.http.client.Response;
|
| 14 |
import com.google.gwt.http.client.URL;
|
14 |
import com.google.gwt.http.client.URL;
|
| Line 49... |
Line 49... |
| 49 |
* le mots clés à ajouter avec son parent et son identifiant
|
49 |
* le mots clés à ajouter avec son parent et son identifiant
|
| 50 |
*/
|
50 |
*/
|
| Line 51... |
Line 51... |
| 51 |
|
51 |
|
| Line 52... |
Line 52... |
| 52 |
public void ajouter(final Rafraichissable r, String utilisateur, final Observation obs) {
|
52 |
public void ajouter(final Rafraichissable r, String utilisateur, final Observation obs) {
|
| 53 |
|
53 |
|
| 54 |
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST,Configuration.getServiceBaseUrl()+ "/Inventory/") ;
|
54 |
RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.POST,Configuration.getServiceBaseUrl()+ "/Inventory/") ;
|
| 55 |
rb.setHeader("Content-type", "application/x-www-form-urlencoded");
|
55 |
rb.setHeader("Content-type", "application/x-www-form-urlencoded");
|
| 56 |
String postData = "ce_utilisateur="
|
56 |
String postData = "ce_utilisateur="
|
| 57 |
+ utilisateur
|
57 |
+ utilisateur
|
| Line 104... |
Line 104... |
| 104 |
* le mots clés à ajouter avec son parent et son identifiant
|
104 |
* le mots clés à ajouter avec son parent et son identifiant
|
| 105 |
*/
|
105 |
*/
|
| Line 106... |
Line 106... |
| 106 |
|
106 |
|
| Line 107... |
Line 107... |
| 107 |
public void modifier(final Rafraichissable r, String utilisateur, final Observation obs) {
|
107 |
public void modifier(final Rafraichissable r, String utilisateur, final Observation obs) {
|
| 108 |
|
108 |
|
| 109 |
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST,Configuration.getServiceBaseUrl()+ "/Inventory/" + utilisateur + "/" + obs.getNumeroOrdre()+ "/") ;
|
109 |
RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.POST,Configuration.getServiceBaseUrl()+ "/Inventory/" + utilisateur + "/" + obs.getNumeroOrdre()+ "/") ;
|
| 110 |
rb.setHeader("Content-type", "application/x-www-form-urlencoded");
|
110 |
rb.setHeader("Content-type", "application/x-www-form-urlencoded");
|
| 111 |
String postData = "ce_utilisateur="
|
111 |
String postData = "ce_utilisateur="
|
| 112 |
+ utilisateur
|
112 |
+ utilisateur
|
| Line 159... |
Line 159... |
| 159 |
|
159 |
|
| 160 |
String postData = "";
|
160 |
String postData = "";
|
| Line 161... |
Line 161... |
| 161 |
postData += "&action=DELETE";
|
161 |
postData += "&action=DELETE";
|
| 162 |
|
162 |
|
| 163 |
// on envoie un post avec l'id de l'image à supprimer
|
163 |
// on envoie un post avec l'id de l'image à supprimer
|
| 164 |
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST,
|
164 |
RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.POST,
|
| 165 |
Configuration.getServiceBaseUrl()
|
165 |
Configuration.getServiceBaseUrl()
|
| 166 |
+ "/inventory/"
|
166 |
+ "/inventory/"
|
| 167 |
+ identifiant
|
167 |
+ identifiant
|