Subversion Repositories eFlore/Applications.coel

Rev

Rev 1673 | Rev 1691 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1673 Rev 1685
1
package org.tela_botanica.client.modeles.structure;
1
package org.tela_botanica.client.modeles.structure;
2
 
2
 
3
import java.util.HashMap;
3
import java.util.HashMap;
4
 
4
 
5
import org.tela_botanica.client.Mediateur;
5
import org.tela_botanica.client.Mediateur;
6
import org.tela_botanica.client.RegistreId;
6
import org.tela_botanica.client.RegistreId;
7
import org.tela_botanica.client.http.JsonRestRequestBuilder;
7
import org.tela_botanica.client.http.JsonRestRequestBuilder;
8
import org.tela_botanica.client.http.JsonRestRequestCallback;
8
import org.tela_botanica.client.http.JsonRestRequestCallback;
9
import org.tela_botanica.client.interfaces.Rafraichissable;
9
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.modeles.Information;
10
import org.tela_botanica.client.modeles.Information;
11
import org.tela_botanica.client.modeles.personne.PersonneListe;
11
import org.tela_botanica.client.modeles.personne.PersonneListe;
12
import org.tela_botanica.client.modeles.projet.ProjetListe;
12
import org.tela_botanica.client.modeles.projet.ProjetListe;
13
import org.tela_botanica.client.synchronisation.Reponse;
13
import org.tela_botanica.client.synchronisation.Reponse;
14
import org.tela_botanica.client.util.UtilDAO;
14
import org.tela_botanica.client.util.UtilDAO;
15
 
15
 
16
import com.extjs.gxt.ui.client.Registry;
16
import com.extjs.gxt.ui.client.Registry;
17
import com.google.gwt.core.client.GWT;
17
import com.google.gwt.core.client.GWT;
18
import com.google.gwt.http.client.URL;
18
import com.google.gwt.http.client.URL;
19
import com.google.gwt.json.client.JSONArray;
19
import com.google.gwt.json.client.JSONArray;
20
import com.google.gwt.json.client.JSONObject;
20
import com.google.gwt.json.client.JSONObject;
21
import com.google.gwt.json.client.JSONValue;
21
import com.google.gwt.json.client.JSONValue;
22
import com.google.gwt.user.client.Window;
22
import com.google.gwt.user.client.Window;
23
 
23
 
24
public class StructureAsyncDao {
24
public class StructureAsyncDao {
25
	private static final String SERVICE_NOM = "CoelStructure";
25
	private static final String SERVICE_NOM = "CoelStructure";
26
	
26
	
27
	private String utilisateurId = null;
27
	private String utilisateurId = null;
28
	private Rafraichissable vueARafraichir = null;
28
	private Rafraichissable vueARafraichir = null;
29
	
29
	
30
	public StructureAsyncDao(Rafraichissable vue) {
30
	public StructureAsyncDao(Rafraichissable vue) {
31
		if (Mediateur.DEBUG) System.out.println("|| StructureAsyncDao > vueARafraichir = "+vue.getClass().toString());
31
		if (Mediateur.DEBUG) System.out.println("|| StructureAsyncDao > vueARafraichir = "+vue.getClass().toString());
32
		vueARafraichir = vue;
32
		vueARafraichir = vue;
33
		utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
33
		utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
34
	}
34
	}
35
 
35
 
36
	/**
36
	/**
37
	 * 
37
	 * 
38
	 * @param paginationProgressive : définit le mode de consultation de la base de données
38
	 * @param paginationProgressive : définit le mode de consultation de la base de données
39
	 * 			- True :	la consultation des données est progressive, ce qui signifie que la liste est chargée (paginée) au
39
	 * 			- True :	la consultation des données est progressive, ce qui signifie que la liste est chargée (paginée) au
40
	 * 						fur et à mesure de la consultation des données par l'utilisateur.
40
	 * 						fur et à mesure de la consultation des données par l'utilisateur.
41
	 * 			- False :	la consultation des données est classique : un seul appel à la base de données est effectué, le retour
41
	 * 			- False :	la consultation des données est classique : un seul appel à la base de données est effectué, le retour
42
	 * 						est renvoyé à l'appelant
42
	 * 						est renvoyé à l'appelant
43
	 * 			// FIXME : si la taille de la liste est supérieure à la limite du JREST (150), ce deuxieme mode ne fonctionne pas
43
	 * 			// FIXME : si la taille de la liste est supérieure à la limite du JREST (150), ce deuxieme mode ne fonctionne pas
44
	 */
44
	 */
45
	public void selectionner(final boolean paginationProgressive, final String projetId, final String structureId, final String nomStructure, final String formatRetour, final int start, final int nbElements, final Integer seqId) {
45
	public void selectionner(final boolean paginationProgressive, final String projetId, final String structureId, final String nomStructure, final String formatRetour, final int start, final int nbElements, final Integer seqId) {
46
		
46
		
47
		String nom = (nomStructure == null) ? "%" : nomStructure+"%";
47
		String nom = (nomStructure == null) ? "%" : nomStructure+"%";
48
		String[] parametres = {projetId, structureId, nom};
48
		String[] parametres = {projetId, structureId, nom};
49
		
49
		
50
		HashMap<String, String> restrictions = new HashMap<String, String>();
50
		HashMap<String, String> restrictions = new HashMap<String, String>();
51
 
51
 
52
		if (nbElements != -1)	{
52
		if (nbElements != -1)	{
53
			restrictions.put("limit", String.valueOf(nbElements));
53
			restrictions.put("limit", String.valueOf(nbElements));
54
		}
54
		}
55
		
55
		
56
		if ((formatRetour != null) && (formatRetour != "")) {
56
		if ((formatRetour != null) && (formatRetour != "")) {
57
			restrictions.put("formatRetour", formatRetour);
57
			restrictions.put("formatRetour", formatRetour);
58
		}
58
		}
59
		
59
		
60
		/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
60
		/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
61
		if (paginationProgressive) {
61
		if (paginationProgressive) {
62
			
62
			
63
			/** DEFINITION DU TUPLE DE DEPART **/
63
			/** DEFINITION DU TUPLE DE DEPART **/
64
			restrictions.put("start", String.valueOf(start));
64
			restrictions.put("start", String.valueOf(start));
65
			
65
			
66
			/** CONSTRUCTION DE LA REQUETE **/
66
			/** CONSTRUCTION DE LA REQUETE **/
67
    		final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
67
    		final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
68
 
68
 
69
    		/** ENVOI DE LA REQUETE **/
69
    		/** ENVOI DE LA REQUETE **/
70
    		rb.envoyerRequete(null, new JsonRestRequestCallback()
70
    		rb.envoyerRequete(null, new JsonRestRequestCallback()
71
    		{
71
    		{
72
    			/** RECEPTION DE LA REPONSE **/
72
    			/** RECEPTION DE LA REPONSE **/
73
    			public void surReponse(JSONValue responseValue)
73
    			public void surReponse(JSONValue responseValue)
74
    			{
74
    			{
75
					if (seqId != null)	{
75
					if (seqId != null)	{
76
						Reponse reponseRequete = new Reponse(responseValue, seqId);
76
						Reponse reponseRequete = new Reponse(responseValue, seqId);
77
						vueARafraichir.rafraichir(reponseRequete);
77
						vueARafraichir.rafraichir(reponseRequete);
78
					}
78
					}
79
					
79
					
80
    				/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
80
    				/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
81
    				 * On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
81
    				 * On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
82
					else vueARafraichir.rafraichir(responseValue);
82
					else vueARafraichir.rafraichir(responseValue);
83
    			}
83
    			}
84
    		});
84
    		});
85
		}
85
		}
86
		/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
86
		/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
87
		else {
87
		else {
88
			
88
			
89
			/** DEFINITION DU TUPLE DE DEPART **/
89
			/** DEFINITION DU TUPLE DE DEPART **/
90
			restrictions.put("start", String.valueOf(start*nbElements));
90
			restrictions.put("start", String.valueOf(start*nbElements));
91
			
91
			
92
			final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
92
			final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
93
			
93
			
94
			rb.envoyerRequete(null, new JsonRestRequestCallback() {
94
			rb.envoyerRequete(null, new JsonRestRequestCallback() {
95
 
95
 
96
				public void surReponse(JSONValue responseValue) {
96
				public void surReponse(JSONValue responseValue) {
97
					
97
					
98
					if (responseValue != null) {
98
					if (responseValue != null) {
99
						
99
						
100
						Information info = new Information("selection_structure");
100
						Information info = new Information("selection_structure");
101
						
101
						
102
						JSONObject responseObject = responseValue.isObject();
102
						JSONObject responseObject = responseValue.isObject();
103
						
103
						
104
						if (responseObject != null) {
104
						if (responseObject != null) {
105
							
105
							
106
							// Si la réponse est un tableau, alors c'est une liste de structure qui a été retournée
106
							// Si la réponse est un tableau, alors c'est une liste de structure qui a été retournée
107
							if (responseObject.get("structures").isArray() != null) {
107
							if (responseObject.get("structures").isArray() != null) {
108
								
108
								
109
								JSONObject reponse = responseObject;
109
								JSONObject reponse = responseObject;
110
								StructureListe structures;
110
								StructureListe structures;
111
								structures = new StructureListe(reponse.get("structures").isArray(), reponse.get("nbElements").isNumber(), vueARafraichir);
111
								structures = new StructureListe(reponse.get("structures").isArray(), reponse.get("nbElements").isNumber(), vueARafraichir);
112
								structures.setTaillePage(nbElements);
112
								structures.setTaillePage(nbElements);
113
								structures.setPageCourante(start);
113
								structures.setPageCourante(start);
114
								
114
								
115
								info.setDonnee(0, structures);
115
								info.setDonnee(0, structures);
116
								
116
								
117
								if (seqId != null)	{
117
								if (seqId != null)	{
118
									Reponse reponseRequete = new Reponse(info, seqId);
118
									Reponse reponseRequete = new Reponse(info, seqId);
119
									vueARafraichir.rafraichir(reponseRequete);
119
									vueARafraichir.rafraichir(reponseRequete);
120
								}
120
								}
121
								else vueARafraichir.rafraichir(structures);
121
								else vueARafraichir.rafraichir(structures);
122
								
122
								
123
							// Si la réponse est un objet, alors c'est une unique structure qui a été retournée
123
							// Si la réponse est un objet, alors c'est une unique structure qui a été retournée
124
							} else if (responseObject.get("structures").isObject() != null) {
124
							} else if (responseObject.get("structures").isObject() != null) {
125
								
125
								
126
								JSONObject reponse = responseObject.get("structures").isObject();
126
								JSONObject reponse = responseObject.get("structures").isObject();
127
								Structure structure = new Structure(reponse);
127
								Structure structure = new Structure(reponse);
128
								StructureConservation structureConservation = new StructureConservation(reponse);
128
								StructureConservation structureConservation = new StructureConservation(reponse);
129
								StructureValorisation structureValorisation = new StructureValorisation(reponse);
129
								StructureValorisation structureValorisation = new StructureValorisation(reponse);
130
								
130
								
131
								info.setDonnee(0, structure);
131
								info.setDonnee(0, structure);
132
								info.setDonnee(1, structureConservation);
132
								info.setDonnee(1, structureConservation);
133
								info.setDonnee(2, structureValorisation);
133
								info.setDonnee(2, structureValorisation);
134
								
134
								
135
								if (seqId != null)	{
135
								if (seqId != null)	{
136
									Reponse reponseRequete = new Reponse(info, seqId);
136
									Reponse reponseRequete = new Reponse(info, seqId);
137
									vueARafraichir.rafraichir(reponseRequete);
137
									vueARafraichir.rafraichir(reponseRequete);
138
								}
138
								}
139
								else vueARafraichir.rafraichir(info);
139
								else vueARafraichir.rafraichir(info);
140
							}  
140
							}  
141
						} else {
141
						} else {
142
							GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null);
142
							GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null);
143
						}
143
						}
144
					} else {
144
					} else {
145
						if (structureId == null) {
145
						if (structureId == null) {
146
							// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
146
							// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
147
							StructureListe structures = new StructureListe(0);
147
							StructureListe structures = new StructureListe(0);
148
							vueARafraichir.rafraichir(structures);								
148
							vueARafraichir.rafraichir(structures);								
149
						}
149
						}
150
					}
150
					}
151
				}
151
				}
152
			});
152
			});
153
		}
153
		}
154
	}
154
	}
155
	
155
	
156
 
156
 
157
	public void ajouter(final Structure str, StructureConservation conservation, StructureValorisation valorisation) {
157
	public void ajouter(final Structure str, StructureConservation conservation, StructureValorisation valorisation) {
158
		String postDonneesEncodees = construirePost(null, str, conservation, valorisation);
158
		String postDonneesEncodees = construirePost(null, str, conservation, valorisation);
159
 
159
 
160
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);	
160
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);	
161
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
161
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
162
			@Override
162
			@Override
163
			public void surReponse(JSONValue responseValue) {
163
			public void surReponse(JSONValue responseValue) {
164
				if (responseValue.isString() != null) {
164
				if (responseValue.isString() != null) {
165
					Information info = new Information("ajout_structure");
165
					Information info = new Information("ajout_structure");
166
					String structureIdOuMessage = responseValue.isString().stringValue();
166
					String structureIdOuMessage = responseValue.isString().stringValue();
167
					if (structureIdOuMessage.matches("^[0-9]+$")) {
167
					if (structureIdOuMessage.matches("^[0-9]+$")) {
168
						info.setDonnee(structureIdOuMessage);
168
						info.setDonnee(structureIdOuMessage);
169
					} else {
169
					} else {
170
						info.setMessage(structureIdOuMessage);
170
						info.setMessage(structureIdOuMessage);
171
					}
171
					}
172
					vueARafraichir.rafraichir(info);
172
					vueARafraichir.rafraichir(info);
173
				} else {
173
				} else {
174
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
174
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
175
				}
175
				}
176
			}
176
			}
177
		});
177
		});
178
	}
178
	}
179
 
179
 
180
	public void modifier(String structureId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
180
	public void modifier(String structureId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
181
		String postDonneesEncodees = construirePost(structureId, str, conservation, valorisation);
181
		String postDonneesEncodees = construirePost(structureId, str, conservation, valorisation);
182
		String[] parametres = {structureId};
182
		String[] parametres = {structureId};
183
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
183
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
184
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
184
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
185
			@Override
185
			@Override
186
			public void surReponse(JSONValue responseValue) {
186
			public void surReponse(JSONValue responseValue) {
187
				// Si la requête a impliquées des valeurs autogénérées, l'objet modifié est retourné
187
				// Si la requête a impliquées des valeurs autogénérées, l'objet modifié est retourné
188
				JSONObject obj;
188
				JSONObject obj;
189
				if ((obj = responseValue.isObject()) != null) {
189
				if ((obj = responseValue.isObject()) != null) {
190
					if (obj.get("structures").isObject() != null) {
190
					if (obj.get("structures").isObject() != null) {
191
						Structure structure = new Structure(obj.get("structures").isObject());
191
						Structure structure = new Structure(obj.get("structures").isObject());
192
						Information info = new Information("modif_structure");
192
						Information info = new Information("modif_structure");
193
						info.setDonnee(structure);
193
						info.setDonnee(structure);
194
						vueARafraichir.rafraichir(info);
194
						vueARafraichir.rafraichir(info);
195
					}
195
					}
196
				}
196
				}
197
				// Si la requête est un succès, reception d'une chaine
197
				// Si la requête est un succès, reception d'une chaine
198
				else if (responseValue.isString() != null) {
198
				else if (responseValue.isString() != null) {
199
					Information info = new Information("modif_structure");
199
					Information info = new Information("modif_structure");
200
					info.setMessage(responseValue.isString().stringValue());
200
					info.setMessage(responseValue.isString().stringValue());
201
					vueARafraichir.rafraichir(info);
201
					vueARafraichir.rafraichir(info);
202
				} else {
202
				} else {
203
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
203
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
204
				}
204
				}
205
			}
205
			}
206
		});
206
		});
207
	}
207
	}
208
	
208
	
209
	public void supprimer(String structuresId) {
209
	public void supprimer(String structuresId) {
210
		String[] parametres = {utilisateurId, structuresId};
210
		String[] parametres = {utilisateurId, structuresId};
211
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
211
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
212
		rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
212
		rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
213
			@Override
213
			@Override
214
			public void surReponse(JSONValue responseValue) {
214
			public void surReponse(JSONValue responseValue) {
215
				if (responseValue.isString() != null) {
215
				if (responseValue.isString() != null) {
216
					Information info = new Information("suppression_structure");
216
					Information info = new Information("suppression_structure");
217
					info.setMessage(responseValue.isString().stringValue());
217
					info.setMessage(responseValue.isString().stringValue());
218
					vueARafraichir.rafraichir(info);
218
					vueARafraichir.rafraichir(info);
219
				} else {
219
				} else {
220
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
220
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
221
				}
221
				}
222
			}
222
			}
223
		});
223
		});
224
	}
224
	}
225
	
225
	
226
	private String construirePost(String structureId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
226
	private String construirePost(String structureId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
227
		String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId); 
227
		String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId); 
228
			
228
			
229
		if (str != null) {
229
		if (str != null) {
230
			if (structureId != null) {
230
			if (structureId != null) {
231
				postDonnees += "&cs_id_structure=" + URL.encodeComponent(structureId);
231
				postDonnees += "&cs_id_structure=" + URL.encodeComponent(structureId);
232
			}
232
			}
233
			
233
			
234
			postDonnees += "&cpr_abreviation=" + URL.encodeComponent(str.getAbreviationProjet());
234
			postDonnees += "&cpr_abreviation=" + URL.encodeComponent(str.getAbreviationProjet());
235
			postDonnees += "&cs_ce_projet=" + URL.encodeComponent(str.getIdProjet()) +
235
			postDonnees += "&cs_ce_projet=" + URL.encodeComponent(str.getIdProjet()) +
236
				"&cs_ce_mere=" + URL.encodeComponent(str.getIdMere()) +
236
				"&cs_ce_mere=" + URL.encodeComponent(str.getIdMere()) +
237
				"&cs_guid=" + URL.encodeComponent(str.getGuid()) +
237
				"&cs_guid=" + URL.encodeComponent(str.getGuid()) +
238
				"&cs_truk_identifiant_alternatif=" + URL.encodeComponent(str.getIdAlternatif()) +
238
				"&cs_truk_identifiant_alternatif=" + URL.encodeComponent(str.getIdAlternatif()) +
239
				"&cs_nom=" + URL.encodeComponent(str.getNom()) +
239
				"&cs_nom=" + URL.encodeComponent(str.getNom()) +
240
				"&cs_truk_nom_alternatif=" + URL.encodeComponent(str.getNomAlternatif()) +
240
				"&cs_truk_nom_alternatif=" + URL.encodeComponent(str.getNomAlternatif()) +
241
				"&cs_description=" + URL.encodeComponent(str.getDescription()) +
241
				"&cs_description=" + URL.encodeComponent(str.getDescription()) +
242
				"&cs_ce_type=" + URL.encodeComponent(str.getType()) +
242
				"&cs_ce_type=" + URL.encodeComponent(str.getType()) +
243
				"&cs_ce_truk_type_prive=" + URL.encodeComponent(str.getTypePrive()) +
243
				"&cs_ce_truk_type_prive=" + URL.encodeComponent(str.getTypePrive()) +
244
				"&cs_ce_truk_type_public=" + URL.encodeComponent(str.getTypePublic()) +
244
				"&cs_ce_truk_type_public=" + URL.encodeComponent(str.getTypePublic()) +
245
				"&cs_adresse_01=" + URL.encodeComponent(str.getAdresse()) +
245
				"&cs_adresse_01=" + URL.encodeComponent(str.getAdresse()) +
246
				"&cs_adresse_02=" + URL.encodeComponent(str.getAdresseComplement()) +
246
				"&cs_adresse_02=" + URL.encodeComponent(str.getAdresseComplement()) +
247
				"&cs_date_fondation=" + URL.encodeComponent(str.getDateFondationFormatMysql()) +
247
				"&cs_date_fondation=" + URL.encodeComponent(str.getDateFondationFormatMysql()) +
248
				"&cs_code_postal=" + URL.encodeComponent(str.getCodePostal()) +
248
				"&cs_code_postal=" + URL.encodeComponent(str.getCodePostal()) +
249
				"&cs_ville=" + URL.encodeComponent(str.getVille()) +
249
				"&cs_ville=" + URL.encodeComponent(str.getVille()) +
250
				"&cs_ce_truk_region=" + URL.encodeComponent(str.get("ce_truk_region").toString()) +
250
				"&cs_ce_truk_region=" + URL.encodeComponent(str.get("ce_truk_region").toString()) +
251
				"&cs_ce_truk_pays=" + URL.encodeComponent(str.getPays()) +
251
				"&cs_ce_truk_pays=" + URL.encodeComponent(str.getPays()) +
252
				"&cs_latitude=" + URL.encodeComponent(str.getLatitude()) +
252
				"&cs_latitude=" + URL.encodeComponent(str.getLatitude()) +
253
				"&cs_longitude=" + URL.encodeComponent(str.getLongitude()) +
253
				"&cs_longitude=" + URL.encodeComponent(str.getLongitude()) +
254
				"&cs_truk_telephone=" + URL.encodeComponent(str.getTelephone()) +
254
				"&cs_truk_telephone=" + URL.encodeComponent(str.getTelephone()) +
255
				"&cs_truk_url=" + URL.encodeComponent(str.getUrl()) +
255
				"&cs_truk_url=" + URL.encodeComponent(str.getUrl()) +
256
				"&cs_nbre_personne=" + URL.encodeComponent(Integer.toString(str.getNbrePersonne())) +
256
				"&cs_nbre_personne=" + (str.getNbrePersonne() != null ? str.getNbrePersonne() : "") +
257
				"&cs_condition_acces=" + URL.encodeComponent(str.getConditionAcces())+
257
				"&cs_condition_acces=" + URL.encodeComponent(str.getConditionAcces())+
258
				"&cs_condition_usage=" + URL.encodeComponent(str.getConditionUsage())+
258
				"&cs_condition_usage=" + URL.encodeComponent(str.getConditionUsage())+
259
				"&cs_courriel=" + URL.encodeComponent(str.getCourriel());
259
				"&cs_courriel=" + URL.encodeComponent(str.getCourriel());
260
		}
260
		}
261
		if (conservation != null) {
261
		if (conservation != null) {
262
			if (structureId != null) {
262
			if (structureId != null) {
263
				postDonnees += "&csc_id_structure=" + URL.encodeComponent(structureId);
263
				postDonnees += "&csc_id_structure=" + URL.encodeComponent(structureId);
264
			}
264
			}
265
			postDonnees += "&csc_mark_formation=" + URL.encodeComponent(conservation.getFormation()) +
265
			postDonnees += "&csc_mark_formation=" + URL.encodeComponent(conservation.getFormation()) +
266
				"&csc_formation=" + URL.encodeComponent(conservation.getFormationInfo()) +
266
				"&csc_formation=" + URL.encodeComponent(conservation.getFormationInfo()) +
267
				"&csc_mark_formation_interet=" + URL.encodeComponent(conservation.getFormationInteret()) +
267
				"&csc_mark_formation_interet=" + URL.encodeComponent(conservation.getFormationInteret()) +
268
				"&csc_truk_stockage_local=" + URL.encodeComponent(conservation.getStockageLocal()) +
268
				"&csc_truk_stockage_local=" + URL.encodeComponent(conservation.getStockageLocal()) +
269
				"&csc_truk_stockage_meuble=" + URL.encodeComponent(conservation.getStockageMeuble()) +
269
				"&csc_truk_stockage_meuble=" + URL.encodeComponent(conservation.getStockageMeuble()) +
270
				"&csc_truk_stockage_parametre=" + URL.encodeComponent(conservation.getStockageParametre()) +
270
				"&csc_truk_stockage_parametre=" + URL.encodeComponent(conservation.getStockageParametre()) +
271
				"&csc_mark_collection_commune=" + URL.encodeComponent(conservation.getCollectionCommune()) +
271
				"&csc_mark_collection_commune=" + URL.encodeComponent(conservation.getCollectionCommune()) +
272
				"&csc_truk_collection_autre=" + URL.encodeComponent(conservation.getCollectionAutre()) +
272
				"&csc_truk_collection_autre=" + URL.encodeComponent(conservation.getCollectionAutre()) +
273
				"&csc_mark_acces_controle=" + URL.encodeComponent(conservation.getAccesControle()) +
273
				"&csc_mark_acces_controle=" + URL.encodeComponent(conservation.getAccesControle()) +
274
				"&csc_mark_restauration=" + URL.encodeComponent(conservation.getRestauration()) +
274
				"&csc_mark_restauration=" + URL.encodeComponent(conservation.getRestauration()) +
275
				"&csc_truk_restauration_operation=" + URL.encodeComponent(conservation.getRestaurationOperation()) +
275
				"&csc_truk_restauration_operation=" + URL.encodeComponent(conservation.getRestaurationOperation()) +
276
				"&csc_ce_materiel_conservation=" + URL.encodeComponent(conservation.getMaterielConservation()) +
276
				"&csc_ce_materiel_conservation=" + URL.encodeComponent(conservation.getMaterielConservation()) +
277
				"&csc_truk_materiel_autre=" + URL.encodeComponent(conservation.getMaterielAutre()) +
277
				"&csc_truk_materiel_autre=" + URL.encodeComponent(conservation.getMaterielAutre()) +
278
				"&csc_mark_traitement=" + URL.encodeComponent(conservation.getTraitement()) +
278
				"&csc_mark_traitement=" + URL.encodeComponent(conservation.getTraitement()) +
279
				"&csc_truk_traitement=" + URL.encodeComponent(conservation.getTraitements()) +
279
				"&csc_truk_traitement=" + URL.encodeComponent(conservation.getTraitements()) +
280
				"&csc_mark_acquisition_collection=" + URL.encodeComponent(conservation.getAcquisitionCollection()) +
280
				"&csc_mark_acquisition_collection=" + URL.encodeComponent(conservation.getAcquisitionCollection()) +
281
				"&csc_mark_acquisition_echantillon=" + URL.encodeComponent(conservation.getAcquisitionEchantillon()) +
281
				"&csc_mark_acquisition_echantillon=" + URL.encodeComponent(conservation.getAcquisitionEchantillon()) +
282
				"&csc_mark_acquisition_traitement=" + URL.encodeComponent(conservation.getAcquisitionTraitement()) +
282
				"&csc_mark_acquisition_traitement=" + URL.encodeComponent(conservation.getAcquisitionTraitement()) +
283
				"&csc_truk_acquisition_traitement_poison=" + URL.encodeComponent(conservation.getAcquisitionTraitementPoison()) +
283
				"&csc_truk_acquisition_traitement_poison=" + URL.encodeComponent(conservation.getAcquisitionTraitementPoison()) +
284
				"&csc_truk_acquisition_traitement_insecte=" + URL.encodeComponent(conservation.getAcquisitionTraitementInsecte());
284
				"&csc_truk_acquisition_traitement_insecte=" + URL.encodeComponent(conservation.getAcquisitionTraitementInsecte());
285
		}
285
		}
286
		if (valorisation != null) {
286
		if (valorisation != null) {
287
			if (structureId != null) {
287
			if (structureId != null) {
288
				postDonnees += "&csv_id_structure=" + URL.encodeComponent(structureId);
288
				postDonnees += "&csv_id_structure=" + URL.encodeComponent(structureId);
289
			}
289
			}
290
			postDonnees += "&csv_mark_action=" + URL.encodeComponent(valorisation.getAction()) +
290
			postDonnees += "&csv_mark_action=" + URL.encodeComponent(valorisation.getAction()) +
291
				"&csv_truk_action=" + URL.encodeComponent(valorisation.getActionInfo()) +
291
				"&csv_truk_action=" + URL.encodeComponent(valorisation.getActionInfo()) +
292
				"&csv_publication=" + URL.encodeComponent(valorisation.getPublication()) +
292
				"&csv_publication=" + URL.encodeComponent(valorisation.getPublication()) +
293
				"&csv_collection_autre=" + URL.encodeComponent(valorisation.getCollectionAutre()) +
293
				"&csv_collection_autre=" + URL.encodeComponent(valorisation.getCollectionAutre()) +
294
				"&csv_mark_action_future=" + URL.encodeComponent(valorisation.getActionFuture()) +
294
				"&csv_mark_action_future=" + URL.encodeComponent(valorisation.getActionFuture()) +
295
				"&csv_action_future=" + URL.encodeComponent(valorisation.getActionFutureInfo()) +
295
				"&csv_action_future=" + URL.encodeComponent(valorisation.getActionFutureInfo()) +
296
				"&csv_mark_recherche=" + URL.encodeComponent(valorisation.getRecherche()) +
296
				"&csv_mark_recherche=" + URL.encodeComponent(valorisation.getRecherche()) +
297
				"&csv_truk_recherche_provenance=" + URL.encodeComponent(valorisation.getRechercheProvenance()) +
297
				"&csv_truk_recherche_provenance=" + URL.encodeComponent(valorisation.getRechercheProvenance()) +
298
				"&csv_truk_recherche_type=" + URL.encodeComponent(valorisation.getRechercheType()) +
298
				"&csv_truk_recherche_type=" + URL.encodeComponent(valorisation.getRechercheType()) +
299
				"&csv_mark_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotif()) +
299
				"&csv_mark_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotif()) +
300
				"&csv_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotifInfo()) +
300
				"&csv_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotifInfo()) +
301
				"&csv_mark_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotif()) +
301
				"&csv_mark_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotif()) +
302
				"&csv_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotifInfo());
302
				"&csv_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotifInfo());
303
		}
303
		}
304
		return postDonnees;
304
		return postDonnees;
305
	}
305
	}
306
}
306
}