Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1329 Rev 1367
Line 24... Line 24...
24
	
24
	
25
	String utilisateurId = null;
25
	String utilisateurId = null;
Line 26... Line 26...
26
	private Rafraichissable vueARafraichir = null;
26
	private Rafraichissable vueARafraichir = null;
-
 
27
	
27
	
28
	public ProjetAsyncDao(Rafraichissable vueARafraichirCourrante) {
28
	public ProjetAsyncDao(Rafraichissable vueARafraichirCourrante) {
29
		if (Mediateur.DEBUG) System.out.println("|| ProjetAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
29
		vueARafraichir = vueARafraichirCourrante;
30
		vueARafraichir = vueARafraichirCourrante;
Line 65... Line 66...
65
    			/** RECEPTION DE LA REPONSE **/
66
    			/** RECEPTION DE LA REPONSE **/
66
    			public void surReponse(JSONValue responseValue)
67
    			public void surReponse(JSONValue responseValue)
67
    			{
68
    			{
68
    				/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
69
    				/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
69
    				 * On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
70
    				 * On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
-
 
71
					if (seqId != null)	{
-
 
72
						Reponse reponseRequete = new Reponse(responseValue, seqId);
-
 
73
						vueARafraichir.rafraichir(reponseRequete);
-
 
74
					}
-
 
75
					else	{
70
    				vueARafraichir.rafraichir(responseValue);
76
						vueARafraichir.rafraichir(responseValue);
-
 
77
					}
71
    			}
78
    			}
72
    		});
79
    		});
73
		}
80
		}
74
		/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
81
		/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
75
		else {
82
		else {
Line 111... Line 118...
111
								JSONObject reponse = responseObject.get("projets").isObject();
118
								JSONObject reponse = responseObject.get("projets").isObject();
112
								Projet projet = new Projet(reponse);
119
								Projet projet = new Projet(reponse);
Line 113... Line 120...
113
								
120
								
114
								Information info = new Information("selection_projet");
121
								Information info = new Information("selection_projet");
-
 
122
								info.setDonnee(0, projet);
-
 
123
								
-
 
124
								if (seqId != null)	{
-
 
125
									Reponse reponseRequete = new Reponse(info, seqId);
-
 
126
									vueARafraichir.rafraichir(reponseRequete);
-
 
127
								}
115
								info.setDonnee(0, projet);
128
								else	{
-
 
129
									vueARafraichir.rafraichir(info);
116
								vueARafraichir.rafraichir(info);
130
								}
117
							}
131
							}
118
						} else {
132
						} else {
119
							GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un objet ou un tableau JSON et vaut : "+responseValue.toString(), null);
133
							GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un objet ou un tableau JSON et vaut : "+responseValue.toString(), null);
120
						}
134
						}
121
					} else {
135
					} else {
122
						// Dans le cas, où nous demandons tous les projets et qu'il n'y en a pas, nous retournons un objet vide
136
						// Dans le cas, où nous demandons tous les projets et qu'il n'y en a pas, nous retournons un objet vide
123
						if (projetId == null) {
137
						if (projetId == null) {
-
 
138
							ProjetListe projets = new ProjetListe(0);
-
 
139
							if (seqId != null)	{
-
 
140
								Reponse reponseRequete = new Reponse(projets, seqId);
-
 
141
								vueARafraichir.rafraichir(reponseRequete);
-
 
142
							}
124
							ProjetListe projets = new ProjetListe(0);
143
							else	{
-
 
144
								vueARafraichir.rafraichir(projets);
125
							vueARafraichir.rafraichir(projets);								
145
							}						
126
						}
146
						}
127
					}
147
					}
128
				}
148
				}
129
			});
149
			});