You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2011/10/19 09:25:47 UTC

svn commit: r1186004 - in /james/hupa/trunk: ./ client/ client/src/main/java/org/apache/hupa/ client/src/main/java/org/apache/hupa/client/gin/ client/src/main/java/org/apache/hupa/client/mvp/ client/src/main/java/org/apache/hupa/client/rf/ client/src/m...

Author: manolo
Date: Wed Oct 19 07:25:46 2011
New Revision: 1186004

URL: http://svn.apache.org/viewvc?rev=1186004&view=rev
Log:
Use most recent versions of libraries and gwt. Add support for RequestFactory (initial stuff: dependencies, tests). Increase snapshot version

Added:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/HupaRequestFactory.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/SubjectProxy.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/SubjectRequest.java
    james/hupa/trunk/client/src/main/webapp/Hupa.css
    james/hupa/trunk/client/src/main/webapp/Hupa.html
    james/hupa/trunk/client/src/main/webapp/favicon.ico   (with props)
    james/hupa/trunk/client/src/main/webapp/images/
      - copied from r1185996, james/hupa/trunk/client/war/images/
    james/hupa/trunk/client/src/test/java/org/apache/hupa/client/rf/
    james/hupa/trunk/client/src/test/java/org/apache/hupa/client/rf/SubjectTest.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/CachedIMAPStore.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/JavaMailSessionProvider.java
      - copied, changed from r1177236, james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/SessionProvider.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/rf/
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/rf/Subject.java
Removed:
    james/hupa/trunk/client/war/
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/SessionProvider.java
Modified:
    james/hupa/trunk/README.txt
    james/hupa/trunk/client/pom.xml
    james/hupa/trunk/client/src/main/java/org/apache/hupa/Hupa.gwt.xml
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaGinjector.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java
    james/hupa/trunk/client/src/main/webapp/WEB-INF/web.xml
    james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceClientTestModule.java
    james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceMvpTestModule.java
    james/hupa/trunk/mock/pom.xml
    james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/DemoModeConstants.java
    james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java
    james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java
    james/hupa/trunk/pom.xml
    james/hupa/trunk/server/pom.xml
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceServerTestModule.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/integration/StoreBugTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorageTest.java
    james/hupa/trunk/shared/pom.xml
    james/hupa/trunk/widgets/pom.xml

Modified: james/hupa/trunk/README.txt
URL: http://svn.apache.org/viewvc/james/hupa/trunk/README.txt?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/README.txt (original)
+++ james/hupa/trunk/README.txt Wed Oct 19 07:25:46 2011
@@ -15,48 +15,31 @@ There is an example configuration file i
 - Or anywhere if you start your application server with the parameter:
   -Dhupa.config.file=full_path_to_your_properties_file
 
-###### Using hupa in demo mode #################
+###### Hupa and GMail #################
+
+By default hupa is configurated as a gmail imap/smtp client, use any gmail valid account to login.
+Note that previously to use a gmail account via imap you should enable it.
 
-In demo mode there is not necessary any imap or smtp server.
+###### Using hupa in demo mode #################
+In demo mode it is not necessary any imap or smtp server.
 A bunch of example messages and folders are shown to the user to be manipulated.
 Almost every hupa feature work in demo mode.
 
 To enable demo mode for incoming messages set 'IMAPServerAddress=demo-mode' and
 'SMTPServerAddress=demo-mode' for outgoing messages.
 
-To login into the system in thi mode use the user 'demo' with password 'demo'  
+To login into the system in this mode use the user 'demo' with password 'demo'  
 
 ###### Eclipse GWT Plugin notes ################
-
-- If you want to run hupa in hosted mode:
-  * be sure to add the following line as "vm argument" in the Run configuration:
-    -Dhupa.config.file=${project_loc}/server/src/main/webapp/WEB-INF/conf/config.properties 
-  * be sure to add the following line as "program argument" in the Run configuration:   
-    -war ${project_loc}/client/war
-
-- If you receive this kind of errors in eclipse:
-  >> 'Access restriction: The constructor Data[...] is not accessible due to restriction on required library [...]/jre/lib/rt.jar'
-
-  Change the order of the libraries putting 'JRE System Library' at the bottom.
-
-- To avoid these gwt-pugin's messages
-  >> 'The output directory for the project should be set to /hupa/client/war/WEB-INF/classes'
-  >> 'The web.xml file does not exist'
-
-  You have two options:
-  1.- Upgrade your google-eclipse plugin
-  2.- follow these steps:
-      - In unix-like environments make these symbolic links: 
-           $ ln -s client/war war
-           $ ln -s ../../src/main/webapp/WEB-INF/web.xml client/war/WEB-INF/web.xml
-      - In windows you can either:
-           a)   use Sysinternal's Junction command
-                (http://technet.microsoft.com/it-it/sysinternals/bb896768(en-us).aspx)
-                > junction war client\war
-           b)   copy recursively 'client/war' to 'war'
-                copy 'client/src/main/webapp/WEB-INF/web.xml' to 'client/war/WEB-INF'
-      - Then, set project's output directory to: /hupa/client/war/WEB-INF/classes
-           properties -> Java Build Path -> Source -> Default output folder
+- Hupa uses maven to be built, before inporting the project, you shoul install m2eclipse 
+and google plugins, then go to Import -> New maven project and select the modules:
+shared, mock, server, widget and client.
+
+- To run hupa in hosted mode, select: Run as -> (Google) Web application.
+  * May be you need to specify the appropriate hupa configuration file if you do not
+    have a suitable file in $HOME/.hupa or /etc/default/hupa you should add the following line
+    to the "vm argument" in the Run configuration:
+    -Dhupa.config.file=folder_to_hupa_dources/server/src/main/webapp/WEB-INF/conf/config.properties 
 
 - If you compile hupa with google's eclipse plugin and you get the message:
   >> 'GWT module hupa needs to be (re)compiled, please run a compile or use the Compile/Browse button in hosted mode'

Modified: james/hupa/trunk/client/pom.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/pom.xml?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/client/pom.xml (original)
+++ james/hupa/trunk/client/pom.xml Wed Oct 19 07:25:46 2011
@@ -1,43 +1,31 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-    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.
--->
-<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">
+<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-client</artifactId>
     <name>hupa</name>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>0.0.2-SNAPSHOT</version>
     <packaging>war</packaging>
     <description>A GWT based IMAP webmail</description>
     <parent>
         <groupId>org.apache.hupa</groupId>
         <artifactId>hupa-parent</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
+        <version>0.0.2-SNAPSHOT</version>
     </parent>
     <build>
-        <outputDirectory>war/WEB-INF/classes
-        </outputDirectory>
+        <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
         <plugins>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>gwt-maven-plugin</artifactId>
                 <configuration>
-                    <runTarget>Hupa.html</runTarget>
-                    <extraJvmArgs>-Xmx1024m -Dhupa.config.file=${project.parent.basedir}/server/src/main/webapp/WEB-INF/conf/config.properties</extraJvmArgs>
+                     <runTarget>Hupa.html</runTarget>
+                     <extraJvmArgs>
+                         -Dhupa.config.file=${project.parent.basedir}/server/src/main/webapp/WEB-INF/conf/config.properties
+                     </extraJvmArgs>
+                     <compileReport>true</compileReport>
+                     <disableClassMetadata>true</disableClassMetadata>
+                     <disableCastChecking>true</disableCastChecking>
                 </configuration>
                 <executions>
                     <execution>
@@ -66,12 +54,6 @@
                     <webXml>src/main/webapp/WEB-INF/web.xml
                     </webXml>
                     <webResources>
-                        <resource>
-                            <directory>war</directory>
-                            <excludes>
-                                <exclude>**/hupa/*</exclude>
-                            </excludes>
-                        </resource>
                         <!-- this is a ugly hack but I'm not sure howto solve it -->
                         <!-- This take care of including the config file within the war -->
                         <resource>
@@ -90,27 +72,53 @@
                     <wtpversion>2.0</wtpversion>
                     <additionalBuildcommands>
                         <buildCommand>
-                            <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
+                            <name>
+                                com.google.gwt.eclipse.core.gwtProjectValidator
+                            </name>
                         </buildCommand>
                     </additionalBuildcommands>
                     <additionalProjectnatures>
-                        <projectnature>org.eclipse.ajdt.ui.ajnature
-                        </projectnature>
+                        <projectnature>org.eclipse.ajdt.ui.ajnature</projectnature>
                         <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>
                     </additionalProjectnatures>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.bsc.maven</groupId>
+                <artifactId>maven-processor-plugin</artifactId>
+                <executions>
+                   <execution>
+                       <id>process</id>
+                       <goals>
+                           <goal>process</goal>
+                       </goals>
+                       <phase>generate-sources</phase>
+                   </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>${project.build.directory}/generated-sources/apt</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.hupa</groupId>
-            <artifactId>hupa-mock</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.hupa</groupId>
             <artifactId>hupa-server</artifactId>
         </dependency>
         <dependency>
@@ -126,19 +134,17 @@
             <artifactId>cobogw</artifactId>
         </dependency>
         <dependency>
-            <groupId>net.customware.gwt.dispatch</groupId>
+            <groupId>net.customware.gwt.dispatch
+            </groupId>
             <artifactId>gwt-dispatch</artifactId>
         </dependency>
         <dependency>
             <groupId>com.googlecode.gwt.inject</groupId>
             <artifactId>gin</artifactId>
+            <version>1.5</version>
             <classifier>2.2.0</classifier>
         </dependency>
         <dependency>
-            <groupId>javax.inject</groupId>
-            <artifactId>javax.inject</artifactId>
-        </dependency>
-        <dependency>
             <groupId>net.customware.gwt.presenter
             </groupId>
             <artifactId>gwt-presenter</artifactId>
@@ -148,8 +154,7 @@
             <artifactId>gwt-dnd</artifactId>
         </dependency>
         <dependency>
-            <!-- groupId>eu.maydu.gwt</groupId -->
-            <groupId>gwt-vl</groupId>
+            <groupId>eu.maydu.gwt</groupId>
             <artifactId>gwt-vl</artifactId>
         </dependency>
         <dependency>
@@ -159,27 +164,48 @@
         <dependency>
             <groupId>com.google.gwt</groupId>
             <artifactId>gwt-servlet</artifactId>
-            <scope>runtime</scope>
         </dependency>
         <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+        </dependency>        
+        <dependency>
             <groupId>com.google.gwt</groupId>
             <artifactId>gwt-user</artifactId>
-            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>com.google.gwt</groupId>
             <artifactId>gwt-dev</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.easymock</groupId>
             <artifactId>easymock</artifactId>
-            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.web.bindery</groupId>
+            <artifactId>requestfactory-server</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+            <classifier>sources</classifier>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-validator-annotation-processor</artifactId>
+        </dependency>        
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>1.6.1</version>
         </dependency>
     </dependencies>
 </project>

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/Hupa.gwt.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/Hupa.gwt.xml?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/Hupa.gwt.xml (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/Hupa.gwt.xml Wed Oct 19 07:25:46 2011
@@ -34,6 +34,7 @@
   <inherits name="gwtupload.GWTUpload"/>
   <inherits name="eu.maydu.gwt.validation.ValidationLibrary"/>
   <inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/>
+  <inherits name='com.google.web.bindery.requestfactory.RequestFactory'/>
   
   <!-- Inherit the default GWT style sheet.  You can change       -->
   <!-- the theme of your GWT application by uncommenting          -->
@@ -45,10 +46,15 @@
   <stylesheet src="Upload.css"/>
   
   <source path="client"/>
+  <set-property name="compiler.stackMode" value="strip" />
+
   
-  <extend-property name="locale" values="en" />
-  <extend-property name="locale" values="es" />
-  <extend-property name="locale" values="de" />
+<!--   <extend-property name="locale" values="en" /> -->
+<!--   <extend-property name="locale" values="es" /> -->
+<!--   <extend-property name="locale" values="de" /> -->
+
+  <set-property name="user.agent" value="gecko1_8,safari"/>
+
   
   <!-- Specify the app entry point class.                         -->
   <entry-point class='org.apache.hupa.client.Hupa'/>

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java Wed Oct 19 07:25:46 2011
@@ -46,7 +46,11 @@ import org.apache.hupa.client.mvp.place.
 import org.apache.hupa.client.mvp.place.IMAPMessageListPresenterPlace;
 import org.apache.hupa.client.mvp.place.LoginPresenterPlace;
 import org.apache.hupa.client.mvp.place.MessageSendPresenterPlace;
+import org.apache.hupa.client.rf.HupaRequestFactory;
 
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.shared.SimpleEventBus;
+import com.google.inject.Provider;
 import com.google.inject.Singleton;
 
 public class HupaClientModule extends AbstractPresenterModule {
@@ -69,6 +73,22 @@ public class HupaClientModule extends Ab
         bind(IMAPMessageListPresenterPlace.class).in(Singleton.class);
         bind(MessageSendPresenterPlace.class).in(Singleton.class);
         bind(ContactsPresenterPlace.class).in(Singleton.class);
+        
+        bind(com.google.gwt.event.shared.EventBus.class)
+            .to(SimpleEventBus.class)
+            .in(Singleton.class);
+        bind(HupaRequestFactory.class)
+            .toProvider(HupaClientModule.RequestFactoryProvider.class)
+            .in(Singleton.class);
+    }
+    
+    public static class RequestFactoryProvider implements Provider<HupaRequestFactory> {
+        private static final com.google.gwt.event.shared.EventBus eventBus = new SimpleEventBus();
+        public HupaRequestFactory get() {
+            HupaRequestFactory rf = GWT.create(HupaRequestFactory.class);
+            rf.initialize(eventBus);
+            return rf;
+        }
     }
 
 }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaGinjector.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaGinjector.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaGinjector.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaGinjector.java Wed Oct 19 07:25:46 2011
@@ -23,13 +23,15 @@ import net.customware.gwt.presenter.clie
 import net.customware.gwt.presenter.client.place.PlaceManager;
 
 import org.apache.hupa.client.mvp.AppPresenter;
+import org.apache.hupa.client.rf.HupaRequestFactory;
 
 import com.google.gwt.inject.client.GinModules;
 import com.google.gwt.inject.client.Ginjector;
 
 @GinModules({StandardDispatchModule.class,HupaClientModule.class})
 public interface HupaGinjector extends Ginjector {
-    public AppPresenter getAppPresenter();
-    public PlaceManager getPlaceManager();
-    public EventBus getEventBus();
+    AppPresenter getAppPresenter();
+    PlaceManager getPlaceManager();
+    EventBus getEventBus();
+    HupaRequestFactory getRequestFactory();
 }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java Wed Oct 19 07:25:46 2011
@@ -488,6 +488,7 @@ public class MainPresenter extends Widge
             public void onLogin(LoginEvent event) {
                 user = event.getUser();
                 folder = new IMAPFolder(user.getSettings().getInboxFolderName());
+                messageListPresenter.revealDisplay(user, folder, null);
             }
             
         }));

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/HupaRequestFactory.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/HupaRequestFactory.java?rev=1186004&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/HupaRequestFactory.java (added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/HupaRequestFactory.java Wed Oct 19 07:25:46 2011
@@ -0,0 +1,25 @@
+/****************************************************************
+ * 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.rf;
+
+import com.google.web.bindery.requestfactory.shared.RequestFactory;
+
+public interface HupaRequestFactory extends RequestFactory {
+  SubjectRequest subjectRequest();
+}
\ No newline at end of file

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/SubjectProxy.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/SubjectProxy.java?rev=1186004&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/SubjectProxy.java (added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/SubjectProxy.java Wed Oct 19 07:25:46 2011
@@ -0,0 +1,39 @@
+/****************************************************************
+ * 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.rf;
+
+import org.apache.hupa.server.rf.Subject;
+
+import com.google.web.bindery.requestfactory.shared.EntityProxy;
+import com.google.web.bindery.requestfactory.shared.ProxyFor;
+
+@ProxyFor(Subject.class)
+public interface SubjectProxy extends EntityProxy {
+  String getTitle();
+
+  Long getId();
+
+  Integer getVersion();
+
+  void setTitle(String title);
+
+  void setId(Long id);
+
+  void setVersion(Integer version);
+}

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/SubjectRequest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/SubjectRequest.java?rev=1186004&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/SubjectRequest.java (added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/SubjectRequest.java Wed Oct 19 07:25:46 2011
@@ -0,0 +1,40 @@
+/****************************************************************
+ * 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.rf;
+
+import org.apache.hupa.server.rf.Subject;
+
+import com.google.web.bindery.requestfactory.shared.InstanceRequest;
+import com.google.web.bindery.requestfactory.shared.Request;
+import com.google.web.bindery.requestfactory.shared.RequestContext;
+import com.google.web.bindery.requestfactory.shared.Service;
+
+@Service(Subject.class)
+public interface SubjectRequest extends RequestContext {
+
+  Request<java.lang.Long> countSubjects();
+
+  Request<SubjectProxy> findSubject(Long id);
+
+  InstanceRequest<SubjectProxy, java.lang.Void> remove();
+
+  InstanceRequest<SubjectProxy, java.lang.Void> persist();
+
+  Request<String> echo(SubjectProxy subject, String from, String to);
+}

Added: james/hupa/trunk/client/src/main/webapp/Hupa.css
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/webapp/Hupa.css?rev=1186004&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/webapp/Hupa.css (added)
+++ james/hupa/trunk/client/src/main/webapp/Hupa.css Wed Oct 19 07:25:46 2011
@@ -0,0 +1,356 @@
+/*
+  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.
+*/
+
+/************[ Fonts ]***************************/
+body, table td, select, * {
+    font-family:  arial, 'comic sans ms', sans-serif, helvetica, verdana;
+    font-size: 12px;
+}
+
+/************[ widget: MyDialogBox ]****************/
+.hupa-dialog-box td.dialogMiddleCenter  {
+	background: #fae5b0 !important;
+}
+.hupa-dialog-box .dialogContent .gwt-Label {
+	font-weight: bold;
+	margin: 15px;
+}
+.hupa-dialog-box .Caption {
+    font-size: 14px;
+}
+
+/************[ widget: RndPanel ]****************/
+.hupa-rounded {
+   border: 1px solid #7FAAFF; 
+   -moz-border-radius: 5px;
+   -webkit-border-radius: 4px;
+}
+
+/************[ widget: Loading ]*************************************/
+div.hupa-loading {
+	background: url(images/ajax-loader.gif) no-repeat;
+	padding-left: 25px;
+	width: 100px;
+	height: 14px;
+    white-space: nowrap;
+    margin-top: 5px;
+    margin-left: auto;
+    margin-right: auto;
+    text-align: left;
+    vertical-align: top;
+}
+
+/************[ widget: EnableHyperLink ]*********/
+.gwt-Hyperlink {
+	color: #0d0eb0;
+	text-decoration: underline;
+	cursor: pointer;
+}
+.hupa-hyperlink .gwt-Hyperlink-disabled {
+	color: #8d8d8d;
+}
+div.gwt-Hyperlink, div.gwt-Anchor {
+	padding-left: 4px;
+}
+
+/************[ view: AppView ]*******************/
+div.Hupa {
+	text-align: left;
+	margin-top: 0px;
+	padding: 0px;
+	width: 100%;
+	min-width: 920px;
+}
+* html div.Hupa {
+   margin-top: 15px;
+}
+div.hupa-logo {
+    width: 75px;
+	height: 64px;
+    float: left;
+	background: url(images/hupa-logo-64.jpg) no-repeat;
+}
+
+div.hupa-top { 
+    padding-left: 80px;
+    padding-right: 8px;
+}
+* html div.hupa-top { 
+    padding-left: 0px;
+} 
+div.hupa-top-wrap {
+	height: 64px;
+	background-color: #C5D9FF;
+}
+div.cgb-RPC-hupa-top-wrap {
+	height: 59px;
+}
+
+table.hupa-top {
+    width: 100%;    
+    margin-bottom: 0px;
+}
+table.hupa-button-bar td div {
+	padding-top: 12px;
+}
+
+div.hupa-loginfo-label, div.hupa-loginfo-user {
+	margin-left: 10px;
+}
+.hupa-loginfo-user {
+	font-style: italic;
+	font-weight: bold;
+}
+.hupa-menu-button {
+	margin-right: 15px;
+}
+div.hupa-header {
+    color: #C5D9FF;
+	padding-left: 10px;
+	height: 32px;
+}
+
+div.hupa-main {
+	clear: both;
+	margin: 8px 8px 8px 8px;
+	min-height: 500px;
+}
+
+* html div.cgb-RPC-hupa-main {
+	height: 500px;
+    text-align: center;
+}
+
+div.hupa-flash {
+	border: 1px solid #FAD163;
+    background-color: #fae5b0;
+	text-align: center;
+    margin: auto auto 2px auto;
+    width: 50%;
+    position: absolute;
+    top: 45px;
+    left: 25%;
+}
+* html div.hupa-flash {
+	border: none;
+	background: none;
+}
+* html .hupa-flash div {
+    background-color: #fae5b0;
+}
+
+.hupa-flash div.gwt-Label {
+	padding: 5px 20px 5px 20px;
+}
+
+div.hupa-bottom {
+	text-align: center;
+}
+/************[ view: LoginView ]*******************/
+table.hupa-login {
+    text-align: right;
+	margin-left: auto;
+	margin-right: auto; 
+	padding: 40px;
+}
+
+table.hupa-login td {
+	text-align: center;
+	padding-top: 6px;
+}
+table.hupa-login-form {
+	padding: 10px;
+}
+
+.hupa-login-textbox {
+	width: 230px;
+	background-color:  #d8ecfd;
+	border: 1px solid #7FAAFF;
+	margin-left: 5px;
+}
+
+/*************[ view: MainView ]*********************/
+.hupa-tree {
+	width: 158px;
+	overflow: hidden;
+}
+
+/************[ widget: CommandsBar ]*********/
+.hupa-commands-bar {
+	width: 100%;
+    padding: 5px 4px 5px 4px;
+    background-color: #deeeff;  
+}
+
+/************[ view: IMAPMessageListView ]*******************/
+.hupa-msglist, .hupa-msg-top-bar, .hupa-msgtable {
+	width: 100%;
+}
+.hupa-msg-top-bar {
+	padding: 10px 4px 10px 4px;
+    background-color: #C3D9FF;	
+}
+
+.hupa-msgtable-row {
+    text-align: left;
+	vertical-align: top;
+	padding: 0px 10px 0px 10px;
+	cursor: pointer;
+}
+.hupa-msgtable-unseen {
+    font-weight: bold;
+}
+
+.hupa-msgtable-empty {
+    font-weight: bold;
+	text-align: center;
+	padding: 20px;
+}
+.hupa-search-box {
+	width: 150px;
+}
+
+input[type=text], input[type=file], textarea {
+    background-color:  #d8ecfd;
+    border: 1px solid #7FAAFF;
+}
+
+.dragdrop-dragable{
+	background: red;
+	}
+
+.gwt-SuggestBoxPopup {
+    font-size: 10px;
+}
+
+.hupa-buttons .gwt-ListBox {
+	margin-left: 5px;
+}
+
+/*************[ buttonbars ]*********************/
+.hupa-buttons {
+    white-space: nowrap;
+}
+
+.hupa-buttons td {
+  padding-left: 3px;
+}
+
+.hupa-buttons div {
+	white-space: nowrap;
+	vertical-align: middle;
+}
+.hupa-buttons .gwt-Hyperlink {
+	padding-left: 6px;
+}
+
+
+/************[ widget: MessageHeaders ]*******************/
+table.hupa-msg-headers {
+    background-color: #C3D9FF;
+}
+.hupa-msg-headers td.label {
+	width: 175px;
+	text-align: right;
+	font-weight: bold;
+	padding-right: 5px;
+}
+
+/************[ view: IMAPMessageView ]*******************/
+table.hupa-msgview {
+	width: 100%;
+}
+div.hupa-msgview-content {
+	padding: 20px;
+}
+
+.hupa-attachment .hupa-hyperlink {
+	padding-left: 5px;
+	font-style: italic;
+	color: #0d0eb0;
+	text-decoration: underline;
+	cursor: pointer;
+}
+
+/************[ view: MessageSendView ]*******************/
+table.hupa-msgsend {
+	width: 100%;
+}
+
+.hupa-validate-error {
+	border:	1pt solid red;
+    background-color: #fae5b0;
+}
+
+/************[ view: ContactsView ]*******************/
+table.hupa-contacts {
+	margin-left: auto;
+	margin-right: auto;
+}
+
+
+/************************************************************************/
+/*** Non re-factored stuff ***/
+.cbg-ButtonContent {
+	font-size: 80%;
+}
+
+.hupa-ErrorLabel, .gwt-PagingOptions .errorMessage {
+    color:           			   #FF0000;
+}
+
+
+
+
+
+.gwt-ScrollTable .dataTable td {
+    border-top:    				  	1pt solid #EEEEEE;
+    white-space:   			    	nowrap;
+    padding:					   	0px 10px 0px 10px;
+    overflow:    			      	hidden;
+    font-size:						12px;
+	cursor:         			    pointer;
+}
+
+
+.gwt-ScrollTable .dataTable tr.highlighted {
+    background:    				  	#FAD163;
+}
+
+.gwt-ScrollTable .dataTable tr.selected td {
+    background:       				#FFF7D7;
+}
+
+.hupa-IMAPFolder-unseen {
+	font-weight: bold;	
+}
+
+.hupa-IMAPFolder-selected {
+    background:                     #C3D9FF;
+    width:                          100%;   
+}
+
+.hupa-droptarget-invalid {
+	color:							red;
+}
+
+.hupa-editor { 
+	border: 2px solid #C3D9FF;
+}
+

Added: james/hupa/trunk/client/src/main/webapp/Hupa.html
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/webapp/Hupa.html?rev=1186004&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/webapp/Hupa.html (added)
+++ james/hupa/trunk/client/src/main/webapp/Hupa.html Wed Oct 19 07:25:46 2011
@@ -0,0 +1,59 @@
+<!--
+    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.
+-->
+<!DOCTYPE>
+
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+    
+    <title>Hupa webmail</title>
+    
+    <!-- define loading style early -->
+    <style type="text/css">
+		div.loading {
+		    width: 100%; 
+		    height: 100%; 
+		    background-color: #d8ecfd;
+		}
+		.loading img {
+		    position: absolute;
+		    top: 50%;
+		    left: 50%;
+		}
+    </style>
+  </head>
+
+  <!-- Add this to disable right menu in some browsers: -->
+  <!--    oncontextmenu="return false;"                 -->
+  <body>
+  
+    <!-- An image is shown while the application is loaded -->
+    <!-- It will be removed as soon as the app is ready    -->
+    <div id="loading" class="loading">
+     <img src="images/hupa-spinning.gif">
+    </div>
+    
+    <!-- Necessary for history support -->
+    <iframe src="javascript:''"  id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
+    
+    <!-- Download attachments needs this -->
+    <iframe src="" id="__download" style="width:0;height:0;border:0"></iframe> 
+  </body>
+
+  <!--  load the application at the end when loading is being shown -->
+  <script type="text/javascript" language="javascript" src="hupa/hupa.nocache.js"></script>
+    
+</html>

Modified: james/hupa/trunk/client/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/webapp/WEB-INF/web.xml?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/webapp/WEB-INF/web.xml (original)
+++ james/hupa/trunk/client/src/main/webapp/WEB-INF/web.xml Wed Oct 19 07:25:46 2011
@@ -62,5 +62,15 @@
     <welcome-file-list>
         <welcome-file>Hupa.html</welcome-file>
     </welcome-file-list>
+    
+    <!-- RequestFactory dispatcher -->
+    <servlet>
+        <servlet-name>requestFactory</servlet-name>
+        <servlet-class>com.google.web.bindery.requestfactory.server.RequestFactoryServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>requestFactory</servlet-name>
+        <url-pattern>/gwtRequest</url-pattern>
+    </servlet-mapping>
 
 </web-app>

Added: james/hupa/trunk/client/src/main/webapp/favicon.ico
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/webapp/favicon.ico?rev=1186004&view=auto
==============================================================================
Binary file - no diff available.

Propchange: james/hupa/trunk/client/src/main/webapp/favicon.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceClientTestModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceClientTestModule.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceClientTestModule.java (original)
+++ james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceClientTestModule.java Wed Oct 19 07:25:46 2011
@@ -28,7 +28,7 @@ import org.apache.hupa.server.InMemoryIM
 import org.apache.hupa.server.guice.AbstractGuiceTestModule;
 import org.apache.hupa.server.guice.DefaultUserSettingsProvider;
 import org.apache.hupa.server.guice.DemoModeConstants;
-import org.apache.hupa.server.guice.SessionProvider;
+import org.apache.hupa.server.guice.JavaMailSessionProvider;
 import org.apache.hupa.server.handler.AbstractSendMessageHandler;
 import org.apache.hupa.server.handler.ContactsHandler;
 import org.apache.hupa.server.handler.CreateFolderHandler;
@@ -66,7 +66,7 @@ public class GuiceClientTestModule exten
   protected void configureHandlers() {
       Names.bindProperties(binder(), DemoModeConstants.demoProperties);
       
-      bind(Session.class).toProvider(SessionProvider.class);
+      bind(Session.class).toProvider(JavaMailSessionProvider.class);
       bind(HttpSession.class).toProvider(MockHttpSessionProvider.class);
       bind(Settings.class).toProvider(DefaultUserSettingsProvider.class).in(Singleton.class);
       bind(Log.class).toProvider(MockLogProvider.class).in(Singleton.class);

Modified: james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceMvpTestModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceMvpTestModule.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceMvpTestModule.java (original)
+++ james/hupa/trunk/client/src/test/java/org/apache/hupa/client/guice/GuiceMvpTestModule.java Wed Oct 19 07:25:46 2011
@@ -33,12 +33,19 @@ import org.apache.hupa.client.HupaMessag
 import org.apache.hupa.client.mock.MockMessageSendDisplay;
 import org.apache.hupa.client.mvp.ContactsPresenter;
 import org.apache.hupa.client.mvp.MessageSendPresenter;
+import org.apache.hupa.client.rf.HupaRequestFactory;
 import org.easymock.EasyMock;
 
+import com.google.gwt.event.shared.SimpleEventBus;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.inject.AbstractModule;
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 import com.google.inject.Singleton;
+import com.google.web.bindery.requestfactory.server.ServiceLayer;
+import com.google.web.bindery.requestfactory.server.SimpleRequestProcessor;
+import com.google.web.bindery.requestfactory.server.testing.InProcessRequestTransport;
+import com.google.web.bindery.requestfactory.vm.RequestFactorySource;
 
 /**
  * Guice module used to test presenters
@@ -54,7 +61,6 @@ public class GuiceMvpTestModule extends 
     
     @Override
     protected void configure() {
-
         if (dispatchAsyncInstance == null) {
             bind(DispatchAsync.class).to(dispatchAsyncClass).in(Singleton.class);
         } else {
@@ -70,6 +76,24 @@ public class GuiceMvpTestModule extends 
 
         bindDisplay(ContactsPresenter.Display.class);
         bind(MessageSendPresenter.Display.class).to(MockMessageSendDisplay.class);
+        
+        bind(com.google.gwt.event.shared.EventBus.class)
+            .to(SimpleEventBus.class)
+            .in(Singleton.class);
+        bind(HupaRequestFactory.class)
+            .toProvider(RequestFactoryProvider.class)
+            .in(Singleton.class);
+    }
+    
+    public static class RequestFactoryProvider implements Provider<HupaRequestFactory> {
+        private static final com.google.gwt.event.shared.EventBus eventBus = new SimpleEventBus();
+        public HupaRequestFactory get() {
+            HupaRequestFactory rf = RequestFactorySource.create(HupaRequestFactory.class);
+            ServiceLayer serviceLayer = ServiceLayer.create();
+            SimpleRequestProcessor processor = new SimpleRequestProcessor(serviceLayer);
+            rf.initialize(eventBus, new InProcessRequestTransport(processor));
+            return rf;
+        }
     }
 
     protected <D extends Display> void bindDisplay(final Class<D> display) {
@@ -108,5 +132,4 @@ public class GuiceMvpTestModule extends 
             }
         }
     }
-
 }
\ No newline at end of file

Added: james/hupa/trunk/client/src/test/java/org/apache/hupa/client/rf/SubjectTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/test/java/org/apache/hupa/client/rf/SubjectTest.java?rev=1186004&view=auto
==============================================================================
--- james/hupa/trunk/client/src/test/java/org/apache/hupa/client/rf/SubjectTest.java (added)
+++ james/hupa/trunk/client/src/test/java/org/apache/hupa/client/rf/SubjectTest.java Wed Oct 19 07:25:46 2011
@@ -0,0 +1,51 @@
+/****************************************************************
+ * 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.rf;
+
+import org.apache.hupa.client.HupaMvpTestCase;
+
+import com.google.web.bindery.requestfactory.shared.Receiver;
+
+public class SubjectTest extends HupaMvpTestCase {
+
+    public void testEcho() throws Exception {
+        HupaRequestFactory rf = injector.getInstance(HupaRequestFactory.class);
+        
+        SubjectRequest req = rf.subjectRequest(); 
+        SubjectProxy t = req.create(SubjectProxy.class);
+        t.setTitle("New-Subject");
+        req.echo(t, "from_manolo", "to_james").fire(new Receiver<String>() {
+            public void onSuccess(String response) {
+                assertTrue(response.contains("from_manolo"));
+                assertTrue(response.contains("to_james"));
+            }
+        });
+        
+        req = rf.subjectRequest(); 
+        t = req.create(SubjectProxy.class);
+        t.setTitle("New-Subject");
+        req.persist().using(t);
+        req.countSubjects().to(new Receiver<Long>() {
+            public void onSuccess(Long response) {
+                assertEquals(1l, response.longValue());
+            }
+        }).fire();
+    }
+}
+

Modified: james/hupa/trunk/mock/pom.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/pom.xml?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/mock/pom.xml (original)
+++ james/hupa/trunk/mock/pom.xml Wed Oct 19 07:25:46 2011
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.apache.hupa</groupId>
         <artifactId>hupa-parent</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
+        <version>0.0.2-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

Modified: james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/DemoModeConstants.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/DemoModeConstants.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/DemoModeConstants.java (original)
+++ james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/guice/DemoModeConstants.java Wed Oct 19 07:25:46 2011
@@ -48,7 +48,7 @@ public class DemoModeConstants {
             put("Password",MockIMAPStore.MOCK_LOGIN);
 
             put("IMAPServerAddress", MockSMTPTransport.MOCK_HOST);
-            put("IMAPServerPort", MockSMTPTransport.MOCK_PORT.toString());
+            put("IMAPServerPort", "143");
             put("IMAPS", "false");
             
             put("TrustStore", "my-truststore");

Modified: james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java (original)
+++ james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java Wed Oct 19 07:25:46 2011
@@ -39,13 +39,12 @@ public class MockIMAPStore extends IMAPS
     public final static String MOCK_SENT_FOLDER = "Mock-Sent";
     public final static String MOCK_TRASH_FOLDER = "Mock-Trash";
     public final static String MOCK_DRAFTS_FOLDER = "Mock-Drafts";
-    public final static String MOCK_LOGIN = "mock-login";
+    public final static String MOCK_LOGIN = "demo";
     private Map<String, String> validLogins = new HashMap<String, String>();
-    private Map<String, Integer> validServers = new HashMap<String, Integer>();
     private boolean connected = false;
     private List<MockIMAPFolder> folders = new ArrayList<MockIMAPFolder>();
     private List<String> capList;
-    static final URLName demoUrl = new URLName(null, MockSMTPTransport.MOCK_HOST, MockSMTPTransport.MOCK_PORT, null, null, null);
+    static final URLName demoUrl = new URLName(null, MockSMTPTransport.MOCK_HOST, 0, null, null, null);
     
     /**
      * Default constructor, it creates the folder structure and loads messages for demo
@@ -61,7 +60,6 @@ public class MockIMAPStore extends IMAPS
     public MockIMAPStore(Session session, URLName url) {
         super(session, url);
         if (url != null && MockSMTPTransport.MOCK_HOST.equals(url.getHost())) {
-            validServers.put(MockSMTPTransport.MOCK_HOST, MockSMTPTransport.MOCK_PORT);
             validLogins.put(MOCK_LOGIN, MOCK_LOGIN);
             try {
                 new MockIMAPFolder(MOCK_INBOX_FOLDER, this).create(Folder.HOLDS_FOLDERS | Folder.HOLDS_MESSAGES);
@@ -139,10 +137,6 @@ public class MockIMAPStore extends IMAPS
         this.validLogins = validLogins;
     }
 
-    public synchronized void setValidServers(Map<String,Integer> validServers) {
-        this.validServers = validServers;
-    }
-    
     public synchronized void clear() {
         folders.clear();
     }
@@ -185,20 +179,12 @@ public class MockIMAPStore extends IMAPS
     @Override
     public synchronized void connect(String host, int port, String username,
             String password) throws MessagingException {
-        Integer myPort = validServers.get(host);
-        if (myPort != null && myPort.intValue() == port) {
-            connect(username,password);
-        } else {
-            throw new MessagingException("Can't connect to host");
-        }
+        connect(username,password);
     }
 
     @Override
     public synchronized void connect(String host, String user, String password)
             throws MessagingException {
-        if (validServers.containsKey(host) == false) {
-            throw new MessagingException("Can't connect to host");
-        }
         connect(user,password);
     }
 

Modified: james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java (original)
+++ james/hupa/trunk/mock/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java Wed Oct 19 07:25:46 2011
@@ -32,9 +32,8 @@ import javax.mail.URLName;
 public class MockSMTPTransport extends Transport {
 
     public static final String MOCK_HOST = "mock-host";
-    public static final Integer MOCK_PORT = 143;
     
-    static final URLName mockUrl = new URLName(null, MOCK_HOST, MOCK_PORT, null, null, null);
+    static final URLName mockUrl = new URLName(null, MOCK_HOST, 0, null, null, null);
 
     public MockSMTPTransport(Session session) {
         super(session, mockUrl);

Modified: james/hupa/trunk/pom.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/pom.xml?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/pom.xml (original)
+++ james/hupa/trunk/pom.xml Wed Oct 19 07:25:46 2011
@@ -19,7 +19,7 @@
     <groupId>org.apache.hupa</groupId>
     <artifactId>hupa-parent</artifactId>
     <name>hupa-parent</name>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>0.0.2-SNAPSHOT</version>
     <description>Hupa is a GWT based Webmail</description>
     <url>http://james.apache.org/hupa</url>
     <inceptionYear>2009</inceptionYear>
@@ -39,9 +39,9 @@
     <modules>
         <module>mock</module>
         <module>shared</module>
-        <module>client</module>
         <module>server</module>
         <module>widgets</module>
+        <module>client</module>
     </modules>
 
     <distributionManagement>
@@ -93,10 +93,9 @@
             </url>
         </repository>
         <repository>
-            <!-- The indicated repository @ http://gwt-vl.sourceforge.net/?to=resources doesn't works -->
             <id>gwt-vl</id>
             <name>GWT-VL (Validation library and framework for GWT)</name>
-            <url>http://ftp.heanet.ie/mirrors/sourceforge/g/project/gw/</url>
+            <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads</url>
         </repository>
         <repository>
             <id>cobogw</id>
@@ -111,7 +110,7 @@
     </repositories>
     <properties>
         <gwtVersion>2.4.0</gwtVersion>
-        <gwtMavenVersion>2.3.0-1</gwtMavenVersion>
+        <gwtMavenVersion>2.4.0</gwtMavenVersion>
         <target.jdk>1.6</target.jdk>
     </properties>
 
@@ -231,6 +230,23 @@
                     </dependencies>
                 </plugin>
                 <plugin>
+                    <groupId>org.bsc.maven</groupId>
+                    <artifactId>maven-processor-plugin</artifactId>
+                    <version>2.0.5</version>
+                    <dependencies>
+                        <dependency>
+                            <groupId>com.google.web.bindery</groupId>
+                            <artifactId>requestfactory-apt</artifactId>
+                            <version>${gwtVersion}</version>
+                         </dependency>
+                    </dependencies>
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>build-helper-maven-plugin</artifactId>
+                    <version>1.7</version>
+                </plugin>
+                <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>versions-maven-plugin</artifactId>
                     <version>1.2</version>
@@ -553,10 +569,9 @@
                 <version>3.1.1</version>
             </dependency>
             <dependency>
-                <!-- groupId>eu.maydu.gwt</groupId -->
-                <groupId>gwt-vl</groupId>
+                <groupId>eu.maydu.gwt</groupId>
                 <artifactId>gwt-vl</artifactId>
-                <version>0.8b</version>
+                <version>0.9a</version>
             </dependency>
             <dependency>
                 <groupId>gwtupload</groupId>
@@ -617,9 +632,14 @@
                 <groupId>com.google.gwt</groupId>
                 <artifactId>gwt-dev</artifactId>
                 <version>${gwtVersion}</version>
-                <scope>provided</scope>
+                <scope>compile</scope>
             </dependency>
             <dependency>
+                <groupId>org.json</groupId>
+                <artifactId>json</artifactId>
+                <version>20090211</version>
+            </dependency>             
+            <dependency>
                 <groupId>junit</groupId>
                 <artifactId>junit</artifactId>
                 <version>4.9</version>
@@ -632,10 +652,38 @@
                 <scope>test</scope>
             </dependency>
             <dependency>
+                <groupId>com.google.web.bindery</groupId>
+                <artifactId>requestfactory-server</artifactId>
+                <version>${gwtVersion}</version>
+            </dependency>
+            <dependency>
+                <groupId>javax.validation</groupId>
+                <artifactId>validation-api</artifactId>
+                <version>1.0.0.GA</version>
+                <scope>compile</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.validation</groupId>
+                <artifactId>validation-api</artifactId>
+                <version>1.0.0.GA</version>
+                <classifier>sources</classifier>
+                <scope>compile</scope>
+            </dependency>
+            <dependency>
                 <groupId>aopalliance</groupId>
                 <artifactId>aopalliance</artifactId>
                 <version>1.0</version>
             </dependency>
+            <dependency>
+                <groupId>org.hibernate</groupId>
+                <artifactId>hibernate-validator-annotation-processor</artifactId>
+                <version>4.1.0.Final</version>
+            </dependency>       
+            <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-log4j12</artifactId>
+                <version>1.6.1</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 </project>

Modified: james/hupa/trunk/server/pom.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/pom.xml?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/server/pom.xml (original)
+++ james/hupa/trunk/server/pom.xml Wed Oct 19 07:25:46 2011
@@ -19,14 +19,14 @@
     <groupId>org.apache.hupa</groupId>
     <artifactId>hupa-server</artifactId>
     <name>hupa-server</name>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>0.0.2-SNAPSHOT</version>
     <description>Servercode implementation to access IMAP Mailbox</description>
     <packaging>jar</packaging>
 
     <parent>
         <groupId>org.apache.hupa</groupId>
         <artifactId>hupa-parent</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
+        <version>0.0.2-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/CachedIMAPStore.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/CachedIMAPStore.java?rev=1186004&view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/CachedIMAPStore.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/CachedIMAPStore.java Wed Oct 19 07:25:46 2011
@@ -0,0 +1,39 @@
+package org.apache.hupa.server;
+
+import javax.mail.MessagingException;
+
+import com.sun.mail.imap.IMAPStore;
+
+public class CachedIMAPStore {
+    private long validUntil;
+    private int validForMillis;
+    private IMAPStore store;
+    
+    private CachedIMAPStore() {
+    }
+    
+    public static CachedIMAPStore getInstance() {
+        return new CachedIMAPStore();
+    }
+
+    public CachedIMAPStore(IMAPStore store, int validForSeconds) {
+        this.store = store;
+        this.validForMillis = validForSeconds * 1000;
+        this.validUntil = System.currentTimeMillis() + validForMillis;
+    }
+
+    public boolean isExpired() {
+        if (validUntil > System.currentTimeMillis() && store.isConnected()) {
+            return false;
+        }
+        return true;
+    }
+
+    public void validate() throws MessagingException {
+        validUntil = System.currentTimeMillis() + validForMillis;
+    }
+
+    public IMAPStore getStore() {
+        return store;
+    }
+}
\ No newline at end of file

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java Wed Oct 19 07:25:46 2011
@@ -33,7 +33,6 @@ import org.apache.hupa.server.mock.MockS
 import org.apache.hupa.shared.data.User;
 
 import com.google.inject.Inject;
-import com.google.inject.Provider;
 import com.google.inject.Singleton;
 import com.google.inject.name.Named;
 import com.sun.mail.imap.IMAPStore;
@@ -50,15 +49,14 @@ public class InMemoryIMAPStoreCache impl
     
     @Inject
     public InMemoryIMAPStoreCache(Log logger, @Named("IMAPServerAddress") String address, @Named("IMAPServerPort") int port, @Named("IMAPS") boolean useSSL, @Named("IMAPConnectionPoolSize") int connectionPoolSize, @Named("IMAPConnectionPoolTimeout") int timeout, @Named("SessionDebug") boolean debug,
-            @Named("TrustStore") String truststore, @Named("TrustStorePassword") String truststorePassword, Provider<Session> sessionProvider) {
+            @Named("TrustStore") String truststore, @Named("TrustStorePassword") String truststorePassword, Session session) {
         this.logger = logger;
         this.address = address;
         this.port = port;
         this.useSSL = useSSL;
-      
-        session = sessionProvider.get();
+        this.session = session;
         if (debug && logger.isDebugEnabled()) {
-            session.setDebug(true);
+            this.session.setDebug(true);
         }
         
         Properties props = session.getProperties();
@@ -167,31 +165,5 @@ public class InMemoryIMAPStoreCache impl
         pool.remove(username);
     }
     
-    private static final class CachedIMAPStore {
-        private long validUntil;
-        private int validForMillis;
-        private IMAPStore store;
-        
-        public CachedIMAPStore(IMAPStore store, int validForSeconds) {
-            this.store = store;
-            this.validForMillis = validForSeconds * 1000;
-            this.validUntil = System.currentTimeMillis() + validForMillis;
-        }
-        
-        public boolean isExpired() {
-            if (validUntil > System.currentTimeMillis() && store.isConnected()) {
-                return false;
-            }
-            return true;
-        }
-        
-        public void validate() throws MessagingException {
-            validUntil = System.currentTimeMillis() + validForMillis;
-        }
-        
-        public IMAPStore getStore() {
-            return store;
-        }
-    }
 
 }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java Wed Oct 19 07:25:46 2011
@@ -108,6 +108,18 @@ public class GuiceServerModule extends A
 
     @Override
     protected void configureHandlers() {
+        Properties properties;
+        try {
+            // Bind addresses and ports for imap and smtp
+            properties = loadProperties();
+            Names.bindProperties(binder(), properties);
+        } catch (Exception e) {
+            throw new RuntimeException("Unable to to configure hupa server," +
+                    "\nmake sure that you have a valid /etc/default/hupa file" +
+                    "\nor the web container has been started with the appropriate parameter:" +
+                    " -Dhupa.config.file=your_hupa_properties_file", e);
+        }
+        
         bindHandler(CheckSession.class, CheckSessionHandler.class);
         bindHandler(LoginUser.class, LoginUserHandler.class);
         bindHandler(FetchFolders.class, FetchFoldersHandler.class);
@@ -136,20 +148,9 @@ public class GuiceServerModule extends A
         bind(DownloadAttachmentServlet.class).in(Singleton.class);
         bind(UploadAttachmentServlet.class).in(Singleton.class);
         bind(MessageSourceServlet.class).in(Singleton.class);
-        bind(Session.class).toProvider(SessionProvider.class);
+        bind(Session.class).toProvider(JavaMailSessionProvider.class);
         bind(UserPreferencesStorage.class).to(InImapUserPreferencesStorage.class);
-
-        Properties properties;
-        try {
-            // Bind addresses and ports for imap and smtp
-            properties = loadProperties();
-            Names.bindProperties(binder(), properties);
-        } catch (Exception e) {
-            throw new RuntimeException("Unable to to configure hupa server," +
-                    "\nmake sure that you have a valid /etc/default/hupa file" +
-                    "\nor the web container has been started with the appropriate parameter:" +
-                    " -Dhupa.config.file=your_hupa_properties_file", e);
-        }
+        bind(Properties.class).toInstance(properties);
     }
 
     protected Properties loadProperties() throws Exception {
@@ -177,32 +178,35 @@ public class GuiceServerModule extends A
     }
 
     protected Properties validateProperties(Properties properties) {
-	List<String> errors = new ArrayList<String>();
-	
-        // Test for mandatory and complete properties with default values when missing
-	for (ConfigurationProperties confProps : ConfigurationProperties.values()) {
-	    if (confProps.isMandatory()) {
-		if (properties.get(confProps.getProperty()) == null) {
-		    errors.add("The mandatory Property '" + confProps.getProperty() + "' is not set.");
-		}
-	    } else {
-		if (properties.get(confProps.getProperty()) == null) {
-		    properties.setProperty(confProps.getProperty(), confProps.getPropValue());
-		}
-	    }
-	}
-
-	// Test for unknown properties set in configuration
-	for (Object key : properties.keySet()) {
-	    if (ConfigurationProperties.lookup((String)key) == null) {
-		errors.add("The Property '" + key + "' has no configuration impacts, it's unknown");
-	    }
-	}
-	if (!errors.isEmpty()) {
-	    throw new IllegalArgumentException(errors.toString());
-	}
-	
-	return properties;
+        List<String> errors = new ArrayList<String>();
+
+        // Test for mandatory and complete properties with default values when
+        // missing
+        for (ConfigurationProperties confProps : ConfigurationProperties
+                .values()) {
+            if (confProps.isMandatory()) {
+                if (properties.get(confProps.getProperty()) == null) {
+                    errors.add("The mandatory Property '"
+                            + confProps.getProperty() + "' is not set.");
+                }
+            } else if (properties.get(confProps.getProperty()) == null) {
+                properties.setProperty(confProps.getProperty(),
+                    confProps.getPropValue());
+            }
+        }
+
+        // Test for unknown properties set in configuration
+        for (Object key : properties.keySet()) {
+            if (ConfigurationProperties.lookup((String) key) == null) {
+                errors.add("The Property '" + key
+                        + "' has no configuration impacts, it's unknown");
+            }
+        }
+        if (!errors.isEmpty()) {
+            throw new IllegalArgumentException(errors.toString());
+        }
+
+        return properties;
     }
     
     protected Properties loadProperties(String name) {

Copied: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/JavaMailSessionProvider.java (from r1177236, james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/SessionProvider.java)
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/JavaMailSessionProvider.java?p2=james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/JavaMailSessionProvider.java&p1=james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/SessionProvider.java&r1=1177236&r2=1186004&rev=1186004&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/SessionProvider.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/JavaMailSessionProvider.java Wed Oct 19 07:25:46 2011
@@ -25,7 +25,7 @@ import javax.mail.Session;
 
 import com.google.inject.Provider;
 
-public class SessionProvider implements Provider<Session>{
+public class JavaMailSessionProvider implements Provider<Session>{
 
     public Session get() {
         Session session = Session.getDefaultInstance(new Properties(), null);

Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/rf/Subject.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/rf/Subject.java?rev=1186004&view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/rf/Subject.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/rf/Subject.java Wed Oct 19 07:25:46 2011
@@ -0,0 +1,87 @@
+/****************************************************************
+ * 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.rf;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class Subject {
+
+    public static HashMap<Long, Subject> subjects = new HashMap<Long, Subject>();
+
+    private static long cont = 0;
+    private Integer version = 0;
+    private Long id = cont++;
+    private String title;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getVersion() {
+        return version;
+    }
+
+    public void setVersion(Integer version) {
+        this.version = version;
+    }
+
+    public void flush() {
+    }
+
+    public void persist() {
+        version++;
+        subjects.put(getId(), this);
+    }
+
+    public void remove() {
+        subjects.remove(getId());
+    }
+
+    public static List<Subject> findAllSubjects() {
+        return new ArrayList<Subject>(subjects.values());
+    }
+
+    public static long countSubjects() {
+        return subjects.size();
+    }
+
+    public static Subject findSubject(Long id) {
+        return subjects.get(id);
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public static String echo(Subject subject, String from, String to) {
+        String msg = "In server side: " + subject.getTitle() + ",from: " + from
+                + " To: " + to;
+        return msg;
+    }
+}

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceServerTestModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceServerTestModule.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceServerTestModule.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceServerTestModule.java Wed Oct 19 07:25:46 2011
@@ -62,7 +62,7 @@ public class GuiceServerTestModule exten
   protected void configureHandlers() {
       Names.bindProperties(binder(), DemoModeConstants.demoProperties);
       
-      bind(Session.class).toProvider(SessionProvider.class);
+      bind(Session.class).toProvider(JavaMailSessionProvider.class);
       bind(HttpSession.class).toProvider(MockHttpSessionProvider.class);
       bind(Settings.class).toProvider(DefaultUserSettingsProvider.class).in(Singleton.class);
       bind(Log.class).toProvider(MockLogProvider.class).in(Singleton.class);

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/ServerModulTest.java Wed Oct 19 07:25:46 2011
@@ -96,9 +96,9 @@ public class ServerModulTest {
         tmp.deleteOnExit();
         Collection<String> lines = new ArrayList<String>();
         lines.add("IMAPServerAddress = " + MockSMTPTransport.MOCK_HOST);
-        lines.add("IMAPServerPort = " + MockSMTPTransport.MOCK_PORT);
+        lines.add("IMAPServerPort = 143");
         lines.add("SMTPServerAddress = " + MockSMTPTransport.MOCK_HOST);
-        lines.add("SMTPServerPort = " + MockSMTPTransport.MOCK_PORT);
+        lines.add("SMTPServerPort = 25");
         lines.add("DefaultInboxFolder = " + MockIMAPStore.MOCK_INBOX_FOLDER);
         lines.add("DefaultTrashFolder = " + MockIMAPStore.MOCK_TRASH_FOLDER);
         lines.add("DefaultSentFolder = " + MockIMAPStore.MOCK_SENT_FOLDER);

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/integration/StoreBugTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/integration/StoreBugTest.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/integration/StoreBugTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/integration/StoreBugTest.java Wed Oct 19 07:25:46 2011
@@ -25,7 +25,7 @@ import com.sun.mail.imap.IMAPStore;
 import junit.framework.Assert;
 
 import org.apache.hupa.server.InMemoryIMAPStoreCache;
-import org.apache.hupa.server.guice.SessionProvider;
+import org.apache.hupa.server.guice.JavaMailSessionProvider;
 import org.apache.hupa.server.mock.MockIMAPStore;
 import org.apache.hupa.server.mock.MockLog;
 import org.apache.hupa.shared.data.User;
@@ -55,7 +55,7 @@ public class StoreBugTest {
     
     Session session = Session.getDefaultInstance(new Properties(), null);
     static InMemoryIMAPStoreCache cache = new InMemoryIMAPStoreCache(new MockLog(), imapServer, imapPort, isSSl, 2, 60000, false,
-	    truststore, truststorePassword, new SessionProvider());
+	    truststore, truststorePassword, new JavaMailSessionProvider().get());
     static User user = new User() {
        private static final long serialVersionUID = 1L;
        {setName(imapUser); setPassword(imapPass);}

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorageTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorageTest.java?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorageTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorageTest.java Wed Oct 19 07:25:46 2011
@@ -32,7 +32,7 @@ import org.apache.hupa.server.InMemoryIM
 import org.apache.hupa.server.guice.DefaultUserSettingsProvider;
 import org.apache.hupa.server.guice.DemoModeConstants;
 import org.apache.hupa.server.guice.GuiceServerTestModule;
-import org.apache.hupa.server.guice.SessionProvider;
+import org.apache.hupa.server.guice.JavaMailSessionProvider;
 import org.apache.hupa.server.handler.AbstractSendMessageHandler;
 import org.apache.hupa.server.handler.ContactsHandler;
 import org.apache.hupa.server.handler.CreateFolderHandler;
@@ -96,7 +96,7 @@ public class InImapUserPreferencesStorag
         protected void configureHandlers() {
             Names.bindProperties(binder(), DemoModeConstants.demoProperties);
             
-            bind(Session.class).toProvider(SessionProvider.class);
+            bind(Session.class).toProvider(JavaMailSessionProvider.class);
             bind(HttpSession.class).toProvider(MockHttpSessionProvider.class);
             bind(Settings.class).toProvider(DefaultUserSettingsProvider.class).in(Singleton.class);
             bind(Log.class).toProvider(MockLogProvider.class).in(Singleton.class);

Modified: james/hupa/trunk/shared/pom.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/pom.xml?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/shared/pom.xml (original)
+++ james/hupa/trunk/shared/pom.xml Wed Oct 19 07:25:46 2011
@@ -19,13 +19,13 @@
     <groupId>org.apache.hupa</groupId>
     <artifactId>hupa-shared</artifactId>
     <name>hupa-shared</name>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>0.0.2-SNAPSHOT</version>
     <packaging>jar</packaging>
     <description>Shared code for the client and server</description>
     <parent>
         <groupId>org.apache.hupa</groupId>
         <artifactId>hupa-parent</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
+        <version>0.0.2-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
@@ -60,4 +60,4 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
-</project>
\ No newline at end of file
+</project>

Modified: james/hupa/trunk/widgets/pom.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/widgets/pom.xml?rev=1186004&r1=1186003&r2=1186004&view=diff
==============================================================================
--- james/hupa/trunk/widgets/pom.xml (original)
+++ james/hupa/trunk/widgets/pom.xml Wed Oct 19 07:25:46 2011
@@ -19,14 +19,14 @@
     <groupId>org.apache.hupa</groupId>
     <artifactId>hupa-widgets</artifactId>
     <name>hupa-widgets</name>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>0.0.2-SNAPSHOT</version>
     <packaging>jar</packaging>
     <description>Collection of reusable widgets</description>
 
     <parent>
         <groupId>org.apache.hupa</groupId>
         <artifactId>hupa-parent</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
+        <version>0.0.2-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org