Author: norman
Date: Mon Sep  7 12:38:19 2009
New Revision: 812113

URL: http://svn.apache.org/viewvc?rev=812113&view=rev
Log:
Add support of configurable location of server's configuration file. Used the 
patch of Manuel Carrasco (thank you) as basis and modified the patch to work os 
independent and look for the config under /path/to/webapp/WEB-INF/config/. 
(LABS-434)

Added:
    labs/hupa/trunk/README.txt
    labs/hupa/trunk/server/src/main/webapp/
    labs/hupa/trunk/server/src/main/webapp/WEB-INF/
    labs/hupa/trunk/server/src/main/webapp/WEB-INF/conf/
    labs/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties
    labs/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/
    
labs/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java
Removed:
    labs/hupa/trunk/client/src/main/resources/config.properties
    labs/hupa/trunk/server/src/main/resources/
Modified:
    labs/hupa/trunk/   (props changed)
    labs/hupa/trunk/.classpath
    labs/hupa/trunk/.settings/org.maven.ide.eclipse.prefs
    labs/hupa/trunk/client/pom.xml
    
labs/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/MyGuiceServletConfig.java
    
labs/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java
    labs/hupa/trunk/war/hupa/hupa.nocache.js

Propchange: labs/hupa/trunk/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep  7 12:38:19 2009
@@ -0,0 +1 @@
+target

Modified: labs/hupa/trunk/.classpath
URL: 
http://svn.apache.org/viewvc/labs/hupa/trunk/.classpath?rev=812113&r1=812112&r2=812113&view=diff
==============================================================================
--- labs/hupa/trunk/.classpath (original)
+++ labs/hupa/trunk/.classpath Mon Sep  7 12:38:19 2009
@@ -1,14 +1,13 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="src" output="shared/target/classes" 
path="shared/src/main/java"/>
-       <classpathentry kind="src" output="server/war/WEB-INF/classes" 
path="server/src/main/java"/>
-       <classpathentry excluding="**" kind="src" 
output="server/war/WEB-INF/classes" path="server/src/main/resources"/>
-       <classpathentry kind="src" output="server/target/test-classes" 
path="server/src/test/java"/>
-       <classpathentry kind="src" output="widgets/target/classes" 
path="widgets/src/main/java"/>
-       <classpathentry kind="src" output="client/war/WEB-INF/classes" 
path="client/src/main/java"/>
-       <classpathentry kind="src" path="client/src/main/resources"/>
-       <classpathentry kind="con" 
path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
-       <classpathentry kind="con" 
path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
-       <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-       <classpathentry kind="output" path="war/WEB-INF/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="shared/target/classes" 
path="shared/src/main/java"/>
+       <classpathentry kind="src" output="server/war/WEB-INF/classes" 
path="server/src/main/java"/>
+       <classpathentry kind="src" output="server/target/test-classes" 
path="server/src/test/java"/>
+       <classpathentry kind="src" output="widgets/target/classes" 
path="widgets/src/main/java"/>
+       <classpathentry kind="src" output="client/war/WEB-INF/classes" 
path="client/src/main/java"/>
+       <classpathentry excluding="**" kind="src" 
output="client/war/WEB-INF/classes" path="client/src/main/resources"/>
+       <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" 
path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
+       <classpathentry kind="con" 
path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>

Modified: labs/hupa/trunk/.settings/org.maven.ide.eclipse.prefs
URL: 
http://svn.apache.org/viewvc/labs/hupa/trunk/.settings/org.maven.ide.eclipse.prefs?rev=812113&r1=812112&r2=812113&view=diff
==============================================================================
--- labs/hupa/trunk/.settings/org.maven.ide.eclipse.prefs (original)
+++ labs/hupa/trunk/.settings/org.maven.ide.eclipse.prefs Mon Sep  7 12:38:19 
2009
@@ -1,9 +1,9 @@
-#Sun Aug 30 16:46:41 CEST 2009
-activeProfiles=
-eclipse.preferences.version=1
-fullBuildGoals=process-test-resources
-includeModules=true
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-skipCompilerPlugin=true
-version=1
+#Mon Sep 07 08:09:58 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=true
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1

Added: labs/hupa/trunk/README.txt
URL: 
http://svn.apache.org/viewvc/labs/hupa/trunk/README.txt?rev=812113&view=auto
==============================================================================
--- labs/hupa/trunk/README.txt (added)
+++ labs/hupa/trunk/README.txt Mon Sep  7 12:38:19 2009
@@ -0,0 +1,14 @@
+###### Bulding ######
+Hupa use maven2 as build tool. To build hupa download maven2 
(http://maven.apache.org), unpack maven2 and install it.
+After that change to hupa directory and execute the following cmd:
+
+* mvn clean package
+
+
+
+###### Eclipse GWT Plugin notes ################
+
+If you want to run hupa in hosted mode be sure to add the following line as 
"vm argument" in the Run configuration:
+
+-Dhupa.config.file=${project_loc}/server/src/main/webapp/WEB-INF/conf/config.properties
+

Modified: labs/hupa/trunk/client/pom.xml
URL: 
http://svn.apache.org/viewvc/labs/hupa/trunk/client/pom.xml?rev=812113&r1=812112&r2=812113&view=diff
==============================================================================
--- labs/hupa/trunk/client/pom.xml (original)
+++ labs/hupa/trunk/client/pom.xml Mon Sep  7 12:38:19 2009
@@ -45,6 +45,11 @@
                                                                
<exclude>**/hupa/*</exclude>
                                                        </excludes>
                                                </resource>
+                                               <!-- this is a ugly hack but 
I'm not sure howto solve it -->
+                                               <!-- This take care of 
including the config file within the war -->
+                                               <resource>
+                                                       
<directory>../server/src/main/webapp/</directory>
+                                               </resource>
                                        </webResources>
                                        <warName>${project.name}</warName>
                                </configuration>

Modified: 
labs/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/MyGuiceServletConfig.java
URL: 
http://svn.apache.org/viewvc/labs/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/MyGuiceServletConfig.java?rev=812113&r1=812112&r2=812113&view=diff
==============================================================================
--- 
labs/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/MyGuiceServletConfig.java
 (original)
+++ 
labs/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/MyGuiceServletConfig.java
 Mon Sep  7 12:38:19 2009
@@ -20,6 +20,9 @@
 package org.apache.hupa.server.guice;
 
 
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.servlet.GuiceServletContextListener;
@@ -32,9 +35,22 @@
  */
 public class MyGuiceServletConfig extends GuiceServletContextListener{
 
+       private ServletContext context;
+       @Override
+       public void contextDestroyed(ServletContextEvent servletContextEvent) {
+               context = null;
+               super.contextDestroyed(servletContextEvent);
+       }
+
+       @Override
+       public void contextInitialized(ServletContextEvent servletContextEvent) 
{
+               context = servletContextEvent.getServletContext();
+               super.contextInitialized(servletContextEvent);
+       }
+
        @Override
        protected Injector getInjector() {
-               return Guice.createInjector(new ServerModul(),new 
DispatchServletModule());
+               return Guice.createInjector(new 
ServerModul(context.getRealPath("/")),new DispatchServletModule());
        }
 
 }

Modified: 
labs/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java
URL: 
http://svn.apache.org/viewvc/labs/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java?rev=812113&r1=812112&r2=812113&view=diff
==============================================================================
--- 
labs/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java
 (original)
+++ 
labs/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/ServerModul.java
 Mon Sep  7 12:38:19 2009
@@ -19,7 +19,8 @@
 
 package org.apache.hupa.server.guice;
 
-import java.net.URL;
+import java.io.File;
+import java.io.FileInputStream;
 import java.util.Properties;
 
 import javax.mail.Session;
@@ -33,11 +34,11 @@
 import org.apache.hupa.server.handler.CreateFolderHandler;
 import org.apache.hupa.server.handler.DeleteFolderHandler;
 import org.apache.hupa.server.handler.DeleteMessageHandler;
-import org.apache.hupa.server.handler.GetMessageDetailsHandler;
 import org.apache.hupa.server.handler.FetchFoldersHandler;
 import org.apache.hupa.server.handler.FetchMessagesHandler;
 import org.apache.hupa.server.handler.FetchRecentMessagesHandler;
 import org.apache.hupa.server.handler.ForwardMessageHandler;
+import org.apache.hupa.server.handler.GetMessageDetailsHandler;
 import org.apache.hupa.server.handler.GetRawMessageHandler;
 import org.apache.hupa.server.handler.LoginSessionHandler;
 import org.apache.hupa.server.handler.LoginUserHandler;
@@ -58,12 +59,23 @@
 /**
  * Module which binds the handlers and configurations
  * 
- * @author norman
- *
+ * 
  */
-public class ServerModul extends ActionHandlerModule{
+public class ServerModul extends ActionHandlerModule {
 
+       public static final String SYS_PROP_CONFIG_FILE = "hupa.config.file";
+
+       public static final String[] CONFIG_PROPERTIES = {
+                       System.getenv("HOME") + "/.hupa/config.properties",
+                       "/etc/default/hupa", "config.properties" };
+       public static final String CONF_DIR = "WEB-INF" + File.separator + 
"conf" + File.separator;
+
+       private String configDir;
        
+       public ServerModul(String rootPath) {
+               configDir = rootPath + File.separator + CONF_DIR;
+       }
+
        @Override
        protected void configureHandlers() {
                bindHandler(LoginUserHandler.class);
@@ -85,11 +97,13 @@
                bindHandler(TagMessagesHandler.class);
                bindHandler(GetRawMessageHandler.class);
                bind(FileItemRegistry.class).in(Singleton.class);
-               
bind(IMAPStoreCache.class).to(InMemoryIMAPStoreCache.class).in(Singleton.class);
+               bind(IMAPStoreCache.class).to(InMemoryIMAPStoreCache.class).in(
+                               Singleton.class);
                
bind(Log.class).toProvider(LogProvider.class).in(Singleton.class);
-               
bind(Settings.class).toProvider(DefaultUserSettingsProvider.class).in(Singleton.class);
+               
bind(Settings.class).toProvider(DefaultUserSettingsProvider.class).in(
+                               Singleton.class);
                bind(DownloadAttachmentServlet.class).in(Singleton.class);
-               bind(UploadAttachmentServlet.class).in(Singleton.class);        
+               bind(UploadAttachmentServlet.class).in(Singleton.class);
                bind(Session.class).toProvider(SessionProvider.class);
                // bind addresses and ports for imap and smtp
                Properties properties;
@@ -98,20 +112,52 @@
                        Names.bindProperties(binder(), properties);
 
                } catch (Exception e) {
-                       throw new RuntimeException("Unable to to configure",e);
+                       throw new RuntimeException("Unable to to configure", e);
                }
        }
-       
-       private Properties loadProperties() throws Exception {
-               Properties properties = new Properties();
-               String name = "config.properties";
- 
-               ClassLoader loader = ServerModul.class.getClassLoader();
-               URL url = loader.getResource(name);
-               if ( url == null ) {
-                       url = loader.getResource("/"+name);
+
+       protected Properties loadProperties() throws Exception {
+               Properties properties = null;
+
+               String fileName = System.getProperty(SYS_PROP_CONFIG_FILE);
+               if (fileName != null) {
+                       properties = loadProperties(fileName);
                }
-               properties.load(url.openStream());
+
+               if (properties == null) {
+                       for (String name : CONFIG_PROPERTIES) {
+                       
+                               properties = loadProperties(name);
+                               if (properties != null)
+                                       break;
+                       }
+               }
+
+               return properties;
+       }
+
+       protected Properties loadProperties(String name) {
+
+               if (name == null)
+                       return null;
+
+               Properties properties = null;
+               File file = new File(name);
+               
+               // check if the file is absolute. If not prefix it with the 
default config dir
+               if (file.isAbsolute() == false) {
+                       file = new File(configDir + File.separator + 
file.getName());
+               }
+               if (file.exists()) {
+                       try {
+                               properties = new Properties();
+                               properties.load(new FileInputStream(file));
+                       } catch (Exception e) {
+                               properties = null;      
+                               e.printStackTrace();
+                       }
+               }
+
                return properties;
        }
 

Added: labs/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties
URL: 
http://svn.apache.org/viewvc/labs/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties?rev=812113&view=auto
==============================================================================
--- labs/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties 
(added)
+++ labs/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties Mon 
Sep  7 12:38:19 2009
@@ -0,0 +1,25 @@
+# The IP or domainname of the IMAP server
+IMAPServerAddress=imap.gmail.com
+# The port of the IMAP server
+IMAPServerPort=993
+# Use SSL/TLS to connect to the IMAP server
+IMAPS=true
+
+# For gmail change this to [GMail]\Sent
+DefaultSentFolder=Sent
+# For gmail change this to [GMail]\Trash
+DefaultTrashFolder=Trash
+
+DefaultInboxFolder=INBOX
+
+# Number of Messages to post fetch
+PostFetchMessageCount=0
+
+# The IP or domainname of the SMTP server
+SMTPServerAddress=smtp.gmail.com
+# The port of the SMTP server
+SMTPServerPort=465
+# Use AUTH for SMTP
+SMTPAuth=true
+# Use SSL/TLS to connect to the SMTP server
+SMTPS=true

Added: 
labs/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java
URL: 
http://svn.apache.org/viewvc/labs/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java?rev=812113&view=auto
==============================================================================
--- 
labs/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java
 (added)
+++ 
labs/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java
 Mon Sep  7 12:38:19 2009
@@ -0,0 +1,80 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.hupa.server.guice;
+
+import java.io.File;
+import java.util.Properties;
+
+import junit.framework.Assert;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ServerModulTest {
+       private String tmpDir = System.getProperty("java.io.tmpdir");
+       private ServerModul module = new ServerModul(tmpDir);
+
+       @Before
+       public void setUp() {
+               // create config directory
+               File f = new File(tmpDir + File.separator + 
ServerModul.CONF_DIR);
+               f.delete();
+               f.deleteOnExit();
+               f.mkdirs();
+       }
+       
+       @Test
+       public void testLoadProperties() throws Exception {
+
+               String fileName = tmpDir + File.separator +"foo.properties";
+               File file = new File(fileName);
+               file.createNewFile();
+               Properties p = module.loadProperties(fileName);
+               Assert.assertNotNull(p);
+               Assert.assertNull(p.get("IMAPServerAddress"));
+               file.delete();
+               
+               // load file from not absolute file
+               fileName = tmpDir + File.separator + ServerModul.CONF_DIR + 
File.separator + "foo2.properties";
+               file = new File(fileName);
+               file.createNewFile();
+               p = module.loadProperties(file.getName());
+               Assert.assertNotNull(p);
+               Assert.assertNull(p.get("IMAPServerAddress"));
+               file.delete();
+       }
+
+       @Test
+       public void testLoadPropertiesWithEmptyFile() throws Exception {
+               File tmp = File.createTempFile("foo", ".properties");
+               tmp.deleteOnExit();
+
+               Properties p = module.loadProperties(tmp.toString());
+               Assert.assertNotNull(p);
+               Assert.assertNull(p.get("IMAPServerAddress"));
+
+               System.setProperty(ServerModul.SYS_PROP_CONFIG_FILE, 
tmp.toString());
+               p = module.loadProperties();
+               Assert.assertNotNull(p);
+               Assert.assertNull(p.get("IMAPServerAddress"));
+               System.clearProperty(ServerModul.SYS_PROP_CONFIG_FILE);
+
+       }
+
+}

Modified: labs/hupa/trunk/war/hupa/hupa.nocache.js
URL: 
http://svn.apache.org/viewvc/labs/hupa/trunk/war/hupa/hupa.nocache.js?rev=812113&r1=812112&r2=812113&view=diff
==============================================================================
--- labs/hupa/trunk/war/hupa/hupa.nocache.js (original)
+++ labs/hupa/trunk/war/hupa/hupa.nocache.js Mon Sep  7 12:38:19 2009
@@ -1,10 +1,12 @@
-function hupa(){var l='',F='" for "gwt:onLoadErrorFn"',D='" for 
"gwt:onPropertyErrorFn"',n='"><\/script>',p='#',r='/',Cb='<script 
defer="defer">hupa.onInjectionDone(\'hupa\')<\/script>',ac='<script 
id="',A='=',q='?',C='Bad handler "',Bb='DOMContentLoaded',sb="GWT module 'hupa' 
needs to be (re)compiled, please run a compile or use the Compile/Browse button 
in hosted 
mode",o='SCRIPT',Fb='__gwt_marker_hupa',s='base',nb='begin',cb='bootstrap',Ab='cbg_button.css',u='clear.cache.gif',z='content',Eb='end',lb='gecko',mb='gecko1_8',yb='gwt.hybrid',tb='gwt/standard/standard.css',E='gwt:onLoadErrorFn',B='gwt:onPropertyErrorFn',y='gwt:property',zb='head',qb='hosted.html?hupa',xb='href',m='hupa',kb='ie6',ab='iframe',t='img',bb="javascript:''",ub='link',pb='loadExternalRefs',v='meta',eb='moduleRequested',Db='moduleStartup',jb='msie',w='name',gb='opera',db='position:absolute;width:0;height:0;border:none',vb='rel',ib='safari',rb='selectingPermutation',x='startup',wb='stylesheet',ob='unknown
 ',fb='user.agent',hb='webkit';var 
cc=window,k=document,bc=cc.__gwtStatsEvent?function(a){return 
cc.__gwtStatsEvent(a)}:null,wc,mc,hc,gc=l,pc={},zc=[],vc=[],fc=[],sc,uc;bc&&bc({moduleName:m,subSystem:x,evtGroup:cb,millis:(new
 
Date()).getTime(),type:nb});if(!cc.__gwt_stylesLoaded){cc.__gwt_stylesLoaded={}}if(!cc.__gwt_scriptsLoaded){cc.__gwt_scriptsLoaded={}}function
 lc(){var 
b=false;try{b=cc.external&&(cc.external.gwtOnLoad&&cc.location.search.indexOf(yb)==-1)}catch(a){}lc=function(){return
 b};return b}
-function oc(){if(wc&&mc){var c=k.getElementById(m);var 
b=c.contentWindow;if(lc()){b.__gwt_getProperty=function(a){return 
ic(a)}}hupa=null;b.gwtOnLoad(sc,m,gc);bc&&bc({moduleName:m,subSystem:x,evtGroup:Db,millis:(new
 Date()).getTime(),type:Eb})}}
-function jc(){var 
j,h=Fb,i;k.write(ac+h+n);i=k.getElementById(h);j=i&&i.previousSibling;while(j&&j.tagName!=o){j=j.previousSibling}function
 f(b){var a=b.lastIndexOf(p);if(a==-1){a=b.length}var 
c=b.indexOf(q);if(c==-1){c=b.length}var d=b.lastIndexOf(r,Math.min(c,a));return 
d>=0?b.substring(0,d+1):l}
-;if(j&&j.src){gc=f(j.src)}if(gc==l){var 
e=k.getElementsByTagName(s);if(e.length>0){gc=e[e.length-1].href}else{gc=f(k.location.href)}}else
 if(gc.match(/^\w+:\/\//)){}else{var 
g=k.createElement(t);g.src=gc+u;gc=f(g.src)}if(i){i.parentNode.removeChild(i)}}
-function tc(){var f=document.getElementsByTagName(v);for(var 
d=0,g=f.length;d<g;++d){var 
e=f[d],h=e.getAttribute(w),b;if(h){if(h==y){b=e.getAttribute(z);if(b){var 
i,c=b.indexOf(A);if(c>=0){h=b.substring(0,c);i=b.substring(c+1)}else{h=b;i=l}pc[h]=i}}else
 if(h==B){b=e.getAttribute(z);if(b){try{uc=eval(b)}catch(a){alert(C+b+D)}}}else 
if(h==E){b=e.getAttribute(z);if(b){try{sc=eval(b)}catch(a){alert(C+b+F)}}}}}}
-function ic(d){var e=vc[d](),b=zc[d];if(e in b){return e}var a=[];for(var c in 
b){a[b[c]]=c}if(uc){uc(d,a,e)}throw null}
-var kc;function nc(){if(!kc){kc=true;var 
a=k.createElement(ab);a.src=bb;a.id=m;a.style.cssText=db;a.tabIndex=-1;k.body.appendChild(a);bc&&bc({moduleName:m,subSystem:x,evtGroup:Db,millis:(new
 Date()).getTime(),type:eb});a.contentWindow.location.replace(gc+xc)}}
-vc[fb]=function(){var d=navigator.userAgent.toLowerCase();var 
b=function(a){return 
parseInt(a[1])*1000+parseInt(a[2])};if(d.indexOf(gb)!=-1){return gb}else 
if(d.indexOf(hb)!=-1){return ib}else if(d.indexOf(jb)!=-1){var c=/msie 
([0-9]+)\.([0-9]+)/.exec(d);if(c&&c.length==3){if(b(c)>=6000){return kb}}}else 
if(d.indexOf(lb)!=-1){var 
c=/rv:([0-9]+)\.([0-9]+)/.exec(d);if(c&&c.length==3){if(b(c)>=1008)return 
mb}return lb}return 
ob};zc[fb]={gecko:0,gecko1_8:1,ie6:2,opera:3,safari:4};hupa.onScriptLoad=function(){if(kc){mc=true;oc()}};hupa.onInjectionDone=function(){wc=true;bc&&bc({moduleName:m,subSystem:x,evtGroup:pb,millis:(new
 Date()).getTime(),type:Eb});oc()};jc();var 
xc;if(lc()){if(cc.external.initModule&&cc.external.initModule(m)){cc.location.reload();return}xc=qb}tc();bc&&bc({moduleName:m,subSystem:x,evtGroup:cb,millis:(new
 Date()).getTime(),type:rb});if(!xc){try{alert(sb);return}catch(a){return}}var 
rc;function qc(){if(!hc){hc=true;if(!__gwt_stylesLoaded[tb]){var a=k.createEl
 
ement(ub);__gwt_stylesLoaded[tb]=a;a.setAttribute(vb,wb);a.setAttribute(xb,gc+tb);k.getElementsByTagName(zb)[0].appendChild(a)}if(!__gwt_stylesLoaded[Ab]){var
 
a=k.createElement(ub);__gwt_stylesLoaded[Ab]=a;a.setAttribute(vb,wb);a.setAttribute(xb,gc+Ab);k.getElementsByTagName(zb)[0].appendChild(a)}oc();if(k.removeEventListener){k.removeEventListener(Bb,qc,false)}if(rc){clearInterval(rc)}}}
-if(k.addEventListener){k.addEventListener(Bb,function(){nc();qc()},false)}var 
rc=setInterval(function(){if(/loaded|complete/.test(k.readyState)){nc();qc()}},50);bc&&bc({moduleName:m,subSystem:x,evtGroup:cb,millis:(new
 
Date()).getTime(),type:Eb});bc&&bc({moduleName:m,subSystem:x,evtGroup:pb,millis:(new
 Date()).getTime(),type:nb});k.write(Cb)}
+function hupa(){var l='',F='" for "gwt:onLoadErrorFn"',D='" for 
"gwt:onPropertyErrorFn"',n='"><\/script>',p='#',hb='&',r='/',gc='<script 
defer="defer">hupa.onInjectionDone(\'hupa\')<\/script>',jc='<script 
id="',A='=',q='?',C='Bad handler "',fc='DOMContentLoaded',Bb="GWT module 'hupa' 
needs to be (re)compiled, please run a compile or use the Compile/Browse button 
in hosted mode",o='SCRIPT',lb='Unexpected exception in locale detection, using 
default: 
',kb='_',ib='__gwt_Locale',ic='__gwt_marker_hupa',s='base',nb='begin',cb='bootstrap',cc='cbg_button.css',u='clear.cache.gif',z='content',jb='default',hc='end',ub='gecko',vb='gecko1_8',ec='gwt-dnd.css',yb='gwt.hybrid',Cb='gwt/standard/standard.css',E='gwt:onLoadErrorFn',B='gwt:onPropertyErrorFn',y='gwt:property',bc='head',zb='hosted.html?hupa',ac='href',m='hupa',tb='ie6',sb='ie8',ab='iframe',t='img',bb="javascript:''",Db='link',xb='loadExternalRefs',fb='locale',gb='locale=',v='meta',eb='moduleRequested',dc='moduleStartup',rb='msie'
 
,w='name',ob='opera',db='position:absolute;width:0;height:0;border:none',Eb='rel',qb='safari',Ab='selectingPermutation',x='startup',Fb='stylesheet',wb='unknown',mb='user.agent',pb='webkit';var
 lc=window,k=document,kc=lc.__gwtStatsEvent?function(a){return 
lc.__gwtStatsEvent(a)}:null,Fc,vc,qc,pc=l,yc={},cd=[],Ec=[],oc=[],Bc,Dc;kc&&kc({moduleName:m,subSystem:x,evtGroup:cb,millis:(new
 
Date()).getTime(),type:nb});if(!lc.__gwt_stylesLoaded){lc.__gwt_stylesLoaded={}}if(!lc.__gwt_scriptsLoaded){lc.__gwt_scriptsLoaded={}}function
 uc(){var 
b=false;try{b=lc.external&&(lc.external.gwtOnLoad&&lc.location.search.indexOf(yb)==-1)}catch(a){}uc=function(){return
 b};return b}
+function xc(){if(Fc&&vc){var c=k.getElementById(m);var 
b=c.contentWindow;if(uc()){b.__gwt_getProperty=function(a){return 
rc(a)}}hupa=null;b.gwtOnLoad(Bc,m,pc);kc&&kc({moduleName:m,subSystem:x,evtGroup:dc,millis:(new
 Date()).getTime(),type:hc})}}
+function sc(){var 
j,h=ic,i;k.write(jc+h+n);i=k.getElementById(h);j=i&&i.previousSibling;while(j&&j.tagName!=o){j=j.previousSibling}function
 f(b){var a=b.lastIndexOf(p);if(a==-1){a=b.length}var 
c=b.indexOf(q);if(c==-1){c=b.length}var d=b.lastIndexOf(r,Math.min(c,a));return 
d>=0?b.substring(0,d+1):l}
+;if(j&&j.src){pc=f(j.src)}if(pc==l){var 
e=k.getElementsByTagName(s);if(e.length>0){pc=e[e.length-1].href}else{pc=f(k.location.href)}}else
 if(pc.match(/^\w+:\/\//)){}else{var 
g=k.createElement(t);g.src=pc+u;pc=f(g.src)}if(i){i.parentNode.removeChild(i)}}
+function Cc(){var f=document.getElementsByTagName(v);for(var 
d=0,g=f.length;d<g;++d){var 
e=f[d],h=e.getAttribute(w),b;if(h){if(h==y){b=e.getAttribute(z);if(b){var 
i,c=b.indexOf(A);if(c>=0){h=b.substring(0,c);i=b.substring(c+1)}else{h=b;i=l}yc[h]=i}}else
 if(h==B){b=e.getAttribute(z);if(b){try{Dc=eval(b)}catch(a){alert(C+b+D)}}}else 
if(h==E){b=e.getAttribute(z);if(b){try{Bc=eval(b)}catch(a){alert(C+b+F)}}}}}}
+function nc(a,b){return b in cd[a]}
+function mc(a){var b=yc[a];return b==null?null:b}
+function rc(d){var e=Ec[d](),b=cd[d];if(e in b){return e}var a=[];for(var c in 
b){a[b[c]]=c}if(Dc){Dc(d,a,e)}throw null}
+var tc;function wc(){if(!tc){tc=true;var 
a=k.createElement(ab);a.src=bb;a.id=m;a.style.cssText=db;a.tabIndex=-1;k.body.appendChild(a);kc&&kc({moduleName:m,subSystem:x,evtGroup:dc,millis:(new
 Date()).getTime(),type:eb});a.contentWindow.location.replace(pc+ad)}}
+Ec[fb]=function(){try{var g;if(g==null){var b=location.search;var 
h=b.indexOf(gb);if(h>=0){var e=b.substring(h);var c=e.indexOf(A)+1;var 
d=e.indexOf(hb);if(d==-1){d=e.length}g=e.substring(c,d)}}if(g==null){g=mc(fb)}if(g==null){g=lc[ib]}if(g==null){return
 jb}while(!nc(fb,g)){var 
f=g.lastIndexOf(kb);if(f==-1){g=jb;break}else{g=g.substring(0,f)}}return 
g}catch(a){alert(lb+a);return 
jb}};cd[fb]={de:0,'default':1,en:2};Ec[mb]=function(){var 
d=navigator.userAgent.toLowerCase();var b=function(a){return 
parseInt(a[1])*1000+parseInt(a[2])};if(d.indexOf(ob)!=-1){return ob}else 
if(d.indexOf(pb)!=-1){return qb}else 
if(d.indexOf(rb)!=-1){if(document.documentMode>=8){return sb}else{var c=/msie 
([0-9]+)\.([0-9]+)/.exec(d);if(c&&c.length==3){var e=b(c);if(e>=6000){return 
tb}}}}else if(d.indexOf(ub)!=-1){var 
c=/rv:([0-9]+)\.([0-9]+)/.exec(d);if(c&&c.length==3){if(b(c)>=1008)return 
vb}return ub}return 
wb};cd[mb]={gecko:0,gecko1_8:1,ie6:2,ie8:3,opera:4,safari:5};hupa.onScriptLoad=function(){if
 
(tc){vc=true;xc()}};hupa.onInjectionDone=function(){Fc=true;kc&&kc({moduleName:m,subSystem:x,evtGroup:xb,millis:(new
 Date()).getTime(),type:hc});xc()};sc();var 
ad;if(uc()){if(lc.external.initModule&&lc.external.initModule(m)){lc.location.reload();return}ad=zb}Cc();kc&&kc({moduleName:m,subSystem:x,evtGroup:cb,millis:(new
 Date()).getTime(),type:Ab});if(!ad){try{alert(Bb);return}catch(a){return}}var 
Ac;function zc(){if(!qc){qc=true;if(!__gwt_stylesLoaded[Cb]){var 
a=k.createElement(Db);__gwt_stylesLoaded[Cb]=a;a.setAttribute(Eb,Fb);a.setAttribute(ac,pc+Cb);k.getElementsByTagName(bc)[0].appendChild(a)}if(!__gwt_stylesLoaded[cc]){var
 
a=k.createElement(Db);__gwt_stylesLoaded[cc]=a;a.setAttribute(Eb,Fb);a.setAttribute(ac,pc+cc);k.getElementsByTagName(bc)[0].appendChild(a)}if(!__gwt_stylesLoaded[ec]){var
 
a=k.createElement(Db);__gwt_stylesLoaded[ec]=a;a.setAttribute(Eb,Fb);a.setAttribute(ac,pc+ec);k.getElementsByTagName(bc)[0].appendChild(a)}xc();if(k.removeEventListener){k.removeEven
 tListener(fc,zc,false)}if(Ac){clearInterval(Ac)}}}
+if(k.addEventListener){k.addEventListener(fc,function(){wc();zc()},false)}var 
Ac=setInterval(function(){if(/loaded|complete/.test(k.readyState)){wc();zc()}},50);kc&&kc({moduleName:m,subSystem:x,evtGroup:cb,millis:(new
 
Date()).getTime(),type:hc});kc&&kc({moduleName:m,subSystem:x,evtGroup:xb,millis:(new
 Date()).getTime(),type:nb});k.write(gc)}
 hupa();
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to