| Line 44... |
Line 44... |
| 44 |
* // FIXME : si la taille de la liste est supérieure à la limite du JREST (150), ce deuxieme mode ne fonctionne pas efficacement (on ne voit pas les enregistrement suivants)
|
44 |
* // FIXME : si la taille de la liste est supérieure à la limite du JREST (150), ce deuxieme mode ne fonctionne pas efficacement (on ne voit pas les enregistrement suivants)
|
| 45 |
*/
|
45 |
*/
|
| 46 |
public void selectionner(final boolean paginationProgressive, final String publicationId, String projetId, String nomComplet, final int start, final int nbElements, final Integer seqId) {
|
46 |
public void selectionner(final boolean paginationProgressive, final String publicationId, String projetId, String nomComplet, final int start, final int nbElements, final Integer seqId) {
|
| Line 47... |
Line 47... |
| 47 |
|
47 |
|
| 48 |
String nom = (nomComplet == null) ? "%" : nomComplet+"%";
|
48 |
String nom = (nomComplet == null) ? "%" : nomComplet+"%";
|
| Line 49... |
Line 49... |
| 49 |
String[] param = {publicationId, nom};
|
49 |
String[] param = {publicationId, projetId, nom};
|
| 50 |
|
50 |
|
| Line 51... |
Line 51... |
| 51 |
HashMap<String, String> restrictions = new HashMap<String, String>();
|
51 |
HashMap<String, String> restrictions = new HashMap<String, String>();
|
| 52 |
restrictions.put("orderby", "cpu_fmt_nom_complet");
|
52 |
restrictions.put("orderby", "cpu_fmt_nom_complet");
|
| 53 |
|
53 |
|
| Line 54... |
Line -... |
| 54 |
if (nbElements != -1) {
|
- |
|
| 55 |
restrictions.put("limit", String.valueOf(nbElements));
|
- |
|
| 56 |
}
|
- |
|
| 57 |
|
54 |
if (nbElements != -1) {
|
| 58 |
Debug.log("start="+start);
|
55 |
restrictions.put("limit", String.valueOf(nbElements));
|
| Line 59... |
Line 56... |
| 59 |
Debug.log("nbElements="+nbElements);
|
56 |
}
|
| 60 |
|
57 |
|
| Line 105... |
Line 102... |
| 105 |
|
102 |
|
| Line 106... |
Line 103... |
| 106 |
if (responseObject != null) {
|
103 |
if (responseObject != null) {
|
| 107 |
|
104 |
|
| 108 |
// Si la réponse est un tableau, alors c'est une liste de projets qui a été retournée
|
105 |
// Si la réponse est un tableau, alors c'est une liste de projets qui a été retournée
|
| 109 |
if (responseObject.get("publications").isArray() != null) {
|
106 |
if (responseObject.get("publications").isArray() != null) {
|
| Line 110... |
Line 107... |
| 110 |
|
107 |
|
| 111 |
JSONArray reponse = responseObject.get("publications").isArray();
|
- |
|
| 112 |
|
- |
|
| 113 |
PublicationListe publications;
|
- |
|
| 114 |
|
- |
|
| 115 |
/*if (reponse.get(1).isObject() != null) {
|
- |
|
| 116 |
publications = new PublicationListe(reponse.get(1).isArray());
|
108 |
JSONArray reponse = responseObject.get("publications").isArray();
|
| 117 |
} else {*/
|
- |
|
| 118 |
Debug.log("responseObject="+responseObject);
|
- |
|
| 119 |
publications = new PublicationListe(responseObject.get("publications").isArray(), responseObject.get("nbElements").isNumber(), vueARafraichir);
|
109 |
|
| 120 |
//}
|
110 |
PublicationListe publications;
|
| Line 121... |
Line 111... |
| 121 |
|
111 |
publications = new PublicationListe(reponse, responseObject.get("nbElements").isNumber(), vueARafraichir);
|
| 122 |
publications.setTaillePage(nbElements);
|
112 |
publications.setTaillePage(nbElements);
|
| Line 130... |
Line 120... |
| 130 |
if (Mediateur.DEBUG) System.out.println("<-- PublicationAsyncDao > Liste non paginée, retour à "+vueARafraichir.getClass().toString());
|
120 |
if (Mediateur.DEBUG) System.out.println("<-- PublicationAsyncDao > Liste non paginée, retour à "+vueARafraichir.getClass().toString());
|
| 131 |
vueARafraichir.rafraichir(publications);
|
121 |
vueARafraichir.rafraichir(publications);
|
| 132 |
}
|
122 |
}
|
| Line 133... |
Line 123... |
| 133 |
|
123 |
|
| 134 |
// Si la réponse est un objet, alors c'est un unique projet qui a été retourné
|
124 |
// Si la réponse est un objet, alors c'est un unique projet qui a été retourné
|
| Line 135... |
Line 125... |
| 135 |
} else if (responseObject.get("projets").isObject() != null) {
|
125 |
} else if (responseObject.get("publications").isObject() != null) {
|
| 136 |
|
126 |
|
| 137 |
final JSONObject reponse = responseObject.get("projets").isObject();
|
127 |
JSONObject reponse = responseObject.get("publications").isObject();
|
| 138 |
// Transformation du tableau JSON réponse en ListeInstitution
|
128 |
// Transformation du tableau JSON réponse en ListeInstitution
|
| 139 |
Publication publication = new Publication(reponse);
|
129 |
Publication publication = new Publication(reponse);
|
| 140 |
// et on met à jour le demandeur des données
|
130 |
// et on met à jour le demandeur des données
|