Subversion Repositories eFlore/Applications.coel

Rev

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

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