Subversion Repositories eFlore/Applications.coel

Rev

Rev 1136 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1136 Rev 1305
Line 7... Line 7...
7
import org.tela_botanica.client.http.JsonRestRequestBuilder;
7
import org.tela_botanica.client.http.JsonRestRequestBuilder;
8
import org.tela_botanica.client.http.JsonRestRequestCallback;
8
import org.tela_botanica.client.http.JsonRestRequestCallback;
9
import org.tela_botanica.client.interfaces.Rafraichissable;
9
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.modeles.Information;
10
import org.tela_botanica.client.modeles.Information;
11
import org.tela_botanica.client.modeles.structure.StructureListe;
11
import org.tela_botanica.client.modeles.structure.StructureListe;
-
 
12
import org.tela_botanica.client.util.Debug;
12
import org.tela_botanica.client.util.UtilDAO;
13
import org.tela_botanica.client.util.UtilDAO;
Line 13... Line 14...
13
 
14
 
14
import com.extjs.gxt.ui.client.Registry;
15
import com.extjs.gxt.ui.client.Registry;
15
import com.google.gwt.core.client.GWT;
16
import com.google.gwt.core.client.GWT;
Line 35... Line 36...
35
		restrictions.put("start", String.valueOf(pageCourante*nbElements));
36
		restrictions.put("start", String.valueOf(pageCourante*nbElements));
36
		if (nbElements != -1)	{
37
		if (nbElements != -1)	{
37
			restrictions.put("limit", String.valueOf(nbElements));
38
			restrictions.put("limit", String.valueOf(nbElements));
38
		}
39
		}
Line -... Line 40...
-
 
40
		
-
 
41
		restrictions.put("orderby", "ccac_id_collection DESC");
39
		
42
		
40
		final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
43
		final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
41
		rb.envoyerRequete(null, new JsonRestRequestCallback() {
44
		rb.envoyerRequete(null, new JsonRestRequestCallback() {
42
			@Override
45
			@Override
43
			public void surReponse(JSONValue responseValue) {
46
			public void surReponse(JSONValue responseValue) {
44
				if (responseValue != null) {
47
				if (responseValue != null) {
45
					// Si la requête est un succès, réception d'un objet ou d'un tableau
48
					// Si la requête est un succès, réception d'un objet ou d'un tableau
-
 
49
					JSONArray responseArray = responseValue.isArray();
46
					JSONArray responseArray = responseValue.isArray();
50
					
47
					if (responseArray.get(1).isObject() != null) {
51
					if (responseArray.get(1).isObject() != null) {
48
						final JSONObject reponse = responseArray.get(1).isObject();
52
						final JSONObject reponse = responseArray.get(1).isObject();
49
						// Transformation du tableau JSON réponse en ListeInstitution
53
						// Transformation du tableau JSON réponse en ListeInstitution
50
						Commentaire commentaire = new Commentaire(reponse);
54
						Commentaire commentaire = new Commentaire(reponse);
51
						// et on met à jour le demandeur des données
55
						// et on met à jour le demandeur des données
52
						vueARafraichir.rafraichir(commentaire);
56
						vueARafraichir.rafraichir(commentaire);
53
					} else if (responseValue.isArray() != null) {
57
					} else if (responseValue.isArray() != null) {
54
						final JSONArray reponse = responseValue.isArray();
58
						final JSONArray reponse = responseValue.isArray();						
55
						CommentaireListe commentaires;
59
						CommentaireListe commentaires;
56
						if (reponse.get(1).isObject() != null)	{
60
						if (reponse.get(1).isObject() != null)	{
57
							commentaires = new CommentaireListe(reponse.get(1).isArray());
61
							commentaires = new CommentaireListe(reponse.get(1).isArray());
58
						} else	{
62
						} else	{