Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1329 Rev 1367
1
package org.tela_botanica.client.modeles.collection;
1
package org.tela_botanica.client.modeles.collection;
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.projet.ProjetListe;
11
import org.tela_botanica.client.modeles.projet.ProjetListe;
-
 
12
import org.tela_botanica.client.synchronisation.Reponse;
12
import org.tela_botanica.client.util.Debug;
13
import org.tela_botanica.client.util.Debug;
13
import org.tela_botanica.client.util.UtilDAO;
14
import org.tela_botanica.client.util.UtilDAO;
14
 
15
 
15
import com.extjs.gxt.ui.client.Registry;
16
import com.extjs.gxt.ui.client.Registry;
16
import com.google.gwt.core.client.GWT;
17
import com.google.gwt.core.client.GWT;
17
import com.google.gwt.http.client.URL;
18
import com.google.gwt.http.client.URL;
18
import com.google.gwt.json.client.JSONArray;
19
import com.google.gwt.json.client.JSONArray;
19
import com.google.gwt.json.client.JSONNumber;
20
import com.google.gwt.json.client.JSONNumber;
20
import com.google.gwt.json.client.JSONObject;
21
import com.google.gwt.json.client.JSONObject;
21
import com.google.gwt.json.client.JSONValue;
22
import com.google.gwt.json.client.JSONValue;
22
 
23
 
23
public class CollectionAsyncDao {
24
public class CollectionAsyncDao {
24
	
25
	
25
	public static final String SERVICE_NOM = "CoelCollection";
26
	public static final String SERVICE_NOM = "CoelCollection";
26
	private String utilisateurId = null;
27
	private String utilisateurId = null;
27
	private Rafraichissable vueARafraichir = null;
28
	private Rafraichissable vueARafraichir = null;
28
	
29
	
29
	public CollectionAsyncDao(Rafraichissable vueARafraichirCourrante) {
30
	public CollectionAsyncDao(Rafraichissable vueARafraichirCourrante) {
-
 
31
		if (Mediateur.DEBUG) System.out.println("|| CollectionAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
30
		vueARafraichir = vueARafraichirCourrante;
32
		vueARafraichir = vueARafraichirCourrante;
31
		utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
33
		utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
32
	}
34
	}
33
	
35
	
34
	/**
36
	/**
35
	 * 
37
	 * 
36
	 * @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
37
	 * 			- 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
38
	 * 						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.
39
	 * 			- 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
40
	 * 						est renvoyé à l'appelant
42
	 * 						est renvoyé à l'appelant
41
	 * 			// 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
42
	 */
44
	 */
43
	public void selectionner(final boolean paginationProgressive, final String projetId, final String collectionId, final String nomCollection, final int start, final int nbElements) {
45
	public void selectionner(final boolean paginationProgressive, final String projetId, final String collectionId, final String nomCollection, final int start, final int nbElements, final Integer seqId) {
44
 
46
 
45
		// Ajout des paramètres et données à selectionner dans l'URL
47
		// Ajout des paramètres et données à selectionner dans l'URL
46
		String nom = (nomCollection == null) ? "%" : nomCollection+"%";
48
		String nom = (nomCollection == null) ? "%" : nomCollection+"%";
47
		String[] parametres = {projetId, collectionId, nom};
49
		String[] parametres = {projetId, collectionId, nom};
48
		
50
		
49
		HashMap<String, String> restrictions = new HashMap<String, String>();
51
		HashMap<String, String> restrictions = new HashMap<String, String>();
50
		
52
		
51
		if (nbElements != -1)	{
53
		if (nbElements != -1)	{
52
			restrictions.put("limit", String.valueOf(nbElements));
54
			restrictions.put("limit", String.valueOf(nbElements));
53
		}
55
		}
54
 
56
 
55
		/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
57
		/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
56
		if (paginationProgressive) {
58
		if (paginationProgressive) {
57
 
59
 
58
			/** DEFINITION DU TUPLE DE DEPART **/
60
			/** DEFINITION DU TUPLE DE DEPART **/
59
			restrictions.put("start", String.valueOf(start));
61
			restrictions.put("start", String.valueOf(start));
60
			
62
			
61
			/** CONSTRUCTION DE LA REQUETE **/
63
			/** CONSTRUCTION DE LA REQUETE **/
62
    		final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
64
    		final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
63
 
65
 
64
    		/** ENVOI DE LA REQUETE **/
66
    		/** ENVOI DE LA REQUETE **/
65
    		rb.envoyerRequete(null, new JsonRestRequestCallback()
67
    		rb.envoyerRequete(null, new JsonRestRequestCallback()
66
    		{
68
    		{
67
    			/** RECEPTION DE LA REPONSE **/
69
    			/** RECEPTION DE LA REPONSE **/
68
    			public void surReponse(JSONValue responseValue)
70
    			public void surReponse(JSONValue responseValue)
69
    			{
71
    			{
70
    				/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
72
    				/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
71
    				 * On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
73
    				 * On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
-
 
74
 
-
 
75
					if (seqId != null)	{
-
 
76
						if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste paginée, retour au sequenceur");
-
 
77
						Reponse reponseRequete = new Reponse(responseValue, seqId);
-
 
78
						vueARafraichir.rafraichir(reponseRequete);
-
 
79
					}
-
 
80
					else	{
-
 
81
						if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
72
    				vueARafraichir.rafraichir(responseValue);
82
						vueARafraichir.rafraichir(responseValue);
-
 
83
					}
73
    			}
84
    			}
74
    		});
85
    		});
75
		}
86
		}
76
		/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
87
		/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
77
		else {
88
		else {
78
			
89
			
79
			/** DEFINITION DU TUPLE DE DEPART **/
90
			/** DEFINITION DU TUPLE DE DEPART **/
80
			restrictions.put("start", String.valueOf(start*nbElements));
91
			restrictions.put("start", String.valueOf(start*nbElements));
81
			
92
			
82
			final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
93
			final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
83
			
94
			
84
			rb.envoyerRequete(null, new JsonRestRequestCallback() {
95
			rb.envoyerRequete(null, new JsonRestRequestCallback() {
85
				@Override
96
				@Override
86
				public void surReponse(JSONValue responseValue) {
97
				public void surReponse(JSONValue responseValue) {
87
					if (responseValue != null) {
98
					if (responseValue != null) {
88
 
99
 
89
						JSONObject responseObject = responseValue.isObject();
100
						JSONObject responseObject = responseValue.isObject();
90
 
101
 
91
						if (responseObject != null) {
102
						if (responseObject != null) {
92
							
103
							
93
							// Si la réponse est un tableau, alors c'est une liste de collections qui a été retournée
104
							// Si la réponse est un tableau, alors c'est une liste de collections qui a été retournée
94
							if (responseObject.get("collections").isArray() != null) {
105
							if (responseObject.get("collections").isArray() != null) {
95
								final JSONArray reponse = responseObject.get("collections").isArray();
106
								final JSONArray reponse = responseObject.get("collections").isArray();
96
								CollectionListe collections = new CollectionListe(reponse, responseObject.get("nbElements").isNumber(), vueARafraichir);
107
								CollectionListe collections = new CollectionListe(reponse, responseObject.get("nbElements").isNumber(), vueARafraichir);
97
								collections.setTaillePage(nbElements);
108
								collections.setTaillePage(nbElements);
98
								collections.setPageCourante(start);							
109
								collections.setPageCourante(start);							
99
								
110
								
100
								vueARafraichir.rafraichir(collections);
111
								vueARafraichir.rafraichir(collections);
101
								
112
								
102
							// Si la réponse est un objet, alors c'est une unique collection qui a été retournée
113
							// Si la réponse est un objet, alors c'est une unique collection qui a été retournée
103
							} else if (responseObject.get("collections").isObject() != null) {
114
							} else if (responseObject.get("collections").isObject() != null) {
104
								final JSONObject reponse = responseObject.get("collections").isObject();
115
								final JSONObject reponse = responseObject.get("collections").isObject();
105
								Collection collection = new Collection(reponse);
116
								Collection collection = new Collection(reponse);
106
								CollectionBotanique collectionBotanique = new CollectionBotanique(reponse);
117
								CollectionBotanique collectionBotanique = new CollectionBotanique(reponse);
107
								collection.setBotanique(collectionBotanique);
118
								collection.setBotanique(collectionBotanique);
108
								
119
								
109
								Information info = new Information("selection_collection");
120
								Information info = new Information("selection_collection");
110
								info.setDonnee(0, collection);
121
								info.setDonnee(0, collection);
-
 
122
								
-
 
123
								// et on met à jour le demandeur des données
-
 
124
								if (seqId != null)	{
-
 
125
									if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste non paginée, retour au sequenceur");
-
 
126
									Reponse reponseRequete = new Reponse(info, seqId);
-
 
127
									vueARafraichir.rafraichir(reponseRequete);
-
 
128
								}
-
 
129
								else	{
-
 
130
									if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste non paginée, retour au sequenceur");
111
								vueARafraichir.rafraichir(info);
131
									vueARafraichir.rafraichir(info);
-
 
132
								}
112
							}
133
							}
113
						} else {
134
						} else {
114
							GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null);
135
							GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null);
115
						}
136
						}
116
					} else {
137
					} else {
117
						// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
138
						// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
118
						if (collectionId == null) {
139
						if (collectionId == null) {
119
							CollectionListe collections = new CollectionListe(0);
140
							CollectionListe collections = new CollectionListe(0);
120
							vueARafraichir.rafraichir(collections);								
141
							vueARafraichir.rafraichir(collections);								
121
						}
142
						}
122
					}
143
					}
123
				}
144
				}
124
			});
145
			});
125
		}
146
		}
126
	}
147
	}
127
	
148
	
128
	public void ajouter(Collection collection) {		
149
	public void ajouter(Collection collection) {		
129
		String postDonneesEncodees = construirePost(null, collection);
150
		String postDonneesEncodees = construirePost(null, collection);
130
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);	
151
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);	
131
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
152
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
132
			@Override
153
			@Override
133
			public void surReponse(JSONValue responseValue) {
154
			public void surReponse(JSONValue responseValue) {
134
				if (responseValue.isString() != null) {
155
				if (responseValue.isString() != null) {
135
					Information info = new Information("ajout_collection");
156
					Information info = new Information("ajout_collection");
136
					String structureIdOuMessage = responseValue.isString().stringValue();
157
					String structureIdOuMessage = responseValue.isString().stringValue();
137
					if (structureIdOuMessage.matches("^[0-9]+$")) {
158
					if (structureIdOuMessage.matches("^[0-9]+$")) {
138
						info.setDonnee(structureIdOuMessage);
159
						info.setDonnee(structureIdOuMessage);
139
					} else {
160
					} else {
140
						info.setMessage(structureIdOuMessage);
161
						info.setMessage(structureIdOuMessage);
141
					}
162
					}
142
					vueARafraichir.rafraichir(info);
163
					vueARafraichir.rafraichir(info);
143
				} else {
164
				} else {
144
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
165
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
145
				}
166
				}
146
			}
167
			}
147
		});
168
		});
148
	}
169
	}
149
	
170
	
150
	public void modifier(Collection collection) {
171
	public void modifier(Collection collection) {
151
		String postDonneesEncodees = construirePost(collection.getId(), collection);
172
		String postDonneesEncodees = construirePost(collection.getId(), collection);
152
		String[] parametres = {collection.getId()};
173
		String[] parametres = {collection.getId()};
153
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
174
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
154
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
175
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
155
			@Override
176
			@Override
156
			public void surReponse(JSONValue responseValue) {
177
			public void surReponse(JSONValue responseValue) {
157
				// Si la requête est un succès, reception d'une chaine
178
				// Si la requête est un succès, reception d'une chaine
158
				if (responseValue.isString() != null) {
179
				if (responseValue.isString() != null) {
159
					Information info = new Information("modif_collection");
180
					Information info = new Information("modif_collection");
160
					info.setMessage(responseValue.isString().stringValue());
181
					info.setMessage(responseValue.isString().stringValue());
161
					vueARafraichir.rafraichir(info);
182
					vueARafraichir.rafraichir(info);
162
				} else {
183
				} else {
163
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
184
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
164
				}
185
				}
165
			}
186
			}
166
		});
187
		});
167
	}
188
	}
168
	
189
	
169
	public void supprimer(String collectionsId) {
190
	public void supprimer(String collectionsId) {
170
		String[] parametres = {utilisateurId, collectionsId};
191
		String[] parametres = {utilisateurId, collectionsId};
171
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
192
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
172
		rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
193
		rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
173
			@Override
194
			@Override
174
			public void surReponse(JSONValue responseValue) {
195
			public void surReponse(JSONValue responseValue) {
175
				if (responseValue.isString() != null) {
196
				if (responseValue.isString() != null) {
176
					Information info = new Information("suppression_collection");
197
					Information info = new Information("suppression_collection");
177
					info.setMessage(responseValue.isString().stringValue());
198
					info.setMessage(responseValue.isString().stringValue());
178
					vueARafraichir.rafraichir(info);
199
					vueARafraichir.rafraichir(info);
179
				} else {
200
				} else {
180
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
201
					GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
181
				}
202
				}
182
			}
203
			}
183
		});
204
		});
184
	}
205
	}
185
	
206
	
186
	private String construirePost(String collectionId, Collection collection) {		
207
	private String construirePost(String collectionId, Collection collection) {		
187
		String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId); 
208
		String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId); 
188
			
209
			
189
		if (collection != null) {
210
		if (collection != null) {
190
			if (collectionId != null) {
211
			if (collectionId != null) {
191
				postDonnees += "&cc_id_collection=" + URL.encodeComponent(collectionId);
212
				postDonnees += "&cc_id_collection=" + URL.encodeComponent(collectionId);
192
			}
213
			}
193
 
214
 
194
			/*
215
			/*
195
			postDonnees += "&cpr_abreviation=" + URL.encodeComponent(((ProjetListe) Registry.get(RegistreId.PROJETS)).get(collection.getIdProjet()).getAbreviation());
216
			postDonnees += "&cpr_abreviation=" + URL.encodeComponent(((ProjetListe) Registry.get(RegistreId.PROJETS)).get(collection.getIdProjet()).getAbreviation());
196
			postDonnees += "&cc_ce_projet=" + URL.encodeComponent(collection.getIdProjet()) +
217
			postDonnees += "&cc_ce_projet=" + URL.encodeComponent(collection.getIdProjet()) +
197
				"&cc_ce_mere=" + URL.encodeComponent(collection.getCollectionMereId()) +
218
				"&cc_ce_mere=" + URL.encodeComponent(collection.getCollectionMereId()) +
198
				"&cc_ce_structure=" + URL.encodeComponent(collection.getIdStructure()) +
219
				"&cc_ce_structure=" + URL.encodeComponent(collection.getIdStructure()) +
199
				"&cc_truk_identifiant_alternatif=" + URL.encodeComponent(collection.getIdAlternatif()) +
220
				"&cc_truk_identifiant_alternatif=" + URL.encodeComponent(collection.getIdAlternatif()) +
200
				"&cc_truk_code=" + URL.encodeComponent(collection.getCode()) +
221
				"&cc_truk_code=" + URL.encodeComponent(collection.getCode()) +
201
				"&cc_nom=" + URL.encodeComponent(collection.getNom()) +
222
				"&cc_nom=" + URL.encodeComponent(collection.getNom()) +
202
				"&cc_truk_nom_alternatif=" + URL.encodeComponent(collection.getNomAlternatif()) +
223
				"&cc_truk_nom_alternatif=" + URL.encodeComponent(collection.getNomAlternatif()) +
203
				"&cc_description=" + URL.encodeComponent(collection.getDescription()) +
224
				"&cc_description=" + URL.encodeComponent(collection.getDescription()) +
204
				"&cc_description_specialiste=" + URL.encodeComponent(collection.getDescriptionSpecialiste()) +
225
				"&cc_description_specialiste=" + URL.encodeComponent(collection.getDescriptionSpecialiste()) +
205
				"&cc_historique=" + URL.encodeComponent(collection.getHistorique()) +
226
				"&cc_historique=" + URL.encodeComponent(collection.getHistorique()) +
206
				"&cc_truk_url=" + URL.encodeComponent(collection.getUrls()) +
227
				"&cc_truk_url=" + URL.encodeComponent(collection.getUrls()) +
207
				"&cc_truk_groupement_principe=" + URL.encodeComponent(collection.getGroupementPrincipe()) +
228
				"&cc_truk_groupement_principe=" + URL.encodeComponent(collection.getGroupementPrincipe()) +
208
				"&cc_truk_groupement_but=" + URL.encodeComponent(collection.getGroupementBut()) +
229
				"&cc_truk_groupement_but=" + URL.encodeComponent(collection.getGroupementBut()) +
209
				"&cc_ce_type=" + URL.encodeComponent(collection.getTypeNcd()) +
230
				"&cc_ce_type=" + URL.encodeComponent(collection.getTypeNcd()) +
210
				"&cc_ce_type_depot=" + URL.encodeComponent(collection.getTypeDepot()) +
231
				"&cc_ce_type_depot=" + URL.encodeComponent(collection.getTypeDepot()) +
211
				"&cc_cote=" + URL.encodeComponent(collection.getCote()) +
232
				"&cc_cote=" + URL.encodeComponent(collection.getCote()) +
212
				"&cc_truk_periode_constitution=" + URL.encodeComponent(collection.getPeriodeConstitution()) +
233
				"&cc_truk_periode_constitution=" + URL.encodeComponent(collection.getPeriodeConstitution()) +
213
				"&cc_truk_couverture_lieu=" + URL.encodeComponent(collection.getCouvertureLieu()) +
234
				"&cc_truk_couverture_lieu=" + URL.encodeComponent(collection.getCouvertureLieu()) +
214
				"&cc_ce_specimen_type=" + URL.encodeComponent(collection.getSpecimenType()) +
235
				"&cc_ce_specimen_type=" + URL.encodeComponent(collection.getSpecimenType()) +
215
				"&cc_specimen_type_nbre=" + URL.encodeComponent(collection.getSpecimenTypeNbre()) +
236
				"&cc_specimen_type_nbre=" + URL.encodeComponent(collection.getSpecimenTypeNbre()) +
216
				"&cc_ce_specimen_type_nbre_precision=" + URL.encodeComponent(collection.getSpecimenTypeNbrePrecision()) +
237
				"&cc_ce_specimen_type_nbre_precision=" + URL.encodeComponent(collection.getSpecimenTypeNbrePrecision()) +
217
				"&cc_ce_specimen_type_classement=" + URL.encodeComponent(collection.getSpecimenTypeClassement());*/
238
				"&cc_ce_specimen_type_classement=" + URL.encodeComponent(collection.getSpecimenTypeClassement());*/
218
			postDonnees += "&" + collection.obtenirChainePOST();
239
			postDonnees += "&" + collection.obtenirChainePOST();
219
		}
240
		}
220
		
241
		
221
		if (collection.getBotanique() != null) {
242
		if (collection.getBotanique() != null) {
222
			if (collectionId != null) {
243
			if (collectionId != null) {
223
				postDonnees += "&ccb_id_collection=" + URL.encodeComponent(collectionId);
244
				postDonnees += "&ccb_id_collection=" + URL.encodeComponent(collectionId);
224
			}
245
			}
225
			CollectionBotanique collectionBotanique = collection.getBotanique();
246
			CollectionBotanique collectionBotanique = collection.getBotanique();
226
			/*postDonnees += "&ccb_nbre_echantillon=" + URL.encodeComponent(collectionBotanique.getNbreEchantillon()) +
247
			/*postDonnees += "&ccb_nbre_echantillon=" + URL.encodeComponent(collectionBotanique.getNbreEchantillon()) +
227
				"&ccb_ce_truk_type=" + URL.encodeComponent(collectionBotanique.getType()) +
248
				"&ccb_ce_truk_type=" + URL.encodeComponent(collectionBotanique.getType()) +
228
				"&ccb_truk_unite_rangement=" + URL.encodeComponent(collectionBotanique.getUniteRangement()) +
249
				"&ccb_truk_unite_rangement=" + URL.encodeComponent(collectionBotanique.getUniteRangement()) +
229
				"&ccb_ce_unite_rangement_etat=" + URL.encodeComponent(collectionBotanique.getUniteRangementEtat()) +
250
				"&ccb_ce_unite_rangement_etat=" + URL.encodeComponent(collectionBotanique.getUniteRangementEtat()) +
230
				"&ccb_truk_unite_base=" + URL.encodeComponent(collectionBotanique.getUniteBase()) +
251
				"&ccb_truk_unite_base=" + URL.encodeComponent(collectionBotanique.getUniteBase()) +
231
				"&ccb_truk_conservation_papier_type=" + URL.encodeComponent(collectionBotanique.getConservationPapierType()) +
252
				"&ccb_truk_conservation_papier_type=" + URL.encodeComponent(collectionBotanique.getConservationPapierType()) +
232
				"&ccb_truk_conservation_methode=" + URL.encodeComponent(collectionBotanique.getConservationMethode()) +
253
				"&ccb_truk_conservation_methode=" + URL.encodeComponent(collectionBotanique.getConservationMethode()) +
233
				"&ccb_specimen_fixation_pourcent=" + URL.encodeComponent(collectionBotanique.getSpecimenFixationPourcent()) +
254
				"&ccb_specimen_fixation_pourcent=" + URL.encodeComponent(collectionBotanique.getSpecimenFixationPourcent()) +
234
				"&ccb_etiquette_fixation_pourcent=" + URL.encodeComponent(collectionBotanique.getEtiquetteFixationPourcent()) +
255
				"&ccb_etiquette_fixation_pourcent=" + URL.encodeComponent(collectionBotanique.getEtiquetteFixationPourcent()) +
235
				"&ccb_truk_specimen_fixation_methode=" + URL.encodeComponent(collectionBotanique.getSpecimenFixationMethode()) +
256
				"&ccb_truk_specimen_fixation_methode=" + URL.encodeComponent(collectionBotanique.getSpecimenFixationMethode()) +
236
				"&ccb_truk_etiquette_fixation_support=" + URL.encodeComponent(collectionBotanique.getEtiquetteFixationSupport()) +
257
				"&ccb_truk_etiquette_fixation_support=" + URL.encodeComponent(collectionBotanique.getEtiquetteFixationSupport()) +
237
				"&ccb_truk_etiquette_fixation_specimen=" + URL.encodeComponent(collectionBotanique.getEtiquetteFixationSpecimen()) +
258
				"&ccb_truk_etiquette_fixation_specimen=" + URL.encodeComponent(collectionBotanique.getEtiquetteFixationSpecimen()) +
238
				"&ccb_truk_etiquette_ecriture=" + URL.encodeComponent(collectionBotanique.getEtiquetteEcriture()) +
259
				"&ccb_truk_etiquette_ecriture=" + URL.encodeComponent(collectionBotanique.getEtiquetteEcriture()) +
239
				"&ccb_ce_traitement=" + URL.encodeComponent(collectionBotanique.getTraitement()) +
260
				"&ccb_ce_traitement=" + URL.encodeComponent(collectionBotanique.getTraitement()) +
240
				"&ccb_truk_traitement_poison=" + URL.encodeComponent(collectionBotanique.getTraitementPoison()) +
261
				"&ccb_truk_traitement_poison=" + URL.encodeComponent(collectionBotanique.getTraitementPoison()) +
241
				"&ccb_truk_traitement_insecte=" + URL.encodeComponent(collectionBotanique.getTraitementInsecte()) +
262
				"&ccb_truk_traitement_insecte=" + URL.encodeComponent(collectionBotanique.getTraitementInsecte()) +
242
				"&ccb_ce_etat_general=" + URL.encodeComponent(collectionBotanique.getEtatGeneral()) +
263
				"&ccb_ce_etat_general=" + URL.encodeComponent(collectionBotanique.getEtatGeneral()) +
243
				"&ccb_truk_degradation_specimen=" + URL.encodeComponent(collectionBotanique.getDegradationSpecimen()) +
264
				"&ccb_truk_degradation_specimen=" + URL.encodeComponent(collectionBotanique.getDegradationSpecimen()) +
244
				"&ccb_truk_degradation_presentation=" + URL.encodeComponent(collectionBotanique.getDegradationPresentation()) +
265
				"&ccb_truk_degradation_presentation=" + URL.encodeComponent(collectionBotanique.getDegradationPresentation()) +
245
				"&ccb_ce_determination=" + URL.encodeComponent(collectionBotanique.getDetermination()) +
266
				"&ccb_ce_determination=" + URL.encodeComponent(collectionBotanique.getDetermination()) +
246
				"&ccb_truk_nature=" + URL.encodeComponent(collectionBotanique.getNature()) +
267
				"&ccb_truk_nature=" + URL.encodeComponent(collectionBotanique.getNature()) +
247
				"&ccb_specialite=" + URL.encodeComponent(collectionBotanique.getSpecialite()) +
268
				"&ccb_specialite=" + URL.encodeComponent(collectionBotanique.getSpecialite()) +
248
				"&ccb_recolte_date_debut=" + URL.encodeComponent(collectionBotanique.getRecolteDateDebut()) +
269
				"&ccb_recolte_date_debut=" + URL.encodeComponent(collectionBotanique.getRecolteDateDebut()) +
249
				"&ccb_ce_recolte_date_debut_type=" + URL.encodeComponent(collectionBotanique.getRecolteDateDebutType()) +
270
				"&ccb_ce_recolte_date_debut_type=" + URL.encodeComponent(collectionBotanique.getRecolteDateDebutType()) +
250
				"&ccb_recolte_date_fin=" + URL.encodeComponent(collectionBotanique.getRecolteDateFin()) +
271
				"&ccb_recolte_date_fin=" + URL.encodeComponent(collectionBotanique.getRecolteDateFin()) +
251
				"&ccb_ce_recolte_date_fin_type=" + URL.encodeComponent(collectionBotanique.getRecolteDateFinType()) +
272
				"&ccb_ce_recolte_date_fin_type=" + URL.encodeComponent(collectionBotanique.getRecolteDateFinType()) +
252
				"&ccb_annotation_classement=" + URL.encodeComponent(collectionBotanique.getClassementAnnotation()) +
273
				"&ccb_annotation_classement=" + URL.encodeComponent(collectionBotanique.getClassementAnnotation()) +
253
				"&ccb_ce_classement_etat=" + URL.encodeComponent(collectionBotanique.getClassementEtat()) +
274
				"&ccb_ce_classement_etat=" + URL.encodeComponent(collectionBotanique.getClassementEtat()) +
254
				"&ccb_truk_etiquette_renseignement=" + URL.encodeComponent(collectionBotanique.getEtiquetteRenseignement()) +
275
				"&ccb_truk_etiquette_renseignement=" + URL.encodeComponent(collectionBotanique.getEtiquetteRenseignement()) +
255
				"&ccb_ce_precision_localite=" + URL.encodeComponent(collectionBotanique.getPrecisionLocalite()) +
276
				"&ccb_ce_precision_localite=" + URL.encodeComponent(collectionBotanique.getPrecisionLocalite()) +
256
				"&ccb_ce_precision_date=" + URL.encodeComponent(collectionBotanique.getPrecisionDate()) +
277
				"&ccb_ce_precision_date=" + URL.encodeComponent(collectionBotanique.getPrecisionDate()) +
257
				"&ccb_annotation_diverse=" + URL.encodeComponent(collectionBotanique.getAnnotationsDiverses()) +
278
				"&ccb_annotation_diverse=" + URL.encodeComponent(collectionBotanique.getAnnotationsDiverses()) +
258
				"&ccb_ce_collection_integre=" + URL.encodeComponent(collectionBotanique.getCollectionIntegre()) +
279
				"&ccb_ce_collection_integre=" + URL.encodeComponent(collectionBotanique.getCollectionIntegre()) +
259
				"&ccb_ce_collection_integre_info=" + URL.encodeComponent(collectionBotanique.getCollectionIntegreInfo()) +
280
				"&ccb_ce_collection_integre_info=" + URL.encodeComponent(collectionBotanique.getCollectionIntegreInfo()) +
260
				"&ccb_ce_inventaire=" + URL.encodeComponent(collectionBotanique.getInventaire()) +
281
				"&ccb_ce_inventaire=" + URL.encodeComponent(collectionBotanique.getInventaire()) +
261
				"&ccb_ce_inventaire_auteur=" + URL.encodeComponent(collectionBotanique.getInventaireAuteur()) +
282
				"&ccb_ce_inventaire_auteur=" + URL.encodeComponent(collectionBotanique.getInventaireAuteur()) +
262
				"&ccb_ce_inventaire_forme=" + URL.encodeComponent(collectionBotanique.getInventaireForme()) +
283
				"&ccb_ce_inventaire_forme=" + URL.encodeComponent(collectionBotanique.getInventaireForme()) +
263
				"&ccb_inventaire_info=" + URL.encodeComponent(collectionBotanique.getInventaireInfo()) +
284
				"&ccb_inventaire_info=" + URL.encodeComponent(collectionBotanique.getInventaireInfo()) +
264
				"&ccb_ce_truk_inventaire_digital=" + URL.encodeComponent(collectionBotanique.getInventaireDigital()) +
285
				"&ccb_ce_truk_inventaire_digital=" + URL.encodeComponent(collectionBotanique.getInventaireDigital()) +
265
				"&ccb_inventaire_digital_pourcent=" + URL.encodeComponent(collectionBotanique.getInventaireDigitalPourcent()) +
286
				"&ccb_inventaire_digital_pourcent=" + URL.encodeComponent(collectionBotanique.getInventaireDigitalPourcent()) +
266
				"&ccb_ce_inventaire_etat=" + URL.encodeComponent(collectionBotanique.getInventaireEtat()) +
287
				"&ccb_ce_inventaire_etat=" + URL.encodeComponent(collectionBotanique.getInventaireEtat()) +
267
				"&ccb_inventaire_donnee_type=" + URL.encodeComponent(collectionBotanique.getInventaireDonneesTypes());*/
288
				"&ccb_inventaire_donnee_type=" + URL.encodeComponent(collectionBotanique.getInventaireDonneesTypes());*/
268
			postDonnees += "&" + collectionBotanique.obtenirChainePOST();
289
			postDonnees += "&" + collectionBotanique.obtenirChainePOST();
269
		}
290
		}
270
		
291
		
271
		return postDonnees;
292
		return postDonnees;
272
	}
293
	}
273
}
294
}