/trunk/src/org/tela_botanica/client/modeles/collection/CollectionAsyncDao.java |
---|
71,7 → 71,7 |
{ |
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy. |
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/ |
if (seqId != null) { |
if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste paginée, retour au sequenceur"); |
Reponse reponseRequete = new Reponse(responseValue, seqId); |
86,7 → 86,7 |
} |
/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/ |
else { |
/** DEFINITION DU TUPLE DE DEPART **/ |
restrictions.put("start", String.valueOf(start*nbElements)); |
100,7 → 100,6 |
JSONObject responseObject = responseValue.isObject(); |
if (responseObject != null) { |
// Si la réponse est un tableau, alors c'est une liste de collections qui a été retournée |
if (responseObject.get("collections").isArray() != null) { |
final JSONArray reponse = responseObject.get("collections").isArray(); |
127,7 → 126,7 |
vueARafraichir.rafraichir(reponseRequete); |
} |
else { |
if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste non paginée, retour au sequenceur"); |
if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste non paginée, retour à "+vueARafraichir.getClass().toString()); |
vueARafraichir.rafraichir(info); |
} |
} |
/trunk/src/org/tela_botanica/client/modeles/publication/PublicationAPersonne.java |
---|
1,10 → 1,12 |
package org.tela_botanica.client.modeles.publication; |
import java.util.Iterator; |
import java.util.Map; |
import java.util.Set; |
import org.tela_botanica.client.modeles.aDonnee; |
import org.tela_botanica.client.modeles.personne.Personne; |
import org.tela_botanica.client.util.Debug; |
import com.google.gwt.json.client.JSONObject; |
26,7 → 28,8 |
} |
public PublicationAPersonne(JSONObject pubAPersListe) { |
personneLiee = new Personne(pubAPersListe); |
Personne personne = new Personne(pubAPersListe); |
setPersonne(personne); |
publicationLiee = new Publication(pubAPersListe); |
// l'objet JSON est une table de hachage |
83,6 → 86,18 |
if (personne != null) { |
setIdPersonne(personne.getId()); |
} |
Map<String, Object> a = personne.getProperties(); |
Set<String> cles = a.keySet(); |
Iterator<String> it = cles.iterator(); |
while (it.hasNext()) { |
String cle = it.next(); |
if (a.get(cle) != null) { |
String cleObjet = cle.replaceFirst("^"+Personne.PREFIXE+"_", ""); |
this.set(cleObjet, a.get(cle)); |
} |
} |
} |
// ID |
152,4 → 167,14 |
public void setFonction(String type, String valeur) { |
setChaineDenormaliseUnique("ce_truk_type", type, valeur); |
} |
// ORDRE DES AUTEURS |
public String getOrdreAuteurs() { |
return renvoyerValeurCorrecte("ordre"); |
} |
public void setOrdreAuteurs(String ordre) { |
if (ordre.matches("[0-9]+")) { |
this.set("ordre", ordre); |
} |
} |
} |
/trunk/src/org/tela_botanica/client/modeles/publication/PublicationAPersonneAsyncDao.java |
---|
1,5 → 1,7 |
package org.tela_botanica.client.modeles.publication; |
import java.util.HashMap; |
import org.tela_botanica.client.Mediateur; |
import org.tela_botanica.client.RegistreId; |
import org.tela_botanica.client.http.JsonRestRequestBuilder; |
33,6 → 35,8 |
public void selectionner(String publicationId, String personnesId, String roleId, final Integer seqId) { |
String[] parametres = {publicationId, personnesId, roleId}; |
HashMap<String, String> restrictions = new HashMap<String, String>(); |
restrictions.put("orderby", "ordre"); |
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres); |
rb.envoyerRequete(null, new JsonRestRequestCallback() { |
@Override |
71,15 → 75,15 |
} else { |
vueARafraichir.rafraichir(publicationAPersonneListe); |
} |
} |
} |
}); |
}); |
} |
public void ajouter(String publicationId, String personnesId, String roleId, final Integer seqId) { |
public void ajouter(String publicationId, String personnesId, String ordreAuteurs, String roleId, final Integer seqId) { |
String postDonneesEncodees = "cpuap_id_publication="+URL.encodeComponent(publicationId) |
+"&cpuap_id_auteur="+URL.encodeComponent(personnesId) |
+"&cpuap_ordre="+URL.encodeComponent(ordreAuteurs) |
+"&cpuap_id_role="+URL.encodeComponent(roleId) |
+"&cmhl_ce_modifier_par="+utilisateurId; |
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM); |
91,13 → 95,16 |
}); |
} |
public void modifier(String publicationId, String personnesId, String roleId, final Integer seqId) { |
public void modifier(String publicationId, String personnesId, String ordreAuteurs, String roleId, final Integer seqId) { |
String[] parametres = {publicationId, personnesId, roleId}; |
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres); |
String postDonneesEncodees = "cpuap_id_publication="+URL.encodeComponent(publicationId) |
+"&cmhl_ce_modifier_par="+utilisateurId; |
+"&cpuap_id_auteur="+URL.encodeComponent(personnesId) |
+"&cpuap_id_role="+URL.encodeComponent(roleId) |
+"&cpuap_ordre="+URL.encodeComponent(ordreAuteurs) |
+"&cmhl_ce_modifier_par="+utilisateurId; |
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() { |
@Override |
/trunk/src/org/tela_botanica/client/modeles/publication/PublicationAsyncDao.java |
---|
133,6 → 133,7 |
private void traiterReponse(JSONValue reponseValeur, String type, Integer seqId) { |
Information info = new Information(type); |
// Si la requête est un succès, réception d'une chaîne |
if (reponseValeur.isString() != null) { |
String idOuMessage = reponseValeur.isString().stringValue(); |