[kune-commits] r1240 - in trunk: . src/main/java/cc/kune/core/client/errors src/main/java/cc/kune/wave/client src/main/java/cc/kune/wave/server src/main/java/org/ourproject/kune/platf/server/manager/impl src/main/java/org/ourproject/kune/rack src/main/resources src/main/webapp/WEB-INF

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Mon Feb 7 22:14:55 CET 2011


Author: vjrj_
Date: 2011-02-07 22:14:53 +0100 (Mon, 07 Feb 2011)
New Revision: 1240

Added:
   trunk/src/main/java/cc/kune/core/client/errors/UserRegistrationException.java
Modified:
   trunk/.classpath
   trunk/pom.xml
   trunk/src/main/java/cc/kune/wave/client/WebClient.java
   trunk/src/main/java/cc/kune/wave/server/WaveStarter.java
   trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/UserManagerDefault.java
   trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java
   trunk/src/main/resources/wave-server.properties
   trunk/src/main/webapp/WEB-INF/web.xml
Log:
WIAB integration updated

Modified: trunk/.classpath
===================================================================
--- trunk/.classpath	2011-02-07 17:33:32 UTC (rev 1239)
+++ trunk/.classpath	2011-02-07 21:14:53 UTC (rev 1240)
@@ -6,7 +6,7 @@
   <classpathentry kind="var" path="M2_REPO/javax/inject/javax.inject/1/javax.inject-1.jar" sourcepath="M2_REPO/javax/inject/javax.inject/1/javax.inject-1-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar" sourcepath="M2_REPO/javax/transaction/jta/1.1/jta-1.1-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar" sourcepath="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar" sourcepath="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6-sources.jar"/>
   <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"/>

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2011-02-07 17:33:32 UTC (rev 1239)
+++ trunk/pom.xml	2011-02-07 21:14:53 UTC (rev 1240)
@@ -71,7 +71,7 @@
       <id>cobogw</id>
       <name>Cobogw repository at googlecode</name>
       <url>http://cobogw.googlecode.com/svn/maven2</url>
-    </repository>    
+    </repository>
     <repository>
       <id>gwt-repo</id>
       <url>http://google-web-toolkit.googlecode.com/svn/2.1.0/gwt/maven/</url>
@@ -164,7 +164,7 @@
       </snapshots>
     </pluginRepository>
     <!-- cc -->
-    <!-- <pluginRepository> <id>gwt-maven</id> <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url> 
+    <!-- <pluginRepository> <id>gwt-maven</id> <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
       </pluginRepository> -->
     <pluginRepository>
       <id>Codehaus Snapshots</id>
@@ -248,7 +248,7 @@
       <groupId>org.springframework</groupId>
       <artifactId>spring-web</artifactId>
     </exclusion>
-  </exclusions> 
+  </exclusions>
 </dependency>
     <dependency>
       <groupId>org.adamtacy</groupId>
@@ -297,7 +297,7 @@
       <artifactId>dozer</artifactId>
       <version>4.0</version>
     </dependency>
-    <!-- <dependency> <groupId>com.calclab</groupId> <artifactId>suco</artifactId> 
+    <!-- <dependency> <groupId>com.calclab</groupId> <artifactId>suco</artifactId>
       <version>0.6.5</version> </dependency> -->
     <dependency>
       <groupId>jmagick</groupId>
@@ -394,16 +394,16 @@
       <artifactId>hibernate-tools</artifactId>
       <version>3.2.3.GA</version>
     </dependency>
-		<dependency>
-			    <groupId>org.hibernate</groupId>
-					    <artifactId>hibernate-c3p0</artifactId>
-							    <version>3.3.1.GA</version>
-								</dependency>
-								<!-- <dependency>
+    <dependency>
+          <groupId>org.hibernate</groupId>
+              <artifactId>hibernate-c3p0</artifactId>
+                  <version>3.3.1.GA</version>
+                </dependency>
+                <!-- <dependency>
       <groupId>c3p0</groupId>
       <artifactId>c3p0</artifactId>
       <version>0.9.1.2</version>
-			</dependency> -->
+      </dependency> -->
     <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
@@ -501,7 +501,7 @@
     <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
-      <version>2.4</version>
+      <version>2.5</version>
       <scope>provided</scope>
     </dependency>
     <!-- testing dependencies -->
@@ -732,7 +732,7 @@
         <configuration>
           <source>1.6</source>
           <target>1.6</target>
-          <!-- Uncomment and run mvn with -X -e if we have same compile problems 
+          <!-- Uncomment and run mvn with -X -e if we have same compile problems
             <compilerArgument>-verbose</compilerArgument> <fork>true</fork> <verbose>true</verbose> -->
         </configuration>
       </plugin>
@@ -755,7 +755,7 @@
             <exclude>**/*_Roo_*</exclude>
           </excludes>
           <forkMode>pertest</forkMode>
-          <!-- Skip the normal tests, we'll run them in the integration-test 
+          <!-- Skip the normal tests, we'll run them in the integration-test
             phase -->
           <skip>true</skip>
         </configuration>
@@ -846,11 +846,11 @@
       <!-- gwtp & GenEvent need this plugin -->
       <!-- maybe test: http://mojo.codehaus.org/apt-maven-plugin/index.html -->
       <!-- instead of this: https://code.google.com/p/maven-annotation-plugin/ -->
-      <!-- <plugin> <groupId>org.bsc.maven</groupId> <artifactId>maven-processor-plugin</artifactId> 
-        <version>1.3.7</version> <executions> <execution> <id>process</id> <goals> 
-        <goal>process</goal> </goals> <phase>generate-sources</phase> </execution> 
-        </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>apt-maven-plugin</artifactId> 
-        <version>1.0-alpha-4</version> <executions> <execution> <goals> <goal>process</goal> 
+      <!-- <plugin> <groupId>org.bsc.maven</groupId> <artifactId>maven-processor-plugin</artifactId>
+        <version>1.3.7</version> <executions> <execution> <id>process</id> <goals>
+        <goal>process</goal> </goals> <phase>generate-sources</phase> </execution>
+        </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>apt-maven-plugin</artifactId>
+        <version>1.0-alpha-4</version> <executions> <execution> <goals> <goal>process</goal>
         <goal>test-process</goal> </goals> </execution> </executions> </plugin> -->
       <!-- BETTER user: http://code.google.com/p/acris/wiki/AnnotationProcessing -->
       <plugin>
@@ -882,11 +882,11 @@
           </execution>
         </executions>
       </plugin>
-      <!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>deb-maven-plugin</artifactId> 
-        <version>1.0-SNAPSHOT</version> <configuration> <description>kune free/open/libre 
-        collaboration platform</description> <maintainer>Kune Development Team &lt;kune-devel at lists.ourproject.org&gt;</maintainer> 
-        <section>web</section> <priority>optional</priority> <architecture>all</architecture> 
-        </configuration> <executions> <execution> <goals> <goal>deb</goal> </goals> 
+      <!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>deb-maven-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version> <configuration> <description>kune free/open/libre
+        collaboration platform</description> <maintainer>Kune Development Team &lt;kune-devel at lists.ourproject.org&gt;</maintainer>
+        <section>web</section> <priority>optional</priority> <architecture>all</architecture>
+        </configuration> <executions> <execution> <goals> <goal>deb</goal> </goals>
         </execution> </executions> </plugin> -->
       <plugin>
         <groupId>org.liquibase</groupId>
@@ -904,7 +904,7 @@
               <password>db4kune</password>
               <verbose>true</verbose>
             </configuration>
-            <!-- <configuration> <verbose>true</verbose> <propertiesFile> 
+            <!-- <configuration> <verbose>true</verbose> <propertiesFile>
               src/main/resources/db/liquibase.properties </propertiesFile> </configuration> -->
             <goals>
               <goal>update</goal>
@@ -983,9 +983,9 @@
       <!-- </execution> -->
       <!-- </executions> -->
       <!-- </plugin> -->
-      <!-- <plugin> <artifactId>maven-clean-plugin</artifactId> <version>2.2</version> 
-        <configuration> <filesets> <fileset> <directory>src/main/webapp/gwt/</directory> 
-        <includes> <include>**/org.ourproject.kune.app.Kune*</include> <followSymlinks>false</followSymlinks> 
+      <!-- <plugin> <artifactId>maven-clean-plugin</artifactId> <version>2.2</version>
+        <configuration> <filesets> <fileset> <directory>src/main/webapp/gwt/</directory>
+        <includes> <include>**/org.ourproject.kune.app.Kune*</include> <followSymlinks>false</followSymlinks>
         </includes> </fileset> </filesets> </configuration> </plugin> -->
     </plugins>
     <!-- <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory> -->

Added: trunk/src/main/java/cc/kune/core/client/errors/UserRegistrationException.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/errors/UserRegistrationException.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/errors/UserRegistrationException.java	2011-02-07 21:14:53 UTC (rev 1240)
@@ -0,0 +1,32 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.client.errors;
+
+public class UserRegistrationException extends DefaultException {
+    private static final long serialVersionUID = -4530874249465164135L;
+
+    public UserRegistrationException() {
+        super();
+    }
+
+    public UserRegistrationException(final String msg) {
+        super(msg);
+    }
+}


Property changes on: trunk/src/main/java/cc/kune/core/client/errors/UserRegistrationException.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java	2011-02-07 17:33:32 UTC (rev 1239)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java	2011-02-07 21:14:53 UTC (rev 1240)
@@ -279,7 +279,7 @@
 
         HistorySupport.init();
 
-        websocket = new WaveWebSocketClient(useSocketIO(), getWebSocketBaseUrl(GWT.getModuleBaseURL() + "/wiab/"));
+        websocket = new WaveWebSocketClient(useSocketIO(), getWebSocketBaseUrl(GWT.getModuleBaseURL()));
         websocket.connect();
 
         if (Session.get().isLoggedIn()) {

Modified: trunk/src/main/java/cc/kune/wave/server/WaveStarter.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/WaveStarter.java	2011-02-07 17:33:32 UTC (rev 1239)
+++ trunk/src/main/java/cc/kune/wave/server/WaveStarter.java	2011-02-07 21:14:53 UTC (rev 1240)
@@ -45,7 +45,6 @@
 import org.waveprotocol.box.server.rpc.FetchServlet;
 import org.waveprotocol.box.server.rpc.ServerRpcProvider;
 import org.waveprotocol.box.server.rpc.SignOutServlet;
-import org.waveprotocol.box.server.rpc.UserRegistrationServlet;
 import org.waveprotocol.box.server.rpc.WaveClientServlet;
 import org.waveprotocol.box.server.waveserver.WaveBus;
 import org.waveprotocol.box.server.waveserver.WaveServerException;
@@ -58,6 +57,7 @@
 import org.waveprotocol.wave.model.version.HashedVersionFactory;
 import org.waveprotocol.wave.util.settings.SettingsBinder;
 
+import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Key;
 import com.google.inject.Module;
@@ -121,7 +121,7 @@
 
         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("/auth/register", injector.getInstance(CustomUserRegistrationServlet.class));
 
         server.addServlet("/fetch/*", injector.getInstance(FetchServlet.class));
 
@@ -146,10 +146,9 @@
     public WaveStarter() {
     }
 
-    public Injector run(final Module coreSettings, final Injector parentInjector) throws PersistenceException,
-            ConfigurationException, WaveServerException {
-        // Injector settingsInjector = Guice.createInjector(coreSettings);
-        Injector settingsInjector = parentInjector.createChildInjector(coreSettings);
+    public Injector 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)));
 
@@ -179,10 +178,10 @@
         return injector;
     }
 
-    public Injector runMain(final Injector settingsInjector) {
+    public Injector runMain() {
         try {
             final Module coreSettings = CustomSettingsBinder.bindSettings(PROPERTIES_FILE_KEY, CoreSettings.class);
-            return run(coreSettings, settingsInjector);
+            return run(coreSettings);
         } catch (final PersistenceException e) {
             LOG.error("PersistenceException when running server:", e);
         } catch (final ConfigurationException e) {
@@ -190,6 +189,6 @@
         } catch (final WaveServerException e) {
             LOG.error("WaveServerException when running server:", e);
         }
-        return settingsInjector;
+        return null;
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/UserManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/UserManagerDefault.java	2011-02-07 17:33:32 UTC (rev 1239)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/UserManagerDefault.java	2011-02-07 21:14:53 UTC (rev 1240)
@@ -41,6 +41,7 @@
 import org.waveprotocol.box.server.authentication.PasswordDigest;
 
 import cc.kune.core.client.errors.I18nNotFoundException;
+import cc.kune.core.client.errors.UserRegistrationException;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.domain.I18nCountry;
 import cc.kune.domain.I18nLanguage;
@@ -93,7 +94,10 @@
         }
         final PasswordDigest passwdDigest = new PasswordDigest(passwd.toCharArray());
 
-        waveUserRegister.tryCreateUser(shortName, passwdDigest);
+        final String msg = waveUserRegister.tryCreateUser(shortName, passwdDigest);
+        if (msg != null) {
+            throw new UserRegistrationException(msg);
+        }
         // if (userPropGroup == null) {
         // userPropGroup = propGroupManager.find(User.PROPS_ID);
         // }

Modified: trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java	2011-02-07 17:33:32 UTC (rev 1239)
+++ trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java	2011-02-07 21:14:53 UTC (rev 1240)
@@ -38,7 +38,6 @@
 
 import cc.kune.wave.server.WaveStarter;
 
-import com.google.inject.Guice;
 import com.google.inject.Injector;
 
 public class RackServletFilter implements Filter {
@@ -130,9 +129,8 @@
         final RackBuilder builder = new RackBuilder();
         module.configure(builder);
         final Rack rack = builder.getRack();
-        final Injector parentInjector = Guice.createInjector();
         final WaveStarter waveStarter = new WaveStarter();
-        final Injector waveChildInjector = waveStarter.runMain(parentInjector);
+        final Injector waveChildInjector = waveStarter.runMain();
         final Injector kuneChildInjector = installInjector(filterConfig, rack, waveChildInjector);
         startContainerListeners(rack.getListeners(), kuneChildInjector);
         docks = rack.getDocks();

Modified: trunk/src/main/resources/wave-server.properties
===================================================================
--- trunk/src/main/resources/wave-server.properties	2011-02-07 17:33:32 UTC (rev 1239)
+++ trunk/src/main/resources/wave-server.properties	2011-02-07 21:14:53 UTC (rev 1240)
@@ -9,7 +9,7 @@
 http_frontend_public_address = localhost:9898
 http_frontend_addresses = ${http_frontend_public_address}
 http_baseurl = /
-resource_base = ./target/kune-0.0.7/
+resource_base = ../kune-0.0.7/
 
 ### Server-specific variables
 ###

Modified: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml	2011-02-07 17:33:32 UTC (rev 1239)
+++ trunk/src/main/webapp/WEB-INF/web.xml	2011-02-07 21:14:53 UTC (rev 1240)
@@ -18,6 +18,33 @@
   <welcome-file-list>
     <welcome-file>ws.html</welcome-file>
   </welcome-file-list>
+
+  <!-- Wave proxies ========================================================================================= -->
+  <filter>
+    <filter-name>JettyContinuationFilter</filter-name>
+    <filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class>
+  </filter>
+  <filter-mapping>
+    <filter-name>JettyContinuationFilter</filter-name>
+    <url-pattern>/attachment/*</url-pattern>
+    <url-pattern>/auth/signin</url-pattern>
+    <url-pattern>/auth/signout</url-pattern>
+    <url-pattern>/auth/register</url-pattern>
+    <url-pattern>/fetch/*</url-pattern>
+    <url-pattern>/robot/dataapi</url-pattern>
+    <url-pattern>/robot/dataapi/oauth/*</url-pattern>
+    <url-pattern>/robot/dataapi/rpc</url-pattern>
+    <url-pattern>/robot/register/*</url-pattern>
+    <url-pattern>/robot/rpc</url-pattern>
+    <url-pattern>/gadgets</url-pattern>
+    <url-pattern>/gadgets/*</url-pattern>
+    <url-pattern>/socket.io/*</url-pattern>
+    <url-pattern>/socket</url-pattern>
+    <url-pattern>/static/*</url-pattern>
+    <url-pattern>/webclient/*</url-pattern>
+    <!-- <url-pattern>/*</url-pattern> -->
+  </filter-mapping>
+
   <!-- JRuby servlets ======================================================================================= -->
   <!-- Note: this gives problems depending on the version of jetty or tomcat -->
   <context-param>




More information about the kune-commits mailing list