Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 718 Rev 723
Line 6... Line 6...
6
import org.tela_botanica.client.interfaces.Rafraichissable;
6
import org.tela_botanica.client.interfaces.Rafraichissable;
Line 7... Line 7...
7
 
7
 
8
import com.extjs.gxt.ui.client.Registry;
8
import com.extjs.gxt.ui.client.Registry;
9
import com.google.gwt.core.client.GWT;
9
import com.google.gwt.core.client.GWT;
-
 
10
import com.google.gwt.http.client.RequestBuilder;
10
import com.google.gwt.http.client.RequestBuilder;
11
import com.google.gwt.http.client.URL;
11
import com.google.gwt.json.client.JSONArray;
12
import com.google.gwt.json.client.JSONArray;
12
import com.google.gwt.json.client.JSONObject;
13
import com.google.gwt.json.client.JSONObject;
13
import com.google.gwt.json.client.JSONValue;
14
import com.google.gwt.json.client.JSONValue;
Line 21... Line 22...
21
		vueARafraichir = vueARafraichirCourrante ;
22
		vueARafraichir = vueARafraichirCourrante ;
22
	}
23
	}
Line 23... Line 24...
23
 
24
 
24
	public void selectionnerPublication(final String publicationId, String projetId, String nomComplet) {
25
	public void selectionnerPublication(final String publicationId, String projetId, String nomComplet) {
25
		// Ajout des paramètres et données à selectionner dans l'URL
26
		// Ajout des paramètres et données à selectionner dans l'URL
26
		final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + 
27
		String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + 
27
			SERVICE_NOM + "/" +
28
			SERVICE_NOM + "/" +
28
			(projetId == null ? "*" : projetId) + "/" +
29
			(projetId == null ? "*" : projetId) + "/" +
29
			(publicationId == null ? "*" : publicationId) + "/" +
30
			(publicationId == null ? "*" : publicationId) + "/" +
30
			(nomComplet == null ? "*" : nomComplet) + "/" +
31
			(nomComplet == null ? "*" : nomComplet) + "/" +
-
 
32
			"";
Line 31... Line 33...
31
			"";
33
		url = URL.encode(url);
Line 32... Line 34...
32
 
34
 
33
		JsonRestRequestBuilder rb = new JsonRestRequestBuilder(RequestBuilder.GET, url);
35
		JsonRestRequestBuilder rb = new JsonRestRequestBuilder(RequestBuilder.GET, url);
Line 46... Line 48...
46
					} else if (responseValue.isArray() != null) {
48
					} else if (responseValue.isArray() != null) {
47
						final JSONArray reponse = responseValue.isArray();
49
						final JSONArray reponse = responseValue.isArray();
48
						PublicationListe publications = new PublicationListe(reponse);
50
						PublicationListe publications = new PublicationListe(reponse);
49
						vueARafraichir.rafraichir(publications);
51
						vueARafraichir.rafraichir(publications);
50
					} else {
52
					} else {
51
						GWT.log(url+"\n\tLa réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null);
53
						GWT.log("La réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null);
52
					}
54
					}
53
				} else {
55
				} else {
54
					// Dans le cas, où nous demandons toutes les publication et qu'il n'y en a pas, nous retournons un objet vide
56
					// Dans le cas, où nous demandons toutes les publication et qu'il n'y en a pas, nous retournons un objet vide
55
					if (publicationId == null) {
57
					if (publicationId == null) {
56
						PublicationListe publications = new PublicationListe(0);
58
						PublicationListe publications = new PublicationListe(0);