Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2617 Rev 2649
Line 1... Line 1...
1
package org.tela_botanica.client;
1
package org.tela_botanica.client;
Line 2... Line 2...
2
 
2
 
3
import org.tela_botanica.client.i18n.Msg;
3
import org.tela_botanica.client.i18n.Msg;
-
 
4
import org.tela_botanica.client.modeles.objets.Configuration;
Line 4... Line 5...
4
import org.tela_botanica.client.modeles.objets.Configuration;
5
import org.tela_botanica.client.util.Util;
5
 
6
 
6
import com.google.gwt.ajaxloader.client.AjaxLoader;
7
import com.google.gwt.ajaxloader.client.AjaxLoader;
-
 
8
import com.google.gwt.ajaxloader.client.AjaxLoader.AjaxLoaderOptions;
-
 
9
import com.google.gwt.core.client.EntryPoint;
7
import com.google.gwt.ajaxloader.client.AjaxLoader.AjaxLoaderOptions;
10
import com.google.gwt.dom.client.Element;
8
import com.google.gwt.core.client.EntryPoint;
11
import com.google.gwt.user.client.DOM;
9
import com.google.gwt.user.client.Timer;
12
import com.google.gwt.user.client.Timer;
10
import com.google.gwt.user.client.Window.Location;
13
import com.google.gwt.user.client.Window.Location;
Line 34... Line 37...
34
					Window.alert(s);
37
					Window.alert(s);
35
					e.printStackTrace();
38
					e.printStackTrace();
36
			}
39
			}
37
		});
40
		});
38
		*/
41
		*/
-
 
42
		
39
		// TODO: config devrait être un singleton
43
		// TODO: config devrait être un singleton
40
		Configuration config = new Configuration();	
44
		Configuration config = new Configuration();	
41
		// Si la langue est précisée dans l'url on la prend, sinon on prend celle par défaut
45
		// Si la langue est précisée dans l'url on la prend, sinon on prend celle par défaut
42
		// @TODO: avertissement si la langue indiquée dans l'url n'est pas la bonne
46
		// @TODO: avertissement si la langue indiquée dans l'url n'est pas la bonne
43
		String langueURL = Location.getParameter("lang");
47
		String langueURL = Location.getParameter("lang");
44
		if (! Msg.init()) {
48
		if (! Msg.init()) {
45
			cel2.LogVersFirebug("La langue par défaut \"" + Msg.getLangueDefaut() + "\" n'a pas pu être chargée");
49
			Util.LogVersFirebug("La langue par défaut \"" + Msg.getLangueDefaut() + "\" n'a pas pu être chargée");
46
		}	
50
		}	
47
		if (langueURL != null && ! langueURL.equals("")) {
51
		if (langueURL != null && ! langueURL.equals("")) {
48
			cel2.LogVersFirebug("Langue passée dans l'URL: " + langueURL);
52
			Util.LogVersFirebug("Langue passée dans l'URL: " + langueURL);
49
			if (! Msg.setLangue(langueURL)) {
53
			if (! Msg.setLangue(langueURL)) {
50
				cel2.LogVersFirebug("La langue demandée \"" + langueURL + "\" n'a pas pu être chargée");
54
				Util.LogVersFirebug("La langue demandée \"" + langueURL + "\" n'a pas pu être chargée");
51
			}
55
			}
52
		}
56
		}
-
 
57
		
-
 
58
		Element elem = DOM.getElementById("texte_chargement");
-
 
59
		elem.setInnerText(Msg.get("chargement"));
Line 53... Line 60...
53
 
60
 
54
		// Chargement de l'api google maps v3 avant l'initialisation pour 
61
		// Chargement de l'api google maps v3 avant l'initialisation pour 
55
		// éviter des "complications"
62
		// éviter des "complications"
56
		// TODO: fabriquer une classe qui cherche dans la config une liste d'api
63
		// TODO: fabriquer une classe qui cherche dans la config une liste d'api
Line 72... Line 79...
72
		carnetEnLigneMediateur.getEtatUtilisateur() ;
79
		carnetEnLigneMediateur.getEtatUtilisateur() ;
Line 73... Line 80...
73
 
80
 
74
		Timer t = new Timer() {
81
		Timer t = new Timer() {
75
			@Override
82
			@Override
76
			public void run() {
83
			public void run() {
77
				 Ext.get("loading").hide();
84
				Ext.get("loading").hide();
78
			}
85
			}
Line 79... Line 86...
79
		};
86
		};
80
		
87
		
81
		t.schedule(3000);
-
 
82
	}
-
 
83
	
-
 
84
	/*private String buildStackTrace(Throwable t, String log) {
-
 
85
	     if (t != null) {
-
 
86
		     log += t.getClass().toString();
-
 
87
		     log += t.getMessage();
-
 
88
		     //
-
 
89
		     StackTraceElement[] stackTrace = t.getStackTrace();
-
 
90
		     if (stackTrace != null) {
-
 
91
		    	 StringBuffer trace = new StringBuffer();
-
 
92
		    
-
 
93
			     for (int i = 0; i < stackTrace.length; i++) {
-
 
94
			    	 trace.append(stackTrace[i].getClassName() + "." + stackTrace[i].getMethodName() + "("
-
 
95
			    			 + stackTrace[i].getFileName() + ":" + stackTrace[i].getLineNumber());
-
 
96
			     }
-
 
97
		    
-
 
98
			     log += trace.toString();
-
 
99
		     }
-
 
100
		     //
-
 
101
		     Throwable cause = t.getCause();
-
 
102
		     if (cause != null && cause != t) {
-
 
103
		    	 log += buildStackTrace(cause, "CausedBy:\n");
-
 
104
		     }
-
 
105
	     }
-
 
106
	     return log;
-
 
107
	}*/
-
 
108
 
-
 
109
	public static native void  LogVersFirebug(Object o) /*-{
-
 
110
		if (!!($wnd.console && $wnd.console.log)) {
-
 
111
			console.log(o);
-
 
112
		}
88
		t.schedule(1500);