8,6 → 8,7 |
import org.tela_botanica.client.http.JsonRestRequestCallback; |
import org.tela_botanica.client.interfaces.Rafraichissable; |
import org.tela_botanica.client.modeles.Information; |
import org.tela_botanica.client.synchronisation.Reponse; |
import org.tela_botanica.client.util.UtilDAO; |
|
import com.extjs.gxt.ui.client.Registry; |
23,11 → 24,12 |
private Rafraichissable vueARafraichir = null; |
|
public CommentaireAsyncDao(Rafraichissable vueARafraichirCourrante) { |
if (Mediateur.DEBUG) System.out.println("|| CommentaireAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString()); |
vueARafraichir = vueARafraichirCourrante ; |
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId(); |
} |
|
public void selectionner(final String commentaireId, String projetId, String titre, final int pageCourante, final int nbElements) { |
public void selectionner(final String commentaireId, String projetId, String titre, final int pageCourante, final int nbElements, final Integer seqId) { |
String[] parametres = {projetId, commentaireId, titre}; |
|
HashMap<String, String> restrictions = new HashMap<String, String>(); |
51,7 → 53,13 |
// Transformation du tableau JSON réponse en ListeInstitution |
Commentaire commentaire = new Commentaire(reponse); |
// et on met à jour le demandeur des données |
vueARafraichir.rafraichir(commentaire); |
if (seqId != null) { |
Reponse reponseRequete = new Reponse(commentaire, seqId); |
vueARafraichir.rafraichir(reponseRequete); |
} |
else { |
vueARafraichir.rafraichir(commentaire); |
} |
} else if (responseValue.isArray() != null) { |
final JSONArray reponse = responseValue.isArray(); |
CommentaireListe commentaires; |
63,7 → 71,13 |
commentaires.setTaillePage(nbElements); |
commentaires.setPageCourante(pageCourante); |
|
vueARafraichir.rafraichir(commentaires); |
if (seqId != null) { |
Reponse reponseRequete = new Reponse(commentaires, seqId); |
vueARafraichir.rafraichir(reponseRequete); |
} |
else { |
vueARafraichir.rafraichir(commentaires); |
} |
} else { |
GWT.log("La réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null); |
} |
71,7 → 85,13 |
// Dans le cas, où nous demandons toutes les publication et qu'il n'y en a pas, nous retournons un objet vide |
if (commentaireId == null) { |
CommentaireListe commentaires = new CommentaireListe(0); |
vueARafraichir.rafraichir(commentaires); |
if (seqId != null) { |
Reponse reponseRequete = new Reponse(commentaires, seqId); |
vueARafraichir.rafraichir(reponseRequete); |
} |
else { |
vueARafraichir.rafraichir(commentaires); |
} |
} |
} |
} |