| 1489 | aurelien | 1 | package org.tela_botanica.client.modeles.objets;
 | 
        
           |  |  | 2 |   | 
        
           |  |  | 3 | import java.util.HashMap;
 | 
        
           | 1542 | aurelien | 4 | import java.util.Iterator;
 | 
        
           |  |  | 5 | import java.util.List;
 | 
        
           | 1489 | aurelien | 6 |   | 
        
           | 2033 | aurelien | 7 | import com.gwtext.client.data.FieldDef;
 | 
        
           |  |  | 8 | import com.gwtext.client.data.IntegerFieldDef;
 | 
        
           | 1489 | aurelien | 9 | import com.gwtext.client.data.SimpleStore;
 | 
        
           |  |  | 10 | import com.gwtext.client.data.Store;
 | 
        
           | 2033 | aurelien | 11 | import com.gwtext.client.data.StringFieldDef;
 | 
        
           | 1489 | aurelien | 12 |   | 
        
           |  |  | 13 | public class Ontologies {
 | 
        
           |  |  | 14 |   | 
        
           | 1542 | aurelien | 15 | 	//TODO: extraire toutes ces valeurs dans des fichiers de configuration
 | 
        
           |  |  | 16 | 	// ou bien via l'appel d'un web service spécialisé.
 | 
        
           | 1489 | aurelien | 17 | 	private static HashMap<String, String> valeursCertitude = null;
 | 
        
           | 1542 | aurelien | 18 | 	private static List<InfosReferentielNom> listeReferentielsNoms = null;
 | 
        
           | 1489 | aurelien | 19 |   | 
        
           |  |  | 20 | 	public static Store getValeursCertitude() {
 | 
        
           |  |  | 21 | 		Object[][] valeurs = {{"Certaine","certain"},
 | 
        
           |  |  | 22 | 				{"Douteuse","douteux"},
 | 
        
           |  |  | 23 | 				{"A déterminer","aDeterminer"}
 | 
        
           |  |  | 24 | 			};
 | 
        
           |  |  | 25 | 		SimpleStore storeCertitude = new SimpleStore(new String[] {"label","valeur"},valeurs);
 | 
        
           |  |  | 26 | 		storeCertitude.load();
 | 
        
           |  |  | 27 | 		return storeCertitude;
 | 
        
           |  |  | 28 | 	}
 | 
        
           |  |  | 29 |   | 
        
           |  |  | 30 | 	public static Store getValeursAbondance() {
 | 
        
           | 1542 | aurelien | 31 | 		Object[][] valeurs = {
 | 
        
           |  |  | 32 | 			{"5 : recouvrement R > 75%","5"},
 | 
        
           |  |  | 33 | 			{"4 : 50% < R < 75%","4"},
 | 
        
           |  |  | 34 | 			{"3 : 25% < R < 50%","3"},
 | 
        
           |  |  | 35 | 			{"2 : 5% < R < 25%","2"},
 | 
        
           |  |  | 36 | 			{"1 : 1% < R < 5%","1"},
 | 
        
           |  |  | 37 | 			{"+ : recouvrement R < 1%","+"},
 | 
        
           |  |  | 38 | 			{"r : rare (quelques pieds)","r"},
 | 
        
           |  |  | 39 | 			{"i : un seul individu","i"},
 | 
        
           |  |  | 40 | 			{"1-5 individus","1-5"},
 | 
        
           |  |  | 41 | 			{"5-10 individus","5-10"},
 | 
        
           |  |  | 42 | 			{"10-50 individus","10-50"},
 | 
        
           |  |  | 43 | 			{"50-100 individus","50-100"},
 | 
        
           |  |  | 44 | 			{"100-500 individus","100-500"},
 | 
        
           |  |  | 45 | 			{">500 individus",">500"},
 | 
        
           |  |  | 46 | 			{"E : exceptionnel","E"},
 | 
        
           |  |  | 47 | 			{"RR : très rare","RR"},
 | 
        
           |  |  | 48 | 			{"R : rare","R"},
 | 
        
           | 1558 | aurelien | 49 | 			{"AR : assez rare","AR"},
 | 
        
           | 1542 | aurelien | 50 | 			{"PC : peu commun","PC"},
 | 
        
           |  |  | 51 | 			{"AC : assez commun","AC"},
 | 
        
           |  |  | 52 | 			{"C : commun","C"},
 | 
        
           | 1558 | aurelien | 53 | 			{"CC : très commun","CC"}
 | 
        
           | 1542 | aurelien | 54 | 		};
 | 
        
           | 1489 | aurelien | 55 | 		SimpleStore storeAbondance = new SimpleStore(new String[] {"label","valeur"},valeurs);
 | 
        
           |  |  | 56 | 		storeAbondance.load();
 | 
        
           |  |  | 57 | 		return storeAbondance;
 | 
        
           |  |  | 58 | 	}
 | 
        
           |  |  | 59 |   | 
        
           |  |  | 60 | 	public static String getCorrespondanceCertitude(String cle) {
 | 
        
           |  |  | 61 | 		if(valeursCertitude == null) {
 | 
        
           |  |  | 62 | 			valeursCertitude = new HashMap<String, String>();
 | 
        
           |  |  | 63 | 			valeursCertitude.put("certain", "Certaine");
 | 
        
           |  |  | 64 | 			valeursCertitude.put("douteux", "Douteuse");
 | 
        
           |  |  | 65 | 			valeursCertitude.put("aDeterminer", "A déterminer");
 | 
        
           |  |  | 66 | 		}
 | 
        
           |  |  | 67 |   | 
        
           |  |  | 68 | 		String valeur = valeursCertitude.get(cle);
 | 
        
           |  |  | 69 |   | 
        
           |  |  | 70 | 		return valeur == null ? cle : valeur;
 | 
        
           |  |  | 71 | 	}
 | 
        
           | 1542 | aurelien | 72 |   | 
        
           |  |  | 73 | 	public static Store getValeursReferentiel() {
 | 
        
           |  |  | 74 | 		List<InfosReferentielNom> listeReferentiels = Configuration.getReferentielsDispos();
 | 
        
           |  |  | 75 | 		Object[][] valeurs = new Object[listeReferentiels.size()][2];
 | 
        
           |  |  | 76 | 		int i = 0;
 | 
        
           |  |  | 77 | 		for (Iterator<InfosReferentielNom> iterator = listeReferentiels.iterator(); iterator
 | 
        
           |  |  | 78 | 				.hasNext();) {
 | 
        
           |  |  | 79 | 			InfosReferentielNom infosReferentielNom = iterator.next();
 | 
        
           |  |  | 80 |   | 
        
           |  |  | 81 | 			String[] valeur = {infosReferentielNom.getIntitule(), infosReferentielNom.getCode()};
 | 
        
           |  |  | 82 | 			valeurs[i] = valeur;
 | 
        
           |  |  | 83 | 			i++;
 | 
        
           |  |  | 84 | 		}
 | 
        
           |  |  | 85 | 		SimpleStore storeReferentiels = new SimpleStore(new String[] {"label","valeur"},valeurs);
 | 
        
           |  |  | 86 | 		storeReferentiels.load();
 | 
        
           |  |  | 87 | 		return storeReferentiels;
 | 
        
           |  |  | 88 | 	}
 | 
        
           |  |  | 89 |   | 
        
           |  |  | 90 | 	public static InfosReferentielNom getInfosReferentielNomParCode(String code) {
 | 
        
           |  |  | 91 | 		InfosReferentielNom infos = null;
 | 
        
           |  |  | 92 | 		List<InfosReferentielNom> listeReferentiels = Configuration.getReferentielsDispos();
 | 
        
           |  |  | 93 | 		for (Iterator<InfosReferentielNom> iterator = listeReferentiels.iterator(); iterator
 | 
        
           |  |  | 94 | 				.hasNext();) {
 | 
        
           |  |  | 95 | 			InfosReferentielNom infosReferentielNom = iterator.next();
 | 
        
           |  |  | 96 | 			if(infosReferentielNom.getCode().equals(code)) {
 | 
        
           |  |  | 97 | 				infos = infosReferentielNom;
 | 
        
           |  |  | 98 | 				break;
 | 
        
           |  |  | 99 | 			}
 | 
        
           |  |  | 100 | 		}
 | 
        
           |  |  | 101 |   | 
        
           |  |  | 102 | 		return infos;
 | 
        
           |  |  | 103 | 	}
 | 
        
           |  |  | 104 |   | 
        
           |  |  | 105 | 	public static Store getValeursPhenologie() {
 | 
        
           |  |  | 106 | 		Object[][] valeurs = {
 | 
        
           |  |  | 107 | 			{"00-09: germination, développement des bourgeons", "00-09"},
 | 
        
           |  |  | 108 | 			{"10-19: développement des feuilles", "10-19"},
 | 
        
           |  |  | 109 | 			{"11: par ex, environ 10% des feuilles épanouies", "11"},
 | 
        
           |  |  | 110 | 			{"15: par ex, environ 50% des feuilles épanouies", "15"},
 | 
        
           |  |  | 111 | 			{"20-29: formation de pousses latérales, tallage", "20-29"},
 | 
        
           |  |  | 112 | 			{"30-39: développement des tiges, croissance des rosettes", "30-39"},
 | 
        
           |  |  | 113 | 			{"40-49: développement des organes de propagation végétative", "40-49"},
 | 
        
           |  |  | 114 | 			{"50-59: apparition de l'inflorescence, épiaison", "50-59"},
 | 
        
           |  |  | 115 | 			{"60-69: floraison", "60-69"},
 | 
        
           |  |  | 116 | 			{"61 : par ex, environ 10% des fleurs épanouies", "61"},
 | 
        
           |  |  | 117 | 			{"65 : par ex, environ 50% des fleurs épanouies", "65"},
 | 
        
           |  |  | 118 | 			{"70-79: fructification", "70-79"},
 | 
        
           |  |  | 119 | 			{"80-89: maturité des fruits et des graines", "80-89"},
 | 
        
           |  |  | 120 | 			{"85: par ex, 50% des fruits matures", "85"},
 | 
        
           |  |  | 121 | 			{"90-99: sénescence et dormance", "90-99"},
 | 
        
           |  |  | 122 | 			{"91: par ex, environ 10% des feuilles jaunes", "91"},
 | 
        
           |  |  | 123 | 			{"95: par ex, environ 50% des feuilles jaunes", "95"}
 | 
        
           |  |  | 124 | 		};
 | 
        
           |  |  | 125 | 		SimpleStore storeAbondance = new SimpleStore(new String[] {"label","valeur"},valeurs);
 | 
        
           |  |  | 126 | 		storeAbondance.load();
 | 
        
           |  |  | 127 | 		return storeAbondance;
 | 
        
           |  |  | 128 | 	}
 | 
        
           | 2033 | aurelien | 129 |   | 
        
           |  |  | 130 | 	public static HashMap<String, String> getCorrespondanceGrilleObservationChampsTri() {
 | 
        
           |  |  | 131 | 		HashMap<String, String> correspondances = new HashMap<String, String>();
 | 
        
           |  |  | 132 | 		correspondances.put("etat_observation", "transmission");
 | 
        
           |  |  | 133 | 		correspondances.put("referentiel_taxo_observation", "nom_referentiel");
 | 
        
           |  |  | 134 | 		correspondances.put("nomSaisi_observation", "nom_sel");
 | 
        
           |  |  | 135 | 		correspondances.put("certitude", "certitude");
 | 
        
           |  |  | 136 | 		correspondances.put("nomRetenu_observation", "nom_ret");
 | 
        
           |  |  | 137 | 		correspondances.put("famille_observation", "famille");
 | 
        
           |  |  | 138 | 		correspondances.put("abondance", "abondance");
 | 
        
           |  |  | 139 | 		correspondances.put("phenologie", "phenologie");
 | 
        
           |  |  | 140 | 		correspondances.put("etat_observation", "transmission");
 | 
        
           |  |  | 141 | 		correspondances.put("lieu", "ce_zone_geo");
 | 
        
           |  |  | 142 | 		correspondances.put("altitude_observation", "altitude");
 | 
        
           |  |  | 143 | 		correspondances.put("date_observation", "date_observation");
 | 
        
           |  |  | 144 | 		correspondances.put("ordre_observation", "ordre");
 | 
        
           |  |  | 145 |   | 
        
           |  |  | 146 | 		return correspondances;
 | 
        
           |  |  | 147 | 	}
 | 
        
           | 1489 | aurelien | 148 | }
 |