Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 306 Rev 385
Line 1... Line 1...
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
Line 2... Line 2...
2
 
2
 
-
 
3
import java.io.Serializable;
3
import java.io.Serializable;
4
import java.util.Collection;
4
import java.util.Collections;
5
import java.util.Collections;
5
import java.util.HashMap;
6
import java.util.HashMap;
6
import java.util.Iterator;
7
import java.util.Iterator;
7
import java.util.LinkedList;
8
import java.util.LinkedList;
Line 11... Line 12...
11
import java.util.TreeSet;
12
import java.util.TreeSet;
Line 12... Line 13...
12
 
13
 
Line 13... Line 14...
13
import org.tela_botanica.client.util.UtilArray;
14
import org.tela_botanica.client.util.UtilArray;
-
 
15
 
Line 14... Line 16...
14
 
16
import com.extjs.gxt.ui.client.data.BaseModelData;
15
import com.extjs.gxt.ui.client.data.BaseModelData;
17
import com.google.gwt.http.client.URL;
16
 
18
 
17
/**
19
/**
Line 346... Line 348...
346
			nouvelleInstance.set(cle, this.get(cle));
348
			nouvelleInstance.set(cle, this.get(cle));
347
		}
349
		}
Line 348... Line 350...
348
		
350
		
349
		return nouvelleInstance;
351
		return nouvelleInstance;
-
 
352
	}
-
 
353
	
-
 
354
	/**
-
 
355
	 * Renvoie une chaine de caractère formatée et encodée pour POST avec toutes les propriétés du modèle
-
 
356
	 * */
-
 
357
	public String obtenirChaineJSON() {
-
 
358
		
-
 
359
		String chaineJSON = "";
-
 
360
		
-
 
361
		HashMap hmProperties = (HashMap) getProperties();
-
 
362
		Collection<String> keys = hmProperties.keySet();
-
 
363
		Iterator<String> it = keys.iterator();
-
 
364
		
-
 
365
		while (it.hasNext())	{
-
 
366
			String key = it.next();
-
 
367
			chaineJSON += "cp_" +  key + "=" + hmProperties.get(key);
-
 
368
			if (it.hasNext())	{
-
 
369
				chaineJSON += "&";
-
 
370
			}
-
 
371
		}
-
 
372
		
-
 
373
		URL.encode(chaineJSON);
-
 
374
		return chaineJSON;
350
	}
375
	}