Subversion Repositories eFlore/Applications.del

Rev

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

Rev 887 Rev 908
Line 5... Line 5...
5
import org.tela_botanica.del.client.modeles.PropositionDetermination;
5
import org.tela_botanica.del.client.modeles.PropositionDetermination;
6
import org.tela_botanica.del.client.services.rest.async.CommentaireCallback;
6
import org.tela_botanica.del.client.services.rest.async.CommentaireCallback;
7
import org.tela_botanica.del.client.services.rest.async.CommentaireCallback.ModeRequete;
7
import org.tela_botanica.del.client.services.rest.async.CommentaireCallback.ModeRequete;
Line 8... Line 8...
8
 
8
 
9
import com.google.gwt.http.client.RequestBuilder;
9
import com.google.gwt.http.client.RequestBuilder;
Line 10... Line 10...
10
import com.google.gwt.user.client.Window;
10
import com.google.gwt.http.client.URL;
Line 11... Line 11...
11
 
11
 
Line 39... Line 39...
39
	
39
	
Line 40... Line 40...
40
	private String assemblerChaineRequeteAjoutModif(Commentaire commentaire) {
40
	private String assemblerChaineRequeteAjoutModif(Commentaire commentaire) {
41
 
41
 
42
		String chaineRequete = "";
42
		String chaineRequete = "";
43
		if(commentaire.getObservation() != null && commentaire.getObservation().getId() != null) {
43
		if(commentaire.getObservation() != null && commentaire.getObservation().getId() != null) {
44
			chaineRequete += "observation="+commentaire.getObservation().getId();
44
			chaineRequete += "observation="+URL.encodeQueryString(commentaire.getObservation().getId());
45
		}
45
		}
46
		if(commentaire.getContributeur().getId() != null) {
46
		if(commentaire.getContributeur().getId() != null) {
Line 47... Line 47...
47
			chaineRequete += "&auteur.id="+commentaire.getContributeur().getId();
47
			chaineRequete += "&auteur.id="+URL.encodeQueryString(commentaire.getContributeur().getId());
48
		}
48
		}
49
 
49
 
50
		if(commentaire.getParent() != null && commentaire.getParent().getId() != null) {
50
		if(commentaire.getParent() != null && commentaire.getParent().getId() != null) {
51
			chaineRequete += "&id_parent="+commentaire.getParent().getId();
51
			chaineRequete += "&id_parent="+URL.encodeQueryString(commentaire.getParent().getId());
52
			PropositionDetermination propositionParente = commentaire.getPropositionParenteOuNulle();
52
			PropositionDetermination propositionParente = commentaire.getPropositionParenteOuNulle();
53
			if(propositionParente != null) {
53
			if(propositionParente != null) {
54
				chaineRequete += "&proposition="+commentaire.getPropositionParenteOuNulle();
54
				chaineRequete += "&proposition="+URL.encodeQueryString(propositionParente.getId());
55
			}
55
			}
56
		}
56
		}
57
		chaineRequete += "&texte="+commentaire.getCommentaire()+
57
		chaineRequete += "&texte="+URL.encodeQueryString(commentaire.getCommentaire())+
58
		"&auteur.prenom="+commentaire.getContributeur().getPrenom()+
58
		"&auteur.prenom="+URL.encodeQueryString(commentaire.getContributeur().getPrenom())+
59
		"&auteur.nom="+commentaire.getContributeur().getNom()+
59
		"&auteur.nom="+URL.encodeQueryString(commentaire.getContributeur().getNom())+
60
		"&auteur.courriel="+commentaire.getContributeur().getAdresseEmail();
60
		"&auteur.courriel="+URL.encodeQueryString(commentaire.getContributeur().getAdresseEmail());