You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by no...@apache.org on 2009/07/07 10:37:29 UTC
svn commit: r791750 - in /labs/hupa: ./ lib/ lib/com.google.gwt.inject/
lib/com.google.gwt.inject/jars/ lib/com.google.gwt.inject/poms/
lib/com.google.gwt/ lib/com.google.gwt/jars/ lib/com.google.gwt/poms/
lib/com.google.inject/ lib/com.google.inject/j...
Author: norman
Date: Tue Jul 7 08:37:28 2009
New Revision: 791750
URL: http://svn.apache.org/viewvc?rev=791750&view=rev
Log:
Commit some work in progress which has the following goals (at the moment most stuff is broken):
*use DI (guice/gin)
*use Action pattern
*replace gwt-mvc with a mvp pattern
Added:
labs/hupa/lib/
labs/hupa/lib/com.google.gwt/
labs/hupa/lib/com.google.gwt.inject/
labs/hupa/lib/com.google.gwt.inject/jars/
labs/hupa/lib/com.google.gwt.inject/jars/gin-1.0-20090622.jar (with props)
labs/hupa/lib/com.google.gwt.inject/poms/
labs/hupa/lib/com.google.gwt.inject/poms/gin-1.0-20090622.pom
labs/hupa/lib/com.google.gwt/jars/
labs/hupa/lib/com.google.gwt/jars/gwt-incubator-march-02-2009.jar (with props)
labs/hupa/lib/com.google.gwt/poms/
labs/hupa/lib/com.google.gwt/poms/gwt-incubator-march-02-2009.pom
labs/hupa/lib/com.google.inject/
labs/hupa/lib/com.google.inject/jars/
labs/hupa/lib/com.google.inject/jars/guice-2.0.jar (with props)
labs/hupa/lib/com.google.inject/jars/guice-servlet-2.0.jar (with props)
labs/hupa/lib/com.google.inject/poms/
labs/hupa/lib/com.google.inject/poms/guice-2.0.pom
labs/hupa/lib/com.google.inject/poms/guice-servlet-2.0.pom
labs/hupa/lib/org.cobogw.gwt/
labs/hupa/lib/org.cobogw.gwt/jars/
labs/hupa/lib/org.cobogw.gwt/jars/org.cobogw.gwt-1.2.4.jar (with props)
labs/hupa/lib/org.cobogw.gwt/poms/
labs/hupa/lib/org.cobogw.gwt/poms/org.cobogw.gwt-1.2.4.pom
labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java
- copied, changed from r791388, labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java
labs/hupa/src/main/java/org/apache/hupa/client/LoginWidget.java
labs/hupa/src/main/java/org/apache/hupa/client/events/
labs/hupa/src/main/java/org/apache/hupa/client/events/EventBus.java
labs/hupa/src/main/java/org/apache/hupa/client/gin/
labs/hupa/src/main/java/org/apache/hupa/client/gin/MyClientModule.java
labs/hupa/src/main/java/org/apache/hupa/client/gin/MyGinjector.java
labs/hupa/src/main/java/org/apache/hupa/client/rpc/
labs/hupa/src/main/java/org/apache/hupa/client/rpc/FetchFolders.java
labs/hupa/src/main/java/org/apache/hupa/client/rpc/FetchFoldersResult.java
labs/hupa/src/main/java/org/apache/hupa/client/rpc/LoginUser.java
labs/hupa/src/main/java/org/apache/hupa/client/rpc/LoginUserResult.java
labs/hupa/src/main/java/org/apache/hupa/server/AbstractIMAPHandler.java
labs/hupa/src/main/java/org/apache/hupa/server/FetchFoldersHandler.java
labs/hupa/src/main/java/org/apache/hupa/server/LoginUserHandler.java
labs/hupa/src/main/java/org/apache/hupa/server/gin/
labs/hupa/src/main/java/org/apache/hupa/server/gin/MyActionHandlerRegistry.java
labs/hupa/src/main/java/org/apache/hupa/server/gin/ServerModul.java
labs/hupa/src/main/java/org/apache/hupa/server/guice/
labs/hupa/src/main/java/org/apache/hupa/server/guice/DispatchServletModule.java
labs/hupa/src/main/java/org/apache/hupa/server/guice/MyGuiceServletConfig.java
Modified:
labs/hupa/pom.xml
labs/hupa/src/main/java/org/apache/hupa/Hupa.gwt.xml
labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPService.java
labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java
labs/hupa/war/WEB-INF/web.xml
Added: labs/hupa/lib/com.google.gwt.inject/jars/gin-1.0-20090622.jar
URL: http://svn.apache.org/viewvc/labs/hupa/lib/com.google.gwt.inject/jars/gin-1.0-20090622.jar?rev=791750&view=auto
==============================================================================
Binary file - no diff available.
Propchange: labs/hupa/lib/com.google.gwt.inject/jars/gin-1.0-20090622.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: labs/hupa/lib/com.google.gwt.inject/poms/gin-1.0-20090622.pom
URL: http://svn.apache.org/viewvc/labs/hupa/lib/com.google.gwt.inject/poms/gin-1.0-20090622.pom?rev=791750&view=auto
==============================================================================
--- labs/hupa/lib/com.google.gwt.inject/poms/gin-1.0-20090622.pom (added)
+++ labs/hupa/lib/com.google.gwt.inject/poms/gin-1.0-20090622.pom Tue Jul 7 08:37:28 2009
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.google.gwt.inject</groupId>
+ <artifactId>gin</artifactId>
+ <name>Google GIN</name>
+ <version>1.0-20090622</version>
+ <description>GIN (GWT INjection) is Guice for Google Web Toolkit client-side code</description>
+ <url>http://code.google.com/p/google-gin/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ <version>2.0</version>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: labs/hupa/lib/com.google.gwt/jars/gwt-incubator-march-02-2009.jar
URL: http://svn.apache.org/viewvc/labs/hupa/lib/com.google.gwt/jars/gwt-incubator-march-02-2009.jar?rev=791750&view=auto
==============================================================================
Binary file - no diff available.
Propchange: labs/hupa/lib/com.google.gwt/jars/gwt-incubator-march-02-2009.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: labs/hupa/lib/com.google.gwt/poms/gwt-incubator-march-02-2009.pom
URL: http://svn.apache.org/viewvc/labs/hupa/lib/com.google.gwt/poms/gwt-incubator-march-02-2009.pom?rev=791750&view=auto
==============================================================================
--- labs/hupa/lib/com.google.gwt/poms/gwt-incubator-march-02-2009.pom (added)
+++ labs/hupa/lib/com.google.gwt/poms/gwt-incubator-march-02-2009.pom Tue Jul 7 08:37:28 2009
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-incubator</artifactId>
+ <version>march-02.2009</version>
+
+</project>
\ No newline at end of file
Added: labs/hupa/lib/com.google.inject/jars/guice-2.0.jar
URL: http://svn.apache.org/viewvc/labs/hupa/lib/com.google.inject/jars/guice-2.0.jar?rev=791750&view=auto
==============================================================================
Binary file - no diff available.
Propchange: labs/hupa/lib/com.google.inject/jars/guice-2.0.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: labs/hupa/lib/com.google.inject/jars/guice-servlet-2.0.jar
URL: http://svn.apache.org/viewvc/labs/hupa/lib/com.google.inject/jars/guice-servlet-2.0.jar?rev=791750&view=auto
==============================================================================
Binary file - no diff available.
Propchange: labs/hupa/lib/com.google.inject/jars/guice-servlet-2.0.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: labs/hupa/lib/com.google.inject/poms/guice-2.0.pom
URL: http://svn.apache.org/viewvc/labs/hupa/lib/com.google.inject/poms/guice-2.0.pom?rev=791750&view=auto
==============================================================================
--- labs/hupa/lib/com.google.inject/poms/guice-2.0.pom (added)
+++ labs/hupa/lib/com.google.inject/poms/guice-2.0.pom Tue Jul 7 08:37:28 2009
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ <name>Google Guice</name>
+ <version>2.0</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>aopalliance</groupId>
+ <artifactId>aopalliance</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: labs/hupa/lib/com.google.inject/poms/guice-servlet-2.0.pom
URL: http://svn.apache.org/viewvc/labs/hupa/lib/com.google.inject/poms/guice-servlet-2.0.pom?rev=791750&view=auto
==============================================================================
--- labs/hupa/lib/com.google.inject/poms/guice-servlet-2.0.pom (added)
+++ labs/hupa/lib/com.google.inject/poms/guice-servlet-2.0.pom Tue Jul 7 08:37:28 2009
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice-servlet</artifactId>
+ <name>Google Guice Servlet</name>
+ <version>2.0</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ <version>2.0</version>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: labs/hupa/lib/org.cobogw.gwt/jars/org.cobogw.gwt-1.2.4.jar
URL: http://svn.apache.org/viewvc/labs/hupa/lib/org.cobogw.gwt/jars/org.cobogw.gwt-1.2.4.jar?rev=791750&view=auto
==============================================================================
Binary file - no diff available.
Propchange: labs/hupa/lib/org.cobogw.gwt/jars/org.cobogw.gwt-1.2.4.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: labs/hupa/lib/org.cobogw.gwt/poms/org.cobogw.gwt-1.2.4.pom
URL: http://svn.apache.org/viewvc/labs/hupa/lib/org.cobogw.gwt/poms/org.cobogw.gwt-1.2.4.pom?rev=791750&view=auto
==============================================================================
--- labs/hupa/lib/org.cobogw.gwt/poms/org.cobogw.gwt-1.2.4.pom (added)
+++ labs/hupa/lib/org.cobogw.gwt/poms/org.cobogw.gwt-1.2.4.pom Tue Jul 7 08:37:28 2009
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.cobogw.gwt</groupId>
+ <artifactId>org.cobogw.gwt</artifactId>
+ <version>1.2.4</version>
+</project>
\ No newline at end of file
Modified: labs/hupa/pom.xml
URL: http://svn.apache.org/viewvc/labs/hupa/pom.xml?rev=791750&r1=791749&r2=791750&view=diff
==============================================================================
--- labs/hupa/pom.xml (original)
+++ labs/hupa/pom.xml Tue Jul 7 08:37:28 2009
@@ -1,282 +1,326 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.hupa</groupId>
- <artifactId>hupa</artifactId>
- <name>Hupa</name>
- <version>0.0.1-SNAPSHOT</version>
- <description>
- Hupa is a GWT based Webmail
- </description>
- <url>http://labs.apache.org</url>
- <inceptionYear>2009</inceptionYear>
-
- <licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
-
- <developers>
- <developer>
- <id>norman</id>
- <name>Norman Maurer</name>
- <email>norman at apache.org</email>
- <timezone>2</timezone>
- <roles>
- <role>Developer</role>
- </roles>
- </developer>
- </developers>
-
- <issueManagement>
- <system>JIRA</system>
- <url>http://issues.apache.org/jira/browse/LABS</url>
- </issueManagement>
-
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/labs/hupa</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/labs/hupa</developerConnection>
- <url>http://svn.apache.org/viewvc/labs/hupa</url>
- </scm>
-
- <repositories>
- <repository>
- <id>gwt-maven</id>
- <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
- </repository>
- <repository>
- <id>gwt-mvc</id>
- <name>GWT MVC repository at googlecode</name>
- <url>http://gwt-mvc.googlecode.com/svn/repository</url>
- </repository>
- </repositories>
-
-
- <!-- include the GWT-Maven repo as plugin, and as standard -->
- <pluginRepositories>
- <pluginRepository>
- <id>gwt-maven</id>
- <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
- </pluginRepository>
- </pluginRepositories>
-
- <!-- convenience to define GWT version in one place -->
- <properties>
- <gwtVersion>1.6.4</gwtVersion>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-5</version>
- </plugin>
-
- <!-- configure the GWT-Maven plugin -->
- <plugin>
- <groupId>com.totsp.gwt</groupId>
- <artifactId>maven-googlewebtoolkit2-plugin</artifactId>
- <version>2.0-RC1</version>
- <configuration>
- <logLevel>INFO</logLevel>
- <compileTargets>
- <value>org.apache.hupa.Hupa</value>
- </compileTargets>
- <runTarget>org.apache.hupa.Hupa/Hupa.html</runTarget>
- <style>DETAILED</style>
- <noServer>false</noServer>
- <extraJvmArgs>-Xmx512m</extraJvmArgs>
-
- <!--
- this parameter is VERY important with automatic mode - has to
- match the version in your declared deps
- -->
- <!--
- if this does not match (default if left out is 1.5.3) you will
- have mysterious errors
- -->
- <gwtVersion>${gwtVersion}</gwtVersion>
- </configuration>
- <executions>
- <execution>
- <goals>
- <!--
- <goal>mergewebxml</goal> <goal>i18n</goal>
- -->
- <goal>compile</goal>
- <!--
- <goal>test</goal>
- -->
- </goals>
- </execution>
- </executions>
- </plugin>
- <!-- Use the dependency plugin to unpack gwt-dev-PLATFORM-libs.zip -->
- <!--
- (this is a replacement for the old "automatic" mode - useful if you
- don't have GWT installed already, or you just want a maven way to
- handle gwt deps)
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-dev</artifactId>
- <version>${gwtVersion}</version>
- <classifier>${platform}-libs</classifier>
- <type>zip</type>
- <overWrite>false</overWrite>
- <outputDirectory>${settings.localRepository}/com/google/gwt/gwt-dev/${gwtVersion}</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!--
- If you want to use the target/web.xml file mergewebxml produces,
- tell the war plugin to use it. Also, exclude what you want from the
- final artifact here.
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webXml>target/web.xml</webXml>
- <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
- </configuration>
- </plugin>
- <!-- tell the compiler we can use 1.5 -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <!-- profiles (with activation per platform) -->
- <profiles>
- <profile>
- <id>gwt-dev-windows</id>
- <properties>
- <platform>windows</platform>
- </properties>
- <activation>
- <activeByDefault>true</activeByDefault>
- <os>
- <family>windows</family>
- </os>
- </activation>
- </profile>
- <profile>
- <id>gwt-dev-mac</id>
- <properties>
- <platform>mac</platform>
- </properties>
- <activation>
- <activeByDefault>false</activeByDefault>
- <os>
- <family>mac</family>
- </os>
- </activation>
- </profile>
- <profile>
- <id>gwt-dev-linux</id>
- <properties>
- <platform>linux</platform>
- </properties>
- <activation>
- <activeByDefault>false</activeByDefault>
- <os>
- <name>linux</name>
- </os>
- </activation>
- </profile>
- </profiles>
-
- <dependencies>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
- </dependency>
-
- <dependency>
- <groupId>org.columba</groupId>
- <artifactId>ristretto-common</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.columba</groupId>
- <artifactId>ristretto-imap</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.columba</groupId>
- <artifactId>ristretto-smtp</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.cobogw </groupId>
- <artifactId>gwt</artifactId>
- <version>1.2.4</version>
- </dependency>
- <dependency>
- <groupId>gwt-mvc</groupId>
- <artifactId>gwt-mvc</artifactId>
- <version>0.2.1-gwt-1.6</version>
- </dependency>
-
- <!-- GWT deps (from central repo) -->
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-servlet</artifactId>
- <version>${gwtVersion}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-user</artifactId>
- <version>${gwtVersion}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-dev</artifactId>
- <version>${gwtVersion}</version>
- <classifier>${platform}-libs</classifier>
- <type>zip</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-dev</artifactId>
- <version>${gwtVersion}</version>
- <classifier>${platform}</classifier>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.hupa</groupId>
+ <artifactId>hupa</artifactId>
+ <name>Hupa</name>
+ <version>0.0.1-SNAPSHOT</version>
+ <description>
+ Hupa is a GWT based Webmail
+ </description>
+ <url>http://labs.apache.org</url>
+ <inceptionYear>2009</inceptionYear>
+
+ <licenses>
+ <license>
+ <name>Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <developers>
+ <developer>
+ <id>norman</id>
+ <name>Norman Maurer</name>
+ <email>norman at apache.org</email>
+ <timezone>2</timezone>
+ <roles>
+ <role>Developer</role>
+ </roles>
+ </developer>
+ </developers>
+
+ <issueManagement>
+ <system>JIRA</system>
+ <url>http://issues.apache.org/jira/browse/LABS</url>
+ </issueManagement>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/labs/hupa</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/labs/hupa</developerConnection>
+ <url>http://svn.apache.org/viewvc/labs/hupa</url>
+ </scm>
+
+ <repositories>
+ <repository>
+ <id>gwt-maven</id>
+ <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
+ </repository>
+ <repository>
+ <id>gwt-mvc</id>
+ <name>GWT MVC repository at googlecode</name>
+ <url>http://gwt-mvc.googlecode.com/svn/repository</url>
+ </repository>
+ <repository>
+ <id>gwt-dispatch</id>
+ <name>GWT Dispatch repository at googlecode</name>
+ <url>http://gwt-dispatch.googlecode.com/svn/maven2</url>
+ </repository>
+ <repository>
+ <id>guice</id>
+ <name>Guice repository at googlecode</name>
+ <url>http://guice-maven.googlecode.com/svn/trunk</url>
+ </repository>
+ <repository>
+ <id>lib-repo</id>
+ <name>lib-m2-repository</name>
+ <url>file://${basedir}/lib</url>
+ <layout>legacy</layout>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <checksumPolicy>ignore</checksumPolicy>
+ </releases>
+ </repository>
+
+ </repositories>
+
+
+ <!-- include the GWT-Maven repo as plugin, and as standard -->
+ <pluginRepositories>
+ <pluginRepository>
+ <id>gwt-maven</id>
+ <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <!-- convenience to define GWT version in one place -->
+ <properties>
+ <gwtVersion>1.6.4</gwtVersion>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.0-beta-5</version>
+ </plugin>
+
+ <!-- configure the GWT-Maven plugin -->
+ <plugin>
+ <groupId>com.totsp.gwt</groupId>
+ <artifactId>maven-googlewebtoolkit2-plugin</artifactId>
+ <version>2.0-RC1</version>
+ <configuration>
+ <logLevel>INFO</logLevel>
+ <compileTargets>
+ <value>org.apache.hupa.Hupa</value>
+ </compileTargets>
+ <runTarget>org.apache.hupa.Hupa/Hupa.html</runTarget>
+ <style>DETAILED</style>
+ <noServer>false</noServer>
+ <extraJvmArgs>-Xmx512m</extraJvmArgs>
+
+ <!--
+ this parameter is VERY important with automatic mode - has to
+ match the version in your declared deps
+ -->
+ <!--
+ if this does not match (default if left out is 1.5.3) you will
+ have mysterious errors
+ -->
+ <gwtVersion>${gwtVersion}</gwtVersion>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <!--
+ <goal>mergewebxml</goal> <goal>i18n</goal>
+ -->
+ <goal>compile</goal>
+ <!--
+ <goal>test</goal>
+ -->
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Use the dependency plugin to unpack gwt-dev-PLATFORM-libs.zip -->
+ <!--
+ (this is a replacement for the old "automatic" mode - useful if you
+ don't have GWT installed already, or you just want a maven way to
+ handle gwt deps)
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwtVersion}</version>
+ <classifier>${platform}-libs</classifier>
+ <type>zip</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${settings.localRepository}/com/google/gwt/gwt-dev/${gwtVersion}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!--
+ If you want to use the target/web.xml file mergewebxml produces,
+ tell the war plugin to use it. Also, exclude what you want from the
+ final artifact here.
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webXml>target/web.xml</webXml>
+ <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
+ </configuration>
+ </plugin>
+ <!-- tell the compiler we can use 1.5 -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- profiles (with activation per platform) -->
+ <profiles>
+ <profile>
+ <id>gwt-dev-windows</id>
+ <properties>
+ <platform>windows</platform>
+ </properties>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <os>
+ <family>windows</family>
+ </os>
+ </activation>
+ </profile>
+ <profile>
+ <id>gwt-dev-mac</id>
+ <properties>
+ <platform>mac</platform>
+ </properties>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ <os>
+ <family>mac</family>
+ </os>
+ </activation>
+ </profile>
+ <profile>
+ <id>gwt-dev-linux</id>
+ <properties>
+ <platform>linux</platform>
+ </properties>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ <os>
+ <name>linux</name>
+ </os>
+ </activation>
+ </profile>
+ </profiles>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.columba</groupId>
+ <artifactId>ristretto-common</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.columba</groupId>
+ <artifactId>ristretto-imap</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.columba</groupId>
+ <artifactId>ristretto-smtp</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.cobogw.gwt</groupId>
+ <artifactId>org.cobogw.gwt</artifactId>
+ <version>1.2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>gwt-mvc</groupId>
+ <artifactId>gwt-mvc</artifactId>
+ <version>0.2.1-gwt-1.6</version>
+ </dependency>
+ <dependency>
+ <groupId>net.customware.gwt.dispatch</groupId>
+ <artifactId>gwt-dispatch</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-incubator</artifactId>
+ <version>march-02-2009</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.code.guice</groupId>
+ <artifactId>guice</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.guice</groupId>
+ <artifactId>guice-servlet</artifactId>
+ <version>2.0</version>
+ </dependency>
+
+ <!-- GWT deps (from central repo) -->
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwtVersion}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwtVersion}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwtVersion}</version>
+ <classifier>${platform}-libs</classifier>
+ <type>zip</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwtVersion}</version>
+ <classifier>${platform}</classifier>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
Modified: labs/hupa/src/main/java/org/apache/hupa/Hupa.gwt.xml
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/Hupa.gwt.xml?rev=791750&r1=791749&r2=791750&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/Hupa.gwt.xml (original)
+++ labs/hupa/src/main/java/org/apache/hupa/Hupa.gwt.xml Tue Jul 7 08:37:28 2009
@@ -1,24 +1,27 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-source/core/src/gwt-module.dtd">
-<module rename-to='hupa'>
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name='com.google.gwt.user.User'/>
-
- <!-- Inherit the default GWT style sheet. You can change -->
- <!-- the theme of your GWT application by uncommenting -->
- <!-- any one of the following lines. -->
- <inherits name='com.google.gwt.user.theme.standard.Standard'/>
- <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
- <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
-
- <!-- Other module inherits -->
- <inherits name='org.cobogw.gwt.user.User' />
-
- <!-- GWT MVC -->
- <inherits name="com.googlecode.gwtmvc.GwtMvc" />
-
- <source path="client"/>
-
- <!-- Specify the app entry point class. -->
- <entry-point class='org.apache.hupa.client.Hupa'/>
-</module>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-source/core/src/gwt-module.dtd">
+<module rename-to='hupa'>
+ <!-- Inherit the core Web Toolkit stuff. -->
+ <inherits name='com.google.gwt.user.User'/>
+
+ <!-- Inherit the default GWT style sheet. You can change -->
+ <!-- the theme of your GWT application by uncommenting -->
+ <!-- any one of the following lines. -->
+ <inherits name='com.google.gwt.user.theme.standard.Standard'/>
+ <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
+ <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
+
+ <!-- Other module inherits -->
+ <inherits name='org.cobogw.gwt.user.User' />
+
+ <!-- GWT MVC -->
+ <inherits name="com.googlecode.gwtmvc.GwtMvc" />
+
+ <inherits name='net.customware.gwt.dispatch.Dispatch' />
+ <inherits name="com.google.gwt.inject.Inject"/>
+
+ <source path="client"/>
+
+ <!-- Specify the app entry point class. -->
+ <entry-point class='org.apache.hupa.client.Hupa'/>
+</module>
Copied: labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java (from r791388, labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java)
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java?p2=labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java&p1=labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java&r1=791388&r2=791750&rev=791750&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java Tue Jul 7 08:37:28 2009
@@ -1,32 +1,17 @@
-/****************************************************************
- * 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.client;
-
-import org.apache.hupa.client.controller.HupaController;
-
-import com.googlecode.gwtmvc.client.MvcEntryPoint;
-
-public class Hupa extends MvcEntryPoint {
-
- public Hupa() {
- super(new HupaController());
- }
-
-}
+package org.apache.hupa.client;
+
+import org.apache.hupa.client.gin.MyGinjector;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.RootPanel;
+
+public class Hupa implements EntryPoint{
+ private final MyGinjector injector = GWT.create(MyGinjector.class);
+
+ public void onModuleLoad() {
+ LoginWidget lPanel = injector.getLoginWidget();
+ lPanel.go(RootPanel.get());
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/LoginWidget.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/LoginWidget.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/LoginWidget.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/LoginWidget.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,208 @@
+/****************************************************************
+ * 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.client;
+
+import net.customware.gwt.dispatch.client.DispatchAsync;
+
+import org.apache.hupa.client.events.EventBus;
+import org.apache.hupa.client.rpc.LoginUser;
+import org.apache.hupa.client.rpc.LoginUserResult;
+import org.cobogw.gwt.user.client.ui.Button;
+import org.cobogw.gwt.user.client.ui.ButtonBar;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.KeyCodes;
+import com.google.gwt.event.dom.client.KeyUpEvent;
+import com.google.gwt.event.dom.client.KeyUpHandler;
+import com.google.gwt.user.client.Cookies;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.CheckBox;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.ui.PasswordTextBox;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.inject.Inject;
+
+public class LoginWidget extends Composite implements KeyUpHandler,ClickHandler{
+
+ private HupaConstants constants = GWT.create(HupaConstants.class);
+ private Button loginButton = new Button(constants.loginButton());
+ private Button resetButton = new Button(constants.resetButton());
+ private TextBox usernameTextBox = new TextBox();
+ private PasswordTextBox passwordTextBox = new PasswordTextBox();
+ private CheckBox saveBox = new CheckBox(constants.saveLoginLabel());
+ private Label errorLabel = new Label(constants.loginInvalid());
+
+ private int minUsernameLength = 1;
+ private int minPasswordLength = 1;
+ private DispatchAsync dispatcher;
+ private EventBus bus;
+
+ @Inject
+ public LoginWidget(DispatchAsync dispatcher,EventBus bus) {
+ this.dispatcher = dispatcher;
+ VerticalPanel vPanel = new VerticalPanel();
+ vPanel.setSpacing(5);
+ vPanel.setWidth("100%");
+ vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
+ vPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+
+ Label header = new Label(constants.productName());
+
+ header.setHeight("25px");
+ header.setStyleName("hupa-LoginWidgetHeader");
+ vPanel.add(header);
+ vPanel.setCellHorizontalAlignment(header, VerticalPanel.ALIGN_LEFT);
+
+ Grid grid = new Grid(3, 2);
+
+ grid.setText(0, 0, constants.usernameLabel());
+ grid.setWidget(0, 1, usernameTextBox);
+
+ grid.setText(1, 0, constants.passwordLabel());
+ grid.setWidget(1, 1, passwordTextBox);
+ grid.setWidget(2, 1, saveBox);
+ usernameTextBox.addKeyUpHandler(this);
+ usernameTextBox.setText(Cookies.getCookie("username"));
+ usernameTextBox.setFocus(true);
+
+ passwordTextBox.addKeyUpHandler(this);
+ passwordTextBox.setText(Cookies.getCookie("password"));
+ vPanel.add(grid);
+ ButtonBar buttonBar = new ButtonBar();
+
+ buttonBar.add(loginButton);
+ buttonBar.add(resetButton);
+
+ loginButton.setEnabled(false);
+ loginButton.addClickHandler(this);
+ resetButton.addClickHandler(this);
+
+ vPanel.add(buttonBar);
+
+ errorLabel.setStyleName("hupa-ErrorLabel");
+ errorLabel.setVisible(false);
+ vPanel.add(errorLabel);
+
+ initWidget(vPanel);
+ }
+
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event
+ * .dom.client.ClickEvent)
+ */
+ public void onClick(ClickEvent event) {
+ if (resetButton.equals(event.getSource())) {
+ reset();
+ } else if (loginButton.equals(event.getSource())) {
+ dispatcher.execute(new LoginUser(getUsername(), getPassword()),
+ new AsyncCallback<LoginUserResult>() {
+
+ public void onFailure(Throwable caught) {
+ error();
+ GWT.log("ERROR", caught);
+ }
+
+ public void onSuccess(LoginUserResult result) {
+ success();
+ GWT.log("SUCCESS", null);
+
+ }
+ });
+ }
+ }
+
+ private void reset() {
+ errorLabel.setVisible(false);
+ loginButton.setEnabled(false);
+ usernameTextBox.setText("");
+ passwordTextBox.setText("");
+ usernameTextBox.setFocus(true);
+ }
+
+ private void error() {
+ reset();
+ errorLabel.setVisible(true);
+
+ if (saveBox.getValue()) {
+ Cookies.removeCookie("username");
+ Cookies.removeCookie("password");
+ }
+ }
+
+ private void success() {
+ if (saveBox.getValue()) {
+ Cookies.setCookie("username", getUsername());
+ Cookies.setCookie("password", getPassword());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.google.gwt.event.dom.client.KeyUpHandler#onKeyUp(com.google.gwt.event
+ * .dom.client.KeyUpEvent)
+ */
+ public void onKeyUp(KeyUpEvent event) {
+ if (usernameTextBox.getText().length() >= minUsernameLength
+ && passwordTextBox.getText().length() >= minPasswordLength) {
+ loginButton.setEnabled(true);
+ } else {
+ loginButton.setEnabled(false);
+ }
+
+ if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
+ if (event.getSource().equals(usernameTextBox)) {
+ passwordTextBox.setFocus(true);
+ } else if (event.getSource().equals(passwordTextBox)) {
+ if (loginButton.isEnabled()) {
+ loginButton.click();
+ }
+ }
+ }
+
+ }
+
+
+ private String getUsername() {
+ return usernameTextBox.getText();
+ }
+
+ private String getPassword() {
+ return passwordTextBox.getText();
+ }
+
+
+ public void go(Panel panel) {
+ panel.clear();
+ panel.add(this);
+ }
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/events/EventBus.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/events/EventBus.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/events/EventBus.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/events/EventBus.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,11 @@
+package org.apache.hupa.client.events;
+
+import com.google.gwt.event.shared.HandlerManager;
+
+public class EventBus extends HandlerManager {
+
+ public EventBus() {
+ super(null);
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/gin/MyClientModule.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/gin/MyClientModule.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/gin/MyClientModule.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/gin/MyClientModule.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,17 @@
+package org.apache.hupa.client.gin;
+
+import org.apache.hupa.client.LoginWidget;
+import org.apache.hupa.client.events.EventBus;
+
+import com.google.gwt.inject.client.AbstractGinModule;
+import com.google.inject.Singleton;
+
+public class MyClientModule extends AbstractGinModule{
+
+ @Override
+ protected void configure() {
+ bind(EventBus.class).in(Singleton.class);
+ bind(LoginWidget.class).in(Singleton.class);
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/gin/MyGinjector.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/gin/MyGinjector.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/gin/MyGinjector.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/gin/MyGinjector.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,13 @@
+package org.apache.hupa.client.gin;
+
+import net.customware.gwt.dispatch.client.gin.ClientDispatchModule;
+
+import org.apache.hupa.client.LoginWidget;
+
+import com.google.gwt.inject.client.GinModules;
+import com.google.gwt.inject.client.Ginjector;
+
+@GinModules({ClientDispatchModule.class,MyClientModule.class})
+public interface MyGinjector extends Ginjector {
+ public LoginWidget getLoginWidget();
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/rpc/FetchFolders.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/rpc/FetchFolders.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/rpc/FetchFolders.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/rpc/FetchFolders.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,27 @@
+package org.apache.hupa.client.rpc;
+
+import org.apache.hupa.client.data.IMAPUser;
+
+import net.customware.gwt.dispatch.shared.Action;
+
+public class FetchFolders implements Action<FetchFoldersResult>{
+
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 8515539585915762904L;
+ private IMAPUser user;
+
+ public FetchFolders(IMAPUser user) {
+ this.user = user;
+ }
+
+ @SuppressWarnings("unused")
+ private FetchFolders() {
+
+ }
+ public IMAPUser getUser() {
+ return user;
+ }
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/rpc/FetchFoldersResult.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/rpc/FetchFoldersResult.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/rpc/FetchFoldersResult.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/rpc/FetchFoldersResult.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,29 @@
+package org.apache.hupa.client.rpc;
+
+import java.util.ArrayList;
+
+import org.apache.hupa.client.data.IMAPFolder;
+
+import net.customware.gwt.dispatch.shared.Result;
+
+public class FetchFoldersResult implements Result{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -6215610133650989605L;
+ private ArrayList<IMAPFolder> folders;
+
+ public FetchFoldersResult(ArrayList<IMAPFolder> folders) {
+ this.folders=folders;
+ }
+
+ @SuppressWarnings("unused")
+ private FetchFoldersResult() {
+
+ }
+
+ public ArrayList<IMAPFolder> getFolders() {
+ return folders;
+ }
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/rpc/LoginUser.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/rpc/LoginUser.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/rpc/LoginUser.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/rpc/LoginUser.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,33 @@
+package org.apache.hupa.client.rpc;
+
+
+
+import net.customware.gwt.dispatch.shared.Action;
+
+public class LoginUser implements Action<LoginUserResult>{
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7541443368424711160L;
+
+
+ private String userName;
+ private String password;
+
+ private LoginUser() {}
+
+ public LoginUser(String userName,String password) {
+ this.userName = userName;
+ this.password = password;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/rpc/LoginUserResult.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/rpc/LoginUserResult.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/rpc/LoginUserResult.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/rpc/LoginUserResult.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,25 @@
+package org.apache.hupa.client.rpc;
+
+import org.apache.hupa.client.data.IMAPUser;
+
+import net.customware.gwt.dispatch.shared.Result;
+
+public class LoginUserResult implements Result{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -8740775403377441876L;
+ private IMAPUser user;
+
+ public LoginUserResult(IMAPUser user) {
+ this.user = user;
+ }
+
+ @SuppressWarnings("unused")
+ private LoginUserResult() {}
+
+ public IMAPUser getUser() {
+ return user;
+ }
+}
Modified: labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPService.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPService.java?rev=791750&r1=791749&r2=791750&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPService.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPService.java Tue Jul 7 08:37:28 2009
@@ -19,7 +19,7 @@
package org.apache.hupa.client.services;
-import java.util.List;
+import java.util.ArrayList;
import org.apache.hupa.client.data.IMAPFolder;
import org.apache.hupa.client.data.IMAPMessage;
@@ -35,7 +35,7 @@
public IMAPUser login(String username,String password)
throws IMAPServiceException;
- public List<IMAPFolder> getFolders(IMAPUser user)
+ public ArrayList<IMAPFolder> getFolders(IMAPUser user)
throws IMAPServiceException;
public ResultList<IMAPMessage> getMessages(IMAPUser user,IMAPFolder folder, int start, int end, String searchString) throws IMAPServiceException;
Added: labs/hupa/src/main/java/org/apache/hupa/server/AbstractIMAPHandler.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/server/AbstractIMAPHandler.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/server/AbstractIMAPHandler.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/server/AbstractIMAPHandler.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,26 @@
+package org.apache.hupa.server;
+
+import java.io.IOException;
+
+import org.apache.hupa.client.data.IMAPUser;
+import org.columba.ristretto.imap.IMAPException;
+import org.columba.ristretto.imap.IMAPProtocol;
+
+import net.customware.gwt.dispatch.server.ActionHandler;
+import net.customware.gwt.dispatch.shared.Action;
+import net.customware.gwt.dispatch.shared.Result;
+
+
+public abstract class AbstractIMAPHandler<A extends Action<R>, R extends Result> implements ActionHandler<A,R>{
+
+ protected IMAPProtocol getProtocol(IMAPUser user) throws IOException,
+ IMAPException {
+ IMAPProtocol protocol = new IMAPProtocol("myblog.kicks-ass.org",
+ IMAPProtocol.DEFAULT_PORT);
+ protocol.openPort();
+ protocol.login(user.getName(), user.getPassword().toCharArray());
+
+ return protocol;
+
+ }
+}
Added: labs/hupa/src/main/java/org/apache/hupa/server/FetchFoldersHandler.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/server/FetchFoldersHandler.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/server/FetchFoldersHandler.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/server/FetchFoldersHandler.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,128 @@
+/****************************************************************
+ * 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;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hupa.client.data.IMAPFolder;
+import org.apache.hupa.client.data.IMAPUser;
+import org.apache.hupa.client.rpc.FetchFolders;
+import org.apache.hupa.client.rpc.FetchFoldersResult;
+import org.apache.hupa.client.services.IMAPServiceException;
+import org.columba.ristretto.imap.IMAPException;
+import org.columba.ristretto.imap.IMAPProtocol;
+import org.columba.ristretto.imap.ListInfo;
+import org.columba.ristretto.imap.SearchKey;
+import org.columba.ristretto.message.MailboxInfo;
+
+import net.customware.gwt.dispatch.server.ExecutionContext;
+import net.customware.gwt.dispatch.shared.ActionException;
+
+public class FetchFoldersHandler extends AbstractIMAPHandler<FetchFolders, FetchFoldersResult>{
+
+ public FetchFoldersResult execute(FetchFolders action, ExecutionContext arg1)
+ throws ActionException {
+ try {
+ return new FetchFoldersResult(getFolders(action.getUser()));
+ } catch (IMAPServiceException e) {
+ throw new ActionException(e);
+ }
+ }
+
+ public void rollback(FetchFolders arg0, FetchFoldersResult arg1,
+ ExecutionContext arg2) throws ActionException {
+ // nothing todo
+
+ }
+
+ public Class<FetchFolders> getActionType() {
+ return FetchFolders.class;
+ }
+
+ protected ArrayList<IMAPFolder> getFolders(IMAPUser user)
+ throws IMAPServiceException {
+ ArrayList<IMAPFolder> fList = new ArrayList<IMAPFolder>();
+ IMAPProtocol protocol = null;
+ try {
+ protocol = getProtocol(user);
+ ListInfo[] infos = protocol.list("", "*");
+
+ for (int i = 0; i < infos.length; i++) {
+ ListInfo info = infos[i];
+
+ String fullName = info.getName();
+ String delimiter = info.getDelimiter();
+ MailboxInfo mInfo= protocol.select(info.getName());
+
+ // we are want to show the not seen flagged message count
+ int unseen = protocol.search(new SearchKey[]{ new SearchKey(SearchKey.UNSEEN)}).length;
+ IMAPFolder iFolder = new IMAPFolder(info.getName());
+ iFolder.setDelimiter(delimiter);
+ iFolder.setMessageCount(mInfo.getExists());
+
+ iFolder.setUnseenMessageCount(unseen);
+
+ System.out.println(mInfo.toString() + " " + mInfo.getRecent());
+ int index = fullName.lastIndexOf(delimiter);
+ if (index > -1) {
+ String parentFullName = fullName.substring(0, index);
+ handleIMAPFolderTree(fList, iFolder, parentFullName);
+ } else {
+ fList.add(iFolder);
+ }
+ }
+ return fList;
+ } catch (IOException e) {
+ e.printStackTrace();
+ throw new IMAPServiceException("Unable to get folders for User "
+ + user);
+ } catch (IMAPException e) {
+ e.printStackTrace();
+ throw new IMAPServiceException("Unable to get folders for User "
+ + user);
+ } finally {
+ if (protocol != null) {
+ try {
+ protocol.close();
+ } catch (Exception e) {
+ // Ignore on close
+ }
+ }
+ }
+ }
+
+ private void handleIMAPFolderTree(List<IMAPFolder> fList,
+ IMAPFolder iFolder, String parentFullName) {
+ for (int a = 0; a < fList.size(); a++) {
+ IMAPFolder tmpFolder = fList.get(a);
+ if (tmpFolder.getFullName().equals(parentFullName)) {
+ tmpFolder.getChildIMAPFolders().add(iFolder);
+ } else {
+ List<IMAPFolder> childFolders = tmpFolder.getChildIMAPFolders();
+ if (childFolders != null && childFolders.isEmpty() == false) {
+ handleIMAPFolderTree(childFolders, iFolder, parentFullName);
+ }
+ }
+ }
+ }
+
+}
Modified: labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java?rev=791750&r1=791749&r2=791750&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java Tue Jul 7 08:37:28 2009
@@ -60,6 +60,15 @@
public class IMAPServiceImpl extends RemoteServiceServlet implements
IMAPService {
+ private static IMAPService SERVICE;
+
+ public static IMAPService getInstance() {
+ if (SERVICE == null) {
+ SERVICE = new IMAPServiceImpl();
+ }
+ return SERVICE;
+ }
+
/**
*
*/
@@ -302,9 +311,9 @@
}
- public List<IMAPFolder> getFolders(IMAPUser user)
+ public ArrayList<IMAPFolder> getFolders(IMAPUser user)
throws IMAPServiceException {
- List<IMAPFolder> fList = new ArrayList<IMAPFolder>();
+ ArrayList<IMAPFolder> fList = new ArrayList<IMAPFolder>();
IMAPProtocol protocol = null;
try {
protocol = getProtocol(user);
Added: labs/hupa/src/main/java/org/apache/hupa/server/LoginUserHandler.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/server/LoginUserHandler.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/server/LoginUserHandler.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/server/LoginUserHandler.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,59 @@
+package org.apache.hupa.server;
+
+import java.io.IOException;
+import java.util.Date;
+
+import net.customware.gwt.dispatch.server.ExecutionContext;
+import net.customware.gwt.dispatch.shared.ActionException;
+
+import org.apache.hupa.client.data.IMAPUser;
+import org.apache.hupa.client.rpc.LoginUser;
+import org.apache.hupa.client.rpc.LoginUserResult;
+import org.apache.hupa.client.services.IMAPServiceException;
+import org.columba.ristretto.imap.IMAPException;
+import org.columba.ristretto.imap.IMAPProtocol;
+
+public class LoginUserHandler extends
+ AbstractIMAPHandler<LoginUser, LoginUserResult> {
+
+ public LoginUserResult execute(LoginUser action, ExecutionContext context)
+ throws ActionException {
+ try {
+ return new LoginUserResult(login(action.getUserName(), action
+ .getPassword()));
+ } catch (IMAPServiceException e) {
+ throw new ActionException(e);
+ }
+ }
+
+ public void rollback(LoginUser user, LoginUserResult result,
+ ExecutionContext context) throws ActionException {
+ // Nothing todo here
+ }
+
+ public Class<LoginUser> getActionType() {
+ return LoginUser.class;
+ }
+
+ protected IMAPUser login(String username, String password)
+ throws IMAPServiceException {
+
+ try {
+ IMAPUser user = new IMAPUser();
+ user.setName(username);
+ user.setPassword(password);
+ IMAPProtocol protocol = getProtocol(user);
+ protocol.openPort();
+ protocol.login(username, password.toCharArray());
+
+ user.setLoginDate(new Date());
+ user.setAuthenticated(true);
+ return user;
+
+ } catch (IOException e) {
+ throw new IMAPServiceException(e.getMessage());
+ } catch (IMAPException e) {
+ throw new IMAPServiceException(e.getMessage());
+ }
+ }
+}
Added: labs/hupa/src/main/java/org/apache/hupa/server/gin/MyActionHandlerRegistry.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/server/gin/MyActionHandlerRegistry.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/server/gin/MyActionHandlerRegistry.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/server/gin/MyActionHandlerRegistry.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,50 @@
+/****************************************************************
+ * 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.gin;
+
+import java.util.List;
+
+import com.google.inject.Binding;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.TypeLiteral;
+
+import net.customware.gwt.dispatch.server.ActionHandler;
+import net.customware.gwt.dispatch.server.DefaultActionHandlerRegistry;
+
+/**
+ * HandlerRegistry which takes care of automaticly binding all configured handlers
+ *
+ * @author Norman Maurer
+ *
+ */
+public class MyActionHandlerRegistry extends DefaultActionHandlerRegistry{
+
+ @Inject
+ public MyActionHandlerRegistry(Injector injector) {
+ super();
+
+ List<Binding<ActionHandler>> bindings = injector.findBindingsByType( TypeLiteral.get( ActionHandler.class ) );
+ for (int i = 0; i < bindings.size();i++) {
+ addHandler(bindings.get(i).getProvider().get());
+ }
+
+ }
+}
Added: labs/hupa/src/main/java/org/apache/hupa/server/gin/ServerModul.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/server/gin/ServerModul.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/server/gin/ServerModul.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/server/gin/ServerModul.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,46 @@
+/****************************************************************
+ * 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.gin;
+
+import net.customware.gwt.dispatch.server.ActionHandlerRegistry;
+import net.customware.gwt.dispatch.server.guice.ServerDispatchModule;
+
+import org.apache.hupa.server.FetchFoldersHandler;
+import org.apache.hupa.server.LoginUserHandler;
+
+/**
+ * Module which binds the handlers
+ *
+ * @author norman
+ *
+ */
+public class ServerModul extends ServerDispatchModule{
+
+ @Override
+ protected void configureHandlers() {
+ bindHandler(LoginUserHandler.class);
+ bindHandler(FetchFoldersHandler.class);
+ }
+
+ @Override
+ protected Class<? extends ActionHandlerRegistry> getActionHandlerRegistryClass() {
+ return MyActionHandlerRegistry.class;
+ }
+}
Added: labs/hupa/src/main/java/org/apache/hupa/server/guice/DispatchServletModule.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/server/guice/DispatchServletModule.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/server/guice/DispatchServletModule.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/server/guice/DispatchServletModule.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,36 @@
+/****************************************************************
+ * 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 net.customware.gwt.dispatch.server.service.DispatchServiceServlet;
+
+import com.google.inject.servlet.ServletModule;
+
+
+public class DispatchServletModule extends ServletModule{
+ @Override
+ public void configureServlets() {
+ serve( "/hupa/dispatch" ).with(DispatchServiceServlet.class );
+
+ }
+
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/server/guice/MyGuiceServletConfig.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/server/guice/MyGuiceServletConfig.java?rev=791750&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/server/guice/MyGuiceServletConfig.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/server/guice/MyGuiceServletConfig.java Tue Jul 7 08:37:28 2009
@@ -0,0 +1,41 @@
+/****************************************************************
+ * 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 org.apache.hupa.server.gin.ServerModul;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.servlet.GuiceServletContextListener;
+
+/**
+ * Simple GuiceServletContextListener which just create the injector
+ *
+ * @author norman
+ *
+ */
+public class MyGuiceServletConfig extends GuiceServletContextListener{
+
+ @Override
+ protected Injector getInjector() {
+ return Guice.createInjector(new ServerModul(),new DispatchServletModule());
+ }
+
+}
Modified: labs/hupa/war/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/labs/hupa/war/WEB-INF/web.xml?rev=791750&r1=791749&r2=791750&view=diff
==============================================================================
--- labs/hupa/war/WEB-INF/web.xml (original)
+++ labs/hupa/war/WEB-INF/web.xml Tue Jul 7 08:37:28 2009
@@ -11,15 +11,28 @@
</welcome-file-list>
<!-- Servlets -->
+<!--
<servlet>
- <servlet-name>imapServlet</servlet-name>
- <servlet-class>org.apache.hupa.server.IMAPServiceImpl</servlet-class>
+ <servlet-name>dispatchServlet</servlet-name>
+ <servlet-class>org.apache.hupa.server.HupaDispatchServiceServlet</servlet-class>
</servlet>
<servlet-mapping>
- <servlet-name>imapServlet</servlet-name>
- <url-pattern>/hupa/imap</url-pattern>
+ <servlet-name>dispatchServlet</servlet-name>
+ <url-pattern>/hupa/dispatch</url-pattern>
</servlet-mapping>
-
+ -->
+ <filter>
+ <filter-name>guiceFilter</filter-name>
+ <filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>guiceFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>org.apache.hupa.server.guice.MyGuiceServletConfig</listener-class>
+ </listener>
</web-app>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org