Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1417 Rev 1428
Line 1... Line 1...
1
package org.tela_botanica.client.modeles.publication;
1
package org.tela_botanica.client.modeles.publication;
Line -... Line 2...
-
 
2
 
-
 
3
import java.util.HashMap;
2
 
4
 
3
import org.tela_botanica.client.Mediateur;
5
import org.tela_botanica.client.Mediateur;
4
import org.tela_botanica.client.RegistreId;
6
import org.tela_botanica.client.RegistreId;
5
import org.tela_botanica.client.http.JsonRestRequestBuilder;
7
import org.tela_botanica.client.http.JsonRestRequestBuilder;
6
import org.tela_botanica.client.http.JsonRestRequestCallback;
8
import org.tela_botanica.client.http.JsonRestRequestCallback;
Line 31... Line 33...
31
		utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
33
		utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
32
	}
34
	}
Line 33... Line 35...
33
	
35
	
34
	public void selectionner(String publicationId, String personnesId, String roleId, final Integer seqId) {
36
	public void selectionner(String publicationId, String personnesId, String roleId, final Integer seqId) {
-
 
37
		String[] parametres = {publicationId, personnesId, roleId};
-
 
38
		HashMap<String, String> restrictions = new HashMap<String, String>();
35
		String[] parametres = {publicationId, personnesId, roleId};
39
		restrictions.put("orderby", "ordre");
36
		final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres);
40
		final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres);
37
		rb.envoyerRequete(null, new JsonRestRequestCallback() {
41
		rb.envoyerRequete(null, new JsonRestRequestCallback() {
38
			@Override
42
			@Override
39
			public void surReponse(JSONValue responseValue) {
43
			public void surReponse(JSONValue responseValue) {
Line 69... Line 73...
69
						Reponse reponseRequete = new Reponse(publicationAPersonneListe, seqId);
73
						Reponse reponseRequete = new Reponse(publicationAPersonneListe, seqId);
70
						vueARafraichir.rafraichir(reponseRequete);
74
						vueARafraichir.rafraichir(reponseRequete);
71
					} else {
75
					} else {
72
						vueARafraichir.rafraichir(publicationAPersonneListe);
76
						vueARafraichir.rafraichir(publicationAPersonneListe);
73
					}
77
					}
74
					
-
 
75
				}
78
				}
76
			}
79
			}
77
		});		
80
		});
78
	}
81
	}
Line 79... Line 82...
79
	
82
	
80
	public void ajouter(String publicationId, String personnesId, String roleId,  final Integer seqId) {
83
	public void ajouter(String publicationId, String personnesId, String ordreAuteurs, String roleId,  final Integer seqId) {
81
		String postDonneesEncodees = "cpuap_id_publication="+URL.encodeComponent(publicationId)
84
		String postDonneesEncodees = "cpuap_id_publication="+URL.encodeComponent(publicationId)
-
 
85
		+"&cpuap_id_auteur="+URL.encodeComponent(personnesId)
82
		+"&cpuap_id_auteur="+URL.encodeComponent(personnesId)
86
		+"&cpuap_ordre="+URL.encodeComponent(ordreAuteurs)
83
		+"&cpuap_id_role="+URL.encodeComponent(roleId)
87
		+"&cpuap_id_role="+URL.encodeComponent(roleId)
84
		+"&cmhl_ce_modifier_par="+utilisateurId;		
88
		+"&cmhl_ce_modifier_par="+utilisateurId;		
85
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
89
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
86
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
90
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
Line 89... Line 93...
89
				traiterReponse(reponseValeur, "ajout_publication_a_personne", seqId);
93
				traiterReponse(reponseValeur, "ajout_publication_a_personne", seqId);
90
			}
94
			}
91
		});
95
		});
92
	}
96
	}
Line 93... Line 97...
93
 
97
 
94
	public void modifier(String publicationId, String personnesId, String roleId, final Integer seqId) {
98
	public void modifier(String publicationId, String personnesId, String ordreAuteurs, String roleId, final Integer seqId) {
Line 95... Line 99...
95
		String[] parametres = {publicationId, personnesId, roleId};
99
		String[] parametres = {publicationId, personnesId, roleId};
Line 96... Line 100...
96
		
100
		
-
 
101
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
-
 
102
		
-
 
103
		String postDonneesEncodees = "cpuap_id_publication="+URL.encodeComponent(publicationId)
97
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
104
		+"&cpuap_id_auteur="+URL.encodeComponent(personnesId)
Line 98... Line 105...
98
		
105
		+"&cpuap_id_role="+URL.encodeComponent(roleId)
99
		String postDonneesEncodees = "cpuap_id_publication="+URL.encodeComponent(publicationId)
106
		+"&cpuap_ordre="+URL.encodeComponent(ordreAuteurs)
100
			+"&cmhl_ce_modifier_par="+utilisateurId;
107
		+"&cmhl_ce_modifier_par="+utilisateurId;	
101
		
108