Subversion Repositories eFlore/Applications.coel

Rev

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

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