Subversion Repositories eFlore/Applications.cel

Rev

Rev 647 | Rev 989 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.client.modeles;

import org.tela_botanica.client.observation.ObservationModele;

import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;

public class ImportObservationAsynchroneDAO {

        private ObservationModele oModele = null ;
        
        public ImportObservationAsynchroneDAO(ObservationModele observationModele) {
                oModele = observationModele;
        }

        public void importerObservations() {
                
                RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()
                                + "/InventoryImport/" + Utilisateur.getInstance().getIdentifiantUtilisateurConsulte());

                try {
                        rb.sendRequest(null, new RequestCallback() {

                                public void onError(Request request, Throwable exception) {
                                        // TODO Auto-generated method stub

                                }

                                public void onResponseReceived(Request request,
                                                Response response) {

                                        if(response.getText().equals("OK")) {
                                                oModele.obtenirNombreObservation(null);
                                        }
                                        else
                                        {
                                                
                                        }

                                }

                        });
                } catch (RequestException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                
        }

}