Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1966 Rev 1967
Line 1... Line 1...
1
package org.tela_botanica.client.modeles.objets;
1
package org.tela_botanica.client.modeles.objets;
Line 2... Line 2...
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
-
 
4
import java.util.HashMap;
4
import java.util.HashMap;
5
import java.util.Iterator;
5
import java.util.List;
6
import java.util.List;
Line 6... Line 7...
6
import java.util.Map;
7
import java.util.Map;
-
 
8
 
-
 
9
import com.google.gwt.i18n.client.Dictionary;
-
 
10
import com.google.gwt.json.client.JSONObject;
7
 
11
import com.google.gwt.json.client.JSONParser;
8
import com.google.gwt.i18n.client.Dictionary;
12
import com.google.gwt.json.client.JSONValue;
Line 9... Line 13...
9
import com.google.gwt.user.client.Window;
13
import com.google.gwt.user.client.Window;
10
import com.google.gwt.user.client.Window.Location;
14
import com.google.gwt.user.client.Window.Location;
Line 57... Line 61...
57
	
61
	
Line 58... Line 62...
58
	private static String tailleMaxUpload;
62
	private static String tailleMaxUpload;
Line -... Line 63...
-
 
63
	
-
 
64
	private static List<InfosReferentielNom> referentielsDispos; 
59
	
65
	
Line 60... Line 66...
60
	private static List<InfosReferentielNom> referentielsDispos; 
66
	private static Map<String,HashMap<String, String>> groupesChampsEtendus; 
61
	
67
	
62
	private static String activerSaisieChampsEtendus = "0";
68
	private static String activerSaisieChampsEtendus = "0";
Line 127... Line 133...
127
					activerSaisieChampsEtendus = "1";
133
					activerSaisieChampsEtendus = "1";
128
				} else if(Location.getParameter("activerSaisieChampsEtendus").equals("0")) {
134
				} else if(Location.getParameter("activerSaisieChampsEtendus").equals("0")) {
129
					activerSaisieChampsEtendus = "0";
135
					activerSaisieChampsEtendus = "0";
130
				} 
136
				} 
131
			}
137
			}
-
 
138
			
-
 
139
			groupesChampsEtendus =  new HashMap<String,HashMap<String, String>>(); 
-
 
140
			if(activerSaisieChampsEtendus.equals("1")) {
-
 
141
				if(Dictionary.getDictionary("configuration").get("groupesChampsEtendus") != null &&
-
 
142
						!Dictionary.getDictionary("configuration").get("groupesChampsEtendus").isEmpty()) {
-
 
143
					groupesChampsEtendus = parserGroupesChampsEtendus(Dictionary.getDictionary("configuration").get(
-
 
144
							"groupesChampsEtendus"));
-
 
145
				}
-
 
146
			}
-
 
147
	}
-
 
148
	
-
 
149
	private HashMap<String,HashMap<String, String>> parserGroupesChampsEtendus(String groupeChampsEtendusJson) {
-
 
150
		HashMap<String,HashMap<String, String>> groupesChampsEtendus = new HashMap<String,HashMap<String, String>>();
-
 
151
		try {
-
 
152
			JSONValue groupesJson = JSONParser.parse(groupeChampsEtendusJson);
-
 
153
			JSONObject groupes = groupesJson.isObject();
-
 
154
			
-
 
155
			for (Iterator<String> iterator = groupes.keySet().iterator(); iterator.hasNext();) {
-
 
156
				String groupe = iterator.next();
-
 
157
				JSONValue listeClesLabelsJson = groupes.get(groupe);
-
 
158
				JSONObject listeClesLabels = listeClesLabelsJson.isObject();
-
 
159
				HashMap<String, String> groupesClesLabel = new HashMap<String, String>();
-
 
160
				for (Iterator<String> itCleLabels = listeClesLabels.keySet().iterator(); itCleLabels.hasNext();) {
-
 
161
					String cle = itCleLabels.next();
-
 
162
					String label = listeClesLabels.get(cle).isString().stringValue();	
-
 
163
					groupesClesLabel.put(cle, label);
-
 
164
				}
-
 
165
				groupesChampsEtendus.put(groupe, groupesClesLabel);
-
 
166
			}
-
 
167
		} catch (Exception e) {
-
 
168
			// TODO: handle exception
-
 
169
		}
-
 
170
		
-
 
171
		return groupesChampsEtendus;
132
	}
172
	}
Line 133... Line 173...
133
	
173
	
134
	private List<InfosReferentielNom> parserReferentielsDispos(String chaineListeReferentiels) {
174
	private List<InfosReferentielNom> parserReferentielsDispos(String chaineListeReferentiels) {
135
		String[] tabReferentiels = chaineListeReferentiels.split(";");
175
		String[] tabReferentiels = chaineListeReferentiels.split(";");
Line 245... Line 285...
245
	}
285
	}
Line 246... Line 286...
246
	
286
	
247
	public static boolean saisieChampsEtendusActivee() {
287
	public static boolean saisieChampsEtendusActivee() {
248
		return activerSaisieChampsEtendus.equals("1");
288
		return activerSaisieChampsEtendus.equals("1");
-
 
289
	}
-
 
290
	
-
 
291
	public static Map<String,HashMap<String, String>> getGroupesChampsEtendus() {
-
 
292
		return groupesChampsEtendus;
249
	}
293
	}