Author: vjrj_ Date: 2011-06-24 18:50:59 +0200 (Fri, 24 Jun 2011) New Revision: 1416 Modified: trunk/.classpath trunk/.project trunk/pom.xml trunk/script/repopubli.sh trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java trunk/src/main/java/cc/kune/wave/client/WebClient.java trunk/src/main/java/cc/kune/wave/client/WebClient.ui.xml trunk/src/main/java/cc/kune/wave/server/CustomWaveClientServlet.java trunk/src/main/java/cc/kune/wave/server/WaveMain.java Log: wave code updated (with several fixes) Modified: trunk/.classpath =================================================================== --- trunk/.classpath 2011-06-24 01:51:23 UTC (rev 1415) +++ trunk/.classpath 2011-06-24 16:50:59 UTC (rev 1416) @@ -11,15 +11,18 @@ <classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/> <classpathentry kind="var" path="M2_REPO/com/google/appengine/appengine-api-1.0-sdk/1.3.1/appengine-api-1.0-sdk-1.3.1.jar"/> <classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.0-SNAPSHOT/box-src-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.1-SNAPSHOT/box-0.3.1-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.1-SNAPSHOT/box-src-0.3.1-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/> <classpathentry kind="var" path="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1.jar" sourcepath="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.0-SNAPSHOT/client-common-src-0.3.0-SNAPSHOT.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.0-SNAPSHOT/client-scheduler-src-0.3.0-SNAPSHOT.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.0-SNAPSHOT/client-src-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.1-SNAPSHOT/client-0.3.1-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.1-SNAPSHOT/client-common-0.3.1-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.1-SNAPSHOT/client-common-src-0.3.1-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.1-SNAPSHOT/client-scheduler-src-0.3.1-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.1-SNAPSHOT/client-src-0.3.1-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/org/cobogw/gwt/cobogw/1.3.1/cobogw-1.3.1.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.0-SNAPSHOT/common-src-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.1-SNAPSHOT/common-src-0.3.1-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar"/> <classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2-sources.jar"/> <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar"/> @@ -29,8 +32,8 @@ <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1.jar" sourcepath="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5-sources.jar"/> <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.0-SNAPSHOT/communication-src-0.3.0-SNAPSHOT.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.0-SNAPSHOT/concurrencycontrol-src-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.1-SNAPSHOT/communication-src-0.3.1-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.1-SNAPSHOT/concurrencycontrol-src-0.3.1-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/crawl_htmlunit/r5662-gae/crawl_htmlunit-r5662-gae.jar"/> <classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar" sourcepath="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-sources.jar"/> <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/> @@ -40,7 +43,7 @@ <classpathentry kind="var" path="M2_REPO/com/calclab/emite/emite-proxy/0.1/emite-proxy-0.1.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/ezmorph/ezmorph/1.0.3/ezmorph-1.0.3.jar" sourcepath="M2_REPO/net/sf/ezmorph/ezmorph/1.0.3/ezmorph-1.0.3-sources.jar"/> <classpathentry kind="var" path="M2_REPO/freemarker/freemarker/2.3.8/freemarker-2.3.8.jar"/> - <classpathentry kind="var" path="M2_REPO/com/google/guava/guava-gwt/r07/guava-gwt-r07.jar"/> + <classpathentry kind="var" path="M2_REPO/com/google/guava/guava-gwt/r09/guava-gwt-r09.jar"/> <classpathentry kind="var" path="M2_REPO/com/google/inject/guice/3.0-rc2/guice-3.0-rc2.jar" sourcepath="M2_REPO/com/google/inject/guice/3.0-rc2/guice-3.0-rc2-sources.jar"/> <classpathentry kind="var" path="M2_REPO/com/google/inject/extensions/guice-assisted-inject/2.0/guice-assisted-inject-2.0.jar"/> <classpathentry kind="var" path="M2_REPO/com/google/inject/extensions/guice-persist/3.0-rc2/guice-persist-3.0-rc2.jar" sourcepath="M2_REPO/com/google/inject/extensions/guice-persist/3.0-rc2/guice-persist-3.0-rc2-sources.jar"/> @@ -50,7 +53,7 @@ <classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/log/gwt-log/gwt-log/3.0.1/gwt-log-3.0.1.jar"/> <classpathentry kind="var" path="M2_REPO/com/google/gwt/gwt-servlet/2.1.1/gwt-servlet-2.1.1.jar" sourcepath="M2_REPO/com/google/gwt/gwt-servlet/2.1.1/gwt-servlet-2.1.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1.jar" sourcepath="M2_REPO/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.0-SNAPSHOT/gwt-util-src-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.1-SNAPSHOT/gwt-util-src-0.3.1-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/voices/gwt-voices/gwt-voices/2.0.0/gwt-voices-2.0.0.jar"/> <classpathentry kind="var" path="M2_REPO/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar"/> <classpathentry kind="var" path="M2_REPO/com/gwtextux/gwtextux/0.4.0.924/gwtextux-0.4.0.924.jar"/> @@ -81,7 +84,7 @@ <classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.7/htmlunit-core-js-2.7.jar" sourcepath="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.7/htmlunit-core-js-2.7-sources.jar"/> <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.4.GA/javassist-3.4.GA.jar"/> <classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/beust/jcommander/1.5/jcommander-1.5.jar" sourcepath="M2_REPO/com/beust/jcommander/1.5/jcommander-1.5-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/beust/jcommander/1.12/jcommander-1.12.jar" sourcepath="M2_REPO/com/beust/jcommander/1.12/jcommander-1.12-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/codehaus/jettison/jettison/1.0-RC2/jettison-1.0-RC2.jar" sourcepath="M2_REPO/org/codehaus/jettison/jettison/1.0-RC2/jettison-1.0-RC2-sources.jar"/> <classpathentry kind="var" path="M2_REPO/jmagick/jmagick/6.2.6-0/jmagick-6.2.6-0.jar"/> <classpathentry kind="var" path="M2_REPO/net/java/dev/jna/jna/3.2.2/jna-3.2.2.jar" sourcepath="M2_REPO/net/java/dev/jna/jna/3.2.2/jna-3.2.2-sources.jar"/> @@ -92,7 +95,7 @@ <classpathentry kind="var" path="M2_REPO/net/sourceforge/findbugs/jsr-305/v0r47/jsr-305-v0r47.jar" sourcepath="M2_REPO/net/sourceforge/findbugs/jsr-305/v0r47/jsr-305-v0r47-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/hibernate/jtidy/r8-20060801/jtidy-r8-20060801.jar"/> <classpathentry kind="var" path="M2_REPO/org/jukito/jukito/1.0/jukito-1.0.jar" sourcepath="M2_REPO/org/jukito/jukito/1.0/jukito-1.0-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar" sourcepath="M2_REPO/junit/junit/4.8.1/junit-4.8.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.2/junit-4.8.2.jar" sourcepath="M2_REPO/junit/junit/4.8.2/junit-4.8.2-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/liquibase/liquibase-core/1.7.0/liquibase-core-1.7.0.jar"/> <classpathentry kind="var" path="M2_REPO/org/liquibase/liquibase-plugin/1.7.0.0/liquibase-plugin-1.7.0.0.jar"/> <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar" sourcepath="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar"/> @@ -105,15 +108,15 @@ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.0-SNAPSHOT/media-src-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.1-SNAPSHOT/media-src-0.3.1-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.jar" sourcepath="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.0-SNAPSHOT/model-src-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.1-SNAPSHOT/model-src-0.3.1-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/mysql/mysql-connector-java/5.1.13/mysql-connector-java-5.1.13.jar"/> <classpathentry kind="var" path="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.14/nekohtml-1.9.14.jar" sourcepath="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.14/nekohtml-1.9.14-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0.jar" sourcepath="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.0-SNAPSHOT/proto-msg-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.1-SNAPSHOT/proto-msg-0.3.1-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar" sourcepath="M2_REPO/org/w3c/css/sac/1.3/sac-1.3-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium/2.0a4/selenium-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium/2.0a4/selenium-2.0a4-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.0a4/selenium-chrome-driver-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.0a4/selenium-chrome-driver-2.0a4-sources.jar"/> @@ -130,11 +133,12 @@ <classpathentry kind="var" path="M2_REPO/jivesoftware/smack/3.1.0/smack-3.1.0.jar"/> <classpathentry kind="var" path="M2_REPO/jivesoftware/smackx/3.1.0/smackx-3.1.0.jar"/> <classpathentry kind="var" path="M2_REPO/org/jivesoftware/smackx/debugger/smackx-debugger/3.0.4/smackx-debugger-3.0.4.jar"/> + <classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar" sourcepath="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6-sources.jar"/> <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/> - <classpathentry kind="var" path="M2_REPO/org/testng/testng/5.14/testng-5.14.jar" sourcepath="M2_REPO/org/testng/testng/5.14/testng-5.14-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.0-SNAPSHOT/util-src-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/testng/testng/6.0.1/testng-6.0.1.jar" sourcepath="M2_REPO/org/testng/testng/6.0.1/testng-6.0.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.1-SNAPSHOT/util-src-0.3.1-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.0-SNAPSHOT/waveinabox-server-0.3-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.1-SNAPSHOT/waveinabox-server-0.3-0.3.1-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar" sourcepath="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/> <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/> Modified: trunk/.project =================================================================== --- trunk/.project 2011-06-24 01:51:23 UTC (rev 1415) +++ trunk/.project 2011-06-24 16:50:59 UTC (rev 1416) @@ -1,66 +1,46 @@ -<?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name>kune</name> - <comment>kune free/open/libre collaboration platform. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>com.google.gdt.eclipse.core.webAppProjectValidator</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.google.gwt.eclipse.core.gwtProjectValidator</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.wst.common.project.facet.core.builder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.wst.validation.validationbuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.instantiations.assist.eclipse.coverage.instrumentationBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.recommenders.rcp.analysis.RecommendersBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.wst.common.project.facet.core.nature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> - <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> - <nature>org.eclipse.ajdt.ui.ajnature</nature> - <nature>com.google.gwt.eclipse.core.gwtNature</nature> - <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature> - <nature>com.instantiations.assist.eclipse.coverage.codeCoverageNature</nature> - <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature> - <nature>org.eclipse.recommenders.rcp.analysis.RecommendersNature</nature> - </natures> -</projectDescription> + <name>kune</name> + <comment>kune free/open/libre collaboration platform. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> + <projects/> + <buildSpec> + <buildCommand> + <name>com.google.gdt.eclipse.core.webAppProjectValidator</name> + </buildCommand> + <buildCommand> + <name>com.google.gwt.eclipse.core.gwtProjectValidator</name> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + </buildCommand> + <buildCommand> + <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name> + </buildCommand> + <buildCommand> + <name>com.instantiations.assist.eclipse.coverage.instrumentationBuilder</name> + </buildCommand> + <buildCommand> + <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name> + </buildCommand> + <buildCommand> + <name>org.eclipse.recommenders.rcp.analysis.RecommendersBuilder</name> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + <nature>org.eclipse.ajdt.ui.ajnature</nature> + <nature>com.google.gwt.eclipse.core.gwtNature</nature> + <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature> + <nature>com.instantiations.assist.eclipse.coverage.codeCoverageNature</nature> + <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature> + <nature>org.eclipse.recommenders.rcp.analysis.RecommendersNature</nature> + </natures> +</projectDescription> \ No newline at end of file Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2011-06-24 01:51:23 UTC (rev 1415) +++ trunk/pom.xml 2011-06-24 16:50:59 UTC (rev 1416) @@ -547,72 +547,87 @@ <dependency> <groupId>org.waveprotocol</groupId> <artifactId>waveinabox-server-0.3</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> <artifactId>proto-msg</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> <artifactId>gwt-util-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava-gwt</artifactId> - <version>r07</version> + <version>r09</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> + <artifactId>box</artifactId> + <version>0.3.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.waveprotocol</groupId> <artifactId>box-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> <artifactId>model-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> + <artifactId>client</artifactId> + <version>0.3.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.waveprotocol</groupId> <artifactId>client-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> + <artifactId>client-common</artifactId> + <version>0.3.1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.waveprotocol</groupId> <artifactId>client-common-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> <artifactId>common-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> <artifactId>util-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> <artifactId>concurrencycontrol-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> <artifactId>client-scheduler-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> <artifactId>media-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.waveprotocol</groupId> <artifactId>communication-src</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.3.1-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.findbugs</groupId> Modified: trunk/script/repopubli.sh =================================================================== --- trunk/script/repopubli.sh 2011-06-24 01:51:23 UTC (rev 1415) +++ trunk/script/repopubli.sh 2011-06-24 16:50:59 UTC (rev 1416) @@ -47,5 +47,5 @@ -Dversion=$VER \ -Dpackaging=$PACKAGING \ -Dfile=$JAR \ - -Durl=scpexe://kune.ourproject.org/home/groups/kune/htdocs/mavenrepo/ \ + -Durl=scpexe://ourproject.org/home/groups/kune/htdocs/mavenrepo/ \ -DrepositoryId=kune.ourproject.org Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java =================================================================== --- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java 2011-06-24 01:51:23 UTC (rev 1415) +++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java 2011-06-24 16:50:59 UTC (rev 1416) @@ -212,7 +212,7 @@ waveHolder.getElement().appendChild(loading); final Element holder = waveHolder.getElement().appendChild(Document.get().createDivElement()); final StagesProvider wave = new StagesProvider(holder, waveHolder, waveRef, channel, idGenerator, - profiles, waveStore, isNewWave); + profiles, waveStore, isNewWave, org.waveprotocol.box.webclient.client.Session.get().getDomain()); this.wave = wave; wave.load(new Command() { @Override Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java =================================================================== --- trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-06-24 01:51:23 UTC (rev 1415) +++ trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-06-24 16:50:59 UTC (rev 1416) @@ -196,49 +196,34 @@ // Please also see WebClientDemo.gwt.xml. private static final Logger REMOTE_LOG = Logger.getLogger("REMOTE_LOG"); - /** - * Returns <code>ws://yourhost[:port]/</code>. - */ - // XXX check formatting wrt GPE - public native static String getWebSocketBaseUrl(String moduleBase) /*-{ - return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/"; - }-*/; + // TODO (Yuri Z.) Change the implementation to RemoteProfileManagerImpl when + // it will be ready. + private final ProfileManager profiles = new ProfileManagerImpl(); - public native static boolean useSocketIO() /*-{ - return !!$wnd.__useSocketIO - }-*/; + @UiField + SplitLayoutPanel splitPanel; - private RemoteViewServiceMultiplexer channel; - private final EventBus eventBus; - private IdGenerator idGenerator; - private final Element loading = new LoadingIndicator().getElement(); + @UiField + Style style; - private ParticipantId loggedInUser; - @UiField - DebugMessagePanel logPanel; + FramedPanel waveFrame; - private final ProfileManager profiles = new ProfileManagerImpl(Session.get().getDomain()); + ImplPanel waveHolder; + private final Element loading = new LoadingIndicator().getElement(); + @UiField(provided = true) final SearchPanelWidget searchPanel = new SearchPanelWidget(new SearchPanelRenderer(profiles)); @UiField - SplitLayoutPanel splitPanel; + DebugMessagePanel logPanel; - @UiField - Style style; - /** The wave panel, if a wave is open. */ private StagesProvider wave; -@UiField -FramedPanel waveFrame; - - ImplPanel waveHolder; - private final WaveStore waveStore = new SimpleWaveStore(); /** @@ -246,6 +231,12 @@ */ private WaveWebSocketClient websocket; + private ParticipantId loggedInUser; + + private IdGenerator idGenerator; + + private RemoteViewServiceMultiplexer channel; + /** * This is the entry point method. */ @@ -279,7 +270,7 @@ setupUi(); - // History.fireCurrentHistoryState(); + // History.fireCurrentHistoryState(); LOG.info("SimpleWebClient.onModuleLoad() done"); } @@ -328,7 +319,19 @@ return websocket; } /** + * Returns <code>ws://yourhost[:port]/</code>. */ + // XXX check formatting wrt GPE + private native String getWebSocketBaseUrl(String moduleBase) /*-{ + return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/"; + }-*/; + + private native boolean useSocketIO() /*-{ + return !!$wnd.__useSocketIO + }-*/; + + /** + */ private void loginToServer() { assert loggedInUser != null; channel = new RemoteViewServiceMultiplexer(websocket, loggedInUser.getAddress()); @@ -369,7 +372,7 @@ waveHolder.getElement().appendChild(loading); final Element holder = waveHolder.getElement().appendChild(Document.get().createDivElement()); final StagesProvider wave = new StagesProvider( - holder, waveHolder, waveRef, channel, idGenerator, profiles, waveStore, isNewWave); + holder, waveHolder, waveRef, channel, idGenerator, profiles, waveStore, isNewWave, Session.get().getDomain()); this.wave = wave; wave.load(new Command() { @Override @@ -426,17 +429,18 @@ private void setupSearchPanel() { // On wave selection, fire an event. - final SearchPresenter.WaveSelectionHandler selectHandler = + SearchPresenter.WaveSelectionHandler selectHandler = new SearchPresenter.WaveSelectionHandler() { @Override - public void onWaveSelected(final WaveId id) { + public void onWaveSelected(WaveId id) { ClientEvents.get().fireEvent(new WaveSelectionEvent(WaveRef.of(id))); } }; - final Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore); - SearchPresenter.create(search, searchPanel, selectHandler); + Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore); + SearchPresenter.create(search, searchPanel, selectHandler, profiles); } + private void setupUi() { // Set up UI final DockLayoutPanel self = BINDER.createAndBindUi(this); Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.ui.xml =================================================================== --- trunk/src/main/java/cc/kune/wave/client/WebClient.ui.xml 2011-06-24 01:51:23 UTC (rev 1415) +++ trunk/src/main/java/cc/kune/wave/client/WebClient.ui.xml 2011-06-24 16:50:59 UTC (rev 1416) @@ -22,20 +22,19 @@ } .splitPanel { - } @external gwt-SplitLayoutPanel-HDragger; @external gwt-SplitLayoutPanel-VDragger; - .splitPanel .gwt-SplitLayoutPanel-HDragger,.splitPanel .gwt-SplitLayoutPanel-VDragger - { + .splitPanel .gwt-SplitLayoutPanel-HDragger,.splitPanel .gwt-SplitLayoutPanel-VDragger { background-color: rootBackground; } - .searchPanel { /* - * GWT's drag panel separators are already huge, so no margin needed on - * sides that have drag panels. - */ + .searchPanel { + /* + * GWT's drag panel separators are already huge, so no margin needed on + * sides that have drag panels. + */ margin: gap 0 0 gap; } @@ -46,10 +45,11 @@ margin: 0 gap gap gap; } - .wavePanel { /* - * GWT's drag panel separators are already huge, so no margin needed on - * sides that have drag panels. - */ + .wavePanel { + /* + * GWT's drag panel separators are already huge, so no margin needed on + * sides that have drag panels. + */ margin: gap 0 0 0; } @@ -63,19 +63,15 @@ </ui:style> <g:DockLayoutPanel unit="PX" styleName="{style.root}"> <g:center> - <g:SplitLayoutPanel ui:field="splitPanel" - stylePrimaryName="{style.splitPanel}"> + <g:SplitLayoutPanel ui:field="splitPanel" stylePrimaryName="{style.splitPanel}"> <g:south size="200"> - <d:DebugMessagePanel ui:field="logPanel" - addStyleNames="{style.debugPanel}" /> + <d:DebugMessagePanel ui:field="logPanel" addStyleNames="{style.debugPanel}" /> </g:south> <g:west size="400"> - <s:SearchPanelWidget ui:field="searchPanel" - addStyleNames="{style.searchPanel}" /> + <s:SearchPanelWidget ui:field="searchPanel" addStyleNames="{style.searchPanel}"/> </g:west> <g:center> - <f:FramedPanel ui:field="waveFrame" - addStyleNames="{style.wavePanel}"> + <f:FramedPanel ui:field="waveFrame" addStyleNames="{style.wavePanel}"> <!-- <w:ImplPanel ui:field="waveHolder" addStyleNames="{style.waveHolder}" /> --> </f:FramedPanel> Modified: trunk/src/main/java/cc/kune/wave/server/CustomWaveClientServlet.java =================================================================== --- trunk/src/main/java/cc/kune/wave/server/CustomWaveClientServlet.java 2011-06-24 01:51:23 UTC (rev 1415) +++ trunk/src/main/java/cc/kune/wave/server/CustomWaveClientServlet.java 2011-06-24 16:50:59 UTC (rev 1416) @@ -23,6 +23,7 @@ import java.util.Enumeration; import java.util.HashMap; +import javax.inject.Singleton; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -45,7 +46,6 @@ import com.google.common.collect.Maps; import com.google.gxp.base.GxpContext; import com.google.inject.Inject; -import com.google.inject.Singleton; import com.google.inject.name.Named; /** Modified: trunk/src/main/java/cc/kune/wave/server/WaveMain.java =================================================================== --- trunk/src/main/java/cc/kune/wave/server/WaveMain.java 2011-06-24 01:51:23 UTC (rev 1415) +++ trunk/src/main/java/cc/kune/wave/server/WaveMain.java 2011-06-24 16:50:59 UTC (rev 1416) @@ -19,8 +19,17 @@ package cc.kune.wave.server; +import java.io.IOException; +import java.util.Collections; +import java.util.Map; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServlet; + import org.apache.commons.configuration.ConfigurationException; -import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlets.ProxyServlet; import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolWaveClientRpc; import org.waveprotocol.box.server.CoreSettings; @@ -37,11 +46,14 @@ import org.waveprotocol.box.server.robots.RobotApiModule; import org.waveprotocol.box.server.robots.RobotRegistrationServlet; import org.waveprotocol.box.server.robots.active.ActiveApiServlet; +import org.waveprotocol.box.server.robots.agent.passwd.PasswordAdminRobot; +import org.waveprotocol.box.server.robots.agent.passwd.PasswordRobot; import org.waveprotocol.box.server.robots.dataapi.DataApiOAuthServlet; import org.waveprotocol.box.server.robots.dataapi.DataApiServlet; import org.waveprotocol.box.server.robots.passive.RobotsGateway; import org.waveprotocol.box.server.rpc.AttachmentServlet; import org.waveprotocol.box.server.rpc.AuthenticationServlet; +import org.waveprotocol.box.server.rpc.FetchProfilesServlet; import org.waveprotocol.box.server.rpc.FetchServlet; import org.waveprotocol.box.server.rpc.SearchServlet; import org.waveprotocol.box.server.rpc.ServerRpcProvider; @@ -62,9 +74,12 @@ import com.google.gwt.logging.server.RemoteLoggingServiceImpl; import com.google.inject.Guice; +import com.google.inject.Inject; import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.Module; +import com.google.inject.Singleton; +import com.google.inject.name.Named; import com.google.inject.name.Names; /** @@ -72,66 +87,40 @@ */ public class WaveMain { - /** - * This is the name of the system property used to find the server config file. - */ - private static final String PROPERTIES_FILE_KEY = "wave.server.config"; + @SuppressWarnings("serial") + @Singleton + public static class GadgetProxyServlet extends HttpServlet { - private static final Log LOG = Log.get(WaveMain.class); + ProxyServlet.Transparent proxyServlet; - public static void main(String... args) { - try { - Module coreSettings = SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, CoreSettings.class); - run(coreSettings); - return; - } catch (PersistenceException e) { - LOG.severe("PersistenceException when running server:", e); - } catch (ConfigurationException e) { - LOG.severe("ConfigurationException when running server:", e); - } catch (WaveServerException e) { - LOG.severe("WaveServerException when running server:", e); + @Inject + public GadgetProxyServlet(@Named(CoreSettings.GADGET_SERVER_HOSTNAME) final String gadgetServerHostname, + @Named(CoreSettings.GADGET_SERVER_PORT) final int gadgetServerPort){ + + LOG.info("Starting GadgetProxyServlet for " + gadgetServerHostname + ":" + gadgetServerPort); + proxyServlet = new ProxyServlet.Transparent("/gadgets", "http", gadgetServerHostname, + gadgetServerPort,"/gadgets"); } - } - public static void run(Module coreSettings) throws PersistenceException, - ConfigurationException, WaveServerException { - Injector settingsInjector = Guice.createInjector(coreSettings); - boolean enableFederation = settingsInjector.getInstance(Key.get(Boolean.class, - Names.named(CoreSettings.ENABLE_FEDERATION))); - - if (enableFederation) { - Module federationSettings = - SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, FederationSettings.class); - // This MUST happen first, or bindings will fail if federation is enabled. - settingsInjector = settingsInjector.createChildInjector(federationSettings); + @Override + public void init(final ServletConfig config) throws ServletException { + proxyServlet.init(config); } - Module federationModule = buildFederationModule(settingsInjector, enableFederation); - PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class); - Injector injector = - settingsInjector.createChildInjector(new ServerModule(enableFederation), - new RobotApiModule(), federationModule, persistenceModule); - - ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class); - WaveBus waveBus = injector.getInstance(WaveBus.class); - - String domain = - injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN))); - if (!ParticipantIdUtil.isDomainAddress(ParticipantIdUtil.makeDomainAddress(domain))) { - throw new WaveServerException("Invalid wave domain: " + domain); + @Override + public void service(final ServletRequest req, final ServletResponse res) throws ServletException, IOException { + proxyServlet.service(req, res); } + } - initializeServer(injector, domain); - initializeServlets(injector, server); - initializeRobots(injector, waveBus); - initializeFrontend(injector, server, waveBus); - initializeFederation(injector); + private static final Log LOG = Log.get(WaveMain.class); - LOG.info("Starting server"); - server.startWebSocketServer(injector); - } + /** + * This is the name of the system property used to find the server config file. + */ + private static final String PROPERTIES_FILE_KEY = "wave.server.config"; - private static Module buildFederationModule(Injector settingsInjector, boolean enableFederation) + private static Module buildFederationModule(final Injector settingsInjector, final boolean enableFederation) throws ConfigurationException { Module federationModule; if (enableFederation) { @@ -142,78 +131,132 @@ return federationModule; } - private static void initializeServer(Injector injector, String waveDomain) + private static void initializeFederation(final Injector injector) { + final FederationTransport federationManager = injector.getInstance(FederationTransport.class); + federationManager.startFederation(); + } + + private static void initializeFrontend(final Injector injector, final ServerRpcProvider server, + final WaveBus waveBus) throws WaveServerException { + final HashedVersionFactory hashFactory = injector.getInstance(HashedVersionFactory.class); + + final WaveletProvider provider = injector.getInstance(WaveletProvider.class); + final ClientFrontend frontend = + ClientFrontendImpl.create(hashFactory, provider, waveBus); + + final ProtocolWaveClientRpc.Interface rpcImpl = WaveClientRpcImpl.create(frontend, false); + server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl)); + } + + private static void initializeRobotAgents(final Injector injector, final ServerRpcProvider server) { + final PasswordRobot passRobot = new PasswordRobot(injector); + final PasswordAdminRobot passAdminRobot = new PasswordAdminRobot(injector); + injector.injectMembers(passRobot); + server.addServlet(PasswordRobot.ROBOT_URI + "/*", passRobot); + server.addServlet(PasswordAdminRobot.ROBOT_URI + "/*", passAdminRobot); + } + + private static void initializeRobots(final Injector injector, final WaveBus waveBus) { + final RobotsGateway robotsGateway = injector.getInstance(RobotsGateway.class); + waveBus.subscribe(robotsGateway); + } + + private static void initializeServer(final Injector injector, final String waveDomain) throws PersistenceException, WaveServerException { - AccountStore accountStore = injector.getInstance(AccountStore.class); + final AccountStore accountStore = injector.getInstance(AccountStore.class); accountStore.initializeAccountStore(); AccountStoreHolder.init(accountStore, waveDomain); // Initialize the SignerInfoStore. - CertPathStore certPathStore = injector.getInstance(CertPathStore.class); + final CertPathStore certPathStore = injector.getInstance(CertPathStore.class); if (certPathStore instanceof SignerInfoStore) { ((SignerInfoStore)certPathStore).initializeSignerInfoStore(); } // Initialize the server. - WaveletProvider waveServer = injector.getInstance(WaveletProvider.class); + final WaveletProvider waveServer = injector.getInstance(WaveletProvider.class); waveServer.initialize(); } - private static void initializeServlets(Injector injector, ServerRpcProvider server) { + private static void initializeServlets(final Injector injector, final ServerRpcProvider server) { server.addServlet("/attachment/*", injector.getInstance(AttachmentServlet.class)); - server.addServlet(SessionManager.SIGN_IN_URL, - injector.getInstance(AuthenticationServlet.class)); + server.addServlet(SessionManager.SIGN_IN_URL, injector.getInstance(AuthenticationServlet.class)); server.addServlet("/auth/signout", injector.getInstance(SignOutServlet.class)); server.addServlet("/auth/register", injector.getInstance(UserRegistrationServlet.class)); - server.addServlet("/fetch/*", injector.getInstance(FetchServlet.class)); - server.addServlet("/search/*", injector.getInstance(SearchServlet.class)); server.addServlet("/robot/dataapi", injector.getInstance(DataApiServlet.class)); - server.addServlet(DataApiOAuthServlet.DATA_API_OAUTH_PATH + "/*", - injector.getInstance(DataApiOAuthServlet.class)); + server.addServlet(DataApiOAuthServlet.DATA_API_OAUTH_PATH + "/*", injector.getInstance(DataApiOAuthServlet.class)); server.addServlet("/robot/dataapi/rpc", injector.getInstance(DataApiServlet.class)); server.addServlet("/robot/register/*", injector.getInstance(RobotRegistrationServlet.class)); server.addServlet("/robot/rpc", injector.getInstance(ActiveApiServlet.class)); + server.addServlet("/webclient/remote_logging", injector.getInstance(RemoteLoggingServiceImpl.class)); + server.addServlet("/profile/*", injector.getInstance(FetchProfilesServlet.class)); - String gadgetServerHostname =injector.getInstance(Key.get(String.class, - Names.named(CoreSettings.GADGET_SERVER_HOSTNAME))); - int gadgetServerPort = - injector.getInstance(Key.get(int.class, Names.named(CoreSettings.GADGET_SERVER_PORT))); - String gadgetServerPath = - injector.getInstance(Key.get(String.class, Names.named(CoreSettings.GADGET_SERVER_PATH))); - ProxyServlet.Transparent proxyServlet = - new ProxyServlet.Transparent("/gadgets", "http", gadgetServerHostname,gadgetServerPort, - gadgetServerPath); - ServletHolder proxyServletHolder = server.addServlet("/gadgets/*", proxyServlet); - proxyServletHolder.setInitParameter("HostHeader", gadgetServerHostname); - - server.addServlet("/webclient/remote_logging", - injector.getInstance(RemoteLoggingServiceImpl.class)); - // server.addServlet("/", injector.getInstance(WaveClientServlet.class)); + final String gadgetHostName = + injector + .getInstance(Key.get(String.class, Names.named(CoreSettings.GADGET_SERVER_HOSTNAME))); + final int port = + injector.getInstance(Key.get(Integer.class, Names.named(CoreSettings.GADGET_SERVER_PORT))); + final Map<String, String> initParams = + Collections.singletonMap("HostHeader", gadgetHostName + ":" + port); + server.addServlet("/gadgets/*", injector.getInstance(GadgetProxyServlet.class), initParams); + + //server.addServlet("/", injector.getInstance(WaveClientServlet.class)); } - private static void initializeRobots(Injector injector, WaveBus waveBus) { - RobotsGateway robotsGateway = injector.getInstance(RobotsGateway.class); - waveBus.subscribe(robotsGateway); + public static void main(final String... args) { + try { + final Module coreSettings = SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, CoreSettings.class); + run(coreSettings); + return; + } catch (final PersistenceException e) { + LOG.severe("PersistenceException when running server:", e); + } catch (final ConfigurationException e) { + LOG.severe("ConfigurationException when running server:", e); + } catch (final WaveServerException e) { + LOG.severe("WaveServerException when running server:", e); + } } - private static void initializeFrontend(Injector injector, ServerRpcProvider server, - WaveBus waveBus) throws WaveServerException { - HashedVersionFactory hashFactory = injector.getInstance(HashedVersionFactory.class); - - WaveletProvider provider = injector.getInstance(WaveletProvider.class); - ClientFrontend frontend = - ClientFrontendImpl.create(hashFactory, provider, waveBus); + public static void run(final Module coreSettings) throws PersistenceException, + ConfigurationException, WaveServerException { + Injector settingsInjector = Guice.createInjector(coreSettings); + final boolean enableFederation = settingsInjector.getInstance(Key.get(Boolean.class, + Names.named(CoreSettings.ENABLE_FEDERATION))); - ProtocolWaveClientRpc.Interface rpcImpl = WaveClientRpcImpl.create(frontend, false); - server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl)); - } + if (enableFederation) { + final Module federationSettings = + SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, FederationSettings.class); + // This MUST happen first, or bindings will fail if federation is enabled. + settingsInjector = settingsInjector.createChildInjector(federationSettings); + } - private static void initializeFederation(Injector injector) { - FederationTransport federationManager = injector.getInstance(FederationTransport.class); - federationManager.startFederation(); + final Module federationModule = buildFederationModule(settingsInjector, enableFederation); + final PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class); + final Injector injector = + settingsInjector.createChildInjector(new ServerModule(enableFederation), + new RobotApiModule(), federationModule, persistenceModule); + + final ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class); + final WaveBus waveBus = injector.getInstance(WaveBus.class); + + final String domain = + injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN))); + if (!ParticipantIdUtil.isDomainAddress(ParticipantIdUtil.makeDomainAddress(domain))) { + throw new WaveServerException("Invalid wave domain: " + domain); + } + + initializeServer(injector, domain); + initializeServlets(injector, server); + initializeRobotAgents(injector, server); + initializeRobots(injector, waveBus); + initializeFrontend(injector, server, waveBus); + initializeFederation(injector); + + LOG.info("Starting server"); + server.startWebSocketServer(injector); } }