Subversion Repositories eFlore/Applications.coel

Rev

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

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