Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 773 Rev 1038
Line 12... Line 12...
12
import com.google.gwt.json.client.JSONString;
12
import com.google.gwt.json.client.JSONString;
13
import com.google.gwt.json.client.JSONValue;
13
import com.google.gwt.json.client.JSONValue;
Line 14... Line 14...
14
 
14
 
Line 15... Line 15...
15
public class ValeurListeAsyncDao {
15
public class ValeurListeAsyncDao {
16
	
16
	
17
	private static HashMap<Integer, ValeurListe> ontologieCache = new HashMap<Integer, ValeurListe>();
17
	private static HashMap<String, ValeurListe> ontologieCache = new HashMap<String, ValeurListe>();
Line 18... Line 18...
18
	private static final String SERVICE_NOM = "CoelValeurListe";
18
	private static final String SERVICE_NOM = "CoelValeurListe";
19
	private Rafraichissable vueARafraichir = null;
19
	private Rafraichissable vueARafraichir = null;
Line 24... Line 24...
24
	
24
	
25
	public void obtenirListe(Integer cle)	{
25
	public void obtenirListe(Integer cle)	{
26
		selectionner("id", cle, null, null);
26
		selectionner("id", cle, null, null);
Line 27... Line 27...
27
	}
27
	}
-
 
28
	
-
 
29
	public void selectionner(String type, Integer cle, String abv, String idValeur) {
-
 
30
		
-
 
31
		// La cleParent en Integer est insuffisante pour les liste valeurs comme Région qui on plusieurs sections sur leur liste
-
 
32
		// (ex : on ne sélectionne que les régions FR.__ puis les régions ES.__ sur la liste 1078 ....
28
	
33
		final String cleParent = cle + (abv == null ? "" : abv);
29
	public void selectionner(String type, final Integer cleParent, String abv, String idValeur) {
34
		
30
		if (ontologieCache.containsKey(cleParent)) {
35
		if (ontologieCache.containsKey(cleParent)) {
31
    		vueARafraichir.rafraichir(ontologieCache.get(cleParent));
36
			vueARafraichir.rafraichir(ontologieCache.get(cleParent));
32
    	} else {
37
    	} else {
33
    		String paramAbv = (type.equals("id") ? null : abv);
38
    		String paramAbv = (type.equals("id") ? null : abv);
34
    		String[] parametres = {type, cleParent.toString(), paramAbv, idValeur};
39
    		String[] parametres = {type, cleParent.toString(), paramAbv, idValeur};