<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>server-dev@james.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/james-server-dev/"/>
<id>http://mail-archives.apache.org/mod_mbox/james-server-dev/</id>
<updated>2009-12-06T12:27:31Z</updated>
<entry>
<title>JAMES Server Nightly Build Report</title>
<author><name>JAMES Nightly Build System &lt;noel@devtech.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c15822748.1276921260088545801.JavaMail.root@devtech.com%3e"/>
<id>urn:uuid:%3c15822748-1276921260088545801-JavaMail-root@devtech-com%3e</id>
<updated>2009-12-06T08:35:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
An automated nightly build of JAMES has been posted to http://people.apache.org/builds/james/nightly/
--------------------------------------------------------------------
Any unit test errors from the build should be reported below:
--------------------------------------------------------------------
BUILD SUCCESSFUL
Total time: 5 minutes 10 seconds
--------------------------------------------------------------------
Done. Packages Will Be Uploaded To The Nightly Repository.
--------------------------------------------------------------------
Please review http://people.apache.org/builds/james/nightly/BUILD.log.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887606 - /james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java</title>
<author><name>norman@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091205224714.1753223888FD@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091205224714-1753223888FD@eris-apache-org%3e</id>
<updated>2009-12-05T22:47:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: norman
Date: Sat Dec  5 22:47:13 2009
New Revision: 887606

URL: http://svn.apache.org/viewvc?rev=887606&amp;view=rev
Log:
Disable new folder button while new folder creation is in progress

Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java

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=887606&amp;r1=887605&amp;r2=887606&amp;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 Sat
Dec  5 22:47:13 2009
@@ -446,6 +446,7 @@
         registerHandler(display.getNewClick().addClickHandler(new ClickHandler() {
 
             public void onClick(ClickEvent event) {
+                display.getNewEnable().setEnabled(false);
                 editableTreeItem = display.createFolder(new EditHandler() {
 
                     public void onEditEvent(EditEvent event) {
@@ -457,10 +458,11 @@
                                 public void onFailure(Throwable caught) {
                                     GWT.log("Error while create folder", caught);
                                     item.cancelEdit();
+                                    display.getNewEnable().setEnabled(true);
                                 }
 
                                 public void onSuccess(GenericResult result) {
-                                    // Nothing todo
+                                    display.getNewEnable().setEnabled(true);
                                 }
 
                             });



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



</pre>
</div>
</content>
</entry>
<entry>
<title>JAMES Server Nightly Build Report</title>
<author><name>JAMES Nightly Build System &lt;noel@devtech.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c14165791.1270501260002087271.JavaMail.root@devtech.com%3e"/>
<id>urn:uuid:%3c14165791-1270501260002087271-JavaMail-root@devtech-com%3e</id>
<updated>2009-12-05T08:34:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
An automated nightly build of JAMES has been posted to http://people.apache.org/builds/james/nightly/
--------------------------------------------------------------------
Any unit test errors from the build should be reported below:
--------------------------------------------------------------------
BUILD SUCCESSFUL
Total time: 4 minutes 35 seconds
--------------------------------------------------------------------
Done. Packages Will Be Uploaded To The Nightly Repository.
--------------------------------------------------------------------
Please review http://people.apache.org/builds/james/nightly/BUILD.log.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>[GUMP@vmgump]: Project james-server (in module james-server) failed</title>
<author><name>Gump &lt;server-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091205143659.5134E72007B@vmgump.apache.org%3e"/>
<id>urn:uuid:%3c20091205143659-5134E72007B@vmgump-apache-org%3e</id>
<updated>2009-12-05T06:36:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
To whom it may engage...
        
This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at general@gump.apache.org.

Project james-server has an issue affecting its community integration.
This issue affects 1 projects,
 and has been outstanding for 6 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
    - james-server :  James Server


Full details are available at:
    http://vmgump.apache.org/gump/public/james-server/james-server/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were provided:
 -DEBUG- Sole output [james-server-core-library-05122009.jar] identifier set to project name
 -DEBUG- Dependency on javamail exists, no need to add for property gump.resource.javamail.
 -DEBUG- Dependency on magic exists, no need to add for property magic.home.
 -INFO- Failed with reason build failed
 -INFO- Failed to extract fallback artifacts from Gump Repository



The following work was performed:
http://vmgump.apache.org/gump/public/james-server/james-server/gump_work/build_james-server_james-server.html
Work Name: build_james-server_james-server (Type: Build)
Work ended in a state of : Failed
Elapsed: 1 min 41 secs
Command Line: /usr/lib/jvm/java-6-sun/bin/java -Djava.awt.headless=true org.apache.tools.ant.Main
-Dgump.merge=/srv/gump/public/gump/work/merge.xml -Dgump.resource.dnsjava=/srv/gump/public/workspace/james-server/stage/dnsjava/jars/dnsjava-2.0.6.jar
-Dgump.resource.javamail=/srv/gump/packages/javamail-1.4/mail.jar -Dgump.resource.jce=/srv/gump/packages/jce/jce-jdk13-116.jar
-Dmagic.home=/srv/gump/public/workspace/avalon-tools/tools/magic/target/05122009 -Dgump.resource.geronimo-spec-jms=/srv/gump/packages/jms1.1/lib/jms.jar
-Dgump.resource.cornerstone-scheduler-api=/srv/gump/public/workspace/excalibur/cornerstone/scheduler/api/target/cornerstone-scheduler-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.commons-logging=/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-05122009.jar
-Dgump.resource.excalibur-pool-impl=/srv/gump/public/workspace/excalibur/components/pool/impl/target/excalibur-pool-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.cornerstone-threads-api=/s
 rv/gump/public/workspace/excalibur/cornerstone/threads/api/target/cornerstone-threads-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.avalon-framework-api=/srv/gump/public/workspace/excalibur/framework/api/target/avalon-framework-api-4.3.2-SNAPSHOT.jar
-Dgump.resource.avalon-logkit=/srv/gump/packages/avalon/avalon-logkit-2.1.jar -Dgump.resource.cornerstone-connection-impl=/srv/gump/public/workspace/excalibur/cornerstone/connection/impl/target/cornerstone-connection-impl-2.2.3-SNAPSHOT.jar
-Dversion=05122009 -Dgump.resource.cornerstone-datasources-api=/srv/gump/public/workspace/excalibur/cornerstone/datasources/api/target/cornerstone-datasources-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.cornerstone-store-api=/srv/gump/public/workspace/excalibur/cornerstone/store/api/target/cornerstone-store-api-2.2.3-SNAPSHOT.jar
-Dbuild.sysclasspath=last -Dgump.resource.log4j=/srv/gump/public/workspace/logging-log4j-12/dist/lib/log4j-05122009.jar
-Dgump.resource.cornerstone-connection-api=/srv/gump/publ
 ic/workspace/excalibur/cornerstone/connection/api/target/cornerstone-connection-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.commons-net=/srv/gump/public/workspace/apache-commons/net/dist/commons-net-05122009.jar
-Dgump.resource.commons-pool=/srv/gump/public/workspace/apache-commons/pool/dist/commons-pool.jar
-Dgump.resource.bcmail=/srv/gump/packages/bouncycastle-jdk14/bcmail-130.jar -Dgump.signature=05122009
-Dgump.resource.commons-dbcp=/srv/gump/public/workspace/apache-commons/dbcp/dist/commons-dbcp.jar
-Dgump.resource.mailapi=/srv/gump/packages/javamail-1.4/mail.jar -Dgump.resource.excalibur-pool-api=/srv/gump/public/workspace/excalibur/components/pool/api/target/excalibur-pool-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.excalibur-thread-api=/srv/gump/public/workspace/excalibur/components/thread/api/target/excalibur-thread-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.bcprov=/srv/gump/packages/bouncycastle-jdk14/bcprov-130.jar -Dgump.resource.cornerstone-sockets-api=/srv/gump/public/worksp
 ace/excalibur/cornerstone/sockets/api/target/cornerstone-sockets-api-2.2.3-SNAPSHOT.jar -Dgump.resource.cornerstone-threads-impl=/srv/gump/public/workspace/excalibur/cornerstone/threads/impl/target/cornerstone-threads-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.servletapi=/srv/gump/public/workspace/jakarta-servletapi-4/lib/servlet.jar
-Dgump.resource.avalon-meta-tools=/srv/gump/packages/avalon/avalon-meta-tools-1.4.0.jar -Dgump.resource.oro=/srv/gump/public/workspace/jakarta-oro/jakarta-oro-05122009.jar
-Dgump.resource.excalibur-thread-impl=/srv/gump/public/workspace/excalibur/components/thread/impl/target/excalibur-thread-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.avalon-framework-impl=/srv/gump/public/workspace/excalibur/framework/impl/target/avalon-framework-impl-4.3.2-SNAPSHOT.jar
-Dgump.resource.excalibur-datasource=/srv/gump/public/workspace/excalibur/components/datasource/target/excalibur-datasource-2.2.3-SNAPSHOT.jar
-Dgump.resource.activation=/srv/gump/packages/jaf-1.1ea/a
 ctivation.jar -Dgump.resource.concurrent=/srv/gump/packages/dougLea/concurrent.jar -Dgump.resource.commons-collections=/srv/gump/public/workspace/commons-collections-3.x/target/commons-collections-3.3-SNAPSHOT.jar

[Working Directory: /srv/gump/public/workspace/james-server]
CLASSPATH: /usr/lib/jvm/java-6-sun/lib/tools.jar:/srv/gump/public/workspace/james-mailet/target/apache-mailet-2.5-SNAPSHOT.jar:/srv/gump/public/workspace/avalon-tools/tools/magic/target/deliverables/jars/avalon-tools-magic-05122009.jar:/srv/gump/public/workspace/junit/dist/junit-05122009.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/ant/dist/lib/ant-trax.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/packages/junit3.8.1/junit.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/excalibur/framework/api/target/avalon-framework-api-4.3.2-SNAPSHOT.j
 ar:/srv/gump/packages/avalon/avalon-logkit-2.1.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/public/workspace/logging-log4j-12/dist/lib/log4j-05122009.jar:/srv/gump/public/workspace/jakarta-servletapi-4/lib/servlet.jar:/srv/gump/packages/jms1.1/lib/jms.jar:/srv/gump/public/workspace/excalibur/framework/impl/target/avalon-framework-impl-4.3.2-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/datasource/target/excalibur-datasource-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/pool/impl/target/excalibur-pool-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/pool/api/target/excalibur-pool-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/commons-collections-3.x/target/commons-collections-3.3-SNAPSHOT.jar:/srv/gump/packages/dougLea/concurrent.jar:/srv/gump/public/workspace/excalibur/cornerstone/threads/api/target/cornerstone-threads-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/thread/api/targ
 et/excalibur-thread-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/connection/api/target/cornerstone-connection-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/sockets/api/target/cornerstone-sockets-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/connection/impl/target/cornerstone-connection-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/threads/impl/target/cornerstone-threads-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/thread/impl/target/excalibur-thread-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-05122009.jar:/srv/gump/public/workspace/excalibur/cornerstone/datasources/api/target/cornerstone-datasources-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/scheduler/api/target/cornerstone-scheduler-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/store
 /api/target/cornerstone-store-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/net/dist/commons-net-05122009.jar:/srv/gump/public/workspace/apache-commons/dbcp/dist/commons-dbcp.jar:/srv/gump/public/workspace/apache-commons/pool/dist/commons-pool.jar:/srv/gump/public/workspace/jakarta-oro/jakarta-oro-05122009.jar:/srv/gump/public/workspace/james-server/stage/dnsjava/jars/dnsjava-2.0.6.jar:/srv/gump/packages/jaf-1.1ea/activation.jar:/srv/gump/packages/bouncycastle-jdk14/bcmail-130.jar:/srv/gump/packages/bouncycastle-jdk14/bcprov-130.jar:/srv/gump/packages/jce/jce-jdk13-116.jar:/srv/gump/packages/avalon/avalon-meta-tools-1.4.0.jar
---------------------------------------------
    [javac] location: class org.apache.james.osgi.OSGIProcessorManagementModule
    [javac] 				Peaberry.service(ProcessorManagementService.class).export());
    [javac] 				^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGIProcessorManagementModule.java:51:
package org.ops4j.peaberry.util does not exist
    [javac] 		bind(org.ops4j.peaberry.util.TypeLiterals.export(ProcessorManagementService.class)).toProvider(
    [javac] 		                            ^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:39:
cannot find symbol
    [javac] symbol  : variable Peaberry
    [javac] location: class org.apache.james.osgi.OSGISpoolManagementModule
    [javac] 		bind(Store.class).toProvider(Peaberry.service(Store.class).single());
    [javac] 		                             ^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:40:
cannot find symbol
    [javac] symbol  : variable Peaberry
    [javac] location: class org.apache.james.osgi.OSGISpoolManagementModule
    [javac] 		bind(Log.class).toProvider(Peaberry.service(Log.class).single());
    [javac] 		                           ^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:41:
cannot find symbol
    [javac] symbol  : variable Peaberry
    [javac] location: class org.apache.james.osgi.OSGISpoolManagementModule
    [javac] 		bind(HierarchicalConfiguration.class).toProvider(Peaberry.service(HierarchicalConfiguration.class).single());
    [javac] 		                                                 ^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:49:
cannot find symbol
    [javac] symbol  : variable Peaberry
    [javac] location: class org.apache.james.osgi.OSGISpoolManagementModule
    [javac] 				Peaberry.service(SpoolManagementService.class).export());
    [javac] 				^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:48:
package org.ops4j.peaberry.util does not exist
    [javac] 		bind(org.ops4j.peaberry.util.TypeLiterals.export(SpoolManagementService.class)).toProvider(
    [javac] 		                            ^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:51:
cannot find symbol
    [javac] symbol  : variable Peaberry
    [javac] location: class org.apache.james.osgi.OSGISpoolManagementModule
    [javac] 				Peaberry.service(SpoolManagementMBean.class).export());
    [javac] 				^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:50:
package org.ops4j.peaberry.util does not exist
    [javac] 		bind(org.ops4j.peaberry.util.TypeLiterals.export(SpoolManagementMBean.class)).toProvider(
    [javac] 		                            ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 49 errors

BUILD FAILED
/srv/gump/public/workspace/james-server/build.xml:162: The following error occurred while
executing this line:
/srv/gump/public/workspace/james-server/build.xml:63: The following error occurred while executing
this line:
/srv/gump/public/workspace/james-server/build.xml:40: The following error occurred while executing
this line:
/srv/gump/public/workspace/james-server/build-tools/module-build.xml:83: The following error
occurred while executing this line:
/srv/gump/public/workspace/james-server/build-tools/common-build.xml:173: The following error
occurred while executing this line:
/srv/gump/public/workspace/james-server/build-tools/common-build.xml:126: Compile failed;
see the compiler error output for details.

Total time: 1 minute 37 seconds
---------------------------------------------

To subscribe to this information via syndicated feeds:
- RSS: http://vmgump.apache.org/gump/public/james-server/james-server/rss.xml
- Atom: http://vmgump.apache.org/gump/public/james-server/james-server/atom.xml

============================== Gump Tracking Only ===
Produced by Gump version 2.3.
Gump Run 07000005122009, vmgump:vmgump-public:07000005122009
Gump E-mail Identifier (unique within run) #40.

--
Apache Gump
http://gump.apache.org/ [Instance: vmgump]

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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887256 - in /james/hupa/trunk/server/src: main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java</title>
<author><name>norman@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091204162838.613E12388962@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204162838-613E12388962@eris-apache-org%3e</id>
<updated>2009-12-04T16:28:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: norman
Date: Fri Dec  4 16:28:36 2009
New Revision: 887256

URL: http://svn.apache.org/viewvc?rev=887256&amp;view=rev
Log:
fix bug in index caculation when searching in messages

Modified:
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java?rev=887256&amp;r1=887255&amp;r2=887256&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java
Fri Dec  4 16:28:36 2009
@@ -99,10 +99,7 @@
             }
             exists = tmpMessages.length;
 
-            int firstIndex = exists - end;
-            if (firstIndex &lt; 1) {
-                firstIndex = 1;
-            }            
+            int firstIndex = exists - end;        
             
             if (tmpMessages.length &gt; firstIndex) {
                 List&lt;Message&gt; mList = new ArrayList&lt;Message&gt;();

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java?rev=887256&amp;r1=887255&amp;r2=887256&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java
(original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java
Fri Dec  4 16:28:36 2009
@@ -82,11 +82,11 @@
         ByteArrayInputStream is = new ByteArrayInputStream("From: a@foo.com\nTo: b@foo.com\nSubject:
something\n\ndata".getBytes());
         MimeMessage msg = new MimeMessage(session, is);
         serverfolder.addMessages(new Message[]{msg});
-        
-        result = handler.execute(new FetchMessages(clientfolder, 0, 10, "*"), null);
+        result = handler.execute(new FetchMessages(clientfolder, 0, 10, "something"), null);
         assertEquals(1, result.getRealCount());
         assertEquals(1, result.getMessages().size());
         
+        
         result = handler.execute(new FetchMessages(clientfolder, 0, 10, null), null);
         assertEquals(1, result.getRealCount());
         assertEquals(1, result.getMessages().size());



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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887248 - /james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java</title>
<author><name>norman@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091204161359.E677D23888EC@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204161359-E677D23888EC@eris-apache-org%3e</id>
<updated>2009-12-04T16:13:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: norman
Date: Fri Dec  4 16:13:58 2009
New Revision: 887248

URL: http://svn.apache.org/viewvc?rev=887248&amp;view=rev
Log:
Empty the searchbox on logout

Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java?rev=887248&amp;r1=887247&amp;r2=887248&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java
Fri Dec  4 16:13:58 2009
@@ -134,7 +134,10 @@
 
             public void onLogout(LogoutEvent logoutEvent) {
                 getDisplay().reset();
+                getDisplay().getSearchValue().setValue("");
                 
+                // we need to fire a event to notify the history about the reset
+                firePresenterChangedEvent();
             }
             
         });



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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (HUPA-60) Paging in mailtable  is not working when search key is given</title>
<author><name>&quot;Norman Maurer (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c1266276934.1259942780766.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1266276934-1259942780766-JavaMail-jira@brutus%3e</id>
<updated>2009-12-04T16:06:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/HUPA-60?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Norman Maurer resolved HUPA-60.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 0.1

&gt; Paging in mailtable  is not working when search key is given 
&gt; -------------------------------------------------------------
&gt;
&gt;                 Key: HUPA-60
&gt;                 URL: https://issues.apache.org/jira/browse/HUPA-60
&gt;             Project: JAMES Hupa
&gt;          Issue Type: Bug
&gt;          Components: client
&gt;            Reporter: Norman Maurer
&gt;            Assignee: Norman Maurer
&gt;             Fix For: 0.1
&gt;
&gt;


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887242 - in /james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler: AbstractFetchMessagesHandler.java FetchMessagesHandler.java FetchRecentMessagesHandler.java</title>
<author><name>norman@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091204160440.441E723889E4@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204160440-441E723889E4@eris-apache-org%3e</id>
<updated>2009-12-04T16:04:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: norman
Date: Fri Dec  4 16:04:39 2009
New Revision: 887242

URL: http://svn.apache.org/viewvc?rev=887242&amp;view=rev
Log:
Paging is now working with and without search key given (HUPA-60)

Modified:
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchRecentMessagesHandler.java

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java?rev=887242&amp;r1=887241&amp;r2=887242&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java
Fri Dec  4 16:04:39 2009
@@ -83,9 +83,9 @@
                 return new FetchMessagesResult(new ArrayList&lt;org.apache.hupa.shared.data.Message&gt;(),start,offset,exists,0);
             }        
             
-            Message[] messages = getMessagesToConvert(f,action);
+            MessageConvertArray convArray = getMessagesToConvert(f,action);
             
-            return new FetchMessagesResult(convert(offset, f, messages),start, offset,exists,f.getUnreadMessageCount());
+            return new FetchMessagesResult(convert(offset, f, convArray.getMesssages()),start,
offset,convArray.getRealCount(),f.getUnreadMessageCount());
             
         } catch (Exception e) {
             e.printStackTrace();
@@ -104,7 +104,7 @@
         }
     }
     
-    protected abstract Message[] getMessagesToConvert(com.sun.mail.imap.IMAPFolder f, A action)
throws MessagingException;
+    protected abstract MessageConvertArray getMessagesToConvert(com.sun.mail.imap.IMAPFolder
f, A action) throws MessagingException;
     
     protected ArrayList&lt;org.apache.hupa.shared.data.Message&gt; convert(int offset, com.sun.mail.imap.IMAPFolder
folder, Message[] messages) throws MessagingException {
         ArrayList&lt;org.apache.hupa.shared.data.Message&gt; mList = new ArrayList&lt;org.apache.hupa.shared.data.Message&gt;();
@@ -197,7 +197,7 @@
         }
         return mList;
     }
-    
+
     private boolean hasAttachment(Message message) throws MessagingException {
         if (message.getContentType().startsWith("multipart/")) {
             try {
@@ -225,4 +225,23 @@
         }
         return false;
     }
+    
+    
+    protected final class MessageConvertArray {
+        private Message[] messages;
+        private int realCount;
+
+        public MessageConvertArray(int realCount, Message[] messages) {
+            this.messages = messages;
+            this.realCount = realCount;
+        }
+        
+        public int getRealCount() {
+            return realCount;
+        }
+        
+        public Message[] getMesssages() {
+            return messages;
+        }
+    }
 }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java?rev=887242&amp;r1=887241&amp;r2=887242&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java
Fri Dec  4 16:04:39 2009
@@ -19,6 +19,9 @@
 
 package org.apache.hupa.server.handler;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.mail.Message;
 import javax.mail.MessagingException;
 import javax.mail.search.BodyTerm;
@@ -59,28 +62,30 @@
     }
 
     @Override
-    protected Message[] getMessagesToConvert(com.sun.mail.imap.IMAPFolder f,
+    protected MessageConvertArray getMessagesToConvert(com.sun.mail.imap.IMAPFolder f,
             FetchMessages action) throws MessagingException {
         String searchString = action.getSearchString();
         int start = action.getStart();
         int offset = action.getOffset();
         int end = start + offset;
 
-        int exists = f.getMessageCount();
-
-        if (end &gt; exists) {
-            end = exists;
-        }
-
-        int firstIndex = exists - end;
-        if (firstIndex &lt; 1) {
-            firstIndex = 1;
-        }
-        int lastIndex = exists - start;
+       
         Message[] messages;
-
+        int exists;
         // check if a searchString was given, and if so use it
         if (searchString == null) {
+            exists = f.getMessageCount();
+
+            if (end &gt; exists) {
+                end = exists;
+            }
+
+            int firstIndex = exists - end;
+            if (firstIndex &lt; 1) {
+                firstIndex = 1;
+            }
+            int lastIndex = exists - start;
+            
             messages = f.getMessages(firstIndex, lastIndex);
         } else {
             SearchTerm subjectTerm = new SubjectTerm(searchString);
@@ -88,12 +93,29 @@
             SearchTerm bodyTerm = new BodyTerm(searchString);
             SearchTerm orTerm = new OrTerm(new SearchTerm[] { subjectTerm,
                     fromTerm, bodyTerm });
-            messages = f.search(orTerm);
-            if (end &gt; messages.length) {
-                end = messages.length;
+            Message[] tmpMessages = f.search(orTerm);
+            if (end &gt; tmpMessages.length) {
+                end = tmpMessages.length;
+            }
+            exists = tmpMessages.length;
+
+            int firstIndex = exists - end;
+            if (firstIndex &lt; 1) {
+                firstIndex = 1;
+            }            
+            
+            if (tmpMessages.length &gt; firstIndex) {
+                List&lt;Message&gt; mList = new ArrayList&lt;Message&gt;();
+                for (int i = firstIndex; i &lt; tmpMessages.length; i++) {
+                    if (i == end) break;
+                    mList.add(tmpMessages[i]);
+                }
+                messages = mList.toArray(new Message[mList.size()]);
+            } else {
+                messages = new Message[0];
             }
-            exists = messages.length;
+          
         }
-        return messages;
+        return new MessageConvertArray(exists, messages);
     }
 }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchRecentMessagesHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchRecentMessagesHandler.java?rev=887242&amp;r1=887241&amp;r2=887242&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchRecentMessagesHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchRecentMessagesHandler.java
Fri Dec  4 16:04:39 2009
@@ -44,10 +44,10 @@
 
     
     @Override
-    protected Message[] getMessagesToConvert(com.sun.mail.imap.IMAPFolder f,
+    protected MessageConvertArray getMessagesToConvert(com.sun.mail.imap.IMAPFolder f,
             FetchRecentMessages action) throws MessagingException {
         Message[] messages = f.search(new FlagTerm(new Flags(Flag.RECENT), true));
-        return messages;
+        return new MessageConvertArray(messages.length, messages);
     }
 
     /*



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



</pre>
</div>
</content>
</entry>
<entry>
<title>JAMES Server Nightly Build Report</title>
<author><name>JAMES Nightly Build System &lt;noel@devtech.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c11726003.1263921259915700908.JavaMail.root@devtech.com%3e"/>
<id>urn:uuid:%3c11726003-1263921259915700908-JavaMail-root@devtech-com%3e</id>
<updated>2009-12-04T08:35:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
An automated nightly build of JAMES has been posted to http://people.apache.org/builds/james/nightly/
--------------------------------------------------------------------
Any unit test errors from the build should be reported below:
--------------------------------------------------------------------
BUILD SUCCESSFUL
Total time: 4 minutes 45 seconds
--------------------------------------------------------------------
Done. Packages Will Be Uploaded To The Nightly Repository.
--------------------------------------------------------------------
Please review http://people.apache.org/builds/james/nightly/BUILD.log.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (HUPA-60) Paging in mailtable  is not working when search key is given</title>
<author><name>&quot;Norman Maurer (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c2117200094.1259865440728.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c2117200094-1259865440728-JavaMail-jira@brutus%3e</id>
<updated>2009-12-03T18:37:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Paging in mailtable  is not working when search key is given 
-------------------------------------------------------------

                 Key: HUPA-60
                 URL: https://issues.apache.org/jira/browse/HUPA-60
             Project: JAMES Hupa
          Issue Type: Bug
          Components: client
            Reporter: Norman Maurer
            Assignee: Norman Maurer




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886863 - in /james/hupa/trunk/client: src/main/java/org/apache/hupa/client/ src/main/java/org/apache/hupa/client/mvp/ src/main/webapp/WEB-INF/ war/</title>
<author><name>manolo@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091203175357.70AF02388962@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091203175357-70AF02388962@eris-apache-org%3e</id>
<updated>2009-12-03T17:53:31Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: manolo
Date: Thu Dec  3 17:52:20 2009
New Revision: 886863

URL: http://svn.apache.org/viewvc?rev=886863&amp;view=rev
Log:
Minor changes to layout.
Added a new class for hupa's css constants

Added:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java
Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java
    james/hupa/trunk/client/src/main/webapp/WEB-INF/web.xml
    james/hupa/trunk/client/war/Hupa.css

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java?rev=886863&amp;view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java (added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java Thu Dec  3 17:52:20
2009
@@ -0,0 +1,32 @@
+/****************************************************************
+ * 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;
+
+
+/**
+ * CSS class names used in Hupa
+ */
+public class HupaCSS {
+    
+    public static final String C_main_container = "Hupa";
+    
+    public static final String C_logout_btn = "hupa-logout-btn";
+
+}

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppView.java?rev=886863&amp;r1=886862&amp;r2=886863&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppView.java Thu Dec
 3 17:52:20 2009
@@ -19,6 +19,7 @@
 
 package org.apache.hupa.client.mvp;
 
+import org.apache.hupa.client.HupaCSS;
 import org.apache.hupa.client.HupaConstants;
 import org.apache.hupa.shared.events.ServerStatusEvent.ServerStatus;
 
@@ -73,8 +74,10 @@
     @Inject
     public AppView(HupaConstants constants) {
         logoutButton = new Hyperlink(constants.logoutButton(),"");
+        logoutButton.addStyleName(HupaCSS.C_logout_btn);
 
         VerticalPanel vPanel = new VerticalPanel();
+        vPanel.setStyleName(HupaCSS.C_main_container);
 
         vPanel.setSpacing(3);
         vPanel.setWidth("100%");

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java?rev=886863&amp;r1=886862&amp;r2=886863&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
Thu Dec  3 17:52:20 2009
@@ -188,12 +188,12 @@
 
         // This is only needed as workaround in pagingscrolltable
         // See http://code.google.com/p/google-web-toolkit-incubator/wiki/PagingScrollTable
-        mailTable.setWidth(Window.getClientWidth() -150 -40+"px");
+        mailTable.setWidth(Window.getClientWidth() -200+"px");
         mailTable.setHeight("600px");
         Window.addResizeHandler(new ResizeHandler() {
 
             public void onResize(ResizeEvent event) {
-                mailTable.setWidth(Window.getClientWidth() -150 -30+"px");
+                mailTable.setWidth(Window.getClientWidth() -200+"px");
             }
             
         });

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java?rev=886863&amp;r1=886862&amp;r2=886863&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java
Thu Dec  3 17:52:20 2009
@@ -75,8 +75,7 @@
         sendButton = new EnableButton(constants.sendButton());
         backButton = new EnableHyperlink(constants.backButton(),"");
         final VerticalPanel mPanel = new VerticalPanel();
-        //mPanel.setWidth("100%");
-        mPanel.setWidth(Window.getClientWidth() -10 +"px");
+        mPanel.setWidth(Window.getClientWidth() -200 +"px");
         
         Window.addResizeHandler(new ResizeHandler() {
 

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=886863&amp;r1=886862&amp;r2=886863&amp;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 Thu Dec  3 17:52:20 2009
@@ -2,7 +2,7 @@
 &lt;!DOCTYPE web-app
     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
     "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;
-&lt;!-- live config --&gt;
+
 &lt;web-app&gt;
 
 	&lt;!-- Default page to serve --&gt;
@@ -10,11 +10,18 @@
 		&lt;welcome-file&gt;Hupa.html&lt;/welcome-file&gt;
 	&lt;/welcome-file-list&gt;
 
+	&lt;!-- Max size of the upload request (10MB) --&gt;
 	&lt;context-param&gt;
-		&lt;!-- max size of the upload request (100MB) --&gt;
 		&lt;param-name&gt;maxSize&lt;/param-name&gt;
-		&lt;param-value&gt;104857600&lt;/param-value&gt;
+		&lt;param-value&gt;10485760&lt;/param-value&gt;
 	&lt;/context-param&gt;
+	&lt;!-- Useful in development mode to see the upload progress bar in fast networks --&gt;
+        &lt;!--
+	    &lt;context-param&gt;
+		&lt;param-name&gt;slowUploads&lt;/param-name&gt;
+		&lt;param-value&gt;100&lt;/param-value&gt;
+	    &lt;/context-param&gt;
+        --&gt;
 	
 	&lt;!-- servlet for incubator gwt stuff --&gt;
 	&lt;servlet&gt;

Modified: james/hupa/trunk/client/war/Hupa.css
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/Hupa.css?rev=886863&amp;r1=886862&amp;r2=886863&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/war/Hupa.css (original)
+++ james/hupa/trunk/client/war/Hupa.css Thu Dec  3 17:52:20 2009
@@ -122,4 +122,8 @@
 
 .hupa-editor { 
 	border: 2px solid #E0ECFF;
-} 
+}
+
+.hupa-logout-btn {
+	margin-right: 20px;
+}



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



</pre>
</div>
</content>
</entry>
<entry>
<title>JAMES Server Nightly Build Report</title>
<author><name>JAMES Nightly Build System &lt;noel@devtech.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c22358090.1253201259829334372.JavaMail.root@devtech.com%3e"/>
<id>urn:uuid:%3c22358090-1253201259829334372-JavaMail-root@devtech-com%3e</id>
<updated>2009-12-03T08:35:34Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
An automated nightly build of JAMES has been posted to http://people.apache.org/builds/james/nightly/
--------------------------------------------------------------------
Any unit test errors from the build should be reported below:
--------------------------------------------------------------------
BUILD SUCCESSFUL
Total time: 5 minutes 6 seconds
--------------------------------------------------------------------
Done. Packages Will Be Uploaded To The Nightly Repository.
--------------------------------------------------------------------
Please review http://people.apache.org/builds/james/nightly/BUILD.log.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>[GUMP@vmgump]: Project james-server (in module james-server) failed</title>
<author><name>Gump &lt;server-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091203142636.8DA0372007A@vmgump.apache.org%3e"/>
<id>urn:uuid:%3c20091203142636-8DA0372007A@vmgump-apache-org%3e</id>
<updated>2009-12-03T06:26:36Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
To whom it may engage...
        
This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at general@gump.apache.org.

Project james-server has an issue affecting its community integration.
This issue affects 1 projects,
 and has been outstanding for 3 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
    - james-server :  James Server


Full details are available at:
    http://vmgump.apache.org/gump/public/james-server/james-server/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were provided:
 -DEBUG- Sole output [james-server-core-library-03122009.jar] identifier set to project name
 -DEBUG- Dependency on javamail exists, no need to add for property gump.resource.javamail.
 -DEBUG- Dependency on magic exists, no need to add for property magic.home.
 -INFO- Failed with reason build failed
 -INFO- Failed to extract fallback artifacts from Gump Repository



The following work was performed:
http://vmgump.apache.org/gump/public/james-server/james-server/gump_work/build_james-server_james-server.html
Work Name: build_james-server_james-server (Type: Build)
Work ended in a state of : Failed
Elapsed: 46 secs
Command Line: /usr/lib/jvm/java-6-sun/bin/java -Djava.awt.headless=true org.apache.tools.ant.Main
-Dgump.merge=/srv/gump/public/gump/work/merge.xml -Dgump.resource.dnsjava=/srv/gump/public/workspace/james-server/stage/dnsjava/jars/dnsjava-2.0.6.jar
-Dgump.resource.javamail=/srv/gump/packages/javamail-1.4/mail.jar -Dgump.resource.jce=/srv/gump/packages/jce/jce-jdk13-116.jar
-Dmagic.home=/srv/gump/public/workspace/avalon-tools/tools/magic/target/03122009 -Dgump.resource.geronimo-spec-jms=/srv/gump/packages/jms1.1/lib/jms.jar
-Dgump.resource.cornerstone-scheduler-api=/srv/gump/public/workspace/excalibur/cornerstone/scheduler/api/target/cornerstone-scheduler-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.commons-logging=/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-03122009.jar
-Dgump.resource.excalibur-pool-impl=/srv/gump/public/workspace/excalibur/components/pool/impl/target/excalibur-pool-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.cornerstone-threads-api=/s
 rv/gump/public/workspace/excalibur/cornerstone/threads/api/target/cornerstone-threads-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.avalon-framework-api=/srv/gump/public/workspace/excalibur/framework/api/target/avalon-framework-api-4.3.2-SNAPSHOT.jar
-Dgump.resource.avalon-logkit=/srv/gump/packages/avalon/avalon-logkit-2.1.jar -Dgump.resource.cornerstone-connection-impl=/srv/gump/public/workspace/excalibur/cornerstone/connection/impl/target/cornerstone-connection-impl-2.2.3-SNAPSHOT.jar
-Dversion=03122009 -Dgump.resource.cornerstone-datasources-api=/srv/gump/public/workspace/excalibur/cornerstone/datasources/api/target/cornerstone-datasources-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.cornerstone-store-api=/srv/gump/public/workspace/excalibur/cornerstone/store/api/target/cornerstone-store-api-2.2.3-SNAPSHOT.jar
-Dbuild.sysclasspath=last -Dgump.resource.log4j=/srv/gump/public/workspace/logging-log4j-12/dist/lib/log4j-03122009.jar
-Dgump.resource.cornerstone-connection-api=/srv/gump/publ
 ic/workspace/excalibur/cornerstone/connection/api/target/cornerstone-connection-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.commons-net=/srv/gump/public/workspace/apache-commons/net/dist/commons-net-03122009.jar
-Dgump.resource.commons-pool=/srv/gump/public/workspace/apache-commons/pool/dist/commons-pool.jar
-Dgump.resource.bcmail=/srv/gump/packages/bouncycastle-jdk14/bcmail-130.jar -Dgump.signature=03122009
-Dgump.resource.commons-dbcp=/srv/gump/public/workspace/apache-commons/dbcp/dist/commons-dbcp.jar
-Dgump.resource.mailapi=/srv/gump/packages/javamail-1.4/mail.jar -Dgump.resource.excalibur-pool-api=/srv/gump/public/workspace/excalibur/components/pool/api/target/excalibur-pool-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.excalibur-thread-api=/srv/gump/public/workspace/excalibur/components/thread/api/target/excalibur-thread-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.bcprov=/srv/gump/packages/bouncycastle-jdk14/bcprov-130.jar -Dgump.resource.cornerstone-sockets-api=/srv/gump/public/worksp
 ace/excalibur/cornerstone/sockets/api/target/cornerstone-sockets-api-2.2.3-SNAPSHOT.jar -Dgump.resource.cornerstone-threads-impl=/srv/gump/public/workspace/excalibur/cornerstone/threads/impl/target/cornerstone-threads-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.servletapi=/srv/gump/public/workspace/jakarta-servletapi-4/lib/servlet.jar
-Dgump.resource.avalon-meta-tools=/srv/gump/packages/avalon/avalon-meta-tools-1.4.0.jar -Dgump.resource.oro=/srv/gump/public/workspace/jakarta-oro/jakarta-oro-03122009.jar
-Dgump.resource.excalibur-thread-impl=/srv/gump/public/workspace/excalibur/components/thread/impl/target/excalibur-thread-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.avalon-framework-impl=/srv/gump/public/workspace/excalibur/framework/impl/target/avalon-framework-impl-4.3.2-SNAPSHOT.jar
-Dgump.resource.excalibur-datasource=/srv/gump/public/workspace/excalibur/components/datasource/target/excalibur-datasource-2.2.3-SNAPSHOT.jar
-Dgump.resource.activation=/srv/gump/packages/jaf-1.1ea/a
 ctivation.jar -Dgump.resource.concurrent=/srv/gump/packages/dougLea/concurrent.jar -Dgump.resource.commons-collections=/srv/gump/public/workspace/commons-collections-3.x/target/commons-collections-3.3-SNAPSHOT.jar

[Working Directory: /srv/gump/public/workspace/james-server]
CLASSPATH: /usr/lib/jvm/java-6-sun/lib/tools.jar:/srv/gump/public/workspace/james-mailet/target/apache-mailet-2.5-SNAPSHOT.jar:/srv/gump/public/workspace/avalon-tools/tools/magic/target/deliverables/jars/avalon-tools-magic-03122009.jar:/srv/gump/public/workspace/junit/dist/junit-03122009.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/ant/dist/lib/ant-trax.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/packages/junit3.8.1/junit.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/excalibur/framework/api/target/avalon-framework-api-4.3.2-SNAPSHOT.j
 ar:/srv/gump/packages/avalon/avalon-logkit-2.1.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/public/workspace/logging-log4j-12/dist/lib/log4j-03122009.jar:/srv/gump/public/workspace/jakarta-servletapi-4/lib/servlet.jar:/srv/gump/packages/jms1.1/lib/jms.jar:/srv/gump/public/workspace/excalibur/framework/impl/target/avalon-framework-impl-4.3.2-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/datasource/target/excalibur-datasource-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/pool/impl/target/excalibur-pool-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/pool/api/target/excalibur-pool-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/commons-collections-3.x/target/commons-collections-3.3-SNAPSHOT.jar:/srv/gump/packages/dougLea/concurrent.jar:/srv/gump/public/workspace/excalibur/cornerstone/threads/api/target/cornerstone-threads-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/thread/api/targ
 et/excalibur-thread-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/connection/api/target/cornerstone-connection-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/sockets/api/target/cornerstone-sockets-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/connection/impl/target/cornerstone-connection-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/threads/impl/target/cornerstone-threads-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/thread/impl/target/excalibur-thread-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-03122009.jar:/srv/gump/public/workspace/excalibur/cornerstone/datasources/api/target/cornerstone-datasources-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/scheduler/api/target/cornerstone-scheduler-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/store
 /api/target/cornerstone-store-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/net/dist/commons-net-03122009.jar:/srv/gump/public/workspace/apache-commons/dbcp/dist/commons-dbcp.jar:/srv/gump/public/workspace/apache-commons/pool/dist/commons-pool.jar:/srv/gump/public/workspace/jakarta-oro/jakarta-oro-03122009.jar:/srv/gump/public/workspace/james-server/stage/dnsjava/jars/dnsjava-2.0.6.jar:/srv/gump/packages/jaf-1.1ea/activation.jar:/srv/gump/packages/bouncycastle-jdk14/bcmail-130.jar:/srv/gump/packages/bouncycastle-jdk14/bcprov-130.jar:/srv/gump/packages/jce/jce-jdk13-116.jar:/srv/gump/packages/avalon/avalon-meta-tools-1.4.0.jar
---------------------------------------------
    [javac] location: class org.apache.james.osgi.OSGIProcessorManagementModule
    [javac] 				Peaberry.service(ProcessorManagementService.class).export());
    [javac] 				^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGIProcessorManagementModule.java:51:
package org.ops4j.peaberry.util does not exist
    [javac] 		bind(org.ops4j.peaberry.util.TypeLiterals.export(ProcessorManagementService.class)).toProvider(
    [javac] 		                            ^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:39:
cannot find symbol
    [javac] symbol  : variable Peaberry
    [javac] location: class org.apache.james.osgi.OSGISpoolManagementModule
    [javac] 		bind(Store.class).toProvider(Peaberry.service(Store.class).single());
    [javac] 		                             ^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:40:
cannot find symbol
    [javac] symbol  : variable Peaberry
    [javac] location: class org.apache.james.osgi.OSGISpoolManagementModule
    [javac] 		bind(Log.class).toProvider(Peaberry.service(Log.class).single());
    [javac] 		                           ^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:41:
cannot find symbol
    [javac] symbol  : variable Peaberry
    [javac] location: class org.apache.james.osgi.OSGISpoolManagementModule
    [javac] 		bind(HierarchicalConfiguration.class).toProvider(Peaberry.service(HierarchicalConfiguration.class).single());
    [javac] 		                                                 ^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:49:
cannot find symbol
    [javac] symbol  : variable Peaberry
    [javac] location: class org.apache.james.osgi.OSGISpoolManagementModule
    [javac] 				Peaberry.service(SpoolManagementService.class).export());
    [javac] 				^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:48:
package org.ops4j.peaberry.util does not exist
    [javac] 		bind(org.ops4j.peaberry.util.TypeLiterals.export(SpoolManagementService.class)).toProvider(
    [javac] 		                            ^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:51:
cannot find symbol
    [javac] symbol  : variable Peaberry
    [javac] location: class org.apache.james.osgi.OSGISpoolManagementModule
    [javac] 				Peaberry.service(SpoolManagementMBean.class).export());
    [javac] 				^
    [javac] /srv/gump/public/workspace/james-server/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java:50:
package org.ops4j.peaberry.util does not exist
    [javac] 		bind(org.ops4j.peaberry.util.TypeLiterals.export(SpoolManagementMBean.class)).toProvider(
    [javac] 		                            ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 49 errors

BUILD FAILED
/srv/gump/public/workspace/james-server/build.xml:162: The following error occurred while
executing this line:
/srv/gump/public/workspace/james-server/build.xml:63: The following error occurred while executing
this line:
/srv/gump/public/workspace/james-server/build.xml:40: The following error occurred while executing
this line:
/srv/gump/public/workspace/james-server/build-tools/module-build.xml:83: The following error
occurred while executing this line:
/srv/gump/public/workspace/james-server/build-tools/common-build.xml:173: The following error
occurred while executing this line:
/srv/gump/public/workspace/james-server/build-tools/common-build.xml:126: Compile failed;
see the compiler error output for details.

Total time: 45 seconds
---------------------------------------------

To subscribe to this information via syndicated feeds:
- RSS: http://vmgump.apache.org/gump/public/james-server/james-server/rss.xml
- Atom: http://vmgump.apache.org/gump/public/james-server/james-server/atom.xml

============================== Gump Tracking Only ===
Produced by Gump version 2.3.
Gump Run 09000003122009, vmgump:vmgump-public:09000003122009
Gump E-mail Identifier (unique within run) #40.

--
Apache Gump
http://gump.apache.org/ [Instance: vmgump]

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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (JDKIM-3) Deal with ASF export classification for cryptography related code.</title>
<author><name>&quot;Norman Maurer (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c523719840.1259785700750.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c523719840-1259785700750-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T20:28:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/JDKIM-3?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Norman Maurer resolved JDKIM-3.
-------------------------------

    Resolution: Fixed
      Assignee: Norman Maurer  (was: Stefano Bagnara)

http://www.apache.org/licenses/exports/ &lt;- updated and email sent

&gt; Deal with ASF export classification for cryptography related code.
&gt; ------------------------------------------------------------------
&gt;
&gt;                 Key: JDKIM-3
&gt;                 URL: https://issues.apache.org/jira/browse/JDKIM-3
&gt;             Project: JAMES jDKIM
&gt;          Issue Type: Task
&gt;          Components: build &amp; docs
&gt;    Affects Versions: 0.2
&gt;            Reporter: Stefano Bagnara
&gt;            Assignee: Norman Maurer
&gt;            Priority: Blocker
&gt;             Fix For: 0.2
&gt;
&gt;
&gt; We have to add some README text and to file a text to someone to be published.
&gt; http://www.apache.org/licenses/exports/
&gt; http://www.apache.org/dev/crypto.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886219 - /james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java</title>
<author><name>manolo@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091202174559.9B69123888D1@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091202174559-9B69123888D1@eris-apache-org%3e</id>
<updated>2009-12-02T17:45:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: manolo
Date: Wed Dec  2 17:45:59 2009
New Revision: 886219

URL: http://svn.apache.org/viewvc?rev=886219&amp;view=rev
Log:
Deleted a bunch of lines which shouldn't be committed in my last patch 

Modified:
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java?rev=886219&amp;r1=886218&amp;r2=886219&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
Wed Dec  2 17:45:59 2009
@@ -47,13 +47,6 @@
      * @see net.customware.gwt.dispatch.server.ActionHandler#getActionType()
      */
     public Class&lt;SendMessage&gt; getActionType() {
-        try {
-            
-        } catch (Exception e) {
-            // TODO: handle exception
-        } finally {
-            
-        }
         return SendMessage.class;
     }
 



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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886211 - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/mvp/ server/src/main/java/org/apache/hupa/server/handler/ server/src/main/java/org/apache/hupa/server/servlet/ server/src/main/resources/mime/ shared/src/main/java/...</title>
<author><name>manolo@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091202173018.8FEBD23888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091202173018-8FEBD23888C5@eris-apache-org%3e</id>
<updated>2009-12-02T17:30:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: manolo
Date: Wed Dec  2 17:30:17 2009
New Revision: 886211

URL: http://svn.apache.org/viewvc?rev=886211&amp;view=rev
Log:
Use Reply-to header.
Improved the text which is automatically added in the head of reply and forward messages.
Added a log line useful to investigate bug #57

Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/HupaDispatchServlet.java
    james/hupa/trunk/server/src/main/resources/mime/7.msg
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/Util.java
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/AbstractMessage.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java?rev=886211&amp;r1=886210&amp;r2=886211&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
Wed Dec  2 17:30:17 2009
@@ -204,7 +204,7 @@
                     message.setFrom(display.getFromText().getText());
                     
                     ArrayList&lt;String&gt; to = new ArrayList&lt;String&gt;();
-                    String[] toRaw = display.getToText().getText().split(",");
+                    String[] toRaw = display.getToText().getText().split("[,;]+");
                     if (toRaw != null) {
                         for (int i = 0; i &lt; toRaw.length;i++) {
                             String toRecip = toRaw[i].trim();
@@ -216,7 +216,7 @@
                     message.setTo(to);
                     
                     ArrayList&lt;String&gt; cc = new ArrayList&lt;String&gt;();
-                    String[] ccRaw = display.getCcText().getText().split(",");
+                    String[] ccRaw = display.getCcText().getText().split("[,;]+");
                     if (ccRaw != null) {
                         for (int i = 0; i &lt; ccRaw.length;i++) {
                             String ccRecip = ccRaw[i].trim();
@@ -343,23 +343,26 @@
         display.getMessageHTML().setHTML("");
 
         if (type.equals(Type.FORWARD)) {
-            display.getSubjectText().setText("Fwd: " + oldmessage.getSubject());
-            display.getMessageHTML().setHTML(wrapMessage(oldmessage, oldDetails));
+            if (! oldmessage.getSubject().toLowerCase().startsWith("fwd:"))
+                display.getSubjectText().setText("Fwd: " + oldmessage.getSubject());
         } else if (type.equals(Type.REPLY) || type.equals(Type.REPLY_ALL)) {
-            display.getSubjectText().setText("Re: " + oldmessage.getSubject());
-            display.getMessageHTML().setHTML(wrapMessage(oldmessage, oldDetails));
-
-            if (type.equals(Type.REPLY)) {
+            if (! oldmessage.getSubject().toLowerCase().startsWith("re:"))
+                display.getSubjectText().setText("Re: " + oldmessage.getSubject());
+            
+            if (oldmessage.getReplyto() != null) {
+                display.getToText().setText(oldmessage.getReplyto());
+            } else if (type.equals(Type.REPLY)) {
                 display.getToText().setText(oldmessage.getFrom());
             } else {
                 oldmessage.getCc().remove(user.getName());
                 display.getCcText().setText(Util.listToString(oldmessage.getCc()));
                 oldmessage.getTo().remove(user.getName());
-
                 display.getToText().setText(Util.listToString(oldmessage.getTo()));
-
             }
         }
+        
+        display.getMessageHTML().setHTML(wrapMessage(oldmessage, oldDetails, type));
+        
         if (mailto != null)
             display.getToText().setText(mailto);
         firePresenterChangedEvent();
@@ -388,12 +391,31 @@
         // DO Nothing
     }
     
-    private String wrapMessage(Message message, MessageDetails details){
+    private String generateHeader(Message message, Type type) {
+        String ret = "&lt;br&gt;&lt;br&gt;";
+        if (type.equals(Type.FORWARD)) {
+            ret += "--------- Forwarded message --------- &lt;br&gt;";
+            ret += "From: " + message.getFrom().replaceAll("&lt;", "&amp;lt;").replaceAll("&gt;",
"&amp;gt;") + "&lt;br&gt;"; 
+            ret += "Date: " + message.getReceivedDate() + "&lt;br&gt;";
+            ret += "Subject: " + message.getSubject() + "&lt;br&gt;";
+            ArrayList&lt;String&gt; to = new ArrayList&lt;String&gt;();
+            to.addAll(message.getTo());
+            to.addAll(message.getCc());
+            ret += "To: " + Util.listToString(to).replaceAll("&lt;", "&amp;lt;").replaceAll("&gt;",
"&amp;gt;") + "&lt;br&gt;";
+        } else if (type.equals(Type.REPLY) || type.equals(Type.REPLY_ALL)) {
+            ret += "On " + message.getReceivedDate();
+            ret += ", " + message.getFrom().replaceAll("&lt;", "&amp;lt;").replaceAll("&gt;",
"&amp;gt;"); 
+            ret += ". wrote:&lt;br&gt;";
+        }
+        return ret + "&lt;br&gt;";
+    }
+    private String wrapMessage(Message message, MessageDetails details, Type type) {
         String ret;
         ret = "&lt;font size=2 style='font-family: arial'&gt;";
-        ret += "&lt;br&gt;&lt;br&gt;On " + message.getReceivedDate() + ", " + message.getFrom()
+". wrote:&lt;br&gt;";
+        ret += generateHeader(message, type);
         ret += "&lt;blockquote style='border-left: 1px solid rgb(204, 204, 204); margin:
0pt 0pt 0pt 0.8ex; padding-left: 1ex;'&gt;";
-        ret += details.getText();
+        if (details != null)
+            ret += details.getText();
         ret += "&lt;/blockquote&gt;&lt;/font&gt;";
         return ret;
     }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java?rev=886211&amp;r1=886210&amp;r2=886211&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java
Wed Dec  2 17:30:17 2009
@@ -129,6 +129,17 @@
                 }
             }
             msg.setFrom(from);
+
+            String replyto = null;
+            if (m.getReplyTo() != null &amp;&amp; m.getReplyTo().length &gt;0 ) {
+                replyto = m.getReplyTo()[0].toString().trim();
+                try {
+                    replyto = MimeUtility.decodeText(replyto);
+                } catch (UnsupportedEncodingException e) {
+                    logger.debug("Unable to decode replyto " + replyto, e);
+                }
+            }
+            msg.setReplyto(replyto);
             
             ArrayList&lt;String&gt; to = new ArrayList&lt;String&gt;();
             // Add to addresses

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java?rev=886211&amp;r1=886210&amp;r2=886211&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java
Wed Dec  2 17:30:17 2009
@@ -131,7 +131,6 @@
 
         StringBuffer sbPlain = new StringBuffer();
         ArrayList&lt;MessageAttachment&gt; attachmentList = new ArrayList&lt;MessageAttachment&gt;();
-
         
         boolean isHTML = handleParts(message, con, sbPlain, attachmentList);
 
@@ -144,6 +143,7 @@
         mDetails.setMessageAttachments(attachmentList);
 
         mDetails.setRawHeader(message.getAllHeaders().toString());
+        
         return mDetails;
     }
 

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java?rev=886211&amp;r1=886210&amp;r2=886211&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
Wed Dec  2 17:30:17 2009
@@ -47,6 +47,13 @@
      * @see net.customware.gwt.dispatch.server.ActionHandler#getActionType()
      */
     public Class&lt;SendMessage&gt; getActionType() {
+        try {
+            
+        } catch (Exception e) {
+            // TODO: handle exception
+        } finally {
+            
+        }
         return SendMessage.class;
     }
 

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/HupaDispatchServlet.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/HupaDispatchServlet.java?rev=886211&amp;r1=886210&amp;r2=886211&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/HupaDispatchServlet.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/HupaDispatchServlet.java
Wed Dec  2 17:30:17 2009
@@ -50,7 +50,9 @@
     public Result execute( Action&lt;?&gt; action ) throws ActionException {
         try {
             logger.info("HupaDispatchServlet: executing: " + action.getClass().getName().replaceAll("^.*\\.",""));
-            return super.execute(action);
+            Result res = super.execute(action);
+            logger.info("HupaDispatchServlet: finished: " + action.getClass().getName().replaceAll("^.*\\.",""));
+            return res;
         } catch (ActionException e) {
             logger.error("HupaDispatchServlet returns an ActionException:" + e.getMessage());
             e.printStackTrace();

Modified: james/hupa/trunk/server/src/main/resources/mime/7.msg
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/resources/mime/7.msg?rev=886211&amp;r1=886210&amp;r2=886211&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/resources/mime/7.msg (original)
+++ james/hupa/trunk/server/src/main/resources/mime/7.msg Wed Dec  2 17:30:17 2009
@@ -1,7 +1,9 @@
                                                                                         
                                                                                         
                                                                         
 Return-Path: &lt;nobody@foo.com&gt;
 MIME-Version: 1.0
-From: Mickey &lt;nobody@foo.com&gt;
+From: Mickey &lt;mickey@foo.com&gt;
+To: Donald &lt;donald@foo.com&gt;
+Reply-to: list@foo.com
 Date: Thu, 29 Oct 2009 08:05:36 +0100
 Message-ID: &lt;50bb78d50910290005h455ac606q26456bc4cecf5c3f@mail.gmail.com&gt;
 Subject: html with inline images

Modified: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/Util.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/Util.java?rev=886211&amp;r1=886210&amp;r2=886211&amp;view=diff
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/Util.java (original)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/Util.java Wed Dec  2 17:30:17
2009
@@ -52,7 +52,7 @@
         for (int i = 0; i &lt; list.size(); i++) {
             sb.append(list.get(i));
             if (i &lt; list.size()-1) {
-                sb.append(", ");
+                sb.append(",    ");
             }
         }
         return sb.toString();

Modified: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/AbstractMessage.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/AbstractMessage.java?rev=886211&amp;r1=886210&amp;r2=886211&amp;view=diff
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/AbstractMessage.java
(original)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/AbstractMessage.java
Wed Dec  2 17:30:17 2009
@@ -30,6 +30,7 @@
     private static final long serialVersionUID = 5208272852772006815L;
     private String from;
     private String subject;
+    private String replyto;
     private ArrayList&lt;String&gt; to;
     private ArrayList&lt;String&gt; cc;
     private boolean hasAttachment;
@@ -48,6 +49,7 @@
         return "From='" + from 
              + "' To='" + toList
              + "' CC='" + ccList
+             + "' ReplyTo='" + replyto
              + "' Subject='" + subject
              + "' Attachments=" + hasAttachment;
     }
@@ -114,6 +116,13 @@
         this.to = to;
     }
     
+    public String getReplyto() {
+        return replyto;
+    }
+
+    public void setReplyto(String replyto) {
+        this.replyto = replyto;
+    }
 
 
 }



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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886159 - in /james/server/trunk: ./ avalon-socket-library/src/main/java/org/apache/james/socket/ management-library/ management-library/src/main/java/org/apache/james/management/impl/ management-library/src/main/java/org/apache/james/osgi/...</title>
<author><name>norman@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091202144155.6479923888EC@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091202144155-6479923888EC@eris-apache-org%3e</id>
<updated>2009-12-02T14:41:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: norman
Date: Wed Dec  2 14:41:53 2009
New Revision: 886159

URL: http://svn.apache.org/viewvc?rev=886159&amp;view=rev
Log:
Start to work on OSGI deployment.. (this is far from complete atm)

Added:
    james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/SimpleConnectionManagerModule.java
    james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/BayesianAnalyzerManagementModule.java
    james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/DomainListManagementModule.java
    james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/ProcessorManagementModule.java
    james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/SpoolManagementModule.java
    james/server/trunk/management-library/src/main/java/org/apache/james/osgi/
    james/server/trunk/management-library/src/main/java/org/apache/james/osgi/ManagementLibraryActivator.java
    james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIBayesianAnalyzerManagementModule.java
    james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIDomainListManagementModule.java
    james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIProcessorManagementModule.java
    james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java
    james/server/trunk/osgi-deployment/
    james/server/trunk/osgi-deployment/src/
    james/server/trunk/osgi-deployment/src/main/
    james/server/trunk/osgi-deployment/src/main/java/
    james/server/trunk/osgi-deployment/src/main/java/org/
    james/server/trunk/osgi-deployment/src/main/java/org/apache/
    james/server/trunk/osgi-deployment/src/main/java/org/apache/james/
    james/server/trunk/osgi-deployment/src/main/java/org/apache/james/osgi/
    james/server/trunk/osgi-deployment/src/main/java/org/apache/james/osgi/ConfigurationProvider.java
    james/server/trunk/user-library/src/main/java/org/apache/james/impl/jamesuser/LocalJamesUsersRepositoryModule.java
    james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/LocalUsersRepositoryModule.java
    james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/UserManagementModule.java
    james/server/trunk/user-library/src/main/java/org/apache/james/osgi/
    james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGILocalJamesUsersRepositoryModule.java
    james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGILocalUsersRepositoryModule.java
    james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGIUserManagementModule.java
    james/server/trunk/user-library/src/main/java/org/apache/james/osgi/UsersLibraryActivator.java
Modified:
    james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonSimpleConnectionManager.java
    james/server/trunk/management-library/pom.xml
    james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonBayesianAnalyzerManagement.java
    james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonDomainListManagement.java
    james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonProcessorManagement.java
    james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonSpoolManagement.java
    james/server/trunk/pom.xml
    james/server/trunk/stage/pom.xml
    james/server/trunk/user-library/pom.xml
    james/server/trunk/user-library/src/main/java/org/apache/james/impl/jamesuser/AvalonLocalJamesUsersRepository.java
    james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/AvalonLocalUsersRepository.java
    james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/AvalonUserManagement.java

Modified: james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonSimpleConnectionManager.java
URL: http://svn.apache.org/viewvc/james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonSimpleConnectionManager.java?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonSimpleConnectionManager.java (original)
+++ james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonSimpleConnectionManager.java Wed Dec  2 14:41:53 2009
@@ -36,11 +36,9 @@
 import org.apache.excalibur.thread.ThreadPool;
 import org.apache.james.bridge.GuiceInjected;
 import org.apache.james.util.ConfigurationAdapter;
-import org.guiceyfruit.jsr250.Jsr250Module;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
-import com.google.inject.name.Names;
 
 public class AvalonSimpleConnectionManager  implements LogEnabled, Initializable, GuiceInjected, Serviceable, Configurable, JamesConnectionManager {
 
@@ -120,13 +118,13 @@
 
 
     public void initialize() throws Exception {
-        manager = Guice.createInjector(new Jsr250Module() , new AbstractModule() {
+        manager = Guice.createInjector(new SimpleConnectionManagerModule() , new AbstractModule() {
 
             @Override
             protected void configure() {
-                bind(ThreadManager.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.threads.ThreadManager")).toInstance(threadManager);
-                bind(org.apache.commons.configuration.HierarchicalConfiguration.class).annotatedWith(Names.named("org.apache.commons.configuration.Configuration")).toInstance(config);
-                bind(Log.class).annotatedWith(Names.named("org.apache.commons.logging.Log")).toInstance(logger);
+                bind(ThreadManager.class).toInstance(threadManager);
+                bind(org.apache.commons.configuration.HierarchicalConfiguration.class).toInstance(config);
+                bind(Log.class).toInstance(logger);
             }
             
         }).getInstance(SimpleConnectionManager.class);

Added: james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/SimpleConnectionManagerModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/SimpleConnectionManagerModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/SimpleConnectionManagerModule.java (added)
+++ james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/SimpleConnectionManagerModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,37 @@
+/****************************************************************
+ * 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.james.socket;
+
+import org.apache.avalon.cornerstone.services.threads.ThreadManager;
+import org.apache.commons.logging.Log;
+import org.guiceyfruit.jsr250.Jsr250Module;
+
+import com.google.inject.name.Names;
+
+public class SimpleConnectionManagerModule extends Jsr250Module{
+
+	@Override
+	protected void configure() {
+		super.configure();
+		  bind(ThreadManager.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.threads.ThreadManager"));
+          bind(org.apache.commons.configuration.HierarchicalConfiguration.class).annotatedWith(Names.named("org.apache.commons.configuration.Configuration"));
+          bind(Log.class).annotatedWith(Names.named("org.apache.commons.logging.Log"));
+	}
+
+}

Modified: james/server/trunk/management-library/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/pom.xml?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/management-library/pom.xml (original)
+++ james/server/trunk/management-library/pom.xml Wed Dec  2 14:41:53 2009
@@ -27,6 +27,40 @@
   &lt;groupId&gt;org.apache.james&lt;/groupId&gt;
   &lt;artifactId&gt;james-server-management-library&lt;/artifactId&gt;
   &lt;name&gt;Apache JAMES Server Management Library&lt;/name&gt;
+   
+  &lt;build&gt;
+    &lt;plugins&gt;
+      &lt;plugin&gt;
+        &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
+        &lt;configuration&gt;
+          &lt;archive&gt;  
+            &lt;manifestFile&gt;${project.build.outputDirectory}/META-INF/MANIFEST.MF&lt;/manifestFile&gt;
+          &lt;/archive&gt; 
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;  
+      &lt;plugin&gt;    
+        &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
+        &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
+        &lt;executions&gt;
+          &lt;execution&gt;
+            &lt;id&gt;bundle-manifest&lt;/id&gt;
+            &lt;phase&gt;process-classes&lt;/phase&gt;
+            &lt;goals&gt;    
+              &lt;goal&gt;manifest&lt;/goal&gt;
+            &lt;/goals&gt;   
+          &lt;/execution&gt;
+        &lt;/executions&gt;
+        &lt;configuration&gt;
+          &lt;instructions&gt;
+            &lt;Export-Package&gt;org.apache.james.management,org.apache.james.management.*&lt;/Export-Package&gt;
+            &lt;Private-Package&gt;org.apache.james.*&lt;/Private-Package&gt;
+            &lt;Bundle-Activator&gt;org.apache.james.osgi.ManagementLibraryActivator&lt;/Bundle-Activator&gt;
+          &lt;/instructions&gt;
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;  
+    &lt;/plugins&gt;
+  &lt;/build&gt;
+  
   &lt;dependencies&gt;
   
     &lt;dependency&gt;
@@ -117,5 +151,13 @@
       &lt;artifactId&gt;spring-aopalliance&lt;/artifactId&gt;
       &lt;scope&gt;runtime&lt;/scope&gt;
     &lt;/dependency&gt;
+     &lt;dependency&gt;
+      &lt;groupId&gt;org.ops4j&lt;/groupId&gt;
+      &lt;artifactId&gt;peaberry&lt;/artifactId&gt;
+    &lt;/dependency&gt; 
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.osgi&lt;/groupId&gt;
+      &lt;artifactId&gt;org.osgi&lt;/artifactId&gt;
+    &lt;/dependency&gt; 
   &lt;/dependencies&gt;
 &lt;/project&gt;

Modified: james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonBayesianAnalyzerManagement.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonBayesianAnalyzerManagement.java?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonBayesianAnalyzerManagement.java (original)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonBayesianAnalyzerManagement.java Wed Dec  2 14:41:53 2009
@@ -39,11 +39,8 @@
 import org.apache.james.util.ConfigurationAdapter;
 import org.apache.james.bridge.GuiceInjected;
 
-import org.guiceyfruit.jsr250.Jsr250Module;
-
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
-import com.google.inject.name.Names;
 
 public class AvalonBayesianAnalyzerManagement implements GuiceInjected, BayesianAnalyzerManagementMBean, BayesianAnalyzerManagementService, Serviceable, Initializable, Configurable, LogEnabled{
 
@@ -59,14 +56,14 @@
     }
 
     public void initialize() throws Exception {
-        mgmt = Guice.createInjector(new Jsr250Module(), new AbstractModule() {
+        mgmt = Guice.createInjector( new BayesianAnalyzerManagementModule(), new AbstractModule() {
 
             @Override
             protected void configure() {
-                bind(org.apache.commons.configuration.HierarchicalConfiguration.class).annotatedWith(Names.named("org.apache.commons.configuration.Configuration")).toInstance(config);
-                bind(Log.class).annotatedWith(Names.named("org.apache.commons.logging.Log")).toInstance(logger);
-                bind(FileSystem.class).annotatedWith(Names.named("org.apache.james.services.FileSystem")).toInstance(fs);     
-                bind(DataSourceSelector.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.datasources.DataSourceSelector")).toInstance(selector);
+                bind(org.apache.commons.configuration.HierarchicalConfiguration.class).toInstance(config);
+                bind(Log.class).toInstance(logger);
+                bind(FileSystem.class).toInstance(fs);     
+                bind(DataSourceSelector.class).toInstance(selector);
 
             }
             

Modified: james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonDomainListManagement.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonDomainListManagement.java?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonDomainListManagement.java (original)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonDomainListManagement.java Wed Dec  2 14:41:53 2009
@@ -23,26 +23,17 @@
 import java.util.List;
 
 import org.apache.avalon.framework.activity.Initializable;
-import org.apache.avalon.framework.configuration.Configurable;
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.LogEnabled;
-import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.james.api.domainlist.DomainList;
+import org.apache.james.bridge.GuiceInjected;
 import org.apache.james.management.DomainListManagementException;
 import org.apache.james.management.DomainListManagementMBean;
 import org.apache.james.management.DomainListManagementService;
-import org.apache.james.bridge.GuiceInjected;
-
-import org.guiceyfruit.jsr250.Jsr250Module;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
-import com.google.inject.name.Named;
-import com.google.inject.name.Names;
 
 public class AvalonDomainListManagement implements GuiceInjected, DomainListManagementService,DomainListManagementMBean, Serviceable, Initializable {
     private DomainList dList;
@@ -52,11 +43,11 @@
     }
 
     public void initialize() throws Exception {
-        mgmt = Guice.createInjector(new Jsr250Module(), new AbstractModule() {
+        mgmt = Guice.createInjector(new DomainListManagementModule(), new AbstractModule() {
 
             @Override
             protected void configure() {
-                bind(DomainList.class).annotatedWith(Names.named("org.apache.james.api.domainlist.DomainList")).toInstance(dList);
+                bind(DomainList.class).toInstance(dList);
             }
             
         }).getInstance(DomainListManagement.class);

Modified: james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonProcessorManagement.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonProcessorManagement.java?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonProcessorManagement.java (original)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonProcessorManagement.java Wed Dec  2 14:41:53 2009
@@ -22,16 +22,13 @@
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
+import org.apache.james.bridge.GuiceInjected;
 import org.apache.james.management.ProcessorManagementMBean;
 import org.apache.james.management.ProcessorManagementService;
 import org.apache.james.services.SpoolManager;
-import org.apache.james.bridge.GuiceInjected;
-
-import org.guiceyfruit.jsr250.Jsr250Module;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
-import com.google.inject.name.Names;
 
 public class AvalonProcessorManagement implements GuiceInjected, Serviceable, Initializable, ProcessorManagementService, ProcessorManagementMBean {
 
@@ -44,11 +41,11 @@
     }
 
     public void initialize() throws Exception {
-        mgmt = Guice.createInjector(new Jsr250Module(), new AbstractModule() {
+        mgmt = Guice.createInjector(new ProcessorManagementModule(), new AbstractModule() {
 
             @Override
             protected void configure() {
-                bind(SpoolManager.class).annotatedWith(Names.named("org.apache.james.services.SpoolManager")).toInstance(smanager);
+                bind(SpoolManager.class).toInstance(smanager);
             }
             
         }).getInstance(ProcessorManagement.class);

Modified: james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonSpoolManagement.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonSpoolManagement.java?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonSpoolManagement.java (original)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/AvalonSpoolManagement.java Wed Dec  2 14:41:53 2009
@@ -28,16 +28,14 @@
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
+import org.apache.james.bridge.GuiceInjected;
 import org.apache.james.management.SpoolFilter;
 import org.apache.james.management.SpoolManagementException;
 import org.apache.james.management.SpoolManagementMBean;
 import org.apache.james.management.SpoolManagementService;
-import org.apache.james.bridge.GuiceInjected;
-import org.guiceyfruit.jsr250.Jsr250Module;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
-import com.google.inject.name.Names;
 
 public class AvalonSpoolManagement  implements GuiceInjected, Serviceable, Initializable, SpoolManagementService, SpoolManagementMBean{
 
@@ -81,11 +79,11 @@
     }
 
     public void initialize() throws Exception {
-        mgmt = Guice.createInjector(new Jsr250Module(), new AbstractModule() {
+        mgmt = Guice.createInjector(new SpoolManagementModule(), new AbstractModule() {
 
             @Override
             protected void configure() {
-                bind(Store.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.store.Store")).toInstance(mailStore);
+                bind(Store.class).toInstance(mailStore);
             }
             
         }).getInstance(SpoolManagement.class);

Added: james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/BayesianAnalyzerManagementModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/BayesianAnalyzerManagementModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/BayesianAnalyzerManagementModule.java (added)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/BayesianAnalyzerManagementModule.java Wed Dec  2 14:41:53 2009
@@ -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.james.management.impl;
+
+import org.apache.avalon.cornerstone.services.datasources.DataSourceSelector;
+import org.apache.commons.logging.Log;
+import org.apache.james.services.FileSystem;
+import org.guiceyfruit.jsr250.Jsr250Module;
+
+import com.google.inject.name.Names;
+
+public class BayesianAnalyzerManagementModule extends Jsr250Module {
+
+    @Override
+    protected void configure() {
+    	super.configure();
+        bind(org.apache.commons.configuration.HierarchicalConfiguration.class).annotatedWith(Names.named("org.apache.commons.configuration.Configuration"));
+        bind(Log.class).annotatedWith(Names.named("org.apache.commons.logging.Log"));
+        bind(FileSystem.class).annotatedWith(Names.named("org.apache.james.services.FileSystem"));     
+        bind(DataSourceSelector.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.datasources.DataSourceSelector"));
+    } 
+}

Added: james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/DomainListManagementModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/DomainListManagementModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/DomainListManagementModule.java (added)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/DomainListManagementModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,35 @@
+/****************************************************************
+ * 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.james.management.impl;
+
+import org.apache.james.api.domainlist.DomainList;
+import org.guiceyfruit.jsr250.Jsr250Module;
+
+import com.google.inject.name.Names;
+
+public class DomainListManagementModule extends Jsr250Module{
+
+	@Override
+	protected void configure() {
+		super.configure();
+		
+        bind(DomainList.class).annotatedWith(Names.named("org.apache.james.api.domainlist.DomainList"));
+	}
+
+}

Added: james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/ProcessorManagementModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/ProcessorManagementModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/ProcessorManagementModule.java (added)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/ProcessorManagementModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,35 @@
+/****************************************************************
+ * 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.james.management.impl;
+
+import org.apache.james.services.SpoolManager;
+import org.guiceyfruit.jsr250.Jsr250Module;
+
+import com.google.inject.name.Names;
+
+public class ProcessorManagementModule extends Jsr250Module{
+
+	@Override
+	protected void configure() {
+		super.configure();
+        bind(SpoolManager.class).annotatedWith(Names.named("org.apache.james.services.SpoolManager"));
+
+	}
+
+}

Added: james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/SpoolManagementModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/SpoolManagementModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/SpoolManagementModule.java (added)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/management/impl/SpoolManagementModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,35 @@
+/****************************************************************
+ * 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.james.management.impl;
+
+import org.apache.avalon.cornerstone.services.store.Store;
+import org.guiceyfruit.jsr250.Jsr250Module;
+
+import com.google.inject.name.Names;
+
+public class SpoolManagementModule extends Jsr250Module{
+
+	@Override
+	protected void configure() {
+		super.configure();
+        bind(Store.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.store.Store"));
+	}
+
+}

Added: james/server/trunk/management-library/src/main/java/org/apache/james/osgi/ManagementLibraryActivator.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/osgi/ManagementLibraryActivator.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/osgi/ManagementLibraryActivator.java (added)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/osgi/ManagementLibraryActivator.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,117 @@
+/****************************************************************
+ * 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.james.osgi;
+
+import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.james.management.BayesianAnalyzerManagementMBean;
+import org.apache.james.management.BayesianAnalyzerManagementService;
+import org.apache.james.management.DomainListManagementMBean;
+import org.apache.james.management.DomainListManagementService;
+import org.apache.james.management.ProcessorManagementMBean;
+import org.apache.james.management.ProcessorManagementService;
+import org.apache.james.management.SpoolManagementMBean;
+import org.apache.james.management.SpoolManagementService;
+import org.ops4j.peaberry.Export;
+import org.ops4j.peaberry.Peaberry;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.Provider;
+
+public class ManagementLibraryActivator implements BundleActivator {
+
+	@Inject
+	private Export&lt;BayesianAnalyzerManagementMBean&gt; analyzerBean;
+
+	@Inject
+	private Export&lt;BayesianAnalyzerManagementService&gt; analyzerService;
+
+	@Inject
+	private Export&lt;DomainListManagementMBean&gt; domBean;
+
+	@Inject
+	private Export&lt;DomainListManagementService&gt; domService;
+
+	@Inject
+	private Export&lt;ProcessorManagementMBean&gt; procBean;
+
+	@Inject
+	private Export&lt;ProcessorManagementService&gt; procService;
+
+	@Inject
+	private Export&lt;SpoolManagementMBean&gt; spoolBean;
+
+	@Inject
+	private Export&lt;SpoolManagementService&gt; spoolService;
+
+	@Inject
+	private Provider&lt;Log&gt; logProvider;
+
+	@Inject
+	private Provider&lt;HierarchicalConfiguration&gt; configProvider;
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
+	 * )
+	 */
+	public void start(BundleContext context) throws Exception {
+		Injector inj = Guice.createInjector(Peaberry.osgiModule(context),
+				new OSGIBayesianAnalyzerManagementModule(),
+				new OSGIDomainListManagementModule(),
+				new OSGIProcessorManagementModule(),
+				new OSGISpoolManagementModule());
+
+		/* Create bundle content */
+		inj.injectMembers(this);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		analyzerBean.unput();
+		analyzerService.unput();
+		domService.unput();
+		domBean.unput();
+		procBean.unput();
+		procService.unput();
+		spoolBean.unput();
+		spoolService.unput();
+
+		analyzerBean = null;
+		analyzerService = null;
+		domService = null;
+		domBean = null;
+		procBean = null;
+		procService = null;
+		spoolBean = null;
+		spoolService = null;
+
+	}
+}

Added: james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIBayesianAnalyzerManagementModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIBayesianAnalyzerManagementModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIBayesianAnalyzerManagementModule.java (added)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIBayesianAnalyzerManagementModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,56 @@
+/****************************************************************
+ * 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.james.osgi;
+
+import org.apache.avalon.cornerstone.services.datasources.DataSourceSelector;
+import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.james.management.BayesianAnalyzerManagementMBean;
+import org.apache.james.management.BayesianAnalyzerManagementService;
+import org.apache.james.management.impl.BayesianAnalyzerManagementModule;
+import org.apache.james.services.FileSystem;
+import org.ops4j.peaberry.Peaberry;
+
+import com.google.inject.name.Names;
+
+public class OSGIBayesianAnalyzerManagementModule extends BayesianAnalyzerManagementModule{
+
+	@Override
+	protected void configure() {
+		super.configure();
+
+		// import osgi service
+		bind(FileSystem.class).toProvider(Peaberry.service(FileSystem.class).single());
+		bind(DataSourceSelector.class).toProvider(Peaberry.service(DataSourceSelector.class).single());
+
+		bind(Log.class).toProvider(Peaberry.service(Log.class).single());
+		bind(HierarchicalConfiguration.class).toProvider(Peaberry.service(HierarchicalConfiguration.class).single());
+		
+		// bind annotations to get the right logger and config
+		bind(String.class).annotatedWith(Names.named("LoggerName")).toInstance("bayesiananalyzermanagement");
+		bind(String.class).annotatedWith(Names.named("ConfigurationName")).toInstance("bayesiananalyzermanagement");
+		
+		// export it as osgi service
+		bind(org.ops4j.peaberry.util.TypeLiterals.export(BayesianAnalyzerManagementMBean.class)).toProvider(
+				Peaberry.service(BayesianAnalyzerManagementMBean.class).export());
+		bind(org.ops4j.peaberry.util.TypeLiterals.export(BayesianAnalyzerManagementService.class)).toProvider(
+				Peaberry.service(BayesianAnalyzerManagementService.class).export());
+	}
+}

Added: james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIDomainListManagementModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIDomainListManagementModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIDomainListManagementModule.java (added)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIDomainListManagementModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,55 @@
+/****************************************************************
+ * 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.james.osgi;
+
+import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.james.api.domainlist.DomainList;
+import org.apache.james.management.DomainListManagementMBean;
+import org.apache.james.management.DomainListManagementService;
+import org.apache.james.management.impl.DomainListManagementModule;
+import org.ops4j.peaberry.Peaberry;
+
+import com.google.inject.name.Names;
+
+public class OSGIDomainListManagementModule extends DomainListManagementModule{
+
+	@Override
+	protected void configure() {
+		super.configure();
+		
+
+		// import osgi service
+		bind(DomainList.class).toProvider(Peaberry.service(DomainList.class).single());
+		bind(Log.class).toProvider(Peaberry.service(Log.class).single());
+		bind(HierarchicalConfiguration.class).toProvider(Peaberry.service(HierarchicalConfiguration.class).single());
+		
+		// bind annotations to get the right logger and config
+		bind(String.class).annotatedWith(Names.named("LoggerName")).toInstance("domainlistmanagement");
+		bind(String.class).annotatedWith(Names.named("ConfigurationName")).toInstance("domainlistmanagement");
+		
+		// export it as osgi service
+		bind(org.ops4j.peaberry.util.TypeLiterals.export(DomainListManagementMBean.class)).toProvider(
+				Peaberry.service(DomainListManagementMBean.class).export());
+		bind(org.ops4j.peaberry.util.TypeLiterals.export(DomainListManagementService.class)).toProvider(
+				Peaberry.service(DomainListManagementService.class).export());
+	}
+
+}

Added: james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIProcessorManagementModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIProcessorManagementModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIProcessorManagementModule.java (added)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGIProcessorManagementModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,54 @@
+/****************************************************************
+ * 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.james.osgi;
+
+import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.james.management.ProcessorManagementMBean;
+import org.apache.james.management.ProcessorManagementService;
+import org.apache.james.management.impl.ProcessorManagementModule;
+import org.apache.james.services.SpoolManager;
+import org.ops4j.peaberry.Peaberry;
+
+import com.google.inject.name.Names;
+
+public class OSGIProcessorManagementModule extends ProcessorManagementModule{
+
+
+	@Override
+	protected void configure() {
+		super.configure();
+		
+
+		// import osgi service
+		bind(SpoolManager.class).toProvider(Peaberry.service(SpoolManager.class).single());
+		bind(Log.class).toProvider(Peaberry.service(Log.class).single());
+		bind(HierarchicalConfiguration.class).toProvider(Peaberry.service(HierarchicalConfiguration.class).single());
+		
+		// bind annotations to get the right logger and config
+		bind(String.class).annotatedWith(Names.named("LoggerName")).toInstance("processormanagement");
+		bind(String.class).annotatedWith(Names.named("ConfigurationName")).toInstance("processormanagement");
+		
+		// export it as osgi service
+		bind(org.ops4j.peaberry.util.TypeLiterals.export(ProcessorManagementMBean.class)).toProvider(
+				Peaberry.service(ProcessorManagementMBean.class).export());
+		bind(org.ops4j.peaberry.util.TypeLiterals.export(ProcessorManagementService.class)).toProvider(
+				Peaberry.service(ProcessorManagementService.class).export());
+	}
+}

Added: james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java (added)
+++ james/server/trunk/management-library/src/main/java/org/apache/james/osgi/OSGISpoolManagementModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,53 @@
+/****************************************************************
+ * 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.james.osgi;
+
+import org.apache.avalon.cornerstone.services.store.Store;
+import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.james.management.SpoolManagementMBean;
+import org.apache.james.management.SpoolManagementService;
+import org.apache.james.management.impl.SpoolManagementModule;
+import org.ops4j.peaberry.Peaberry;
+
+import com.google.inject.name.Names;
+
+public class OSGISpoolManagementModule extends SpoolManagementModule{
+	
+	@Override
+	protected void configure() {
+		super.configure();
+		
+
+		// import osgi service
+		bind(Store.class).toProvider(Peaberry.service(Store.class).single());
+		bind(Log.class).toProvider(Peaberry.service(Log.class).single());
+		bind(HierarchicalConfiguration.class).toProvider(Peaberry.service(HierarchicalConfiguration.class).single());
+		
+		// bind annotations to get the right logger and config
+		bind(String.class).annotatedWith(Names.named("LoggerName")).toInstance("spoolmanagement");
+		bind(String.class).annotatedWith(Names.named("ConfigurationName")).toInstance("spoolmanagement");
+		
+		// export it as osgi service
+		bind(org.ops4j.peaberry.util.TypeLiterals.export(SpoolManagementService.class)).toProvider(
+				Peaberry.service(SpoolManagementService.class).export());
+		bind(org.ops4j.peaberry.util.TypeLiterals.export(SpoolManagementMBean.class)).toProvider(
+				Peaberry.service(SpoolManagementMBean.class).export());
+	}
+}

Added: james/server/trunk/osgi-deployment/src/main/java/org/apache/james/osgi/ConfigurationProvider.java
URL: http://svn.apache.org/viewvc/james/server/trunk/osgi-deployment/src/main/java/org/apache/james/osgi/ConfigurationProvider.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/osgi-deployment/src/main/java/org/apache/james/osgi/ConfigurationProvider.java (added)
+++ james/server/trunk/osgi-deployment/src/main/java/org/apache/james/osgi/ConfigurationProvider.java Wed Dec  2 14:41:53 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.james.osgi;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.commons.configuration.XMLConfiguration;
+
+import com.google.inject.Provider;
+import com.google.inject.name.Named;
+
+public class ConfigurationProvider implements Provider&lt;HierarchicalConfiguration&gt;{
+
+	private XMLConfiguration rootConf;
+	private String componentName;
+	
+	public ConfigurationProvider(@Named("ConfigurationName") String componentName) throws ConfigurationException {
+		this.rootConf = new XMLConfiguration();
+		rootConf.setDelimiterParsingDisabled(true);
+		rootConf.load("config.xml");
+		this.componentName = componentName;
+	}
+	
+	
+	public HierarchicalConfiguration get() {
+		return rootConf.configurationAt(componentName);
+	}
+
+}

Modified: james/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/pom.xml?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/pom.xml (original)
+++ james/server/trunk/pom.xml Wed Dec  2 14:41:53 2009
@@ -82,6 +82,10 @@
   &lt;/scm&gt;
   &lt;build&gt;
     &lt;plugins&gt;
+      &lt;plugin&gt;    
+        &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
+        &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
+      &lt;/plugin&gt;  
       &lt;plugin&gt;
         &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
         &lt;configuration&gt;
@@ -180,7 +184,22 @@
       &lt;/snapshots&gt;
     &lt;/repository&gt;
      --&gt;
+    &lt;!-- enable central that is otherwise disabled by the parent pom. --&gt;
+    &lt;repository&gt;
+      &lt;id&gt;central&lt;/id&gt;
+      &lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;
+      &lt;releases&gt;
+         &lt;enabled&gt;true&lt;/enabled&gt;
+      &lt;/releases&gt;
+    &lt;/repository&gt;
   &lt;/repositories&gt;
+  &lt;dependencies&gt;
+  	&lt;dependency&gt;
+  		&lt;groupId&gt;org.osgi&lt;/groupId&gt;
+  		&lt;artifactId&gt;org.osgi&lt;/artifactId&gt;
+  		&lt;version&gt;3.0.0&lt;/version&gt;
+  	&lt;/dependency&gt;
+  &lt;/dependencies&gt;
   &lt;reporting&gt;
     &lt;plugins&gt;
     &lt;!--
@@ -1150,11 +1169,26 @@
       &lt;version&gt;2.0&lt;/version&gt;
     &lt;/dependency&gt;
     &lt;dependency&gt;
+      &lt;groupId&gt;javax.annotation&lt;/groupId&gt;
+      &lt;artifactId&gt;jsr250-api&lt;/artifactId&gt;     
+      &lt;version&gt;1.0&lt;/version&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
       &lt;groupId&gt;spring-aopalliance&lt;/groupId&gt;
       &lt;artifactId&gt;spring-aopalliance&lt;/artifactId&gt;
       &lt;version&gt;1.0&lt;/version&gt;
       &lt;scope&gt;runtime&lt;/scope&gt;
     &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.ops4j&lt;/groupId&gt;
+      &lt;artifactId&gt;peaberry&lt;/artifactId&gt;
+      &lt;version&gt;1.1.1&lt;/version&gt;
+    &lt;/dependency&gt; 
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.osgi&lt;/groupId&gt;
+      &lt;artifactId&gt;org.osgi&lt;/artifactId&gt;
+      &lt;version&gt;3.0.0&lt;/version&gt;
+    &lt;/dependency&gt; 
   &lt;/dependencies&gt;
   &lt;/dependencyManagement&gt;
 

Modified: james/server/trunk/stage/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/stage/pom.xml?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/stage/pom.xml (original)
+++ james/server/trunk/stage/pom.xml Wed Dec  2 14:41:53 2009
@@ -400,10 +400,18 @@
       &lt;artifactId&gt;guiceyfruit-core&lt;/artifactId&gt;
     &lt;/dependency&gt;
     &lt;dependency&gt;
+      &lt;groupId&gt;javax.annotation&lt;/groupId&gt;
+      &lt;artifactId&gt;jsr250-api&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
       &lt;groupId&gt;spring-aopalliance&lt;/groupId&gt;
       &lt;artifactId&gt;spring-aopalliance&lt;/artifactId&gt;
       &lt;scope&gt;runtime&lt;/scope&gt;
     &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.ops4j&lt;/groupId&gt;
+      &lt;artifactId&gt;peaberry&lt;/artifactId&gt;
+    &lt;/dependency&gt; 
   &lt;/dependencies&gt;
   
   &lt;build&gt;

Modified: james/server/trunk/user-library/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/pom.xml?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/user-library/pom.xml (original)
+++ james/server/trunk/user-library/pom.xml Wed Dec  2 14:41:53 2009
@@ -28,6 +28,41 @@
   &lt;artifactId&gt;james-server-user-library&lt;/artifactId&gt;
   &lt;version&gt;3.0-M1&lt;/version&gt;
   &lt;name&gt;Apache JAMES Server User Library&lt;/name&gt;
+
+  &lt;build&gt;
+    &lt;plugins&gt;
+      &lt;plugin&gt;
+        &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
+        &lt;configuration&gt;
+          &lt;archive&gt;  
+            &lt;manifestFile&gt;${project.build.outputDirectory}/META-INF/MANIFEST.MF&lt;/manifestFile&gt;
+          &lt;/archive&gt; 
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;  
+      &lt;plugin&gt;    
+        &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
+        &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
+        &lt;executions&gt;
+          &lt;execution&gt;
+            &lt;id&gt;bundle-manifest&lt;/id&gt;
+            &lt;phase&gt;process-classes&lt;/phase&gt;
+            &lt;goals&gt;    
+              &lt;goal&gt;manifest&lt;/goal&gt;
+            &lt;/goals&gt;   
+          &lt;/execution&gt;
+        &lt;/executions&gt;
+        &lt;configuration&gt;
+          &lt;instructions&gt;
+            &lt;Export-Package&gt;org.apache.james.impl.jamesuser,org.apache.james.impl.user&lt;/Export-Package&gt;
+            &lt;Private-Package&gt;org.apache.james.*&lt;/Private-Package&gt;
+            &lt;Bundle-Activator&gt;org.apache.james.osgi.UsersLibraryActivator&lt;/Bundle-Activator&gt;
+          &lt;/instructions&gt;
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;  
+    &lt;/plugins&gt;
+  &lt;/build&gt;
+  
+  
   &lt;dependencies&gt;
     &lt;dependency&gt;
       &lt;groupId&gt;org.apache.james&lt;/groupId&gt;
@@ -67,7 +102,14 @@
       &lt;artifactId&gt;spring-aopalliance&lt;/artifactId&gt;
       &lt;scope&gt;runtime&lt;/scope&gt;
     &lt;/dependency&gt;
-    
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.ops4j&lt;/groupId&gt;
+      &lt;artifactId&gt;peaberry&lt;/artifactId&gt;
+    &lt;/dependency&gt; 
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.osgi&lt;/groupId&gt;
+      &lt;artifactId&gt;org.osgi&lt;/artifactId&gt;
+    &lt;/dependency&gt; 
     &lt;dependency&gt;
       &lt;groupId&gt;oro&lt;/groupId&gt;
       &lt;artifactId&gt;oro&lt;/artifactId&gt;

Modified: james/server/trunk/user-library/src/main/java/org/apache/james/impl/jamesuser/AvalonLocalJamesUsersRepository.java
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/src/main/java/org/apache/james/impl/jamesuser/AvalonLocalJamesUsersRepository.java?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/user-library/src/main/java/org/apache/james/impl/jamesuser/AvalonLocalJamesUsersRepository.java (original)
+++ james/server/trunk/user-library/src/main/java/org/apache/james/impl/jamesuser/AvalonLocalJamesUsersRepository.java Wed Dec  2 14:41:53 2009
@@ -21,16 +21,24 @@
 
 import java.util.Collection;
 
+import org.apache.james.api.user.UsersStore;
 import org.apache.james.api.vut.ErrorMappingException;
 import org.apache.james.impl.user.AvalonLocalUsersRepository;
-import org.guiceyfruit.jsr250.Jsr250Module;
 
+import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
 
 public class AvalonLocalJamesUsersRepository extends AvalonLocalUsersRepository implements JamesUsersRepository{
     
     public void initialize() throws Exception {
-        repos = Guice.createInjector(new Jsr250Module(), new LocalUsersRepositoryModule()).getInstance(LocalJamesUsersRepository.class);
+        repos = Guice.createInjector(new LocalJamesUsersRepositoryModule(), new AbstractModule() {
+
+            @Override
+            protected void configure() {
+                bind(UsersStore.class).toInstance(usersStore);
+            }
+            
+        }).getInstance(LocalJamesUsersRepository.class);
     }
     
     public void setEnableAliases(boolean enableAliases) {

Added: james/server/trunk/user-library/src/main/java/org/apache/james/impl/jamesuser/LocalJamesUsersRepositoryModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/src/main/java/org/apache/james/impl/jamesuser/LocalJamesUsersRepositoryModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/user-library/src/main/java/org/apache/james/impl/jamesuser/LocalJamesUsersRepositoryModule.java (added)
+++ james/server/trunk/user-library/src/main/java/org/apache/james/impl/jamesuser/LocalJamesUsersRepositoryModule.java Wed Dec  2 14:41:53 2009
@@ -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.james.impl.jamesuser;
+
+import org.apache.james.impl.user.LocalUsersRepositoryModule;
+
+public class LocalJamesUsersRepositoryModule extends LocalUsersRepositoryModule{
+
+}

Modified: james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/AvalonLocalUsersRepository.java
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/AvalonLocalUsersRepository.java?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/AvalonLocalUsersRepository.java (original)
+++ james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/AvalonLocalUsersRepository.java Wed Dec  2 14:41:53 2009
@@ -28,34 +28,30 @@
 import org.apache.james.api.user.UsersRepository;
 import org.apache.james.api.user.UsersStore;
 import org.apache.james.bridge.GuiceInjected;
-import org.guiceyfruit.jsr250.Jsr250Module;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
-import com.google.inject.name.Names;
 
 public class AvalonLocalUsersRepository implements GuiceInjected, Initializable,Serviceable,UsersRepository{
 
-    private UsersStore usersStore;
+    protected UsersStore usersStore;
     protected LocalUsersRepository repos;
     
     public void initialize() throws Exception {
-        repos = Guice.createInjector(new Jsr250Module(), new LocalUsersRepositoryModule()).getInstance(LocalUsersRepository.class);
+        repos = Guice.createInjector(new LocalUsersRepositoryModule(), new AbstractModule() {
+
+            @Override
+            protected void configure() {
+                bind(UsersStore.class).toInstance(usersStore);
+            }
+            
+        }).getInstance(LocalUsersRepository.class);
     }
 
     public void service(ServiceManager manager) throws ServiceException {
         usersStore = (UsersStore) manager.lookup(UsersStore.ROLE);
     }
     
-    public class LocalUsersRepositoryModule extends AbstractModule {
-
-        @Override
-        protected void configure() {
-            bind(UsersStore.class).annotatedWith(Names.named("org.apache.james.api.user.UsersStore")).toInstance(usersStore);
-        }
-        
-    }
-
     public boolean addUser(User user) {
         return repos.addUser(user);
     }

Modified: james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/AvalonUserManagement.java
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/AvalonUserManagement.java?rev=886159&amp;r1=886158&amp;r2=886159&amp;view=diff
==============================================================================
--- james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/AvalonUserManagement.java (original)
+++ james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/AvalonUserManagement.java Wed Dec  2 14:41:53 2009
@@ -29,11 +29,10 @@
 import org.apache.james.api.user.management.UserManagementException;
 import org.apache.james.api.user.management.UserManagementMBean;
 import org.apache.james.bridge.GuiceInjected;
-import org.guiceyfruit.jsr250.Jsr250Module;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
-import com.google.inject.name.Names;
+
 
 public class AvalonUserManagement implements UserManagementMBean, GuiceInjected, Serviceable, Initializable {
 
@@ -99,17 +98,16 @@
     }
 
     public void initialize() throws Exception {
-        bean = Guice.createInjector(new Jsr250Module(), new UserManagementModule()).getInstance(UserManagement.class);
+        bean = Guice.createInjector(new UserManagementModule(), new AbstractModule() {
+			
+			@Override
+			protected void configure() {
+				bind(UsersStore.class).toInstance(store);
+				bind(UsersRepository.class).toInstance(repos);
+			}
+		}).getInstance(UserManagement.class);
     }
     
-    private class UserManagementModule extends AbstractModule {
-
-        @Override
-        protected void configure() {
-            bind(UsersStore.class).annotatedWith(Names.named("org.apache.james.api.user.UsersStore")).toInstance(store);
-            bind(UsersRepository.class).annotatedWith(Names.named("org.apache.james.api.user.UsersRepository")).toInstance(repos);
-        }
-        
-    }
+   
 
 }

Added: james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/LocalUsersRepositoryModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/LocalUsersRepositoryModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/LocalUsersRepositoryModule.java (added)
+++ james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/LocalUsersRepositoryModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,34 @@
+/****************************************************************
+ * 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.james.impl.user;
+
+import org.apache.james.api.user.UsersStore;
+import org.guiceyfruit.jsr250.Jsr250Module;
+
+import com.google.inject.name.Names;
+
+public class LocalUsersRepositoryModule extends Jsr250Module {
+
+    @Override
+    protected void configure() {
+    	super.configure();
+        bind(UsersStore.class).annotatedWith(Names.named("org.apache.james.api.user.UsersStore"));
+    }
+    
+}

Added: james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/UserManagementModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/UserManagementModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/UserManagementModule.java (added)
+++ james/server/trunk/user-library/src/main/java/org/apache/james/impl/user/UserManagementModule.java Wed Dec  2 14:41:53 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.james.impl.user;
+
+import org.apache.james.api.user.UsersRepository;
+import org.apache.james.api.user.UsersStore;
+import org.guiceyfruit.jsr250.Jsr250Module;
+
+import com.google.inject.name.Names;
+
+public class UserManagementModule extends Jsr250Module {
+
+    @Override
+    protected void configure() {
+    	super.configure();
+        bind(UsersStore.class).annotatedWith(Names.named("org.apache.james.api.user.UsersStore"));
+        bind(UsersRepository.class).annotatedWith(Names.named("org.apache.james.api.user.UsersRepository"));
+    }
+    
+}

Added: james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGILocalJamesUsersRepositoryModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGILocalJamesUsersRepositoryModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGILocalJamesUsersRepositoryModule.java (added)
+++ james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGILocalJamesUsersRepositoryModule.java Wed Dec  2 14:41:53 2009
@@ -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.james.osgi;
+
+import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.james.api.user.UsersStore;
+import org.apache.james.impl.jamesuser.JamesUsersRepository;
+import org.apache.james.impl.jamesuser.LocalJamesUsersRepository;
+import org.apache.james.impl.jamesuser.LocalJamesUsersRepositoryModule;
+import org.ops4j.peaberry.Peaberry;
+
+import com.google.inject.name.Names;
+
+public class OSGILocalJamesUsersRepositoryModule extends LocalJamesUsersRepositoryModule{
+
+	@Override
+	protected void configure() {
+		super.configure();
+
+		// import osgi service
+		bind(UsersStore.class).toProvider(Peaberry.service(UsersStore.class).single());
+		bind(Log.class).toProvider(Peaberry.service(Log.class).single());
+		bind(HierarchicalConfiguration.class).toProvider(Peaberry.service(HierarchicalConfiguration.class).single());
+		
+		// bind annotations to get the right logger and config
+		bind(String.class).annotatedWith(Names.named("LoggerName")).toInstance("localusersrepository");
+		bind(String.class).annotatedWith(Names.named("ConfigurationName")).toInstance("localusersrepository");
+		
+		// export it as osgi service
+		bind(org.ops4j.peaberry.util.TypeLiterals.export(JamesUsersRepository.class)).toProvider(
+				Peaberry.service(LocalJamesUsersRepository.class).export());
+	}
+
+}

Added: james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGILocalUsersRepositoryModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGILocalUsersRepositoryModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGILocalUsersRepositoryModule.java (added)
+++ james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGILocalUsersRepositoryModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,42 @@
+/****************************************************************
+ * 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.james.osgi;
+
+import org.apache.commons.logging.Log;
+import org.apache.james.api.user.UsersRepository;
+import org.apache.james.api.user.UsersStore;
+import org.apache.james.impl.user.LocalUsersRepository;
+import org.apache.james.impl.user.LocalUsersRepositoryModule;
+import org.ops4j.peaberry.Peaberry;
+
+public class OSGILocalUsersRepositoryModule extends LocalUsersRepositoryModule{
+
+	@Override
+	protected void configure() {
+		super.configure();
+		
+		// import osgi service
+        bind(UsersStore.class).toProvider(Peaberry.service(UsersStore.class).single());
+		bind(Log.class).toProvider(Peaberry.service(Log.class).single());
+
+        // export it as osgi service
+        bind(org.ops4j.peaberry.util.TypeLiterals.export(UsersRepository.class)).toProvider(Peaberry.service(LocalUsersRepository.class).export());
+	}
+
+}

Added: james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGIUserManagementModule.java
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGIUserManagementModule.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGIUserManagementModule.java (added)
+++ james/server/trunk/user-library/src/main/java/org/apache/james/osgi/OSGIUserManagementModule.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,45 @@
+/****************************************************************
+ * 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.james.osgi;
+
+import org.apache.commons.logging.Log;
+import org.apache.james.api.user.UsersRepository;
+import org.apache.james.api.user.UsersStore;
+import org.apache.james.api.user.management.UserManagementMBean;
+import org.apache.james.impl.user.UserManagement;
+import org.apache.james.impl.user.UserManagementModule;
+import org.ops4j.peaberry.Peaberry;
+
+public class OSGIUserManagementModule extends UserManagementModule{
+
+	@Override
+	protected void configure() {
+		super.configure();
+		
+		// import osgi service
+        bind(UsersStore.class).toProvider(Peaberry.service(UsersStore.class).single());
+        bind(UsersRepository.class).toProvider(Peaberry.service(UsersRepository.class).single());
+		bind(Log.class).toProvider(Peaberry.service(Log.class).single());
+
+		
+        // export it as osgi service
+        bind(org.ops4j.peaberry.util.TypeLiterals.export(UserManagementMBean.class)).toProvider(Peaberry.service(UserManagement.class).export());
+	}
+
+}

Added: james/server/trunk/user-library/src/main/java/org/apache/james/osgi/UsersLibraryActivator.java
URL: http://svn.apache.org/viewvc/james/server/trunk/user-library/src/main/java/org/apache/james/osgi/UsersLibraryActivator.java?rev=886159&amp;view=auto
==============================================================================
--- james/server/trunk/user-library/src/main/java/org/apache/james/osgi/UsersLibraryActivator.java (added)
+++ james/server/trunk/user-library/src/main/java/org/apache/james/osgi/UsersLibraryActivator.java Wed Dec  2 14:41:53 2009
@@ -0,0 +1,85 @@
+/****************************************************************
+ * 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.james.osgi;
+
+import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.james.impl.jamesuser.LocalJamesUsersRepository;
+import org.apache.james.impl.user.LocalUsersRepository;
+import org.apache.james.impl.user.UserManagement;
+import org.ops4j.peaberry.Export;
+import org.ops4j.peaberry.Peaberry;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.Provider;
+
+public class UsersLibraryActivator implements BundleActivator {
+	@Inject
+	private Provider&lt;Log&gt; logProvider;
+
+	@Inject
+	private Provider&lt;HierarchicalConfiguration&gt; configProvider;
+
+	@Inject
+	private Export&lt;LocalJamesUsersRepository&gt; jamesUsersRepos;
+
+	@Inject
+	private Export&lt;LocalUsersRepository&gt; localUsersRepos;
+
+	@Inject
+	Export&lt;UserManagement&gt; userMgmt;
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
+	 * )
+	 */
+	public void start(BundleContext context) throws Exception {
+		Injector inj = Guice.createInjector(Peaberry.osgiModule(context),
+				new OSGIUserManagementModule(),
+				new OSGILocalJamesUsersRepositoryModule(),
+				new OSGILocalUsersRepositoryModule());
+
+		/* Create bundle content */
+		inj.injectMembers(this);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		jamesUsersRepos.unput();
+		localUsersRepos.unput();
+		userMgmt.unput();
+
+		jamesUsersRepos = null;
+		localUsersRepos = null;
+		userMgmt = null;
+	}
+
+}



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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886131 - in /james/mpt/trunk: antlib/pom.xml main/pom.xml pom.xml</title>
<author><name>norman@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091202122105.2E09623888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091202122105-2E09623888C5@eris-apache-org%3e</id>
<updated>2009-12-02T12:21:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: norman
Date: Wed Dec  2 12:21:03 2009
New Revision: 886131

URL: http://svn.apache.org/viewvc?rev=886131&amp;view=rev
Log:
mpt is now compiling again

Modified:
    james/mpt/trunk/antlib/pom.xml
    james/mpt/trunk/main/pom.xml
    james/mpt/trunk/pom.xml

Modified: james/mpt/trunk/antlib/pom.xml
URL: http://svn.apache.org/viewvc/james/mpt/trunk/antlib/pom.xml?rev=886131&amp;r1=886130&amp;r2=886131&amp;view=diff
==============================================================================
--- james/mpt/trunk/antlib/pom.xml (original)
+++ james/mpt/trunk/antlib/pom.xml Wed Dec  2 12:21:03 2009
@@ -126,6 +126,17 @@
         &lt;/configuration&gt;
       &lt;/plugin&gt;
       &lt;plugin&gt;
+        &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
+        &lt;executions&gt;
+          &lt;execution&gt;
+            &lt;goals&gt;
+              &lt;goal&gt;test-jar&lt;/goal&gt;
+            &lt;/goals&gt;
+          &lt;/execution&gt;
+        &lt;/executions&gt;
+      &lt;/plugin&gt;
+        
+      &lt;plugin&gt;
         &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
         &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
         &lt;version&gt;1.4.3&lt;/version&gt;

Modified: james/mpt/trunk/main/pom.xml
URL: http://svn.apache.org/viewvc/james/mpt/trunk/main/pom.xml?rev=886131&amp;r1=886130&amp;r2=886131&amp;view=diff
==============================================================================
--- james/mpt/trunk/main/pom.xml (original)
+++ james/mpt/trunk/main/pom.xml Wed Dec  2 12:21:03 2009
@@ -77,6 +77,16 @@
         &lt;/configuration&gt;
       &lt;/plugin&gt;
       &lt;plugin&gt;
+        &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
+        &lt;executions&gt;
+          &lt;execution&gt;
+            &lt;goals&gt;
+              &lt;goal&gt;test-jar&lt;/goal&gt;
+            &lt;/goals&gt;
+          &lt;/execution&gt;
+        &lt;/executions&gt;
+      &lt;/plugin&gt;
+      &lt;plugin&gt;
         &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
         &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
         &lt;version&gt;1.4.3&lt;/version&gt;

Modified: james/mpt/trunk/pom.xml
URL: http://svn.apache.org/viewvc/james/mpt/trunk/pom.xml?rev=886131&amp;r1=886130&amp;r2=886131&amp;view=diff
==============================================================================
--- james/mpt/trunk/pom.xml (original)
+++ james/mpt/trunk/pom.xml Wed Dec  2 12:21:03 2009
@@ -40,9 +40,10 @@
     &lt;module&gt;main&lt;/module&gt;
     &lt;module&gt;antlib&lt;/module&gt;
     &lt;module&gt;app&lt;/module&gt;
-    &lt;module&gt;assemble&lt;/module&gt;
+    &lt;module&gt;assemble&lt;/module&gt;  
     &lt;module&gt;mavenplugin&lt;/module&gt;  
   &lt;/modules&gt;
+  
   &lt;scm&gt;
     &lt;connection&gt;scm:svn:http://svn.apache.org/repos/asf/james/mpt/trunk&lt;/connection&gt;
     &lt;developerConnection&gt;scm:svn:https://svn.apache.org/repos/asf/james/mpt/trunk&lt;/developerConnection&gt;
@@ -276,14 +277,43 @@
     &lt;dependencies&gt;
 
     &lt;dependency&gt;
-&lt;!-- TODO: FIXME
-       My maven foo is weak!
-       Can't seem to be able to pick up this version from the antlib module :-/ 
-     --&gt; 
       &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
-      &lt;artifactId&gt;apache-james-mpt&lt;/artifactId&gt;
+      &lt;artifactId&gt;apache-james-mpt-antlib&lt;/artifactId&gt;
       &lt;version&gt;${project.version}&lt;/version&gt;
     &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
+      &lt;artifactId&gt;apache-james-mpt-antlib&lt;/artifactId&gt;
+      &lt;version&gt;${project.version}&lt;/version&gt;
+      &lt;classifier&gt;tests&lt;/classifier&gt;
+      &lt;scope&gt;test&lt;/scope&gt;
+    &lt;/dependency&gt;
+
+    &lt;dependency&gt;
+      &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
+      &lt;artifactId&gt;apache-james-mpt-app&lt;/artifactId&gt;
+      &lt;version&gt;${project.version}&lt;/version&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
+      &lt;artifactId&gt;apache-james-mpt-app&lt;/artifactId&gt;
+      &lt;version&gt;${project.version}&lt;/version&gt;
+      &lt;classifier&gt;tests&lt;/classifier&gt;
+      &lt;scope&gt;test&lt;/scope&gt;
+    &lt;/dependency&gt;
+    
+    &lt;dependency&gt;
+      &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
+      &lt;artifactId&gt;apache-james-mpt-main&lt;/artifactId&gt;
+      &lt;version&gt;${project.version}&lt;/version&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
+      &lt;artifactId&gt;apache-james-mpt-main&lt;/artifactId&gt;
+      &lt;version&gt;${project.version}&lt;/version&gt;
+      &lt;classifier&gt;tests&lt;/classifier&gt;
+      &lt;scope&gt;test&lt;/scope&gt;
+    &lt;/dependency&gt;
 
     &lt;dependency&gt;    
       &lt;groupId&gt;commons-logging&lt;/groupId&gt;
@@ -308,6 +338,7 @@
         &lt;/exclusion&gt;
       &lt;/exclusions&gt;
     &lt;/dependency&gt;
+    
     &lt;dependency&gt;
       &lt;groupId&gt;junit&lt;/groupId&gt;
       &lt;artifactId&gt;junit&lt;/artifactId&gt;



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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (HUPA-59) Support for other javamail storages</title>
<author><name>=?utf-8?Q?Manuel_Carrasco_Mo=C3=B1ino_=28JIRA=29?= &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c508298294.1259753300760.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c508298294-1259753300760-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T11:28:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Support for other javamail storages
-----------------------------------

                 Key: HUPA-59
                 URL: https://issues.apache.org/jira/browse/HUPA-59
             Project: JAMES Hupa
          Issue Type: New Feature
            Reporter: Manuel Carrasco Moñino
            Assignee: Norman Maurer


It would be great hupa support other storage systems in addition to IMAP.
for instance: If hupa could handle the directly james' mailboxes, it greatly improve performance.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (HUPA-58) Strings concatenated in loops</title>
<author><name>=?utf-8?Q?Manuel_Carrasco_Mo=C3=B1ino_=28JIRA=29?= &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c1019446332.1259751980641.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1019446332-1259751980641-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T11:06:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/HUPA-58?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Manuel Carrasco Moñino resolved HUPA-58.
----------------------------------------

    Resolution: Fixed

Partially applied in trunk
I've applied your patch only to server classes, after fixing some lines which break tests.
In shared classes, code is going to be compiled into javascript, and I think the patch doesnt
worth it because the '+' operator in javascript works different than in java, and '+' is easier
to handle by gwt compiler.

&gt; Strings concatenated in loops
&gt; -----------------------------
&gt;
&gt;                 Key: HUPA-58
&gt;                 URL: https://issues.apache.org/jira/browse/HUPA-58
&gt;             Project: JAMES Hupa
&gt;          Issue Type: Improvement
&gt;            Reporter: Eric Jablow
&gt;            Assignee: Manuel Carrasco Moñino
&gt;            Priority: Minor
&gt;         Attachments: concatenation-in-loop.patch
&gt;
&gt;   Original Estimate: 0.17h
&gt;  Remaining Estimate: 0.17h
&gt;
&gt; A few Java files have code like
&gt; String ret = "";
&gt; for (String s : ...) {
&gt;   ret += s +" ";
&gt; }
&gt; StringBuilder.append() is faster and does not allocate new objects.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Assigned: (HUPA-58) Strings concatenated in loops</title>
<author><name>=?utf-8?Q?Manuel_Carrasco_Mo=C3=B1ino_=28JIRA=29?= &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c145211474.1259750901904.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c145211474-1259750901904-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T10:48:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/HUPA-58?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Manuel Carrasco Moñino reassigned HUPA-58:
------------------------------------------

    Assignee: Manuel Carrasco Moñino  (was: Norman Maurer)

&gt; Strings concatenated in loops
&gt; -----------------------------
&gt;
&gt;                 Key: HUPA-58
&gt;                 URL: https://issues.apache.org/jira/browse/HUPA-58
&gt;             Project: JAMES Hupa
&gt;          Issue Type: Improvement
&gt;            Reporter: Eric Jablow
&gt;            Assignee: Manuel Carrasco Moñino
&gt;            Priority: Minor
&gt;         Attachments: concatenation-in-loop.patch
&gt;
&gt;   Original Estimate: 0.17h
&gt;  Remaining Estimate: 0.17h
&gt;
&gt; A few Java files have code like
&gt; String ret = "";
&gt; for (String s : ...) {
&gt;   ret += s +" ";
&gt; }
&gt; StringBuilder.append() is faster and does not allocate new objects.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886105 - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/mvp/ server/src/main/java/org/apache/hupa/server/ server/src/main/java/org/apache/hupa/server/handler/ server/src/main/java/org/apache/hupa/server/utils/ server/src...</title>
<author><name>manolo@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091202103238.CA81823888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091202103238-CA81823888C5@eris-apache-org%3e</id>
<updated>2009-12-02T10:32:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: manolo
Date: Wed Dec  2 10:32:05 2009
New Revision: 886105

URL: http://svn.apache.org/viewvc?rev=886105&amp;view=rev
Log:
Now replying messages handles correctly: inline images present in original message, and new
attachments added by the user.
Re-factoring in MessageHandlers: now they share the same code for createMessage and fillMessage,
being different the getAttachments
Partially applied HUPA-58 patch.

Added:
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/ReplyMessageHandlerTest.java
Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/FileItemRegistry.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/HupaTestCase.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceTestModule.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/TestUtils.java
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/FetchFoldersResult.java
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/ReplyMessage.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
Wed Dec  2 10:32:05 2009
@@ -267,8 +267,7 @@
                     } else if(type.equals(Type.REPLY) || type.equals(Type.REPLY_ALL)) {
                         display.setLoading(true);
 
-                        boolean replyAll = type.equals(Type.REPLY_ALL);
-                        dispatcher.execute(new ReplyMessage(message, folder, oldmessage.getUid(),
replyAll), new HupaCallback&lt;GenericResult&gt;(dispatcher, eventBus) {
+                        dispatcher.execute(new ReplyMessage(message, folder, oldmessage.getUid()),
new HupaCallback&lt;GenericResult&gt;(dispatcher, eventBus) {
                             public void callback(GenericResult result) {
                                 if (result.isSuccess()) {
                                     eventBus.fireEvent(new SentMessageEvent());

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/FileItemRegistry.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/FileItemRegistry.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/FileItemRegistry.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/FileItemRegistry.java Wed
Dec  2 10:32:05 2009
@@ -32,10 +32,18 @@
 
     public Map&lt;String,FileItem&gt; map = new HashMap&lt;String, FileItem&gt;();
     private Log logger;
+    static int idCounter = 0;
+    int registryId;
+    
+    public String toString() {
+        return "registryId=" + registryId +
+               " nItems=" + map.size();
+    }
     
     @Inject
     public FileItemRegistry(Log logger) {
         this.logger = logger;
+        registryId  = idCounter++;
     }
     
     public void add(FileItem item) {

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java
Wed Dec  2 10:32:05 2009
@@ -27,7 +27,6 @@
 import java.util.List;
 import java.util.Properties;
 
-import javax.activation.DataHandler;
 import javax.activation.DataSource;
 import javax.mail.Address;
 import javax.mail.AuthenticationFailedException;
@@ -40,9 +39,11 @@
 import javax.mail.Transport;
 import javax.mail.Flags.Flag;
 import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
 import javax.mail.internet.MimeBodyPart;
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMultipart;
+import javax.mail.internet.MimeMessage.RecipientType;
 import javax.servlet.http.HttpSession;
 
 import net.customware.gwt.dispatch.server.ExecutionContext;
@@ -135,8 +136,17 @@
      * @throws MessagingException
      * @throws ActionException
      */
-    protected abstract Message createMessage(Session session, A action) throws AddressException,
MessagingException,ActionException;
-
+    protected Message createMessage(Session session, A action) throws AddressException, MessagingException
{
+        MimeMessage message = new MimeMessage(session);
+        SMTPMessage m = action.getMessage();
+        message.setFrom(new InternetAddress(m.getFrom()));
+        message.setRecipients(RecipientType.TO, MessageUtils.getRecipients(m.getTo()));
+        message.setRecipients(RecipientType.CC, MessageUtils.getRecipients(m.getCc()));
+        message.setRecipients(RecipientType.BCC, MessageUtils.getRecipients(m.getBcc()));
+        message.setSubject(m.getSubject());
+        message.saveChanges();
+        return message;
+    }
     /**
      * Fill the body of the given message with data which the given action contain
      * 
@@ -151,9 +161,9 @@
 
         String html = restoreInlineLinks(action.getMessage().getText());
         
-        // TODO: client sends the message as html right now, 
+        // TODO: client sends the message as a html document right now, 
         // the idea is that it should be sent in both formats because
-        // it is easier to do the handle html in the browser. 
+        // it is easier to handle html in the browser. 
         String text = htmlToText(html);
         
         @SuppressWarnings("unchecked")
@@ -166,6 +176,7 @@
         return RegexPatterns.replaceAll(s, RegexPatterns.regex_revertInlineImg, RegexPatterns.repl_revertInlineImg);
     }
     
+    // TODO: just temporary stuff because it has to be done in the client side
     protected String htmlToText(String s){
         s=s.replaceAll("\n", " ");
         s=s.replaceAll("(?si)&lt;br\\s*?/?&gt;", "\n");
@@ -184,8 +195,9 @@
      */
     @SuppressWarnings("unchecked")
     protected List getAttachments(A action) throws MessagingException, ActionException {
-        FileItemRegistry registry = MessageUtils.getSessionRegistry(httpSessionProvider.get(),
logger); 
+        FileItemRegistry registry = MessageUtils.getSessionRegistry(logger, httpSessionProvider.get());
         List&lt;MessageAttachment&gt; attachments = action.getMessage().getMessageAttachments();
+        
         ArrayList&lt;FileItem&gt; items = new ArrayList&lt;FileItem&gt;();
         for (MessageAttachment attachment: attachments) {
             FileItem fItem = registry.get(attachment.getName());
@@ -208,7 +220,7 @@
         ArrayList&lt;MessageAttachment&gt; attachments = msg.getMessageAttachments();
         if (attachments != null &amp;&amp; ! attachments.isEmpty()) {
             for(MessageAttachment attach : attachments) 
-                MessageUtils.getSessionRegistry(httpSessionProvider.get(), logger).remove(attach.getName());
+                MessageUtils.getSessionRegistry(logger, httpSessionProvider.get()).remove(attach.getName());
         }
     }
     
@@ -351,7 +363,7 @@
             multipart.addBodyPart(bodyPart);
             for (Object attachment: parts) {
                 if (attachment instanceof FileItem) {
-                    multipart.addBodyPart(fileitemToBodypart((FileItem)attachment));
+                    multipart.addBodyPart(MessageUtils.fileitemToBodypart((FileItem)attachment));
                 } else {
                     multipart.addBodyPart((BodyPart)attachment);
                 }
@@ -364,20 +376,11 @@
 
     }
     
-    private static BodyPart fileitemToBodypart(FileItem item) throws MessagingException {
-        MimeBodyPart messageBodyPart = new MimeBodyPart();
-        DataSource source = new AbstractSendMessageHandler.FileItemDataStore(item);
-        messageBodyPart.setDataHandler(new DataHandler(source));
-        messageBodyPart.setFileName(source.getName());
-        return messageBodyPart;
-    }
-    
-
     /**
      * DataStore which wrap a FileItem
      * 
      */
-    protected static class FileItemDataStore implements DataSource {
+    public static class FileItemDataStore implements DataSource {
 
         private FileItem item;
 

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java
Wed Dec  2 10:32:05 2009
@@ -19,32 +19,21 @@
 
 package org.apache.hupa.server.handler;
 
-import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.activation.DataSource;
 import javax.mail.BodyPart;
 import javax.mail.Folder;
 import javax.mail.Message;
 import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMessage.RecipientType;
 import javax.servlet.http.HttpSession;
 
 import net.customware.gwt.dispatch.shared.ActionException;
 
-import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.logging.Log;
 import org.apache.hupa.server.IMAPStoreCache;
 import org.apache.hupa.server.utils.MessageUtils;
-import org.apache.hupa.shared.data.SMTPMessage;
 import org.apache.hupa.shared.rpc.ForwardMessage;
 
 import com.google.inject.Inject;
@@ -66,26 +55,6 @@
     }
 
     @Override
-    protected Message createMessage(Session session, ForwardMessage action) throws AddressException,
MessagingException, ActionException {
-        MimeMessage message = new MimeMessage(session);
-        SMTPMessage m = action.getMessage();
-        message.setFrom(new InternetAddress(m.getFrom()));
-        List&lt;String&gt; to = m.getTo();
-        for (int i = 0; i &lt; to.size(); i++) {
-            message.addRecipient(RecipientType.TO, new InternetAddress(to.get(i)));
-        }
-
-        List&lt;String&gt; cc = m.getCc();
-        for (int i = 0; cc != null &amp;&amp; i &lt; cc.size(); i++) {
-            message.addRecipient(RecipientType.CC, new InternetAddress(cc.get(i)));
-        }
-        message.setSubject(m.getSubject());
-        message.saveChanges();
-        return message;
-    }
-
-
-    @Override
     @SuppressWarnings("unchecked")
     protected List getAttachments(ForwardMessage action) throws MessagingException, ActionException
{
         List&lt;BodyPart&gt; items = new ArrayList&lt;BodyPart&gt;();
@@ -117,62 +86,4 @@
         return ForwardMessage.class;
     }
 
-    /**
-     * DataStore which wrap a FileItem
-     * 
-     */
-    protected static class PartDataStore implements DataSource {
-
-        private FileItem item;
-
-        public PartDataStore(FileItem item) {
-            this.item = item;
-        }
-
-        /*
-         * (non-Javadoc)
-         * 
-         * @see javax.activation.DataSource#getContentType()
-         */
-        public String getContentType() {
-            return item.getContentType();
-        }
-
-        /*
-         * (non-Javadoc)
-         * 
-         * @see javax.activation.DataSource#getInputStream()
-         */
-        public InputStream getInputStream() throws IOException {
-            return item.getInputStream();
-        }
-
-        /*
-         * (non-Javadoc)
-         * 
-         * @see javax.activation.DataSource#getName()
-         */
-        public String getName() {
-            String fullName = item.getName();
-
-            // Strip path from file
-            int index = fullName.lastIndexOf(File.separator);
-            if (index == -1) {
-                return fullName;
-            } else {
-                return fullName.substring(index + 1, fullName.length());
-            }
-        }
-
-        /*
-         * (non-Javadoc)
-         * 
-         * @see javax.activation.DataSource#getOutputStream()
-         */
-        public OutputStream getOutputStream() throws IOException {
-            return null;
-        }
-
-    }
-
 }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java
Wed Dec  2 10:32:05 2009
@@ -19,13 +19,14 @@
 
 package org.apache.hupa.server.handler;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.mail.BodyPart;
 import javax.mail.Folder;
 import javax.mail.Message;
 import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage.RecipientType;
 import javax.servlet.http.HttpSession;
 
 import net.customware.gwt.dispatch.shared.ActionException;
@@ -33,7 +34,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.hupa.server.IMAPStoreCache;
 import org.apache.hupa.server.utils.MessageUtils;
-import org.apache.hupa.shared.data.SMTPMessage;
 import org.apache.hupa.shared.rpc.ReplyMessage;
 
 import com.google.inject.Inject;
@@ -47,7 +47,7 @@
  * 
  *
  */
-public class ReplyMessageHandler extends AbstractSendMessageHandler&lt;ReplyMessage&gt;{
+public class ReplyMessageHandler extends AbstractSendMessageHandler&lt;ReplyMessage&gt; {
 
     @Inject
     public ReplyMessageHandler(Log logger, IMAPStoreCache store, Provider&lt;HttpSession&gt;
provider,
@@ -55,30 +55,34 @@
         super(logger, store, provider, address, port, auth, useSSL);
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.apache.hupa.server.handler.AbstractSendMessageHandler#createMessage(javax.mail.Session,
org.apache.hupa.shared.rpc.SendMessage)
-     */
-    protected Message createMessage(Session session, ReplyMessage action)
-            throws AddressException, MessagingException, ActionException {
+    @Override
+    @SuppressWarnings("unchecked")
+    protected List getAttachments(ReplyMessage action) throws MessagingException, ActionException
{
+        List&lt;BodyPart&gt; items = new ArrayList&lt;BodyPart&gt;();
         IMAPStore store = cache.get(getUser());
+
         IMAPFolder folder = (IMAPFolder) store.getFolder(action.getFolder().getFullName());
         if (folder.isOpen() == false) {
             folder.open(Folder.READ_ONLY);
         }
-        Message rMessage =  folder.getMessageByUID(action.getReplyMessageUid()).reply(action.getReplyAll());
-        SMTPMessage m = action.getMessage();
-        // Use the new recipient list, maybe it has changed
-        rMessage.setRecipients(RecipientType.TO, MessageUtils.getRecipients(m.getTo()));
-        rMessage.setRecipients(RecipientType.CC, MessageUtils.getRecipients(m.getCc()));
-        rMessage.setRecipients(RecipientType.BCC, MessageUtils.getRecipients(m.getBcc()));
-        rMessage.setFrom(new InternetAddress(m.getFrom()));
-        // replace subject
-        rMessage.setSubject(m.getSubject());
-        rMessage.saveChanges();
-        return rMessage;
+
+        // Only original inline images have to be added to the list 
+        Message msg = folder.getMessageByUID(action.getReplyMessageUid());
+        try {
+            items = MessageUtils.extractInlineImages(logger, msg.getContent());
+            if (items.size() &gt; 0)
+                logger.debug("Replying a message, extracted: " + items.size() + " inline
image from");
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        
+        // Put into the list the attachments uploaded by the user
+        items.addAll(super.getAttachments(action));
+        
+        return items;
     }
 
+
     /*
      * (non-Javadoc)
      * @see net.customware.gwt.dispatch.server.ActionHandler#getActionType()

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
Wed Dec  2 10:32:05 2009
@@ -19,19 +19,10 @@
 
 package org.apache.hupa.server.handler;
 
-import javax.mail.Message;
-import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMessage.RecipientType;
 import javax.servlet.http.HttpSession;
 
 import org.apache.commons.logging.Log;
 import org.apache.hupa.server.IMAPStoreCache;
-import org.apache.hupa.server.utils.MessageUtils;
-import org.apache.hupa.shared.data.SMTPMessage;
 import org.apache.hupa.shared.rpc.SendMessage;
 
 import com.google.inject.Inject;
@@ -53,22 +44,6 @@
 
     /*
      * (non-Javadoc)
-     * @see org.apache.hupa.server.handler.AbstractSendMessageHandler#createMessage(javax.mail.Session,
org.apache.hupa.shared.rpc.SendMessage)
-     */
-    protected Message createMessage(Session session, SendMessage action)
-            throws AddressException, MessagingException {
-        MimeMessage message = new MimeMessage(session);
-        SMTPMessage m = action.getMessage();
-        message.setFrom(new InternetAddress(m.getFrom()));
-        message.setRecipients(RecipientType.TO, MessageUtils.getRecipients(m.getTo()));
-        message.setRecipients(RecipientType.CC, MessageUtils.getRecipients(m.getCc()));
-        message.setRecipients(RecipientType.BCC, MessageUtils.getRecipients(m.getBcc()));
-        message.setSubject(m.getSubject());
-        return message;
-    }
-
-    /*
-     * (non-Javadoc)
      * @see net.customware.gwt.dispatch.server.ActionHandler#getActionType()
      */
     public Class&lt;SendMessage&gt; getActionType() {

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java Wed
Dec  2 10:32:05 2009
@@ -24,6 +24,8 @@
 import java.util.Arrays;
 import java.util.List;
 
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
 import javax.mail.Address;
 import javax.mail.BodyPart;
 import javax.mail.MessagingException;
@@ -31,11 +33,14 @@
 import javax.mail.Part;
 import javax.mail.internet.AddressException;
 import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
 import javax.mail.internet.MimeUtility;
 import javax.servlet.http.HttpSession;
 
+import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.logging.Log;
 import org.apache.hupa.server.FileItemRegistry;
+import org.apache.hupa.server.handler.AbstractSendMessageHandler;
 
 
 
@@ -104,7 +109,16 @@
         return ret;
     }
 
-    public static FileItemRegistry getSessionRegistry(HttpSession session, Log logger) {
+    static public List&lt;BodyPart&gt; extractInlineImages(Log logger, Object content) throws
MessagingException, IOException {
+        ArrayList&lt;BodyPart&gt; ret = new ArrayList&lt;BodyPart&gt;();
+        for (BodyPart attach : extractMessageAttachments(logger, content)) {
+            if (attach.getHeader("Content-ID") != null &amp;&amp; attach.getContentType().startsWith("image/"))
+                ret.add(attach);
+        }
+        return ret;
+    }
+
+    public static FileItemRegistry getSessionRegistry(Log logger, HttpSession session) {
         FileItemRegistry registry = (FileItemRegistry)session.getAttribute("registry");
         if (registry == null) {
             registry = new FileItemRegistry(logger);
@@ -157,5 +171,20 @@
         }
         return null;
     }
+
+    /**
+     * Convert a FileItem to a BodyPart
+     * 
+     * @param item
+     * @return
+     * @throws MessagingException
+     */
+    public static BodyPart fileitemToBodypart(FileItem item) throws MessagingException {
+        MimeBodyPart messageBodyPart = new MimeBodyPart();
+        DataSource source = new AbstractSendMessageHandler.FileItemDataStore(item);
+        messageBodyPart.setDataHandler(new DataHandler(source));
+        messageBodyPart.setFileName(source.getName());
+        return messageBodyPart;
+    }
     
 }
\ No newline at end of file

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/HupaTestCase.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/HupaTestCase.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/HupaTestCase.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/HupaTestCase.java Wed Dec
 2 10:32:05 2009
@@ -29,6 +29,7 @@
 import org.apache.hupa.server.handler.AbstractSendMessageHandler;
 import org.apache.hupa.server.handler.ForwardMessageHandler;
 import org.apache.hupa.server.handler.GetMessageDetailsHandler;
+import org.apache.hupa.server.handler.ReplyMessageHandler;
 import org.apache.hupa.shared.rpc.SendMessage;
 
 import com.google.inject.Injector;
@@ -46,6 +47,7 @@
     protected AbstractSendMessageHandler&lt;SendMessage&gt; abstSendMsgHndl = injector.getInstance(AbstractSendMessageHandler.class);
     
     protected ForwardMessageHandler fwdMsgHndl = injector.getInstance(ForwardMessageHandler.class);
+    protected ReplyMessageHandler reMsgHndl = injector.getInstance(ReplyMessageHandler.class);
     
     protected GetMessageDetailsHandler getDetailsMsgHndl = injector.getInstance(GetMessageDetailsHandler.class);
     

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceTestModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceTestModule.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceTestModule.java
(original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceTestModule.java
Wed Dec  2 10:32:05 2009
@@ -27,6 +27,7 @@
 import org.apache.hupa.server.handler.AbstractSendMessageHandler;
 import org.apache.hupa.server.handler.ForwardMessageHandler;
 import org.apache.hupa.server.handler.GetMessageDetailsHandler;
+import org.apache.hupa.server.handler.ReplyMessageHandler;
 import org.apache.hupa.server.handler.SendMessageHandler;
 import org.apache.hupa.server.mock.MockHttpSession;
 import org.apache.hupa.server.mock.MockIMAPStore;
@@ -59,6 +60,7 @@
         
         bind(AbstractSendMessageHandler.class).to(SendMessageHandler.class);
         bind(SendMessageHandler.class);
+        bind(ReplyMessageHandler.class);
         bind(ForwardMessageHandler.class);
 
     }

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java
(original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java
Wed Dec  2 10:32:05 2009
@@ -45,8 +45,8 @@
                             + " multipart/alternative\n"
                             + "  text/plain\n"
                             + "  text/html\n"
-                            + " mock/attachment =&gt; file_1.bin\n"
-                            + " mock/attachment =&gt; file_2.bin\n";
+                            + " mock/attachment =&gt; uploadedFile_1.bin\n"
+                            + " mock/attachment =&gt; uploadedFile_2.bin\n";
 
     public void testComposeMessage() throws Exception{
 
@@ -112,7 +112,7 @@
         
         MockIMAPFolder sentbox = (MockIMAPFolder) store.getFolder(DemoModeConstants.DEMO_MODE_SENT_FOLDER);
         
-        SMTPMessage smtpmsg = TestUtils.createMockSMTPMessage(MessageUtils.getSessionRegistry(httpSession,
logger), 2);
+        SMTPMessage smtpmsg = TestUtils.createMockSMTPMessage(MessageUtils.getSessionRegistry(logger,
httpSession), 2);
         SendMessage action = new SendMessage(smtpmsg);
         
         Message message = abstSendMsgHndl.createMessage(session, action);
@@ -122,7 +122,9 @@
 
         abstSendMsgHndl.sendMessage(session, demouser, message);
 
-        Part part = MessageUtils.handleMultiPart(logger, message.getContent(), "file_1.bin");
+        
+        // The reported size is wrong before the message has been saved
+        Part part = MessageUtils.handleMultiPart(logger, message.getContent(), "uploadedFile_1.bin");
         assertTrue(part.getSize() &lt; 0);
 
         assertTrue(sentbox.getMessages().length == 0);
@@ -132,8 +134,9 @@
         message = sentbox.getMessage(0);
         assertNotNull(message);
         assertEquals(contentTwoAttach, TestUtils.summaryzeContent(message).toString());
-        
-        part = MessageUtils.handleMultiPart(logger, message.getContent(), "file_1.bin");
+
+        // After saving the message, the reported size has to be OK
+        part = MessageUtils.handleMultiPart(logger, message.getContent(), "uploadedFile_1.bin");
         assertTrue(part.getSize() &gt; 0);
         
     }
@@ -148,7 +151,7 @@
         
         MockIMAPFolder sentbox = (MockIMAPFolder) store.getFolder(DemoModeConstants.DEMO_MODE_SENT_FOLDER);
         
-        SMTPMessage smtpmsg = TestUtils.createMockSMTPMessage(MessageUtils.getSessionRegistry(httpSession,
logger), 2);
+        SMTPMessage smtpmsg = TestUtils.createMockSMTPMessage(MessageUtils.getSessionRegistry(logger,
httpSession), 2);
         SendMessage action = new SendMessage(smtpmsg);
         
         assertTrue(sentbox.getMessages().length == 0);
@@ -157,7 +160,7 @@
         assertNotNull(message);
         assertEquals(contentTwoAttach, TestUtils.summaryzeContent(message).toString());
         
-        Part part = MessageUtils.handleMultiPart(logger, message.getContent(), "file_1.bin");
+        Part part = MessageUtils.handleMultiPart(logger, message.getContent(), "uploadedFile_1.bin");
         assertTrue(part.getSize() &gt; 0);
         
     }

Added: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/ReplyMessageHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/ReplyMessageHandlerTest.java?rev=886105&amp;view=auto
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/ReplyMessageHandlerTest.java
(added)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/ReplyMessageHandlerTest.java
Wed Dec  2 10:32:05 2009
@@ -0,0 +1,98 @@
+/****************************************************************
+ * 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.handler;
+
+
+import javax.mail.Message;
+import javax.servlet.http.HttpSession;
+
+import org.apache.hupa.server.FileItemRegistry;
+import org.apache.hupa.server.HupaTestCase;
+import org.apache.hupa.server.IMAPStoreCache;
+import org.apache.hupa.server.guice.DemoModeConstants;
+import org.apache.hupa.server.mock.MockIMAPFolder;
+import org.apache.hupa.server.mock.MockIMAPStoreCache;
+import org.apache.hupa.server.utils.MessageUtils;
+import org.apache.hupa.server.utils.TestUtils;
+import org.apache.hupa.shared.data.IMAPFolder;
+import org.apache.hupa.shared.data.SMTPMessage;
+import org.apache.hupa.shared.data.User;
+import org.apache.hupa.shared.rpc.ReplyMessage;
+
+import com.sun.mail.imap.IMAPStore;
+
+public class ReplyMessageHandlerTest extends HupaTestCase {
+
+    public void testForwardMessage() throws Exception {
+        User demouser = DemoModeConstants.demoUser;
+
+        HttpSession httpSession = injector.getInstance(HttpSession.class);
+        httpSession.setAttribute("user", demouser);
+
+        IMAPStoreCache storeCache = injector.getInstance(IMAPStoreCache.class);
+        IMAPStore store = injector.getInstance(IMAPStore.class);
+        ((MockIMAPStoreCache)storeCache).addValidUser(demouser, store);
+
+        FileItemRegistry registry = MessageUtils.getSessionRegistry(logger, httpSession);
+        
+        
+        MockIMAPFolder sentbox = (MockIMAPFolder) store.getFolder(DemoModeConstants.DEMO_MODE_SENT_FOLDER);
+        assertTrue(sentbox.getMessages().length == 0);
+
+        MockIMAPFolder inbox = (MockIMAPFolder) store.getFolder(DemoModeConstants.DEMO_MODE_INBOX_FOLDER);
+        assertTrue(inbox.getMessages().length &gt;= 0);
+
+        // Create a mime message with 2 attachments and 1 inline image, and put it in the
inbox
+        Message message = TestUtils.createMockMimeMessage(session, 2);
+        TestUtils.addMockAttachment(message, "inlineImage.jpg", true);
+        
+        inbox.appendMessages(new Message[]{message});
+        long msgUid = inbox.getUID(message);
+        message = inbox.getMessageByUID(msgUid);
+        assertNotNull(message);
+        
+        String expected = "multipart/mixed\n"
+                        + " multipart/alternative\n"
+                        + "  text/plain\n"
+                        + "  text/html\n"
+                        + " mock/attachment =&gt; file_1.bin\n"
+                        + " mock/attachment =&gt; file_2.bin\n"
+                        + " image/mock =&gt; inlineImage.jpg\n";
+        assertEquals(expected, TestUtils.summaryzeContent(message).toString());
+        
+        // Create a reply user action with an uploaded message
+        SMTPMessage smtpmsg = TestUtils.createMockSMTPMessage(registry, 1);
+        ReplyMessage action = new ReplyMessage(smtpmsg, new IMAPFolder(inbox.getFullName()),
msgUid);
+        
+        message = reMsgHndl.createMessage(session, action);
+        message = reMsgHndl.fillBody(message, action);
+        
+        // The final message has to include the file uploaded by the user and the inline
image
+        expected = "multipart/mixed\n"
+                 + " multipart/alternative\n"
+                 + "  text/plain\n"
+                 + "  text/html\n"
+                 + " image/mock =&gt; inlineImage.jpg\n"
+                 + " mock/attachment =&gt; uploadedFile_1.bin\n";
+        
+        assertEquals(expected, TestUtils.summaryzeContent(message).toString());
+
+    }
+}

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java
(original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java
Wed Dec  2 10:32:05 2009
@@ -7,16 +7,9 @@
 import javax.mail.Session;
 
 import org.apache.commons.logging.Log;
-import org.apache.hupa.server.guice.GuiceTestModule;
+import org.apache.hupa.server.HupaTestCase;
 
-import com.google.inject.Injector;
-
-import junit.framework.TestCase;
-
-public class MessageUtilsTest extends TestCase {
-
-    GuiceTestModule module = new GuiceTestModule();
-    Injector injector = module.getInjector();
+public class MessageUtilsTest extends HupaTestCase {
     
     public void testExtractMessageAttachments() throws Exception {
         Session session = injector.getInstance(Session.class);
@@ -25,4 +18,30 @@
         List&lt;BodyPart&gt; parts = MessageUtils.extractMessageAttachments(logger, message.getContent());
         assertEquals(2, parts.size());
     }
+
+    public void testExtractInlineAttachments() throws Exception {
+        Session session = injector.getInstance(Session.class);
+        Log logger = injector.getInstance(Log.class);
+
+        Message message = TestUtils.createMockMimeMessage(session, 1);
+        
+        List&lt;BodyPart&gt; attachments = MessageUtils.extractMessageAttachments(logger,
message.getContent());
+        List&lt;BodyPart&gt; inlineImgs = MessageUtils.extractInlineImages(logger, message.getContent());
+        assertEquals(1, attachments.size());
+        assertEquals(0, inlineImgs.size());
+        
+        TestUtils.addMockAttachment(message, "mfile.bin", false);
+        
+        attachments = MessageUtils.extractMessageAttachments(logger, message.getContent());
+        inlineImgs = MessageUtils.extractInlineImages(logger, message.getContent());
+        assertEquals(2, attachments.size());
+        assertEquals(0, inlineImgs.size());
+
+        TestUtils.addMockAttachment(message, "mfile.jpg", true);
+        
+        attachments = MessageUtils.extractMessageAttachments(logger, message.getContent());
+        inlineImgs = MessageUtils.extractInlineImages(logger, message.getContent());
+        assertEquals(3, attachments.size());
+        assertEquals(1, inlineImgs.size());
+    }
 }
\ No newline at end of file

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/TestUtils.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/TestUtils.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/TestUtils.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/TestUtils.java Wed
Dec  2 10:32:05 2009
@@ -26,6 +26,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 
+import javax.mail.BodyPart;
 import javax.mail.Message;
 import javax.mail.MessagingException;
 import javax.mail.Multipart;
@@ -73,19 +74,18 @@
         }
 
         private String ident(int spaces, String text) {
-            String ret = "";
-            for (int i = 0; i &lt; spaces; i++)
-                ret += " ";
-            return ret + text;
+            char[] padding = new char[spaces];
+            Arrays.fill(padding, ' ');
+            return new String(padding) + text;
         }
-
+        
         public String toString() {
-            String ret = "";
-            for (String s : this) {
-                ret += s + "\n";
-            }
-            return ret;
+            StringBuilder ret = new StringBuilder();
+            for (String s : this) 
+                ret.append(s).append("\n");
+            return ret.toString();
         }
+
     }
 
     /**
@@ -95,20 +95,25 @@
      * @return a new item
      * @throws IOException
      */
-    public static FileItem createMockFileItem(String filename) throws IOException {
+    public static FileItem createMockFileItem(String filename, String contentType) throws
IOException {
         FileItemFactory f = new DiskFileItemFactory();
-        FileItem item = f.createItem("fieldname_" + filename, "mock/attachment", false, filename);
+        FileItem item = f.createItem("fieldname_" + filename, contentType, false, filename);
         OutputStream os = item.getOutputStream();
         os.write("ABCDEFGHIJK\n".getBytes());
         os.close();
         return item;
     }
+
+    public static FileItem createMockFileItem(String filename) throws IOException {
+        return createMockFileItem(filename, "mock/attachment");
+    }
     
     public void testCreateMockFileItem() throws Exception {
         FileItem item = createMockFileItem("filename.jpg");
         assertEquals("ABCDEFGHIJK\n", item.getString());
     }
 
+    
     /**
      * Create a new mime-message from a file stored in the fixtures folder
      * 
@@ -120,8 +125,7 @@
     public static MimeMessage loadMessageFromFile(Session session, String msgFile) throws
Exception {
         msgFile = DemoModeConstants.DEMO_MODE_MESSAGES_LOCATION + msgFile;
         URL url = Thread.currentThread().getContextClassLoader().getResource(msgFile);
-        assertNotNull("Check that the file " + msgFile + " is in the classpath", url);
-    
+
         FileInputStream is = new FileInputStream(url.getFile());
         return new MimeMessage(session, is);
     }
@@ -175,7 +179,7 @@
 
         for (int i = 1; i &lt;= nfiles; i++) {
             FileItem fileItem;
-            fileItem = TestUtils.createMockFileItem("file_" + i + ".bin");
+            fileItem = TestUtils.createMockFileItem("uploadedFile_" + i + ".bin");
             registry.add(fileItem);
 
             MessageAttachment msgAttach = new MessageAttachment();
@@ -243,4 +247,26 @@
         return ret;
     }
 
+    /**
+     * Add a mock attachment to a mime message, you can specify whether the attachment
+     * is an in-line image, and the file name
+     * 
+     * @param message
+     * @param fileName
+     * @param isInline
+     * @throws IOException
+     * @throws MessagingException
+     */
+    public static void addMockAttachment(Message message, String fileName, boolean isInline)
throws IOException, MessagingException {
+        FileItem item = createMockFileItem(fileName, isInline ? "image/mock" : "mock/attachment");
+            
+        BodyPart part = MessageUtils.fileitemToBodypart(item);
+        if (isInline)
+            part.addHeader("Content-ID", "any-id");
+        
+        Multipart mpart = (Multipart) message.getContent();
+        mpart.addBodyPart(part);
+        message.saveChanges();
+    }
+ 
 }
\ No newline at end of file

Modified: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/FetchFoldersResult.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/FetchFoldersResult.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/FetchFoldersResult.java
(original)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/FetchFoldersResult.java
Wed Dec  2 10:32:05 2009
@@ -39,18 +39,17 @@
     
     @SuppressWarnings("unused")
     private FetchFoldersResult() {
-        
     }
     
     public ArrayList&lt;IMAPFolder&gt; getFolders() {
         return folders;
     }
-    
+
     public String toString() {
-        String ret = "";
-        for (IMAPFolder f: folders) {
-            ret += f.getFullName() + " ";
-        }
-        return ret;
+        StringBuilder ret = new StringBuilder();
+        for (IMAPFolder f : folders)
+            ret.append(f.getFullName()).append(" ");
+        return ret.toString();
     }
+    
 }

Modified: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/ReplyMessage.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/ReplyMessage.java?rev=886105&amp;r1=886104&amp;r2=886105&amp;view=diff
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/ReplyMessage.java (original)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/ReplyMessage.java Wed
Dec  2 10:32:05 2009
@@ -27,19 +27,12 @@
 
     private static final long serialVersionUID = -383135476236902779L;
 
-    private boolean replyAll;
     
-    public ReplyMessage(SMTPMessage msg, IMAPFolder folder, long uid, boolean replyAll) {
+    public ReplyMessage(SMTPMessage msg, IMAPFolder folder, long uid) {
         super(msg, folder, uid);
-        this.replyAll = replyAll;
     }
 
     protected ReplyMessage() {
-        
-    }
-    
-    public boolean getReplyAll() {
-        return replyAll;
     }
     
 }



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



</pre>
</div>
</content>
</entry>
<entry>
<title>JAMES Server Nightly Build Report</title>
<author><name>JAMES Nightly Build System &lt;noel@devtech.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c29800491.1243921259742937295.JavaMail.root@devtech.com%3e"/>
<id>urn:uuid:%3c29800491-1243921259742937295-JavaMail-root@devtech-com%3e</id>
<updated>2009-12-02T08:35:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
An automated nightly build of JAMES has been posted to http://people.apache.org/builds/james/nightly/
--------------------------------------------------------------------
Any unit test errors from the build should be reported below:
--------------------------------------------------------------------
BUILD SUCCESSFUL
Total time: 5 minutes 3 seconds
--------------------------------------------------------------------
Done. Packages Will Be Uploaded To The Nightly Repository.
--------------------------------------------------------------------
Please review http://people.apache.org/builds/james/nightly/BUILD.log.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886063 - in /james/mpt/trunk/mavenplugin: pom.xml src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java</title>
<author><name>norman@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091202070211.784F123888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091202070211-784F123888C5@eris-apache-org%3e</id>
<updated>2009-12-02T07:02:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: norman
Date: Wed Dec  2 07:02:09 2009
New Revision: 886063

URL: http://svn.apache.org/viewvc?rev=886063&amp;view=rev
Log:
more work on the maven2 plugin (MPT-2)

Modified:
    james/mpt/trunk/mavenplugin/pom.xml
    james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java

Modified: james/mpt/trunk/mavenplugin/pom.xml
URL: http://svn.apache.org/viewvc/james/mpt/trunk/mavenplugin/pom.xml?rev=886063&amp;r1=886062&amp;r2=886063&amp;view=diff
==============================================================================
--- james/mpt/trunk/mavenplugin/pom.xml (original)
+++ james/mpt/trunk/mavenplugin/pom.xml Wed Dec  2 07:02:09 2009
@@ -33,7 +33,7 @@
   &lt;description&gt;Apache JAMES Mail Protocol Tester (MPT) is a library providing a framework
for the 
 scritable functional testing of ASCII based line protocols. This Maven2 Plugin  is an easy
interface
 to the library requiring no extra coding.&lt;/description&gt;
-  &lt;url&gt;http://james.apache.org/mpt/antlib&lt;/url&gt;
+  &lt;url&gt;http://james.apache.org/mpt/mavenplugin&lt;/url&gt;
   &lt;dependencies&gt;
     &lt;dependency&gt;
       &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
@@ -99,7 +99,7 @@
         &lt;extensions&gt;true&lt;/extensions&gt;
         &lt;configuration&gt;
                 &lt;instructions&gt;
-                        &lt;Export-Package&gt;org.apache.james.mpt.ant&lt;/Export-Package&gt;
+                        &lt;Export-Package&gt;org.apache.james.mpt.maven&lt;/Export-Package&gt;
                         &lt;Embed-Dependency&gt;*;scope=runtime&lt;/Embed-Dependency&gt;
                 &lt;/instructions&gt;
         &lt;/configuration&gt;
@@ -122,9 +122,9 @@
   &lt;/build&gt;
   
   &lt;scm&gt;
-    &lt;connection&gt;scm:svn:http://svn.apache.org/repos/asf/james/mpt/trunk/antlib&lt;/connection&gt;
-    &lt;developerConnection&gt;scm:svn:https://rdonkin@svn.apache.org/repos/asf/james/mpt/trunk/antlib&lt;/developerConnection&gt;
-    &lt;url&gt;http://svn.apache.org/viewcvs.cgi/james/mpt/trunk/antlib?root=Apache-SVN&lt;/url&gt;
+    &lt;connection&gt;scm:svn:http://svn.apache.org/repos/asf/james/mpt/trunk/maven&lt;/connection&gt;
+    &lt;developerConnection&gt;scm:svn:https://rdonkin@svn.apache.org/repos/asf/james/mpt/trunk/maven&lt;/developerConnection&gt;
+    &lt;url&gt;http://svn.apache.org/viewcvs.cgi/james/mpt/trunk/maven?root=Apache-SVN&lt;/url&gt;
   &lt;/scm&gt;
 
 &lt;/project&gt;

Modified: james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java?rev=886063&amp;r1=886062&amp;r2=886063&amp;view=diff
==============================================================================
--- james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java
(original)
+++ james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java
Wed Dec  2 07:02:09 2009
@@ -23,50 +23,75 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.InputStreamReader;
 
 import org.apache.james.mpt.ExternalHostSystem;
 import org.apache.james.mpt.Monitor;
 import org.apache.james.mpt.ProtocolSessionBuilder;
 import org.apache.james.mpt.Runner;
+import org.apache.james.mpt.ScriptedUserAdder;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 
+/**
+ * @goal mpt
+ */
 public class MailProtocolTestMojo extends AbstractMojo implements Monitor{
 
     /**
      *
-     * @parameter default-value="0"
+     * @parameter
+     * @required
      */
     private Integer port;
     
     /**
      *
      * @parameter 
+     * @required
      */
     private File scriptFile;
     
     /**
+     * @required
      * @parameter 
      */
     private String host;
 
-    
+    /**
+     * @parameter 
+     */
+    private String user;
+    /**
+     * @parameter 
+     */
+    private String pass;
     /**
      * @parameter 
      */
     private String shabang;
     
+    /*
+     * (non-Javadoc)
+     * @see org.apache.maven.plugin.AbstractMojo#execute()
+     */
 	public void execute() throws MojoExecutionException, MojoFailureException {
 		validate();
 		
-		 final ExternalHostSystem hostSystem = new ExternalHostSystem(host, port, this, shabang,
null);
-	     final ProtocolSessionBuilder builder = new ProtocolSessionBuilder();
-	     
+     
          final Runner runner = new Runner();
          InputStream inputStream;
 		try {
 			inputStream = new FileInputStream(scriptFile);
+
+		    final ScriptedUserAdder adder = new ScriptedUserAdder(host, port,this);
+	        
+			if (user != null) adder.addUser(user, pass, new InputStreamReader(inputStream));
+	        
+			final ExternalHostSystem hostSystem = new ExternalHostSystem(host, port, this, shabang,
adder);
+		    final ProtocolSessionBuilder builder = new ProtocolSessionBuilder();
+		     
 	        builder.addProtocolLines(scriptFile.getName(), inputStream, runner.getTestElements());
 			runner.runSessions(hostSystem);
 
@@ -78,32 +103,42 @@
        
 	}
 
+	/**
+	 * Validate if the configured parameters are valid
+	 * 
+	 * @throws MojoFailureException
+	 */
 	private void validate() throws MojoFailureException {
 		if (port &lt;= 0) {
             throw new MojoFailureException("'port' configuration must be set.");
 		}
 		
-		if (host == null) {
-            throw new MojoFailureException("'host' configuration must be set.");
-		}
-		
-		if (scriptFile == null ) {
-            throw new MojoFailureException("'scriptFile' configuration must be set.");
-		}
-		
 		if (scriptFile.exists() == false ) {
             throw new MojoFailureException("'scriptFile' not exists");
 		}
 		
 	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.apache.james.mpt.Monitor#debug(char)
+	 */
 	public void debug(char character) {
 		getLog().debug("'" + character + "'");
 	}
 
+	/*
+	 * (non-Javadoc)
+	 * @see org.apache.james.mpt.Monitor#debug(java.lang.String)
+	 */
 	public void debug(String message) {
 		getLog().debug(message);
 	}
 
+	/*
+	 * (non-Javadoc)
+	 * @see org.apache.james.mpt.Monitor#note(java.lang.String)
+	 */
 	public void note(String message) {
 		getLog().debug(message);
 	}



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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (HUPA-58) Strings concatenated in loops</title>
<author><name>&quot;Eric Jablow (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c1183237888.1259713340722.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1183237888-1259713340722-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T00:22:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/HUPA-58?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Eric Jablow updated HUPA-58:
----------------------------

    Attachment: concatenation-in-loop.patch

Patch to replace String concatenation in loops with StringBuilder.append calls.  I suggest
using Google Collections' Joiner class instead.

&gt; Strings concatenated in loops
&gt; -----------------------------
&gt;
&gt;                 Key: HUPA-58
&gt;                 URL: https://issues.apache.org/jira/browse/HUPA-58
&gt;             Project: JAMES Hupa
&gt;          Issue Type: Improvement
&gt;            Reporter: Eric Jablow
&gt;            Assignee: Norman Maurer
&gt;            Priority: Minor
&gt;         Attachments: concatenation-in-loop.patch
&gt;
&gt;   Original Estimate: 0.17h
&gt;  Remaining Estimate: 0.17h
&gt;
&gt; A few Java files have code like
&gt; String ret = "";
&gt; for (String s : ...) {
&gt;   ret += s +" ";
&gt; }
&gt; StringBuilder.append() is faster and does not allocate new objects.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (HUPA-58) Strings concatenated in loops</title>
<author><name>&quot;Eric Jablow (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c1716455632.1259713340698.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1716455632-1259713340698-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T00:22:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Strings concatenated in loops
-----------------------------

                 Key: HUPA-58
                 URL: https://issues.apache.org/jira/browse/HUPA-58
             Project: JAMES Hupa
          Issue Type: Improvement
            Reporter: Eric Jablow
            Assignee: Norman Maurer
            Priority: Minor
         Attachments: concatenation-in-loop.patch

A few Java files have code like

String ret = "";
for (String s : ...) {
  ret += s +" ";
}

StringBuilder.append() is faster and does not allocate new objects.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>[GUMP@vmgump]: Project james-server (in module james-server) failed</title>
<author><name>Gump &lt;server-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091202055345.7F614AB4016@vmgump.apache.org%3e"/>
<id>urn:uuid:%3c20091202055345-7F614AB4016@vmgump-apache-org%3e</id>
<updated>2009-12-01T21:53:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
To whom it may engage...
        
This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at general@gump.apache.org.

Project james-server has an issue affecting its community integration.
This issue affects 1 projects.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
    - james-server :  James Server


Full details are available at:
    http://vmgump.apache.org/gump/public/james-server/james-server/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were provided:
 -DEBUG- Sole output [james-server-core-library-01122009.jar] identifier set to project name
 -DEBUG- Dependency on javamail exists, no need to add for property gump.resource.javamail.
 -DEBUG- Dependency on magic exists, no need to add for property magic.home.
 -INFO- Failed with reason build failed
 -INFO- Failed to extract fallback artifacts from Gump Repository



The following work was performed:
http://vmgump.apache.org/gump/public/james-server/james-server/gump_work/build_james-server_james-server.html
Work Name: build_james-server_james-server (Type: Build)
Work ended in a state of : Failed
Elapsed: 5 mins 49 secs
Command Line: /usr/lib/jvm/java-6-sun/bin/java -Djava.awt.headless=true org.apache.tools.ant.Main
-Dgump.merge=/srv/gump/public/gump/work/merge.xml -Dgump.resource.dnsjava=/srv/gump/public/workspace/james-server/stage/dnsjava/jars/dnsjava-2.0.6.jar
-Dgump.resource.javamail=/srv/gump/packages/javamail-1.4/mail.jar -Dgump.resource.jce=/srv/gump/packages/jce/jce-jdk13-116.jar
-Dmagic.home=/srv/gump/public/workspace/avalon-tools/tools/magic/target/01122009 -Dgump.resource.geronimo-spec-jms=/srv/gump/packages/jms1.1/lib/jms.jar
-Dgump.resource.cornerstone-scheduler-api=/srv/gump/public/workspace/excalibur/cornerstone/scheduler/api/target/cornerstone-scheduler-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.commons-logging=/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-01122009.jar
-Dgump.resource.excalibur-pool-impl=/srv/gump/public/workspace/excalibur/components/pool/impl/target/excalibur-pool-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.cornerstone-threads-api=/s
 rv/gump/public/workspace/excalibur/cornerstone/threads/api/target/cornerstone-threads-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.avalon-framework-api=/srv/gump/public/workspace/excalibur/framework/api/target/avalon-framework-api-4.3.2-SNAPSHOT.jar
-Dgump.resource.avalon-logkit=/srv/gump/packages/avalon/avalon-logkit-2.1.jar -Dgump.resource.cornerstone-connection-impl=/srv/gump/public/workspace/excalibur/cornerstone/connection/impl/target/cornerstone-connection-impl-2.2.3-SNAPSHOT.jar
-Dversion=01122009 -Dgump.resource.cornerstone-datasources-api=/srv/gump/public/workspace/excalibur/cornerstone/datasources/api/target/cornerstone-datasources-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.cornerstone-store-api=/srv/gump/public/workspace/excalibur/cornerstone/store/api/target/cornerstone-store-api-2.2.3-SNAPSHOT.jar
-Dbuild.sysclasspath=last -Dgump.resource.log4j=/srv/gump/public/workspace/logging-log4j-12/dist/lib/log4j-01122009.jar
-Dgump.resource.cornerstone-connection-api=/srv/gump/publ
 ic/workspace/excalibur/cornerstone/connection/api/target/cornerstone-connection-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.commons-net=/srv/gump/public/workspace/apache-commons/net/dist/commons-net-01122009.jar
-Dgump.resource.commons-pool=/srv/gump/public/workspace/apache-commons/pool/dist/commons-pool.jar
-Dgump.resource.bcmail=/srv/gump/packages/bouncycastle-jdk14/bcmail-130.jar -Dgump.signature=01122009
-Dgump.resource.commons-dbcp=/srv/gump/public/workspace/apache-commons/dbcp/dist/commons-dbcp.jar
-Dgump.resource.mailapi=/srv/gump/packages/javamail-1.4/mail.jar -Dgump.resource.excalibur-pool-api=/srv/gump/public/workspace/excalibur/components/pool/api/target/excalibur-pool-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.excalibur-thread-api=/srv/gump/public/workspace/excalibur/components/thread/api/target/excalibur-thread-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.bcprov=/srv/gump/packages/bouncycastle-jdk14/bcprov-130.jar -Dgump.resource.cornerstone-sockets-api=/srv/gump/public/worksp
 ace/excalibur/cornerstone/sockets/api/target/cornerstone-sockets-api-2.2.3-SNAPSHOT.jar -Dgump.resource.cornerstone-threads-impl=/srv/gump/public/workspace/excalibur/cornerstone/threads/impl/target/cornerstone-threads-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.servletapi=/srv/gump/public/workspace/jakarta-servletapi-4/lib/servlet.jar
-Dgump.resource.avalon-meta-tools=/srv/gump/packages/avalon/avalon-meta-tools-1.4.0.jar -Dgump.resource.oro=/srv/gump/public/workspace/jakarta-oro/jakarta-oro-01122009.jar
-Dgump.resource.excalibur-thread-impl=/srv/gump/public/workspace/excalibur/components/thread/impl/target/excalibur-thread-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.avalon-framework-impl=/srv/gump/public/workspace/excalibur/framework/impl/target/avalon-framework-impl-4.3.2-SNAPSHOT.jar
-Dgump.resource.excalibur-datasource=/srv/gump/public/workspace/excalibur/components/datasource/target/excalibur-datasource-2.2.3-SNAPSHOT.jar
-Dgump.resource.activation=/srv/gump/packages/jaf-1.1ea/a
 ctivation.jar -Dgump.resource.concurrent=/srv/gump/packages/dougLea/concurrent.jar -Dgump.resource.commons-collections=/srv/gump/public/workspace/commons-collections-3.x/target/commons-collections-3.3-SNAPSHOT.jar

[Working Directory: /srv/gump/public/workspace/james-server]
CLASSPATH: /usr/lib/jvm/java-6-sun/lib/tools.jar:/srv/gump/public/workspace/james-mailet/target/apache-mailet-2.5-SNAPSHOT.jar:/srv/gump/public/workspace/avalon-tools/tools/magic/target/deliverables/jars/avalon-tools-magic-01122009.jar:/srv/gump/public/workspace/junit/dist/junit-01122009.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/ant/dist/lib/ant-trax.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/packages/junit3.8.1/junit.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/excalibur/framework/api/target/avalon-framework-api-4.3.2-SNAPSHOT.j
 ar:/srv/gump/packages/avalon/avalon-logkit-2.1.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/public/workspace/logging-log4j-12/dist/lib/log4j-01122009.jar:/srv/gump/public/workspace/jakarta-servletapi-4/lib/servlet.jar:/srv/gump/packages/jms1.1/lib/jms.jar:/srv/gump/public/workspace/excalibur/framework/impl/target/avalon-framework-impl-4.3.2-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/datasource/target/excalibur-datasource-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/pool/impl/target/excalibur-pool-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/pool/api/target/excalibur-pool-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/commons-collections-3.x/target/commons-collections-3.3-SNAPSHOT.jar:/srv/gump/packages/dougLea/concurrent.jar:/srv/gump/public/workspace/excalibur/cornerstone/threads/api/target/cornerstone-threads-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/thread/api/targ
 et/excalibur-thread-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/connection/api/target/cornerstone-connection-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/sockets/api/target/cornerstone-sockets-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/connection/impl/target/cornerstone-connection-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/threads/impl/target/cornerstone-threads-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/thread/impl/target/excalibur-thread-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-01122009.jar:/srv/gump/public/workspace/excalibur/cornerstone/datasources/api/target/cornerstone-datasources-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/scheduler/api/target/cornerstone-scheduler-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/store
 /api/target/cornerstone-store-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/net/dist/commons-net-01122009.jar:/srv/gump/public/workspace/apache-commons/dbcp/dist/commons-dbcp.jar:/srv/gump/public/workspace/apache-commons/pool/dist/commons-pool.jar:/srv/gump/public/workspace/jakarta-oro/jakarta-oro-01122009.jar:/srv/gump/public/workspace/james-server/stage/dnsjava/jars/dnsjava-2.0.6.jar:/srv/gump/packages/jaf-1.1ea/activation.jar:/srv/gump/packages/bouncycastle-jdk14/bcmail-130.jar:/srv/gump/packages/bouncycastle-jdk14/bcprov-130.jar:/srv/gump/packages/jce/jce-jdk13-116.jar:/srv/gump/packages/avalon/avalon-meta-tools-1.4.0.jar
---------------------------------------------
prepare-phoenix:
     [echo] Phoenix distribution present - adjusting linefeeds and permissions, copying files
     [copy] Copying 71 files to /srv/gump/public/workspace/james-server/phoenix-deployment/dist/james-server-01122009
     [copy] Copying 6 files to /srv/gump/public/workspace/james-server/phoenix-deployment/dist/james-server-01122009/lib
     [copy] Copying 1 file to /srv/gump/public/workspace/james-server/phoenix-deployment/dist/james-server-01122009/bin

prepare-mxinfo:
    [mkdir] Created dir: /srv/gump/public/workspace/james-server/phoenix-deployment/target/classes
[generatemeta] Writing Info descriptors as legacy xml.

prepare-metainf:
     [copy] Copying 1 file to /srv/gump/public/workspace/james-server/phoenix-deployment/target/meta-inf

prepare:

compile-main:
     [echo] Compiling James Java sources
    [javac] Compiling 7 source files to /srv/gump/public/workspace/james-server/phoenix-deployment/target/classes
     [copy] Copying 2 files to /srv/gump/public/workspace/james-server/phoenix-deployment/target/classes

compile-proposal:

compile:

unit-tests-classpath:

compile-unit-tests:
     [echo] Compiling James Unit Test Java sources
    [mkdir] Created dir: /srv/gump/public/workspace/james-server/phoenix-deployment/target/test
    [mkdir] Created dir: /srv/gump/public/workspace/james-server/phoenix-deployment/target/test/classes
    [javac] Compiling 5 source files to /srv/gump/public/workspace/james-server/phoenix-deployment/target/test/classes
    [javac] /srv/gump/public/workspace/james-server/phoenix-deployment/src/test/org/apache/james/JamesTest.java:161:
warning: [deprecation] isLocalUser(java.lang.String) in org.apache.mailet.MailetContext has
been deprecated
    [javac]         return ((MailetContext)mailServerImpl).isLocalUser(username);
    [javac]                                               ^
    [javac] 1 warning
     [copy] Copying 17 files to /srv/gump/public/workspace/james-server/phoenix-deployment/target/test/classes

run-unit-tests:
     [echo] Running James Unit Tests in directory /srv/gump/public/workspace/james-server/phoenix-deployment
    [mkdir] Created dir: /srv/gump/public/workspace/james-server/phoenix-deployment/target/test/reports
    [junit] Running org.apache.james.AvalonJamesTest
    [junit] Tests run: 5, Failures: 0, Errors: 5, Time elapsed: 0.469 sec

BUILD FAILED
/srv/gump/public/workspace/james-server/build.xml:164: The following error occurred while
executing this line:
/srv/gump/public/workspace/james-server/build.xml:84: The following error occurred while executing
this line:
/srv/gump/public/workspace/james-server/build.xml:40: The following error occurred while executing
this line:
/srv/gump/public/workspace/james-server/phoenix-deployment/build.xml:896: Test org.apache.james.AvalonJamesTest
failed

Total time: 5 minutes 48 seconds
---------------------------------------------

To subscribe to this information via syndicated feeds:
- RSS: http://vmgump.apache.org/gump/public/james-server/james-server/rss.xml
- Atom: http://vmgump.apache.org/gump/public/james-server/james-server/atom.xml

============================== Gump Tracking Only ===
Produced by Gump version 2.3.
Gump Run 11001601122009, vmgump:vmgump-public:11001601122009
Gump E-mail Identifier (unique within run) #2.

--
Apache Gump
http://gump.apache.org/ [Instance: vmgump]

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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r885918 - in /james/mpt/trunk: ./ mavenplugin/ mavenplugin/src/ mavenplugin/src/main/ mavenplugin/src/main/java/ mavenplugin/src/main/java/org/ mavenplugin/src/main/java/org/apache/ mavenplugin/src/main/java/org/apache/james/ mavenplugin/sr...</title>
<author><name>norman@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091201204212.06FAE2388962@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091201204212-06FAE2388962@eris-apache-org%3e</id>
<updated>2009-12-01T20:42:11Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: norman
Date: Tue Dec  1 20:42:10 2009
New Revision: 885918

URL: http://svn.apache.org/viewvc?rev=885918&amp;view=rev
Log:
start to add maven plugin for mpt, no complete yet... (MPT-2)

Added:
    james/mpt/trunk/mavenplugin/
    james/mpt/trunk/mavenplugin/LICENSE.txt
    james/mpt/trunk/mavenplugin/NOTICE.txt
    james/mpt/trunk/mavenplugin/pom.xml
    james/mpt/trunk/mavenplugin/src/
    james/mpt/trunk/mavenplugin/src/main/
    james/mpt/trunk/mavenplugin/src/main/java/
    james/mpt/trunk/mavenplugin/src/main/java/org/
    james/mpt/trunk/mavenplugin/src/main/java/org/apache/
    james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/
    james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/
    james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/
    james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java
Modified:
    james/mpt/trunk/pom.xml

Added: james/mpt/trunk/mavenplugin/LICENSE.txt
URL: http://svn.apache.org/viewvc/james/mpt/trunk/mavenplugin/LICENSE.txt?rev=885918&amp;view=auto
==============================================================================
--- james/mpt/trunk/mavenplugin/LICENSE.txt (added)
+++ james/mpt/trunk/mavenplugin/LICENSE.txt Tue Dec  1 20:42:10 2009
@@ -0,0 +1,176 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
\ No newline at end of file

Added: james/mpt/trunk/mavenplugin/NOTICE.txt
URL: http://svn.apache.org/viewvc/james/mpt/trunk/mavenplugin/NOTICE.txt?rev=885918&amp;view=auto
==============================================================================
--- james/mpt/trunk/mavenplugin/NOTICE.txt (added)
+++ james/mpt/trunk/mavenplugin/NOTICE.txt Tue Dec  1 20:42:10 2009
@@ -0,0 +1,11 @@
+
+=========================================================================
+==      NOTICE file for use with the Apache License, Version 2.0,      ==
+=========================================================================
+
+Apache JAMES 
+Copyright 2007-2008 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+            
\ No newline at end of file

Added: james/mpt/trunk/mavenplugin/pom.xml
URL: http://svn.apache.org/viewvc/james/mpt/trunk/mavenplugin/pom.xml?rev=885918&amp;view=auto
==============================================================================
--- james/mpt/trunk/mavenplugin/pom.xml (added)
+++ james/mpt/trunk/mavenplugin/pom.xml Tue Dec  1 20:42:10 2009
@@ -0,0 +1,130 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  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.    
+--&gt;
+&lt;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"&gt;
+  &lt;parent&gt;
+    &lt;artifactId&gt;apache-james-mpt-project&lt;/artifactId&gt;
+    &lt;groupId&gt;org.apache.james&lt;/groupId&gt;
+    &lt;version&gt;0.2-SNAPSHOT&lt;/version&gt;
+    &lt;!-- Either this really points to the james-project/pom.xml or you
+         will have to tune the local repository, later, in this file --&gt;
+    &lt;relativePath&gt;../pom.xml&lt;/relativePath&gt;
+  &lt;/parent&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;org.apache.james&lt;/groupId&gt;
+  &lt;artifactId&gt;apache-james-mpt-mavenplugin&lt;/artifactId&gt;
+  &lt;name&gt;Apache JAMES MPT Maven2 Plugin&lt;/name&gt;
+  &lt;description&gt;Apache JAMES Mail Protocol Tester (MPT) is a library providing a framework
for the 
+scritable functional testing of ASCII based line protocols. This Maven2 Plugin  is an easy
interface
+to the library requiring no extra coding.&lt;/description&gt;
+  &lt;url&gt;http://james.apache.org/mpt/antlib&lt;/url&gt;
+  &lt;dependencies&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
+      &lt;artifactId&gt;apache-james-mpt-main&lt;/artifactId&gt;
+      &lt;!-- TODO: Use dependency from project pom --&gt;
+      &lt;version&gt;${project.version}&lt;/version&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;junit&lt;/groupId&gt;
+      &lt;artifactId&gt;junit&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
+      &lt;artifactId&gt;maven-plugin-api&lt;/artifactId&gt;
+      &lt;version&gt;2.0&lt;/version&gt;
+    &lt;/dependency&gt;  
+    &lt;dependency&gt;
+        &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
+        &lt;artifactId&gt;apache-james-mpt-main&lt;/artifactId&gt;
+        &lt;!-- TODO: Use dependency from project pom --&gt;
+        &lt;version&gt;${project.version}&lt;/version&gt;
+        &lt;type&gt;test-jar&lt;/type&gt;
+        &lt;scope&gt;test&lt;/scope&gt;
+    &lt;/dependency&gt;
+    
+  &lt;/dependencies&gt;
+
+  &lt;build&gt;
+    &lt;plugins&gt;
+      &lt;plugin&gt;
+        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+        &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
+        &lt;version&gt;2.2&lt;/version&gt;
+        &lt;configuration&gt;
+        &lt;archive&gt;
+          &lt;manifestFile&gt;${project.build.outputDirectory}/META-INF/MANIFEST.MF&lt;/manifestFile&gt;
+            &lt;manifestEntries&gt;
+              &lt;Specification-Title&gt;Apache James MPT Maven2 Plogin&lt;/Specification-Title&gt;
+              &lt;Specification-Version&gt;${pom.version}&lt;/Specification-Version&gt;
+              &lt;Specification-Vendor&gt;The Apache Software Foundation&lt;/Specification-Vendor&gt;
+              &lt;Implementation-Title&gt;Apache James MPT Maven2 Plugin&lt;/Implementation-Title&gt;
+              &lt;Implementation-Version&gt;${pom.version}&lt;/Implementation-Version&gt;
+              &lt;Implementation-Vendor&gt;The Apache Software Foundation&lt;/Implementation-Vendor&gt;
+              &lt;Implementation-Vendor-Id&gt;org.apache&lt;/Implementation-Vendor-Id&gt;
+              &lt;url&gt;${pom.url}&lt;/url&gt;
+            &lt;/manifestEntries&gt;
+          &lt;/archive&gt;
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;
+      &lt;plugin&gt;
+        &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
+        &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
+        &lt;version&gt;1.4.3&lt;/version&gt;
+        &lt;executions&gt;
+                &lt;execution&gt;
+                        &lt;id&gt;bundle-manifest&lt;/id&gt;
+                        &lt;phase&gt;process-classes&lt;/phase&gt;
+                        &lt;goals&gt;
+                                &lt;goal&gt;manifest&lt;/goal&gt;
+                        &lt;/goals&gt;
+                &lt;/execution&gt;
+        &lt;/executions&gt;
+        &lt;extensions&gt;true&lt;/extensions&gt;
+        &lt;configuration&gt;
+                &lt;instructions&gt;
+                        &lt;Export-Package&gt;org.apache.james.mpt.ant&lt;/Export-Package&gt;
+                        &lt;Embed-Dependency&gt;*;scope=runtime&lt;/Embed-Dependency&gt;
+                &lt;/instructions&gt;
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;
+      &lt;plugin&gt;
+        &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
+        &lt;version&gt;2.4&lt;/version&gt;
+        &lt;executions&gt;
+          &lt;execution&gt;
+            &lt;id&gt;create-javadocs&lt;/id&gt; 
+            &lt;phase&gt;package&lt;/phase&gt; 
+            &lt;goals&gt;
+              &lt;goal&gt;javadoc&lt;/goal&gt; 
+              &lt;goal&gt;jar&lt;/goal&gt;
+            &lt;/goals&gt;
+          &lt;/execution&gt;
+        &lt;/executions&gt;
+      &lt;/plugin&gt;
+    &lt;/plugins&gt;
+  &lt;/build&gt;
+  
+  &lt;scm&gt;
+    &lt;connection&gt;scm:svn:http://svn.apache.org/repos/asf/james/mpt/trunk/antlib&lt;/connection&gt;
+    &lt;developerConnection&gt;scm:svn:https://rdonkin@svn.apache.org/repos/asf/james/mpt/trunk/antlib&lt;/developerConnection&gt;
+    &lt;url&gt;http://svn.apache.org/viewcvs.cgi/james/mpt/trunk/antlib?root=Apache-SVN&lt;/url&gt;
+  &lt;/scm&gt;
+
+&lt;/project&gt;

Added: james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java?rev=885918&amp;view=auto
==============================================================================
--- james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java
(added)
+++ james/mpt/trunk/mavenplugin/src/main/java/org/apache/james/mpt/maven/MailProtocolTestMojo.java
Tue Dec  1 20:42:10 2009
@@ -0,0 +1,111 @@
+/****************************************************************
+ * 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.james.mpt.maven;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.james.mpt.ExternalHostSystem;
+import org.apache.james.mpt.Monitor;
+import org.apache.james.mpt.ProtocolSessionBuilder;
+import org.apache.james.mpt.Runner;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+public class MailProtocolTestMojo extends AbstractMojo implements Monitor{
+
+    /**
+     *
+     * @parameter default-value="0"
+     */
+    private Integer port;
+    
+    /**
+     *
+     * @parameter 
+     */
+    private File scriptFile;
+    
+    /**
+     * @parameter 
+     */
+    private String host;
+
+    
+    /**
+     * @parameter 
+     */
+    private String shabang;
+    
+	public void execute() throws MojoExecutionException, MojoFailureException {
+		validate();
+		
+		 final ExternalHostSystem hostSystem = new ExternalHostSystem(host, port, this, shabang,
null);
+	     final ProtocolSessionBuilder builder = new ProtocolSessionBuilder();
+	     
+         final Runner runner = new Runner();
+         InputStream inputStream;
+		try {
+			inputStream = new FileInputStream(scriptFile);
+	        builder.addProtocolLines(scriptFile.getName(), inputStream, runner.getTestElements());
+			runner.runSessions(hostSystem);
+
+		} catch (IOException e1) {
+            throw new MojoExecutionException("Cannot load script " + scriptFile.getName(),
e1);
+        } catch (Exception e) {
+            throw new MojoExecutionException("[FAILURE] in script " + scriptFile.getName()
+ "\n" + e.getMessage(), e);
+        }
+       
+	}
+
+	private void validate() throws MojoFailureException {
+		if (port &lt;= 0) {
+            throw new MojoFailureException("'port' configuration must be set.");
+		}
+		
+		if (host == null) {
+            throw new MojoFailureException("'host' configuration must be set.");
+		}
+		
+		if (scriptFile == null ) {
+            throw new MojoFailureException("'scriptFile' configuration must be set.");
+		}
+		
+		if (scriptFile.exists() == false ) {
+            throw new MojoFailureException("'scriptFile' not exists");
+		}
+		
+	}
+	public void debug(char character) {
+		getLog().debug("'" + character + "'");
+	}
+
+	public void debug(String message) {
+		getLog().debug(message);
+	}
+
+	public void note(String message) {
+		getLog().debug(message);
+	}
+	
+}

Modified: james/mpt/trunk/pom.xml
URL: http://svn.apache.org/viewvc/james/mpt/trunk/pom.xml?rev=885918&amp;r1=885917&amp;r2=885918&amp;view=diff
==============================================================================
--- james/mpt/trunk/pom.xml (original)
+++ james/mpt/trunk/pom.xml Tue Dec  1 20:42:10 2009
@@ -41,6 +41,7 @@
     &lt;module&gt;antlib&lt;/module&gt;
     &lt;module&gt;app&lt;/module&gt;
     &lt;module&gt;assemble&lt;/module&gt;
+    &lt;module&gt;mavenplugin&lt;/module&gt;  
   &lt;/modules&gt;
   &lt;scm&gt;
     &lt;connection&gt;scm:svn:http://svn.apache.org/repos/asf/james/mpt/trunk&lt;/connection&gt;



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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (MPT-2) write maven plugin</title>
<author><name>&quot;Norman Maurer (JIRA)&quot; &lt;server-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c1553015248.1259692100698.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1553015248-1259692100698-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T18:28:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
write maven plugin
------------------

                 Key: MPT-2
                 URL: https://issues.apache.org/jira/browse/MPT-2
             Project: JAMES MPT
          Issue Type: New Feature
            Reporter: Norman Maurer
            Assignee: Norman Maurer


It would be cool to have a maven plugin which runs mpt tests

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (JAMES-939) SMTP Auth does not respect &quot;*&quot; to cancel AUTH</title>
<author><name>&quot;Norman Maurer (JIRA)&quot; &lt;server-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c1934422361.1259691380682.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1934422361-1259691380682-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T18:16:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/JAMES-939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784316#action_12784316
] 

Norman Maurer commented on JAMES-939:
-------------------------------------

Fixed in trunk

&gt; SMTP Auth does not respect "*" to cancel AUTH
&gt; ---------------------------------------------
&gt;
&gt;                 Key: JAMES-939
&gt;                 URL: https://issues.apache.org/jira/browse/JAMES-939
&gt;             Project: JAMES Server
&gt;          Issue Type: Bug
&gt;          Components: SMTPServer
&gt;    Affects Versions: 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.4, 2.3.3, 3.0, 3.0-M1, Trunk
&gt;            Reporter: Norman Maurer
&gt;            Assignee: Norman Maurer
&gt;             Fix For: 3.0, 3.0-M1, Trunk
&gt;
&gt;
&gt; According to RFC2554:
&gt; "If the client wishes to cancel an authentication exchange, it issues a line with a single
"*".  If the server receives such an answer, it MUST reject the AUTH command by sending a
501 reply."
&gt; Like this (from a Postfix session):
&gt; AUTH PLAIN
&gt; 334
&gt; *
&gt; 501 5.7.0 Authentication aborted

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r885854 - in /james/server/trunk: smtp-protocol-library/src/main/java/org/apache/james/smtpserver/protocol/core/esmtp/AuthCmdHandler.java smtpserver-function/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java</title>
<author><name>norman@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091201181342.544CF23888DC@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091201181342-544CF23888DC@eris-apache-org%3e</id>
<updated>2009-12-01T18:13:42Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: norman
Date: Tue Dec  1 18:13:41 2009
New Revision: 885854

URL: http://svn.apache.org/viewvc?rev=885854&amp;view=rev
Log:
Allow to cancel AUTH according to RFC (JAMES-939)

Modified:
    james/server/trunk/smtp-protocol-library/src/main/java/org/apache/james/smtpserver/protocol/core/esmtp/AuthCmdHandler.java
    james/server/trunk/smtpserver-function/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java

Modified: james/server/trunk/smtp-protocol-library/src/main/java/org/apache/james/smtpserver/protocol/core/esmtp/AuthCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtp-protocol-library/src/main/java/org/apache/james/smtpserver/protocol/core/esmtp/AuthCmdHandler.java?rev=885854&amp;r1=885853&amp;r2=885854&amp;view=diff
==============================================================================
--- james/server/trunk/smtp-protocol-library/src/main/java/org/apache/james/smtpserver/protocol/core/esmtp/AuthCmdHandler.java
(original)
+++ james/server/trunk/smtp-protocol-library/src/main/java/org/apache/james/smtpserver/protocol/core/esmtp/AuthCmdHandler.java
Tue Dec  1 18:13:41 2009
@@ -58,23 +58,37 @@
     implements CommandHandler, EhloExtension, ExtensibleHandler, MailParametersHook {
 
     private abstract class AbstractSMTPLineHandler implements LineHandler {
-        
+
         public void onLine(SMTPSession session, byte[] line) {
             try {
                 String l = new String(line, "US-ASCII");
-                SMTPResponse res = onCommand(session,l);
+                SMTPResponse res = handleCommand(session, l);
                 session.popLineHandler();
                 session.writeSMTPResponse(res);
             } catch (UnsupportedEncodingException e) {
-                // This should never happen, anyway return a error message and disconnect
is prolly the best thing todo here
-                session.getLogger().error("Unable to parse line",e);
-                //end the session
+                // This should never happen, anyway return a error message and
+                // disconnect is prolly the best thing todo here
+                session.getLogger().error("Unable to parse line", e);
+                // end the session
                 SMTPResponse resp = new SMTPResponse(SMTPRetCode.LOCAL_ERROR, "Unable to
parse line.");
                 resp.setEndSession(true);
                 session.writeSMTPResponse(resp);
             }
         }
 
+        private SMTPResponse handleCommand(SMTPSession session, String line) {
+            // See JAMES-939
+            
+            // According to RFC2554:
+            // "If the client wishes to cancel an authentication exchange, it issues a line
with a single "*".
+            // If the server receives such an answer, it MUST reject the AUTH
+            // command by sending a 501 reply."
+            if (line.equals("*\r\n")) {
+                return new SMTPResponse(SMTPRetCode.SYNTAX_ERROR_ARGUMENTS, DSNStatus.getStatus(DSNStatus.PERMANENT,
DSNStatus.SECURITY_AUTH) + " Authentication aborted");
+            }
+            return onCommand(session, line);
+        }
+
         protected abstract SMTPResponse onCommand(SMTPSession session, String l);
     }
 

Modified: james/server/trunk/smtpserver-function/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java?rev=885854&amp;r1=885853&amp;r2=885854&amp;view=diff
==============================================================================
--- james/server/trunk/smtpserver-function/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java
(original)
+++ james/server/trunk/smtpserver-function/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java
Tue Dec  1 18:13:41 2009
@@ -196,8 +196,10 @@
     protected void setUp() throws Exception {
         m_serviceManager = setUpServiceManager();
 
+        SimpleLog smtpLog = new SimpleLog("MockLog");
+        smtpLog.setLevel(SimpleLog.LOG_LEVEL_DEBUG);
         m_smtpServer = new SMTPServerProtocolHandlerFactory();
-        m_smtpServer.setLog(new SimpleLog("MockLog"));
+        m_smtpServer.setLog(smtpLog);
         m_smtpServer.setLoader(m_serviceManager);
         m_smtpServer.setDNSService(m_dnsServer);
         m_smtpServer.setMailetContext(mailetContext);
@@ -846,6 +848,31 @@
         smtpProtocol1.quit();
     }
 
+    public void testAuthCancel() throws Exception {
+        m_testConfiguration.setAuthorizedAddresses("127.0.0.1/8");
+        m_testConfiguration.setAuthorizingAnnounce();
+        finishSetUp(m_testConfiguration);
+
+        SMTPClient smtpProtocol = new SMTPClient();
+        smtpProtocol.connect("127.0.0.1", m_smtpListenerPort);
+
+        smtpProtocol.sendCommand("ehlo", InetAddress.getLocalHost().toString());
+
+        String sender ="test_user_smtp@localhost";
+      
+        smtpProtocol.sendCommand("AUTH PLAIN");
+
+        assertEquals("start auth.", 334, smtpProtocol.getReplyCode());
+
+        smtpProtocol.sendCommand("*");
+
+        assertEquals("cancel auth.", 501, smtpProtocol.getReplyCode());
+
+        smtpProtocol.quit();
+
+    }
+    
+    // Test for JAMES-939
     public void testAuth() throws Exception {
         m_testConfiguration.setAuthorizedAddresses("128.0.0.1/8");
         m_testConfiguration.setAuthorizingAnnounce();



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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (HUPA-57) Some times it is necessary to push twice the actions in the ui</title>
<author><name>=?utf-8?Q?Manuel_Carrasco_Mo=C3=B1ino_=28JIRA=29?= &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c2024532348.1259690540639.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c2024532348-1259690540639-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T18:02:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Some times it is necessary to push twice the actions in the ui
--------------------------------------------------------------

                 Key: HUPA-57
                 URL: https://issues.apache.org/jira/browse/HUPA-57
             Project: JAMES Hupa
          Issue Type: Bug
          Components: client, server
            Reporter: Manuel Carrasco Moñino
            Assignee: Norman Maurer


This is a weird behavior I'm suffering. 

When I click an action (for instance viewing a message, o moving to another folder), the wait
image appears but the server response doesn't come.
Pushing again on the link the response comes immediately.

Not sure where the problem is and how to debug, just I open this issue to share it.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r885783 [2/2] - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/ client/src/main/java/org/apache/hupa/client/mvp/ client/war/WEB-INF/ server/src/main/java/org/apache/hupa/server/guice/ server/src/main/java/org/apache/hupa/...</title>
<author><name>manolo@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091201150503.D150923889D0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091201150503-D150923889D0@eris-apache-org%3e</id>
<updated>2009-12-01T15:05:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java Tue Dec  1 15:05:00 2009
@@ -21,55 +21,62 @@
 
 
 import javax.mail.Message;
-import javax.mail.Session;
+import javax.mail.Part;
 import javax.servlet.http.HttpSession;
 
-import junit.framework.TestCase;
-
-import org.apache.hupa.server.FileItemRegistry;
+import org.apache.hupa.server.HupaTestCase;
 import org.apache.hupa.server.IMAPStoreCache;
 import org.apache.hupa.server.guice.DemoModeConstants;
-import org.apache.hupa.server.guice.GuiceTestModule;
 import org.apache.hupa.server.mock.MockIMAPFolder;
 import org.apache.hupa.server.mock.MockIMAPStoreCache;
+import org.apache.hupa.server.utils.MessageUtils;
+import org.apache.hupa.server.utils.TestUtils;
 import org.apache.hupa.shared.data.SMTPMessage;
 import org.apache.hupa.shared.data.User;
 import org.apache.hupa.shared.rpc.SendMessage;
 
-import com.google.inject.Injector;
 import com.sun.mail.imap.IMAPStore;
 
-public class AbtractSendMessageHandlerTest extends TestCase {
-    
-    GuiceTestModule module = new GuiceTestModule();
-    Injector injector = module.getInjector();
-    
-    public void testFillMockMessages () throws Exception{
-        Session session = injector.getInstance(Session.class);
-        
-        Message msg = MsgUtils.fillMockMimeMessage(session, "Hola", null, 0);
+public class AbtractSendMessageHandlerTest extends HupaTestCase {
+
+    User demouser = DemoModeConstants.demoUser;
+
+    String contentTwoAttach = "multipart/mixed\n"
+                            + " multipart/alternative\n"
+                            + "  text/plain\n"
+                            + "  text/html\n"
+                            + " mock/attachment =&gt; file_1.bin\n"
+                            + " mock/attachment =&gt; file_2.bin\n";
+
+    public void testComposeMessage() throws Exception{
+
+        Message msg = TestUtils.createMockMimeMessage(session, "body", null, -1);
         String exp = "text/plain\n";
-        assertEquals(exp, MsgUtils.summaryzeContent(msg).toString());
+        assertEquals(exp, TestUtils.summaryzeContent(msg).toString());
+        
+        msg = TestUtils.createMockMimeMessage(session, "body", null, 0);
+        exp = "text/plain\n";
+        assertEquals(exp, TestUtils.summaryzeContent(msg).toString());
 
-        msg = MsgUtils.fillMockMimeMessage(session, null, "&lt;div&gt;hola&lt;/div&gt;", 0);
+        msg = TestUtils.createMockMimeMessage(session, null, "html", 0);
         exp = "text/html\n";
-        assertEquals(exp, MsgUtils.summaryzeContent(msg).toString());
+        assertEquals(exp, TestUtils.summaryzeContent(msg).toString());
 
-        msg = MsgUtils.fillMockMimeMessage(session, "hola", "&lt;div&gt;hola&lt;/div&gt;", 0);
+        msg = TestUtils.createMockMimeMessage(session, 0);
         exp = "multipart/alternative\n" +
               " text/plain\n" +
               " text/html\n";
-        assertEquals(exp, MsgUtils.summaryzeContent(msg).toString());
+        assertEquals(exp, TestUtils.summaryzeContent(msg).toString());
         
-        msg = MsgUtils.fillMockMimeMessage(session, "hola", "&lt;div&gt;hola&lt;/div&gt;", 1);
+        msg = TestUtils.createMockMimeMessage(session, 1);
         exp = "multipart/mixed\n" +
               " multipart/alternative\n" +
               "  text/plain\n" +
               "  text/html\n" +
               " mock/attachment =&gt; file_1.bin\n";
-        assertEquals(exp, MsgUtils.summaryzeContent(msg).toString());
+        assertEquals(exp, TestUtils.summaryzeContent(msg).toString());
         
-        msg = MsgUtils.fillMockMimeMessage(session, "hola", "&lt;div&gt;hola&lt;/div&gt;", 3);
+        msg = TestUtils.createMockMimeMessage(session, 3);
         exp = "multipart/mixed\n" +
               " multipart/alternative\n" +
               "  text/plain\n" +
@@ -77,25 +84,25 @@
               " mock/attachment =&gt; file_1.bin\n" +
               " mock/attachment =&gt; file_2.bin\n" +
               " mock/attachment =&gt; file_3.bin\n";
-        assertEquals(exp, MsgUtils.summaryzeContent(msg).toString());
+        assertEquals(exp, TestUtils.summaryzeContent(msg).toString());
     }
     
+    public void testRestoreInlineLinks() {
+        String txt, res;
+        txt = ".. &lt;img\nsrc='...&amp;name=abcd' name='cid:abcd'\nwhatever=/&gt; ..";
+        res = abstSendMsgHndl.restoreInlineLinks(txt);
+        assertEquals(".. &lt;img\nsrc='cid:abcd'\nwhatever=/&gt; ..", res);
+    }
+
     public void testHtmlmessageToText() {
         String txt, res;
         txt = "&lt;div&gt;Hola:&lt;/div&gt;Como \n estas&lt;br/&gt;Adios\n\n";
-        
-        @SuppressWarnings("unchecked")
-        AbstractSendMessageHandler&lt;SendMessage&gt; handler = injector.getInstance(AbstractSendMessageHandler.class);
-
-        res = handler.htmlToText(txt);
+        res = abstSendMsgHndl.htmlToText(txt);
         assertEquals("Hola:\nComo estas\nAdios ", res);
     }
     
     public void testSendEmailWithAttachments() throws Exception {
         
-        Session session = injector.getInstance(Session.class);
-        User demouser = DemoModeConstants.demoUser;
-
         HttpSession httpSession = injector.getInstance(HttpSession.class);
         httpSession.setAttribute("user", demouser);
 
@@ -103,33 +110,55 @@
         IMAPStore store = injector.getInstance(IMAPStore.class);
         ((MockIMAPStoreCache)storeCache).addValidUser(demouser, store);
         
-        FileItemRegistry registry = injector.getInstance(FileItemRegistry.class);
-        
-        @SuppressWarnings("unchecked")
-        AbstractSendMessageHandler&lt;SendMessage&gt; handler = injector.getInstance(AbstractSendMessageHandler.class);
-
         MockIMAPFolder sentbox = (MockIMAPFolder) store.getFolder(DemoModeConstants.DEMO_MODE_SENT_FOLDER);
-        assertTrue(sentbox.getMessages().length == 0);
         
-        SMTPMessage smtpmsg = MsgUtils.fillSMTPMessage(registry, 2);
+        SMTPMessage smtpmsg = TestUtils.createMockSMTPMessage(MessageUtils.getSessionRegistry(httpSession, logger), 2);
         SendMessage action = new SendMessage(smtpmsg);
         
-        Message message = handler.createMessage(session, action);
-        message =  handler.fillBody(message, action);
+        Message message = abstSendMsgHndl.createMessage(session, action);
+        message =  abstSendMsgHndl.fillBody(message, action);
         
-        String expected = "multipart/mixed\n"
-                        + " multipart/alternative\n"
-                        + "  text/plain\n"
-                        + "  text/html\n"
-                        + " mock/attachment =&gt; file_1.bin\n"
-                        + " mock/attachment =&gt; file_2.bin\n";
+        assertEquals(contentTwoAttach, TestUtils.summaryzeContent(message).toString());
+
+        abstSendMsgHndl.sendMessage(session, demouser, message);
+
+        Part part = MessageUtils.handleMultiPart(logger, message.getContent(), "file_1.bin");
+        assertTrue(part.getSize() &lt; 0);
+
+        assertTrue(sentbox.getMessages().length == 0);
+        abstSendMsgHndl.saveSentMessage(session, demouser, message);
+        assertTrue(sentbox.getMessages().length == 1);
         
-        assertEquals(expected, MsgUtils.summaryzeContent(message).toString());
+        message = sentbox.getMessage(0);
+        assertNotNull(message);
+        assertEquals(contentTwoAttach, TestUtils.summaryzeContent(message).toString());
         
-        handler.sendMessage(demouser, session, message);
-        handler.saveSentMessage(demouser, message);
-        assertTrue(sentbox.getMessages().length == 1);
+        part = MessageUtils.handleMultiPart(logger, message.getContent(), "file_1.bin");
+        assertTrue(part.getSize() &gt; 0);
         
     }
 
+    public void testExecute() throws Exception {
+
+        HttpSession httpSession = injector.getInstance(HttpSession.class);
+        httpSession.setAttribute("user", demouser);
+
+        IMAPStore store = injector.getInstance(IMAPStore.class);
+        ((MockIMAPStoreCache)storeCache).addValidUser(demouser, store);
+        
+        MockIMAPFolder sentbox = (MockIMAPFolder) store.getFolder(DemoModeConstants.DEMO_MODE_SENT_FOLDER);
+        
+        SMTPMessage smtpmsg = TestUtils.createMockSMTPMessage(MessageUtils.getSessionRegistry(httpSession, logger), 2);
+        SendMessage action = new SendMessage(smtpmsg);
+        
+        assertTrue(sentbox.getMessages().length == 0);
+        abstSendMsgHndl.execute(action, null);
+        Message message = sentbox.getMessage(0);
+        assertNotNull(message);
+        assertEquals(contentTwoAttach, TestUtils.summaryzeContent(message).toString());
+        
+        Part part = MessageUtils.handleMultiPart(logger, message.getContent(), "file_1.bin");
+        assertTrue(part.getSize() &gt; 0);
+        
+    }
 }

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/CreateFolderHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/CreateFolderHandlerTest.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/CreateFolderHandlerTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/CreateFolderHandlerTest.java Tue Dec  1 15:05:00 2009
@@ -27,14 +27,12 @@
 
 import org.apache.hupa.server.mock.MockIMAPFolder;
 import org.apache.hupa.server.mock.MockIMAPStore;
-import org.apache.hupa.server.mock.MockLog;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.User;
 import org.apache.hupa.shared.exception.InvalidSessionException;
 import org.apache.hupa.shared.rpc.CreateFolder;
 
 public class CreateFolderHandlerTest extends AbstractHandlerTest{
-
     
     public void testCreate() throws MessagingException {
         User user = createUser();

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/DeleteFolderHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/DeleteFolderHandlerTest.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/DeleteFolderHandlerTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/DeleteFolderHandlerTest.java Tue Dec  1 15:05:00 2009
@@ -26,7 +26,6 @@
 
 import org.apache.hupa.server.mock.MockIMAPFolder;
 import org.apache.hupa.server.mock.MockIMAPStore;
-import org.apache.hupa.server.mock.MockLog;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.User;
 import org.apache.hupa.shared.exception.InvalidSessionException;

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/DeleteMessageByUidHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/DeleteMessageByUidHandlerTest.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/DeleteMessageByUidHandlerTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/DeleteMessageByUidHandlerTest.java Tue Dec  1 15:05:00 2009
@@ -32,13 +32,11 @@
 
 import org.apache.hupa.server.mock.MockIMAPFolder;
 import org.apache.hupa.server.mock.MockIMAPStore;
-import org.apache.hupa.server.mock.MockLog;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.User;
 import org.apache.hupa.shared.rpc.DeleteMessageByUid;
 
 public class DeleteMessageByUidHandlerTest extends AbstractHandlerTest{
-
     
     public void testDeleteFolderNotExists() throws MessagingException {
         DeleteMessageByUidHandler handler = new DeleteMessageByUidHandler(storeCache, logger, httpSessionProvider);

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchFoldersHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchFoldersHandlerTest.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchFoldersHandlerTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchFoldersHandlerTest.java Tue Dec  1 15:05:00 2009
@@ -28,7 +28,6 @@
 
 import org.apache.hupa.server.mock.MockIMAPFolder;
 import org.apache.hupa.server.mock.MockIMAPStore;
-import org.apache.hupa.server.mock.MockLog;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.User;
 import org.apache.hupa.shared.exception.InvalidSessionException;

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FowardMessageHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FowardMessageHandlerTest.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FowardMessageHandlerTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FowardMessageHandlerTest.java Tue Dec  1 15:05:00 2009
@@ -20,62 +20,26 @@
 package org.apache.hupa.server.handler;
 
 import javax.mail.Message;
-import javax.mail.Session;
 import javax.servlet.http.HttpSession;
 
-import junit.framework.TestCase;
-
-import org.apache.commons.logging.Log;
 import org.apache.hupa.server.FileItemRegistry;
+import org.apache.hupa.server.HupaTestCase;
 import org.apache.hupa.server.IMAPStoreCache;
-import org.apache.hupa.server.InMemoryIMAPStoreCache;
 import org.apache.hupa.server.guice.DemoModeConstants;
-import org.apache.hupa.server.guice.GuiceTestModule;
-import org.apache.hupa.server.guice.SessionProvider;
-import org.apache.hupa.server.mock.MockHttpSession;
 import org.apache.hupa.server.mock.MockIMAPFolder;
 import org.apache.hupa.server.mock.MockIMAPStoreCache;
-import org.apache.hupa.server.mock.MockLogProvider;
+import org.apache.hupa.server.utils.TestUtils;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.SMTPMessage;
 import org.apache.hupa.shared.data.User;
 import org.apache.hupa.shared.rpc.ForwardMessage;
 
-import com.google.inject.AbstractModule;
-import com.google.inject.Injector;
-import com.google.inject.Singleton;
-import com.google.inject.name.Names;
 import com.sun.mail.imap.IMAPStore;
 
-public class FowardMessageHandlerTest extends TestCase {
-
-    public class TestConfigurationModule extends AbstractModule {
-        @Override
-        protected void configure() {
-
-            DemoModeConstants.demoProperties.put("DefaultUserSessionId", "WhateverId");
-            Names.bindProperties(binder(), DemoModeConstants.demoProperties);
-
-            bind(Log.class).toProvider(MockLogProvider.class).in(Singleton.class);
-            bind(FileItemRegistry.class).in(Singleton.class);
-            bind(Session.class).toProvider(SessionProvider.class);
-            bind(HttpSession.class).to(MockHttpSession.class).in(Singleton.class);
+public class FowardMessageHandlerTest extends HupaTestCase {
 
-            bind(IMAPStoreCache.class).to(InMemoryIMAPStoreCache.class);
-
-            bind(ForwardMessageHandler.class);
-            bind(GetMessageDetailsHandler.class);
-
-        }
-    }
+    public void testForwardMessage() throws Exception {
 
-    public void testMine() throws Exception {
-        
-        
-        GuiceTestModule module = new GuiceTestModule();
-        Injector injector = module.getInjector();
-
-        Session session = injector.getInstance(Session.class);
         User demouser = DemoModeConstants.demoUser;
 
         HttpSession httpSession = injector.getInstance(HttpSession.class);
@@ -87,38 +51,33 @@
         
         FileItemRegistry registry = injector.getInstance(FileItemRegistry.class);
         
-        ForwardMessageHandler handler = injector.getInstance(ForwardMessageHandler.class);
-
         MockIMAPFolder sentbox = (MockIMAPFolder) store.getFolder(DemoModeConstants.DEMO_MODE_SENT_FOLDER);
         assertTrue(sentbox.getMessages().length == 0);
 
         MockIMAPFolder inbox = (MockIMAPFolder) store.getFolder(DemoModeConstants.DEMO_MODE_INBOX_FOLDER);
         assertTrue(inbox.getMessages().length &gt;= 0);
         
-        Message message = MsgUtils.fillMockMimeMessage(session, "hola", null, 2);
+        Message message = TestUtils.createMockMimeMessage(session, 2);
         inbox.appendMessages(new Message[]{message});
         long msgUid = inbox.getUID(message);
         message = inbox.getMessageByUID(msgUid);
         assertNotNull(message);
         
         IMAPFolder ifolder = new IMAPFolder(inbox.getFullName());
-        SMTPMessage smtpmsg = MsgUtils.fillSMTPMessage(registry, 2);
+        SMTPMessage smtpmsg = TestUtils.createMockSMTPMessage(registry, 2);
         ForwardMessage action = new ForwardMessage(smtpmsg, ifolder, msgUid);
         
-        message = handler.createMessage(session, action);
-        message = handler.fillBody(message, action);
-
-        // TODO: this is the expected behavior of the handler, but it doesn't work
-        // It's commented to avoid breaking the build
+        message = fwdMsgHndl.createMessage(session, action);
+        message = fwdMsgHndl.fillBody(message, action);
+        
+        String expected = "multipart/mixed\n"
+            + " multipart/alternative\n"
+            + "  text/plain\n"
+            + "  text/html\n"
+            + " mock/attachment =&gt; file_1.bin\n"
+            + " mock/attachment =&gt; file_2.bin\n";
         
-//        String expected = "multipart/mixed\n"
-//            + " multipart/alternative\n"
-//            + "  text/plain\n"
-//            + "  text/html\n"
-//            + " mock/attachment =&gt; file_1.bin\n"
-//            + " mock/attachment =&gt; file_2.bin\n";
-//        
-//        assertEquals(expected, MsgUtils.summaryzeContent(message).toString());
+        assertEquals(expected, TestUtils.summaryzeContent(message).toString());
 
     }
 

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/GetMessageDetailsHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/GetMessageDetailsHandlerTest.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/GetMessageDetailsHandlerTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/GetMessageDetailsHandlerTest.java Tue Dec  1 15:05:00 2009
@@ -23,117 +23,33 @@
 import javax.mail.Message;
 import javax.mail.internet.MimeMessage;
 
-import org.apache.hupa.server.mock.MockIMAPFolder;
-import org.apache.hupa.server.mock.MockIMAPStore;
+import org.apache.hupa.server.HupaTestCase;
+import org.apache.hupa.server.IMAPStoreCache;
+import org.apache.hupa.server.guice.DemoModeConstants;
+import org.apache.hupa.server.mock.MockIMAPStoreCache;
+import org.apache.hupa.server.utils.TestUtils;
 import org.apache.hupa.shared.SConsts;
-import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.MessageDetails;
+import org.apache.hupa.shared.data.User;
 
-public class GetMessageDetailsHandlerTest extends AbstractHandlerTest {
-    
-    GetMessageDetailsHandler handler = new GetMessageDetailsHandler(storeCache, logger, httpSessionProvider);
+import com.sun.mail.imap.IMAPFolder;
+import com.sun.mail.imap.IMAPStore;
 
-    public void testRegexHtml() {
-        String txt, res;
-        txt = "&lt;!'https://www.aaa.1:#@%/;$()~_?+-=\\.&amp;&lt;br/&gt;";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_http, "");
-        assertEquals("&lt;!'&lt;br/&gt;", res);
-
-        txt = "... a b c http://somewhere d e f ...";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_http, GetMessageDetailsHandler.repl_http);
-        assertEquals("... a b c &lt;a href=\"http://somewhere\"&gt;http://somewhere&lt;/a&gt; d e f ...", res);
-    }
-
-    public void testRegexEmail() {
-        String txt, res;
-        txt = "!'BcD091_%55-+.aa@abc01-01.dd-a.aBc+";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_email, "");
-        assertEquals("!'+", res);
-
-        txt = "!'=BcD091_%55-+.aa@abc01-01.dd-a.aBc+";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_email, "");
-        assertEquals(txt, res);
-
-        txt = "... a b c aaa@aaa.bbb d e f ...";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_email, GetMessageDetailsHandler.repl_email);
-        assertEquals(res, "... a b c &lt;a href=\"mailto:aaa@aaa.bbb\"&gt;aaa@aaa.bbb&lt;/a&gt; d e f ...");
-    }
-
-    public void testRegexInlineImg() {
-        String txt, res;
-        txt = ".. &lt;img\nsrc=\"cid:abcd\"\nwhatever=/&gt;click&lt;/a\n&gt; ..";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_inlineImg, GetMessageDetailsHandler.repl_inlineImg);
-        assertEquals(".. &lt;img\nsrc=\"hupa/downloadAttachmentServlet?folder=%%FOLDER%%&amp;uid=%%UID%%&amp;name=abcd\"\nwhatever=/&gt;click&lt;/a\n&gt; ..", res);
-    }
-    
-    public void testRegexBadTags() {
-        String txt, res;
-        txt = "&lt;html&gt;&lt;head&gt;h&lt;tag&gt;&lt;/head&gt;&lt;body&gt;.&lt;style&gt;..&lt;/style&gt;.&lt;script type=&gt;//&lt;/script&gt;&lt;/body&gt;.&lt;/html&gt;";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_badTags, GetMessageDetailsHandler.repl_badTags);
-        res = handler.replaceAll(res, GetMessageDetailsHandler.regex_unneededTags, GetMessageDetailsHandler.repl_unneededTags);
-        assertEquals("...", res);
-    }
-
-    public void testRegexBadAttributes() {
-
-        String txt, res;
-        txt = "... &lt;div attr=a onClick=\"something('');\"&gt; ...";
-        res = handler.replaceAllRecursive(txt, GetMessageDetailsHandler.regex_badAttrs, GetMessageDetailsHandler.repl_badAttrs);
-        assertEquals("... &lt;div attr=a&gt; ...", res);
-
-        txt = "... &lt;div attr=a onClick=\"something('');\" attr=b onMouseOver=whatever attr=c onKeyup=\"\" /&gt; ...";
-        res = handler.replaceAllRecursive(txt, GetMessageDetailsHandler.regex_badAttrs, GetMessageDetailsHandler.repl_badAttrs);
-        assertEquals("... &lt;div attr=a attr=b attr=c /&gt; ...", res);
-    }
+public class GetMessageDetailsHandlerTest extends HupaTestCase {
     
-    public void testRegexHtmlLinks() {
-        String txt, res;
-        txt = ".. &lt;a href=\"http://whatever\"&gt;..&lt;/a&gt; ..";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_existingHttpLinks, GetMessageDetailsHandler.repl_existingHttpLinks);
-        assertEquals(".. &lt;a onClick=\"openLink('http://whatever');return false;\" href=\"http://whatever\"&gt;..&lt;/a&gt; ..", res);
-
-        txt = "-- &lt;div&gt; .. &lt;img src=\"http://whatever\"/&gt; .. &lt;/div&gt;";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_orphandHttpLinks, GetMessageDetailsHandler.repl_orphandHttpLinks);
-        assertEquals(txt, res);
-        
-        txt = "-- &lt;div&gt; .. \"http://whatever\" .. &lt;/div&gt;";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_orphandHttpLinks, GetMessageDetailsHandler.repl_orphandHttpLinks);
-        assertEquals("-- &lt;div&gt; .. \"&lt;a href=\"http://whatever\"&gt;http://whatever&lt;/a&gt;\" .. &lt;/div&gt;", res);
-
-        res = handler.replaceAll(res, GetMessageDetailsHandler.regex_existingHttpLinks, GetMessageDetailsHandler.repl_existingHttpLinks);
-        assertEquals("-- &lt;div&gt; .. \"&lt;a onClick=\"openLink('http://whatever');return false;\" href=\"http://whatever\"&gt;http://whatever&lt;/a&gt;\" .. &lt;/div&gt;", res);
-        
-    }
-
-    public void testRegexEmailLinks() {
-        String txt, res;
-        
-        txt = ".. &lt;a href=\"mailTo:someone@somedomain.com\"&gt;..&lt;/a&gt; ..";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_existingEmailLinks, GetMessageDetailsHandler.repl_existngEmailLinks);
-        assertEquals(".. &lt;a onClick=\"mailTo('someone@somedomain.com');return false;\" href=\"mailto:someone@somedomain.com\"&gt;..&lt;/a&gt; ..", res);
-        
-        txt = "-- &lt;div&gt; .. someone@somedomain.com .. &lt;/div&gt;";
-        res = handler.replaceAll(txt, GetMessageDetailsHandler.regex_orphandEmailLinks, GetMessageDetailsHandler.repl_orphandEmailLinks);
-        assertEquals("-- &lt;div&gt; .. &lt;a href=\"mailto:someone@somedomain.com\"&gt;someone@somedomain.com&lt;/a&gt; .. &lt;/div&gt;", res);
-
-        res = handler.replaceAll(res, GetMessageDetailsHandler.regex_existingEmailLinks, GetMessageDetailsHandler.repl_existngEmailLinks);
-        assertEquals("-- &lt;div&gt; .. &lt;a onClick=\"mailTo('someone@somedomain.com');return false;\" href=\"mailto:someone@somedomain.com\"&gt;someone@somedomain.com&lt;/a&gt; .. &lt;/div&gt;", res);
-        
-    }
-
     public void testTextDocumentToHtml() throws Exception {
 
         String msg = "...\nhttp://www.example.com/path/action.do;s=1;a=2?p=abcd\n...";
-        String res = handler.txtDocumentToHtml(msg, "aFolder", 9999l);
+        String res = getDetailsMsgHndl.txtDocumentToHtml(msg, "aFolder", 9999l);
         assertNotSame(msg, res);
         assertTrue(res.contains("onClick=\"openLink('http://"));
         
         msg = "...\nnobody@subdomain.the-domain.org\n...";
-        res = handler.txtDocumentToHtml(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.txtDocumentToHtml(msg, "aFolder", 9999l);
         assertNotSame(msg, res);
         assertTrue(res.contains("onClick=\"mailTo('nobody@"));
         
-        res = handler.txtDocumentToHtml("", "aFolder", 9999l);
+        res = getDetailsMsgHndl.txtDocumentToHtml("", "aFolder", 9999l);
         assertTrue(res.length()==0);
         
     }
@@ -141,42 +57,42 @@
     public void testFilterHtmlDocument() throws Exception {
 
         String msg = "&lt;div&gt;...\nhttp://whatever\n...&lt;/div&gt;";
-        String res = handler.txtDocumentToHtml(msg, "aFolder", 9999l);
+        String res = getDetailsMsgHndl.txtDocumentToHtml(msg, "aFolder", 9999l);
         assertNotSame(msg, res);
         assertTrue(res.contains("onClick=\"openLink('http://whatever"));
         
         msg = "...\n&lt;a\nhref=https://www.example.com/path/action.do;s=1;a=2?p=abcd\n...";
-        res = handler.filterHtmlDocument(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.filterHtmlDocument(msg, "aFolder", 9999l);
         assertNotSame(msg, res);
         assertTrue(res.contains("onClick=\"openLink('https://"));
 
         msg = "...\n&lt;a\nhref=mailTo:nobody@subdomain.the-domain.org\n...";
-        res = handler.filterHtmlDocument(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.filterHtmlDocument(msg, "aFolder", 9999l);
         assertNotSame(msg, res);
         assertTrue(res.contains("onClick=\"mailTo('nobody@"));
 
         msg = "...\n...&lt;img   \n   src=\"cid:1.1934304663@web28309.mail.ukl.yahoo.com\" width=200\n....";
-        res = handler.filterHtmlDocument(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.filterHtmlDocument(msg, "aFolder", 9999l);
         assertNotSame(msg, res);
-        assertEquals("...\n...&lt;img   \n   src=\"" + 
+        assertEquals("...\n...&lt;img   \n   src='" + 
                 SConsts.HUPA + SConsts.SERVLET_DOWNLOAD + "?" 
                 + SConsts.PARAM_FOLDER + "=aFolder&amp;" 
                 + SConsts.PARAM_UID + "=9999&amp;"
-                + SConsts.PARAM_NAME + "=1.1934304663@web28309.mail.ukl.yahoo.com\" width=200\n....", res);
+                + SConsts.PARAM_NAME + "=1.1934304663@web28309.mail.ukl.yahoo.com' name='cid:1.1934304663@web28309.mail.ukl.yahoo.com' width=200\n....", res);
         
         msg = "\n\n.... &lt;Script \ntype=\"whatever\"\n&gt;\nalert('hello');\n&lt;/script &gt; ---\n\n";
-        res = handler.filterHtmlDocument(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.filterHtmlDocument(msg, "aFolder", 9999l);
         assertNotSame(msg, res);
 
         msg = "\n\n.... &lt;a \nid=\"whatever\"\nonclick=\"alert('hello');\"\n&lt;/a &gt; ---\n\n";
-        res = handler.filterHtmlDocument(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.filterHtmlDocument(msg, "aFolder", 9999l);
         assertNotSame(msg, res);
 
         msg = "\n\n.... &lt;style \ntype=\"whatever\"\n&gt;\n.a{};\n&lt;/Style &gt; ---\n\n";
-        res = handler.filterHtmlDocument(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.filterHtmlDocument(msg, "aFolder", 9999l);
         assertNotSame(msg, res);
         
-        res = handler.filterHtmlDocument("", "aFolder", 9999l);
+        res = getDetailsMsgHndl.filterHtmlDocument("", "aFolder", 9999l);
         assertTrue(res.length()==0);
 
     }
@@ -184,28 +100,28 @@
     public void testRegexEmailsInsideTagAttributes() {
         String msg, res;
         msg = ".. &lt;a href=\"http://whatever?param1=whatever&amp;email= dock@example.com&amp;param3\"&gt;..&lt;/a&gt; ..";
-        res = handler.filterHtmlDocument(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.filterHtmlDocument(msg, "aFolder", 9999l);
         assertFalse(res.contains("mailTo("));
 
         msg = ".. &lt;a href=bla &gt; http://whatever?param1=whatever&amp;email=dock@example.com&amp;param3 &lt;/a&gt; ..";
-        res = handler.filterHtmlDocument(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.filterHtmlDocument(msg, "aFolder", 9999l);
         assertFalse(res.contains("mailTo("));
         assertFalse(res.contains("openLink("));
 
         msg = ".. &lt;div &gt; http://whatever?param1=whatever&amp;email=dock@example.com&amp;param3 &lt;p&gt; ..";
-        res = handler.filterHtmlDocument(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.filterHtmlDocument(msg, "aFolder", 9999l);
         assertFalse(res.contains("mailTo("));
         assertTrue(res.contains("openLink("));
         
         msg = "http://accounts.myspace.com.deaaaf.me.uk/msp/index.php?fuseaction=update&amp;code=78E2BL6-EKY5L893K4MHSA-74ESO-D743U41GYB18J-FA18EI698V4M&amp;email=somehone@somewere.com";
-        res = handler.txtDocumentToHtml(msg, "aFolder", 9999l);
+        res = getDetailsMsgHndl.txtDocumentToHtml(msg, "aFolder", 9999l);
         assertFalse(res.contains("mailTo("));
         assertTrue(res.contains("openLink("));
         
     }
 
     private MessageDetails loadMessageDetails(String msgFile) throws Exception {
-        return handler.mimeToDetails(loadMessage(msgFile), "theFolder", 9999l);
+        return getDetailsMsgHndl.mimeToDetails(TestUtils.loadMessageFromFile(session,msgFile), "theFolder", 9999l);
     }
     
     public void testMessageDetails_textPlain() throws Exception {
@@ -226,7 +142,7 @@
     }
 
     public void testMessageDetails_charsetIso() throws Exception {
-        MimeMessage message = loadMessage("3.msg");
+        MimeMessage message = TestUtils.loadMessageFromFile(session,"3.msg");
         String from = message.getFrom()[0].toString();
         assertTrue(from.contains("\u00AE"));
         
@@ -246,30 +162,39 @@
         assertTrue(details.getText().length() &gt; 0);
     }
     
-
     public void testMessageDetails_html_with_inline_images() throws Exception {
+
+        IMAPStoreCache storeCache = injector.getInstance(IMAPStoreCache.class);
+        IMAPStore store = injector.getInstance(IMAPStore.class);
+
+        User demouser = DemoModeConstants.demoUser;
+        ((MockIMAPStoreCache)storeCache).addValidUser(demouser, store);
         
-        MockIMAPStore store = (MockIMAPStore) storeCache.get(user);
-        MockIMAPFolder serverfolder = (MockIMAPFolder)store.getFolder("WHATEVER"); 
+        IMAPFolder serverfolder = (IMAPFolder)store.getFolder("WHATEVER"); 
         serverfolder.create(Folder.HOLDS_MESSAGES);
         
-        MimeMessage msg = loadMessage("7.msg");
+        MimeMessage msg = TestUtils.loadMessageFromFile(session,"7.msg");
         serverfolder.addMessages(new Message[]{msg});
-
-        IMAPFolder clientfolder = new IMAPFolder("WHATEVER");
-        MessageDetails details = handler.exposeMessage(user, clientfolder, 0);
-        assertTrue(details.getText().contains("img src=\"" + 
+        
+        org.apache.hupa.shared.data.IMAPFolder clientfolder = new org.apache.hupa.shared.data.IMAPFolder("WHATEVER");
+        MessageDetails details = getDetailsMsgHndl.exposeMessage(demouser, clientfolder, 0);
+        
+        // inline images have to be downloaded from the server
+        assertTrue(details.getText().contains("img src=\'" + 
                 SConsts.HUPA + SConsts.SERVLET_DOWNLOAD + "?" +
                 SConsts.PARAM_FOLDER + "=WHATEVER&amp;" + 
                 SConsts.PARAM_UID + "=0&amp;" + 
-                SConsts.PARAM_NAME + "=1.1934304663@web28309.mail.ukl.yahoo.com\""));
+                SConsts.PARAM_NAME + "=1.1934304663@web28309.mail.ukl.yahoo.com'"));
+        
+        // inline images are not in the message list
+        assertEquals(0, details.getMessageAttachments().size());
         
     }
 
     public void testMessageDetails_links() throws Exception {
         MessageDetails details = loadMessageDetails("2.msg");
 
-        String html = handler.filterHtmlDocument(details.getText(), "foldername", 111l);
+        String html = getDetailsMsgHndl.filterHtmlDocument(details.getText(), "foldername", 111l);
         assertFalse(html.contains("&lt;script&gt;"));
         assertFalse(html.contains("&lt;style&gt;"));
         assertTrue(html.contains("&lt;a onClick=\"openLink('http://code.google.com/intl/es/webtoolkit/');return false;\" href=\"http://code.google.com/intl/es/webtoolkit/\""));

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/LogoutUserHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/LogoutUserHandlerTest.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/LogoutUserHandlerTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/LogoutUserHandlerTest.java Tue Dec  1 15:05:00 2009
@@ -22,13 +22,11 @@
 
 import net.customware.gwt.dispatch.shared.ActionException;
 
-import org.apache.hupa.server.mock.MockLog;
 import org.apache.hupa.shared.data.User;
 import org.apache.hupa.shared.rpc.LogoutUser;
 import org.apache.hupa.shared.rpc.LogoutUserResult;
 
 public class LogoutUserHandlerTest extends AbstractHandlerTest{
-
     
     public void testLogout() {
         String username = "test";

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/servlet/DownloadAttachmentServletTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/servlet/DownloadAttachmentServletTest.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/servlet/DownloadAttachmentServletTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/servlet/DownloadAttachmentServletTest.java Tue Dec  1 15:05:00 2009
@@ -4,19 +4,21 @@
 import javax.mail.internet.MimeMessage;
 
 import org.apache.hupa.server.handler.AbstractHandlerTest;
+import org.apache.hupa.server.utils.MessageUtils;
+import org.apache.hupa.server.utils.TestUtils;
 
 public class DownloadAttachmentServletTest extends AbstractHandlerTest {
 
     public void testDownloadAttachmentByName() throws Exception {
-        MimeMessage message = loadMessage("7.msg");
-        Part part = DownloadAttachmentServlet.handleMultiPart(logger, message
+        MimeMessage message = TestUtils.loadMessageFromFile(session, "7.msg");
+        Part part = MessageUtils.handleMultiPart(logger, message
                 .getContent(), "Image.4FB480B138F7456382ABBD1EE7B0748A");
         assertNotNull(part);
     }
     
     public void testDownloadAttachmentByContentId() throws Exception {
-        MimeMessage message = loadMessage("7.msg");
-        Part part = DownloadAttachmentServlet.handleMultiPart(logger, message
+        MimeMessage message = TestUtils.loadMessageFromFile(session, "7.msg");
+        Part part = MessageUtils.handleMultiPart(logger, message
                 .getContent(), "1.1934304663@web28309.mail.ukl.yahoo.com");
         assertNotNull(part);
     }

Added: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java?rev=885783&amp;view=auto
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java (added)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java Tue Dec  1 15:05:00 2009
@@ -0,0 +1,28 @@
+package org.apache.hupa.server.utils;
+
+import java.util.List;
+
+import javax.mail.BodyPart;
+import javax.mail.Message;
+import javax.mail.Session;
+
+import org.apache.commons.logging.Log;
+import org.apache.hupa.server.guice.GuiceTestModule;
+
+import com.google.inject.Injector;
+
+import junit.framework.TestCase;
+
+public class MessageUtilsTest extends TestCase {
+
+    GuiceTestModule module = new GuiceTestModule();
+    Injector injector = module.getInjector();
+    
+    public void testExtractMessageAttachments() throws Exception {
+        Session session = injector.getInstance(Session.class);
+        Log logger = injector.getInstance(Log.class);
+        Message message = TestUtils.createMockMimeMessage(session, 2);
+        List&lt;BodyPart&gt; parts = MessageUtils.extractMessageAttachments(logger, message.getContent());
+        assertEquals(2, parts.size());
+    }
+}
\ No newline at end of file

Added: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/RegexPatternsTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/RegexPatternsTest.java?rev=885783&amp;view=auto
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/RegexPatternsTest.java (added)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/RegexPatternsTest.java Tue Dec  1 15:05:00 2009
@@ -0,0 +1,106 @@
+package org.apache.hupa.server.utils;
+
+import junit.framework.TestCase;
+
+public class RegexPatternsTest extends TestCase {
+    
+    public void testRegexHtml() {
+        String txt, res;
+        txt = "&lt;!'https://www.aaa.1:#@%/;$()~_?+-=\\.&amp;&lt;br/&gt;";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_htmllink, "");
+        assertEquals("&lt;!'&lt;br/&gt;", res);
+
+        txt = "... a b c http://somewhere d e f ...";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_htmllink, RegexPatterns.repl_htmllink);
+        assertEquals("... a b c &lt;a href=\"http://somewhere\"&gt;http://somewhere&lt;/a&gt; d e f ...", res);
+    }
+
+    public void testRegexEmail() {
+        String txt, res;
+        txt = "!'BcD091_%55-+.aa@abc01-01.dd-a.aBc+";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_email, "");
+        assertEquals("!'+", res);
+
+        txt = "!'=BcD091_%55-+.aa@abc01-01.dd-a.aBc+";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_email, "");
+        assertEquals(txt, res);
+
+        txt = "... a b c aaa@aaa.bbb d e f ...";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_email, RegexPatterns.repl_email);
+        assertEquals(res, "... a b c &lt;a href=\"mailto:aaa@aaa.bbb\"&gt;aaa@aaa.bbb&lt;/a&gt; d e f ...");
+    }
+
+    public void testRegexInlineImg() {
+        String txt, res;
+        txt = ".. &lt;img\nsrc=\"cid:abcd\"\nwhatever=/&gt;click&lt;/a\n&gt; ..";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_inlineImg, RegexPatterns.repl_inlineImg);
+        assertEquals(".. &lt;img\nsrc='hupa/downloadAttachmentServlet?folder=%%FOLDER%%&amp;uid=%%UID%%&amp;name=abcd' name='cid:abcd'\nwhatever=/&gt;click&lt;/a\n&gt; ..", res);
+    }
+
+    public void testRegexRestoreInlineLinks() {
+        String txt, res;
+        txt = ".. &lt;img\nsrc='cid:abcd'\nwhatever=/&gt;click&lt;/a\n&gt; ..";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_inlineImg, RegexPatterns.repl_inlineImg);
+        assertNotSame(txt, res);
+        
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_revertInlineImg, RegexPatterns.repl_revertInlineImg);
+        assertEquals(txt, res);
+    }
+
+    
+    public void testRegexBadTags() {
+        String txt, res;
+        txt = "&lt;html&gt;&lt;head&gt;h&lt;tag&gt;&lt;/head&gt;&lt;body&gt;.&lt;style&gt;..&lt;/style&gt;.&lt;script type=&gt;//&lt;/script&gt;&lt;/body&gt;.&lt;/html&gt;";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_badTags, RegexPatterns.repl_badTags);
+        res = RegexPatterns.replaceAll(res, RegexPatterns.regex_unneededTags, RegexPatterns.repl_unneededTags);
+        assertEquals("...", res);
+    }
+
+    public void testRegexBadAttributes() {
+
+        String txt, res;
+        txt = "... &lt;div attr=a onClick=\"something('');\"&gt; ...";
+        res = RegexPatterns.replaceAllRecursive(txt, RegexPatterns.regex_badAttrs, RegexPatterns.repl_badAttrs);
+        assertEquals("... &lt;div attr=a&gt; ...", res);
+
+        txt = "... &lt;div attr=a onClick=\"something('');\" attr=b onMouseOver=whatever attr=c onKeyup=\"\" /&gt; ...";
+        res = RegexPatterns.replaceAllRecursive(txt, RegexPatterns.regex_badAttrs, RegexPatterns.repl_badAttrs);
+        assertEquals("... &lt;div attr=a attr=b attr=c /&gt; ...", res);
+    }
+    
+    public void testRegexHtmlLinks() {
+        String txt, res;
+        txt = ".. &lt;a href=\"http://whatever\"&gt;..&lt;/a&gt; ..";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_existingHttpLinks, RegexPatterns.repl_existingHttpLinks);
+        assertEquals(".. &lt;a onClick=\"openLink('http://whatever');return false;\" href=\"http://whatever\"&gt;..&lt;/a&gt; ..", res);
+
+        txt = "-- &lt;div&gt; .. &lt;img src=\"http://whatever\"/&gt; .. &lt;/div&gt;";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_orphandHttpLinks, RegexPatterns.repl_orphandHttpLinks);
+        assertEquals(txt, res);
+        
+        txt = "-- &lt;div&gt; .. \"http://whatever\" .. &lt;/div&gt;";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_orphandHttpLinks, RegexPatterns.repl_orphandHttpLinks);
+        assertEquals("-- &lt;div&gt; .. \"&lt;a href=\"http://whatever\"&gt;http://whatever&lt;/a&gt;\" .. &lt;/div&gt;", res);
+
+        res = RegexPatterns.replaceAll(res, RegexPatterns.regex_existingHttpLinks, RegexPatterns.repl_existingHttpLinks);
+        assertEquals("-- &lt;div&gt; .. \"&lt;a onClick=\"openLink('http://whatever');return false;\" href=\"http://whatever\"&gt;http://whatever&lt;/a&gt;\" .. &lt;/div&gt;", res);
+        
+    }
+
+    public void testRegexEmailLinks() {
+        String txt, res;
+        
+        txt = ".. &lt;a href=\"mailTo:someone@somedomain.com\"&gt;..&lt;/a&gt; ..";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_existingEmailLinks, RegexPatterns.repl_existngEmailLinks);
+        assertEquals(".. &lt;a onClick=\"mailTo('someone@somedomain.com');return false;\" href=\"mailto:someone@somedomain.com\"&gt;..&lt;/a&gt; ..", res);
+        
+        txt = "-- &lt;div&gt; .. someone@somedomain.com .. &lt;/div&gt;";
+        res = RegexPatterns.replaceAll(txt, RegexPatterns.regex_orphandEmailLinks, RegexPatterns.repl_orphandEmailLinks);
+        assertEquals("-- &lt;div&gt; .. &lt;a href=\"mailto:someone@somedomain.com\"&gt;someone@somedomain.com&lt;/a&gt; .. &lt;/div&gt;", res);
+
+        res = RegexPatterns.replaceAll(res, RegexPatterns.regex_existingEmailLinks, RegexPatterns.repl_existngEmailLinks);
+        assertEquals("-- &lt;div&gt; .. &lt;a onClick=\"mailTo('someone@somedomain.com');return false;\" href=\"mailto:someone@somedomain.com\"&gt;someone@somedomain.com&lt;/a&gt; .. &lt;/div&gt;", res);
+        
+    }
+
+}
\ No newline at end of file

Copied: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/TestUtils.java (from r884868, james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/MsgUtils.java)
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/TestUtils.java?p2=james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/TestUtils.java&amp;p1=james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/MsgUtils.java&amp;r1=884868&amp;r2=885783&amp;rev=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/MsgUtils.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/TestUtils.java Tue Dec  1 15:05:00 2009
@@ -17,11 +17,12 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.hupa.server.handler;
-
-import gwtupload.server.MemoryFileItemFactory;
+package org.apache.hupa.server.utils;
 
+import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 
@@ -30,72 +31,25 @@
 import javax.mail.Multipart;
 import javax.mail.Part;
 import javax.mail.Session;
+import javax.mail.Message.RecipientType;
 import javax.mail.internet.AddressException;
 import javax.mail.internet.MimeMessage;
 
+import junit.framework.TestCase;
+
 import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.apache.hupa.server.FileItemRegistry;
+import org.apache.hupa.server.guice.DemoModeConstants;
+import org.apache.hupa.server.handler.AbstractSendMessageHandler;
 import org.apache.hupa.shared.data.MessageAttachment;
 import org.apache.hupa.shared.data.SMTPMessage;
 
-public class MsgUtils {
-
-    /**
-     * Creates a FileItem which is stored in memory
-     * 
-     * @param filename
-     * @return a new item
-     * @throws IOException
-     */
-    public static FileItem createMockFileItem(String filename) throws IOException {
-        MemoryFileItemFactory f = new MemoryFileItemFactory();
-        FileItem item = f.createItem("fieldname_" + filename, "mock/attachment", false, filename);
-        item.getOutputStream().write("file content".getBytes());
-        item.getOutputStream().close();
-        return item;
-    }
-
-    /**
-     * Parses a mime message and returns an array of content-types which is a
-     * simple representation of its structure. Each line of the array represents
-     * a part and it is indented with spaces. It's used in testing or debugging.
-     * 
-     * @param msg
-     * @return
-     * @throws IOException
-     * @throws MessagingException
-     */
-    protected static ArrayList&lt;String&gt; summaryzeContent(Message msg) throws IOException, MessagingException {
-        return summaryzeContent(msg.getContent(), msg.getContentType(), 0);
-    }
-
-    static ArrayList&lt;String&gt; summaryzeContent(Object content, String contentType, final int spaces) throws IOException, MessagingException {
-
-        ContenTypeArrayList ret = new ContenTypeArrayList();
-
-        ret.add(contentType, spaces);
-        if (content instanceof Multipart) {
-            Multipart mp = (Multipart) content;
-            contentType = mp.getContentType();
-            for (int i = 0; i &lt; mp.getCount(); i++) {
-                Part part = mp.getBodyPart(i);
-                contentType = part.getContentType();
-                if (contentType.startsWith("text")) {
-                    ret.add(contentType, spaces + 1);
-                } else if (contentType.startsWith("message/rfc822")) {
-                    MimeMessage msg = (MimeMessage) part.getDataHandler().getContent();
-                    ret.addAll(summaryzeContent(msg.getContent(), msg.getContentType(), spaces + 1));
-                } else {
-                    if (part.getFileName() != null) {
-                        ret.add(part.getContentType(), part.getFileName(), spaces + 1);
-                    } else {
-                        ret.addAll(summaryzeContent(part.getContent(), contentType, spaces + 1));
-                    }
-                }
-            }
-        }
-        return ret;
-    }
+/**
+ * A bunch of useful methods used for testing
+ */
+public class TestUtils extends TestCase {
 
     /**
      * A class which represents the tree of content-types present in a mime
@@ -114,14 +68,6 @@
             return super.add(ident(spaces, cleanCType(type) + " =&gt; " + name));
         }
 
-        public String toString() {
-            String ret = "";
-            for (String s : this) {
-                ret += s + "\n";
-            }
-            return ret;
-        }
-
         private String cleanCType(String contenType) {
             return contenType.toLowerCase().replaceAll("(?s)[\"\\s]*(.+);.*$", "$1");
         }
@@ -132,14 +78,104 @@
                 ret += " ";
             return ret + text;
         }
+
+        public String toString() {
+            String ret = "";
+            for (String s : this) {
+                ret += s + "\n";
+            }
+            return ret;
+        }
     }
 
-    public static SMTPMessage fillSMTPMessage(FileItemRegistry registry, int nfiles) throws AddressException, MessagingException, IOException {
+    /**
+     * Creates a FileItem which stores data in memory
+     * 
+     * @param filename
+     * @return a new item
+     * @throws IOException
+     */
+    public static FileItem createMockFileItem(String filename) throws IOException {
+        FileItemFactory f = new DiskFileItemFactory();
+        FileItem item = f.createItem("fieldname_" + filename, "mock/attachment", false, filename);
+        OutputStream os = item.getOutputStream();
+        os.write("ABCDEFGHIJK\n".getBytes());
+        os.close();
+        return item;
+    }
+    
+    public void testCreateMockFileItem() throws Exception {
+        FileItem item = createMockFileItem("filename.jpg");
+        assertEquals("ABCDEFGHIJK\n", item.getString());
+    }
+
+    /**
+     * Create a new mime-message from a file stored in the fixtures folder
+     * 
+     * @param session
+     * @param msgFile
+     * @return
+     * @throws Exception
+     */
+    public static MimeMessage loadMessageFromFile(Session session, String msgFile) throws Exception {
+        msgFile = DemoModeConstants.DEMO_MODE_MESSAGES_LOCATION + msgFile;
+        URL url = Thread.currentThread().getContextClassLoader().getResource(msgFile);
+        assertNotNull("Check that the file " + msgFile + " is in the classpath", url);
+    
+        FileInputStream is = new FileInputStream(url.getFile());
+        return new MimeMessage(session, is);
+    }
+
+    /**
+     * Creates a new mime message.
+     * It is possible to specify which parts to create (text, html or both) and
+     * the number of attachments 
+     *  
+     * @param session
+     * @param text
+     * @param html
+     * @param nfiles
+     * @return
+     * @throws MessagingException
+     * @throws IOException
+     */
+    public static Message createMockMimeMessage(Session session, String text, String html, int nfiles) throws MessagingException, IOException {
+        ArrayList&lt;FileItem&gt; items = new ArrayList&lt;FileItem&gt;();
+        for (int i = 1; i &lt;= nfiles; i++) {
+            FileItem fileItem;
+            fileItem = TestUtils.createMockFileItem("file_" + i + ".bin");
+            items.add(fileItem);
+        }
+        MimeMessage message = new MimeMessage(session);
+        message.setFrom(MessageUtils.getRecipients("from@dom.com")[0]);
+        message.setRecipients(RecipientType.TO, MessageUtils.getRecipients("to@dom.com"));
+        message.setRecipients(RecipientType.CC, MessageUtils.getRecipients("cc@dom.com"));
+        message.setRecipients(RecipientType.BCC, MessageUtils.getRecipients("bcc@dom.com"));
+        message.setSubject("Subject");
+        return AbstractSendMessageHandler.composeMessage(message, text, html, items);
+    }
+    
+    public static Message createMockMimeMessage(Session session, int nfiles) throws MessagingException, IOException {
+        return createMockMimeMessage(session, "Body", "&lt;div&gt;Body&lt;/div&gt;", nfiles);
+    }
+
+    /**
+     * Creates a client side mock smtp message.
+     * It is possible to say the number of attachments we want.
+     *  
+     * @param registry
+     * @param nfiles
+     * @return
+     * @throws AddressException
+     * @throws MessagingException
+     * @throws IOException
+     */
+    public static SMTPMessage createMockSMTPMessage(FileItemRegistry registry, int nfiles) throws AddressException, MessagingException, IOException {
         ArrayList&lt;MessageAttachment&gt; attachments = new ArrayList&lt;MessageAttachment&gt;();
 
         for (int i = 1; i &lt;= nfiles; i++) {
             FileItem fileItem;
-            fileItem = MsgUtils.createMockFileItem("file_" + i + ".bin");
+            fileItem = TestUtils.createMockFileItem("file_" + i + ".bin");
             registry.add(fileItem);
 
             MessageAttachment msgAttach = new MessageAttachment();
@@ -152,9 +188,9 @@
 
         SMTPMessage smtpMessage = new SMTPMessage();
         smtpMessage.setFrom("from@dom.com");
-        smtpMessage.setTo(Arrays.asList("to@dom.com"));
-        smtpMessage.setCc(Arrays.asList("cc@dom.com"));
-        smtpMessage.setBcc(Arrays.asList("bcc@dom.com"));
+        smtpMessage.setTo(new ArrayList&lt;String&gt;(Arrays.asList("to@dom.com")));
+        smtpMessage.setCc(new ArrayList&lt;String&gt;(Arrays.asList("cc@dom.com")));
+        smtpMessage.setBcc(new ArrayList&lt;String&gt;(Arrays.asList("bcc@dom.com")));
         smtpMessage.setSubject("Subject");
         smtpMessage.setText("&lt;div&gt;Body&lt;/div&gt;");
         smtpMessage.setMessageAttachments(attachments);
@@ -163,14 +199,48 @@
 
     }
 
-    public static Message fillMockMimeMessage(Session session, String text, String html, int nfiles) throws MessagingException, IOException {
-        ArrayList&lt;FileItem&gt; items = new ArrayList&lt;FileItem&gt;();
-        for (int i = 1; i &lt;= nfiles; i++) {
-            FileItem fileItem;
-            fileItem = MsgUtils.createMockFileItem("file_" + i + ".bin");
-            items.add(fileItem);
+    /**
+     * Parses a mime message and returns an array of content-types.
+     * Each line in the array represents a mime part and is indented 
+     * with spaces.
+     *  
+     * It's used in testing or debugging.
+     * 
+     * @param msg
+     * @return
+     * @throws IOException
+     * @throws MessagingException
+     */
+    public static ArrayList&lt;String&gt; summaryzeContent(Message msg) throws IOException, MessagingException {
+        return summaryzeContent(msg.getContent(), msg.getContentType(), 0);
+    }
+
+    public static ArrayList&lt;String&gt; summaryzeContent(Object content, String contentType, final int spaces) throws IOException, MessagingException {
+
+        ContenTypeArrayList ret = new ContenTypeArrayList();
+
+        ret.add(contentType, spaces);
+        if (content instanceof Multipart) {
+            Multipart mp = (Multipart) content;
+            contentType = mp.getContentType();
+            for (int i = 0; i &lt; mp.getCount(); i++) {
+                Part part = mp.getBodyPart(i);
+                contentType = part.getContentType();
+                if (contentType.startsWith("text")) {
+                    ret.add(contentType, spaces + 1);
+                } else if (contentType.startsWith("message/rfc822")) {
+                    MimeMessage msg = (MimeMessage) part.getDataHandler().getContent();
+                    ret.addAll(summaryzeContent(msg.getContent(), msg.getContentType(), spaces + 1));
+                } else {
+                    if (part.getFileName() != null) {
+                        ret.add(part.getContentType(), part.getFileName(), spaces + 1);
+                    } else {
+                        ret.addAll(summaryzeContent(part.getContent(), contentType, spaces + 1));
+                    }
+                }
+            }
         }
-        return AbstractSendMessageHandler.composeMessage(session, text, html, items);
+        return ret;
     }
 
 }
\ No newline at end of file

Modified: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/AbstractMessage.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/AbstractMessage.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/AbstractMessage.java (original)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/AbstractMessage.java Tue Dec  1 15:05:00 2009
@@ -20,7 +20,7 @@
 package org.apache.hupa.shared.data;
 
 import java.io.Serializable;
-import java.util.List;
+import java.util.ArrayList;
 
 public class AbstractMessage implements Serializable{
     
@@ -30,8 +30,8 @@
     private static final long serialVersionUID = 5208272852772006815L;
     private String from;
     private String subject;
-    private List&lt;String&gt; to;
-    private List&lt;String&gt; cc;
+    private ArrayList&lt;String&gt; to;
+    private ArrayList&lt;String&gt; cc;
     private boolean hasAttachment;
     
     public String toString() {
@@ -80,11 +80,11 @@
     }
 
 
-    public void setCc(List&lt;String&gt; cc) {
+    public void setCc(ArrayList&lt;String&gt; cc) {
         this.cc = cc;
     }
 
-    public List&lt;String&gt; getCc() {
+    public ArrayList&lt;String&gt; getCc() {
         return cc;
     }
 
@@ -106,11 +106,11 @@
         return subject;
     }
 
-    public  List&lt;String&gt; getTo() {
+    public ArrayList&lt;String&gt; getTo() {
         return to;
     }
 
-    public void setTo(List&lt;String&gt; to) {
+    public void setTo(ArrayList&lt;String&gt; to) {
         this.to = to;
     }
     

Modified: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/SMTPMessage.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/SMTPMessage.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/SMTPMessage.java (original)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/SMTPMessage.java Tue Dec  1 15:05:00 2009
@@ -20,11 +20,10 @@
 package org.apache.hupa.shared.data;
 
 import java.util.ArrayList;
-import java.util.List;
 
 public class SMTPMessage extends AbstractMessage{
     private static final long serialVersionUID = 7331361994526216161L;
-    private List&lt;String&gt; bcc;
+    private ArrayList&lt;String&gt; bcc;
     private String text;
     private ArrayList&lt;MessageAttachment&gt; aList;
     
@@ -44,10 +43,10 @@
              + "'\nMessage:\n" + text;
     }
     
-    public List&lt;String&gt; getBcc() {
+    public ArrayList&lt;String&gt; getBcc() {
         return bcc;
     }
-    public void setBcc( List&lt;String&gt; bcc) {
+    public void setBcc(ArrayList&lt;String&gt; bcc) {
         this.bcc = bcc;
     }
     



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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r885783 [1/2] - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/ client/src/main/java/org/apache/hupa/client/mvp/ client/war/WEB-INF/ server/src/main/java/org/apache/hupa/server/guice/ server/src/main/java/org/apache/hupa/...</title>
<author><name>manolo@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091201150503.CB66023888EC@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091201150503-CB66023888EC@eris-apache-org%3e</id>
<updated>2009-12-01T15:05:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: manolo
Date: Tue Dec  1 15:05:00 2009
New Revision: 885783

URL: http://svn.apache.org/viewvc?rev=885783&amp;view=rev
Log:
Fixed a bug in sending emails with attachments in client side because the uploader widget was not correctly reseted.
Fixed a bug in server side because attachment-registry was not multisession.
Forward and send actions handle correctly attachments now, but reply needs more work.
Fixed a bug in Demo-mode which produced unreacheable attachments in the sent-box.
Inline images are not shown in the attachment list.
Increased server test coverage.
Re-factoring: moved methods from handles to util classes, renamed classes, regexp, tests classes etc.
Rolled back in client side to use implementations instead of interfaces

Added:
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/RegexPatterns.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/HupaTestCase.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/RegexPatternsTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/TestUtils.java
      - copied, changed from r884868, james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/MsgUtils.java
Removed:
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/MsgUtils.java
Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCallback.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java
    james/hupa/trunk/client/war/WEB-INF/web.xml
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/DownloadAttachmentServlet.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/UploadAttachmentServlet.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceTestModule.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbstractHandlerTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/CreateFolderHandlerTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/DeleteFolderHandlerTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/DeleteMessageByUidHandlerTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchFoldersHandlerTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FowardMessageHandlerTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/GetMessageDetailsHandlerTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/LogoutUserHandlerTest.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/servlet/DownloadAttachmentServletTest.java
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/AbstractMessage.java
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/data/SMTPMessage.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCallback.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCallback.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCallback.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCallback.java Tue Dec  1 15:05:00 2009
@@ -39,6 +39,8 @@
     private EventBus eventBus = null;
     private ServerStatusEvent available = new ServerStatusEvent(ServerStatus.Available); 
     private ServerStatusEvent unavailable = new ServerStatusEvent(ServerStatus.Unavailable); 
+
+    @SuppressWarnings("unused")
     private Display display = null;
 
     @Inject

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java Tue Dec  1 15:05:00 2009
@@ -62,7 +62,7 @@
  */
 public class AppPresenter extends WidgetContainerPresenter&lt;AppPresenter.Display&gt;{
 
-    private static final int NOOP_INTERVAL = 15000;
+    private static final int NOOP_INTERVAL = 150000;
 
     public interface Display extends WidgetContainerDisplay {
         public HasClickHandlers getLogoutClick();

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java Tue Dec  1 15:05:00 2009
@@ -192,10 +192,6 @@
             
         }));
 
-        registerHandler(display.getUploader().addOnStatusChangedHandler(onStatusChangedHandler));
-        registerHandler(display.getUploader().addOnFinishUploadHandler(onFinishUploadHandler));
-        registerHandler(display.getUploader().addOnCancelUploadHandler(onCancelUploadHandler));
-        
         registerHandler(display.getSendClick().addClickHandler(new ClickHandler() {
 
             public void onClick(ClickEvent event) {
@@ -294,6 +290,8 @@
             }
             
         }));
+        
+        reset();
     }
 
     /**
@@ -301,6 +299,10 @@
      */
     private void reset() {
         display.resetUploader();
+        display.getUploader().addOnStatusChangedHandler(onStatusChangedHandler);
+        display.getUploader().addOnFinishUploadHandler(onFinishUploadHandler);
+        display.getUploader().addOnCancelUploadHandler(onCancelUploadHandler);
+        
         display.getBccText().setText("");
         display.getCcText().setText("");
         display.getToText().setText("");

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java Tue Dec  1 15:05:00 2009
@@ -61,15 +61,17 @@
     private TextBox cc = new TextBox();
     private TextBox bcc = new TextBox();
     private TextBox subject = new TextBox();
-    private BaseUploadStatus uploadStatus = new BaseUploadStatus();
-    private MultiUploader uploader = new MultiUploader(uploadStatus);
+    private MultiUploader uploader = null;
     private Editor editor = new Editor();
     private EnableButton sendButton;
     private EnableHyperlink backButton;
     private Loading sendProgress = new Loading();
+    private HupaConstants constants;
+   
 
     @Inject
     public MessageSendView(HupaConstants constants) {
+        this.constants = constants;
         sendButton = new EnableButton(constants.sendButton());
         backButton = new EnableHyperlink(constants.backButton(),"");
         final VerticalPanel mPanel = new VerticalPanel();
@@ -98,7 +100,6 @@
         detailGrid.setWidget(2, 1, cc);
         detailGrid.setWidget(3, 1, bcc);
         detailGrid.setWidget(4, 1, subject);
-        detailGrid.setWidget(5, 1, uploader);
         detailGrid.getCellFormatter().setHorizontalAlignment(0, 0, HorizontalPanel.ALIGN_RIGHT);
         detailGrid.getCellFormatter().setHorizontalAlignment(1, 0, HorizontalPanel.ALIGN_RIGHT);
         detailGrid.getCellFormatter().setHorizontalAlignment(2, 0, HorizontalPanel.ALIGN_RIGHT);
@@ -159,11 +160,6 @@
         editor.setWidth("100%");
         editor.setHeight("400px");
 
-        uploadStatus.setCancelConfiguration(IUploadStatus.GMAIL_CANCEL_CFG);
-        uploader.setServletPath(GWT.getModuleBaseURL() + SConsts.SERVLET_UPLOAD);
-        uploader.avoidRepeatFiles(true);
-        uploader.setI18Constants(constants);
-        
         mPanel.add(detailGrid);
 
         HorizontalPanel buttonBar = new HorizontalPanel();
@@ -272,15 +268,20 @@
         return uploader;
     }
 
-    /*
-     * (non-Javadoc)
+    /* (non-Javadoc)
      * @see org.apache.hupa.client.mvp.MessageSendPresenter.Display#resetUploader()
      */
     public void resetUploader() {
-        uploader.removeFromParent();
-        uploader = new MultiUploader();
+        if (uploader != null &amp;&amp; uploader.isAttached())
+            uploader.removeFromParent();
+        
+        BaseUploadStatus uploadStatus = new BaseUploadStatus();
+        uploadStatus.setCancelConfiguration(IUploadStatus.GMAIL_CANCEL_CFG);
+        uploader = new MultiUploader(uploadStatus);
         uploader.setServletPath(GWT.getModuleBaseURL() + SConsts.SERVLET_UPLOAD);
         uploader.avoidRepeatFiles(true);
+        uploader.setI18Constants(constants);        
+        
         detailGrid.setWidget(5, 1, uploader);        
     }
 

Modified: james/hupa/trunk/client/war/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/WEB-INF/web.xml?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/war/WEB-INF/web.xml (original)
+++ james/hupa/trunk/client/war/WEB-INF/web.xml Tue Dec  1 15:05:00 2009
@@ -10,19 +10,18 @@
 		&lt;welcome-file&gt;Hupa.html&lt;/welcome-file&gt;
 	&lt;/welcome-file-list&gt;
 
+	&lt;!-- Max size of the upload request (10MB) --&gt;
 	&lt;context-param&gt;
-		&lt;!-- max size of the upload request (10MB) --&gt;
 		&lt;param-name&gt;maxSize&lt;/param-name&gt;
 		&lt;param-value&gt;10485760&lt;/param-value&gt;
 	&lt;/context-param&gt;
-	&lt;context-param&gt;
-		&lt;!--
-			useful in development mode to see the upload progress bar in fast
-			networks
-		--&gt;
+	&lt;!-- Useful in development mode to see the upload progress bar in fast networks --&gt;
+        &lt;!--
+	    &lt;context-param&gt;
 		&lt;param-name&gt;slowUploads&lt;/param-name&gt;
-		&lt;param-value&gt;true&lt;/param-value&gt;
-	&lt;/context-param&gt;
+		&lt;param-value&gt;100&lt;/param-value&gt;
+	    &lt;/context-param&gt;
+        --&gt;
 	
 	&lt;!-- servlet for incubator gwt stuff --&gt;
 	&lt;servlet&gt;

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=885783&amp;r1=885782&amp;r2=885783&amp;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 Tue Dec  1 15:05:00 2009
@@ -28,7 +28,6 @@
 import net.customware.gwt.dispatch.server.guice.ActionHandlerModule;
 
 import org.apache.commons.logging.Log;
-import org.apache.hupa.server.FileItemRegistry;
 import org.apache.hupa.server.IMAPStoreCache;
 import org.apache.hupa.server.InMemoryIMAPStoreCache;
 import org.apache.hupa.server.handler.CheckSessionHandler;
@@ -41,10 +40,10 @@
 import org.apache.hupa.server.handler.FetchRecentMessagesHandler;
 import org.apache.hupa.server.handler.ForwardMessageHandler;
 import org.apache.hupa.server.handler.GetMessageDetailsHandler;
+import org.apache.hupa.server.handler.IdleHandler;
 import org.apache.hupa.server.handler.LoginUserHandler;
 import org.apache.hupa.server.handler.LogoutUserHandler;
 import org.apache.hupa.server.handler.MoveMessageHandler;
-import org.apache.hupa.server.handler.IdleHandler;
 import org.apache.hupa.server.handler.RenameFolderHandler;
 import org.apache.hupa.server.handler.ReplyMessageHandler;
 import org.apache.hupa.server.handler.SendMessageHandler;
@@ -71,7 +70,7 @@
     public static final String[] CONFIG_PROPERTIES = {
             System.getenv("HOME") + "/.hupa/" + CONFIG_FILE_NAME,
             "/etc/default/hupa"
-            };
+    };
     public static final String CONF_DIR = "WEB-INF/conf/";
 
     private String configDir;
@@ -101,7 +100,6 @@
         bindHandler(CreateFolderHandler.class);
         bindHandler(TagMessagesHandler.class);
         bindHandler(SetFlagsHandler.class);
-        bind(FileItemRegistry.class).in(Singleton.class);
         bind(IMAPStoreCache.class).to(InMemoryIMAPStoreCache.class).in(
                 Singleton.class);
         bind(Log.class).toProvider(LogProvider.class).in(Singleton.class);

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java Tue Dec  1 15:05:00 2009
@@ -24,7 +24,6 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Properties;
 
@@ -32,6 +31,7 @@
 import javax.activation.DataSource;
 import javax.mail.Address;
 import javax.mail.AuthenticationFailedException;
+import javax.mail.BodyPart;
 import javax.mail.Folder;
 import javax.mail.Message;
 import javax.mail.MessagingException;
@@ -40,7 +40,6 @@
 import javax.mail.Transport;
 import javax.mail.Flags.Flag;
 import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
 import javax.mail.internet.MimeBodyPart;
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMultipart;
@@ -55,6 +54,8 @@
 import org.apache.hupa.server.IMAPStoreCache;
 import org.apache.hupa.server.guice.DemoModeConstants;
 import org.apache.hupa.server.mock.MockSMTPTransport;
+import org.apache.hupa.server.utils.MessageUtils;
+import org.apache.hupa.server.utils.RegexPatterns;
 import org.apache.hupa.shared.data.MessageAttachment;
 import org.apache.hupa.shared.data.SMTPMessage;
 import org.apache.hupa.shared.data.User;
@@ -73,25 +74,57 @@
  */
 public abstract class AbstractSendMessageHandler&lt;A extends SendMessage&gt; extends AbstractSessionHandler&lt;A,GenericResult&gt; {
 
-    private final FileItemRegistry registry;
     private final Properties props = new Properties();
     private final boolean auth;
     private final String address;
     private final int port;
     private boolean useSSL = false;
+    private Provider&lt;HttpSession&gt; httpSessionProvider;
 
     @Inject
-    public AbstractSendMessageHandler(Log logger, FileItemRegistry registry, IMAPStoreCache store, Provider&lt;HttpSession&gt; provider, @Named("SMTPServerAddress") String address, @Named("SMTPServerPort") int port, @Named("SMTPAuth") boolean auth, @Named("SMTPS") boolean useSSL) {
+    public AbstractSendMessageHandler(Log logger, IMAPStoreCache store, Provider&lt;HttpSession&gt; provider, @Named("SMTPServerAddress") String address, @Named("SMTPServerPort") int port, @Named("SMTPAuth") boolean auth, @Named("SMTPS") boolean useSSL) {
         super(store,logger,provider);
-        this.registry = registry;
         this.auth = auth;
         this.address = address;
         this.port = port;
         this.useSSL  = useSSL;
+        this.httpSessionProvider = provider;
         props.put("mail.smtp.auth", auth);
     }
 
+    @Override
+    protected GenericResult executeInternal(A action, ExecutionContext context)
+            throws ActionException {
+        GenericResult result = new GenericResult();
+        try {
+            Session session = Session.getDefaultInstance(props);
 
+            Message message = createMessage(session, action);
+            message = fillBody(message,action);
+
+            sendMessage(session, getUser(), message);
+            saveSentMessage(session, getUser(), message);
+        
+            resetAttachments(action);
+        
+            // TODO: notify the user more accurately where is the error
+            // if the message was sent and the storage in the sent folder failed, etc.
+        } catch (AddressException e) {
+            result.setError("Error while parsing recipient: " + e.getMessage());
+            logger.error("Error while parsing recipient", e);
+        } catch (AuthenticationFailedException e) {
+            result.setError("Error while sending message: SMTP Authentication error.");
+            logger.error("SMTP Authentication error", e);
+        } catch (MessagingException e) {
+            result.setError("Error while sending message: " + e.getMessage());
+            logger.error("Error while sending message", e);
+        } catch (Exception e) {
+            result.setError("Unexpected exception while sendig message: " + e.getMessage());
+            logger.error("Unexpected exception while sendig message: ", e);
+        }
+        return result;
+    }
+    
     /**
      * Create basic Message which contains all headers. No body is filled
      * 
@@ -103,7 +136,7 @@
      * @throws ActionException
      */
     protected abstract Message createMessage(Session session, A action) throws AddressException, MessagingException,ActionException;
-    
+
     /**
      * Fill the body of the given message with data which the given action contain
      * 
@@ -116,30 +149,21 @@
      */
     protected Message fillBody(Message message, A action) throws MessagingException, ActionException, IOException {
 
-        SMTPMessage m = action.getMessage();
-        ArrayList&lt;MessageAttachment&gt; attachments = m.getMessageAttachments();
+        String html = restoreInlineLinks(action.getMessage().getText());
         
-        // Create the body
-        Multipart body = createMultipartAlternative(m.getText());
+        // TODO: client sends the message as html right now, 
+        // the idea is that it should be sent in both formats because
+        // it is easier to do the handle html in the browser. 
+        String text = htmlToText(html);
         
-        // check if there are any attachments to include
-        if (attachments == null || attachments.isEmpty()) {
-            message.setContent(body);
-        } else {
-            // create the message part with the  body
-            MimeBodyPart messageBodyPart = new MimeBodyPart();
-            messageBodyPart.setContent(body);
+        @SuppressWarnings("unchecked")
+        List items = getAttachments(action);
+        
+        return composeMessage(message, text, html, items);
+    }
 
-            // create the multipart which contains the message and attachments
-            Multipart multipart = new MimeMultipart();
-            multipart.addBodyPart(messageBodyPart);
-            multipart = handleAttachments(multipart, attachments);
-            
-            message.setContent(multipart);
-        }
-        // save message 
-        message.saveChanges();
-        return message;
+    protected String restoreInlineLinks(String s) {
+        return RegexPatterns.replaceAll(s, RegexPatterns.regex_revertInlineImg, RegexPatterns.repl_revertInlineImg);
     }
     
     protected String htmlToText(String s){
@@ -152,59 +176,52 @@
         return s;
     }
     
-    protected Multipart createMultipartAlternative(String html) throws MessagingException {
-        MimeMultipart mimeMultipart= new MimeMultipart();
-        mimeMultipart.setSubType("alternative");
-        
-        MimeBodyPart txtPart= new MimeBodyPart();
-        txtPart.setContent(htmlToText(html), "text/plain");
-        mimeMultipart.addBodyPart(txtPart);
-        
-        MimeBodyPart htmlPart= new MimeBodyPart();
-        htmlPart.setContent(html, "text/html");
-        htmlPart.setHeader("Content-Type", "text/html; format=flowed");
-        mimeMultipart.addBodyPart(htmlPart);
-        
-        return mimeMultipart;
-   
+    /**
+     * Get the attachments stored in the registry.
+     * 
+     * @param attachments
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    protected List getAttachments(A action) throws MessagingException, ActionException {
+        FileItemRegistry registry = MessageUtils.getSessionRegistry(httpSessionProvider.get(), logger); 
+        List&lt;MessageAttachment&gt; attachments = action.getMessage().getMessageAttachments();
+        ArrayList&lt;FileItem&gt; items = new ArrayList&lt;FileItem&gt;();
+        for (MessageAttachment attachment: attachments) {
+            FileItem fItem = registry.get(attachment.getName());
+            if (fItem != null)
+                items.add(fItem);
+        }
+        logger.debug("Found " + items.size() + " attachmets in the registry.");
+        return items;
     }
-
+    
+    /**
+     * Remove attachments from the registry
+     *  
+     * @param action
+     * @throws MessagingException
+     * @throws ActionException
+     */
     protected void resetAttachments(A action) throws MessagingException, ActionException {
-        SMTPMessage m = action.getMessage();
-        ArrayList&lt;MessageAttachment&gt; attachments = m.getMessageAttachments();
+        SMTPMessage msg = action.getMessage();
+        ArrayList&lt;MessageAttachment&gt; attachments = msg.getMessageAttachments();
         if (attachments != null &amp;&amp; ! attachments.isEmpty()) {
             for(MessageAttachment attach : attachments) 
-                registry.remove(attach.getName());
+                MessageUtils.getSessionRegistry(httpSessionProvider.get(), logger).remove(attach.getName());
         }
     }
     
     /**
-     * Construct the multipart for the given attachments and return it
+     * Send the message using SMTP, if the configuration uses authenticated SMTP, it uses
+     * the user stored in session to get the given login and password.
      * 
-     * @param multipart 
-     * @param attachments
-     * @return multipart
+     * @param user
+     * @param session
+     * @param message
      * @throws MessagingException
      */
-    protected Multipart handleAttachments(Multipart multipart, ArrayList&lt;MessageAttachment&gt; attachments) throws MessagingException {
-        if (attachments != null) {
-            for(MessageAttachment attachment: attachments) {
-                // get the attachment from the registry
-                FileItem fItem = registry.get(attachment.getName());
-                if (fItem == null)
-                    continue;
-                // Part two is attachment
-                MimeBodyPart messageBodyPart = new MimeBodyPart();
-                DataSource source = new FileItemDataStore(fItem);
-                messageBodyPart.setDataHandler(new DataHandler(source));
-                messageBodyPart.setFileName(source.getName());
-                multipart.addBodyPart(messageBodyPart);
-            }
-        }
-        return multipart;
-    }
-
-    protected void sendMessage(User user, Session session, Message message) throws MessagingException {
+    protected void sendMessage(Session session, User user, Message message) throws MessagingException {
         Transport transport;
     
         if (DemoModeConstants.DEMO_MODE.equals(address)) {
@@ -234,7 +251,15 @@
         transport.sendMessage(message, recips);
     }
 
-    protected void saveSentMessage(User user, Message message) throws MessagingException {
+    /**
+     * Save the message in the sent folder
+     * 
+     * @param user
+     * @param message
+     * @throws MessagingException
+     * @throws IOException 
+     */
+    protected void saveSentMessage(Session session, User user, Message message) throws MessagingException, IOException {
         IMAPStore iStore = cache.get(user);
         IMAPFolder folder = (IMAPFolder) iStore.getFolder(user.getSettings().getSentFolderName());
         
@@ -248,6 +273,13 @@
             if (folder.isOpen() == false) {
                 folder.open(Folder.READ_WRITE);
             }
+
+            // It is necessary to copy the message, before putting it
+            // in the sent folder. If not, it is not guaranteed that it is 
+            // stored in ascii and is not possible to get the attachments
+            // size.
+            message = new MimeMessage((MimeMessage)message);
+
             message.setFlag(Flag.SEEN, true);
             folder.appendMessages(new Message[] {message});
             
@@ -256,135 +288,14 @@
             } catch (MessagingException e) {
                 // we don't care on close
             }
-
-        }
-    }
-    
-    
-
-    /**
-     * DataStore which wrap a FileItem
-     * 
-     */
-    protected static class FileItemDataStore implements DataSource {
-
-        private FileItem item;
-
-        public FileItemDataStore(FileItem item) {
-            this.item = item;
-        }
-
-        /*
-         * (non-Javadoc)
-         * @see javax.activation.DataSource#getContentType()
-         */
-        public String getContentType() {
-            return item.getContentType();
-        }
-
-        /*
-         * (non-Javadoc)
-         * @see javax.activation.DataSource#getInputStream()
-         */
-        public InputStream getInputStream() throws IOException {
-            return item.getInputStream();
-        }
-
-        /*
-         * (non-Javadoc)
-         * @see javax.activation.DataSource#getName()
-         */
-        public String getName() {
-            String fullName = item.getName();
-            
-            // Strip path from file
-            int index = fullName.lastIndexOf(File.separator);
-            if (index == -1) {
-                return fullName;
-            } else {
-                return fullName.substring(index +1 ,fullName.length());
-            }
         }
-
-        /*
-         * (non-Javadoc)
-         * @see javax.activation.DataSource#getOutputStream()
-         */
-        public OutputStream getOutputStream() throws IOException {
-            return null;
-        }
-
     }
 
-
-
-    @Override
-    protected GenericResult executeInternal(A action, ExecutionContext context)
-            throws ActionException {
-        GenericResult result = new GenericResult();
-        try {
-            Session session = Session.getDefaultInstance(props);
-
-            Message message = createMessage(session, action);
-            message = fillBody(message,action);
-
-            sendMessage(getUser(),session, message);
-            saveSentMessage(getUser(), message);
-            resetAttachments(action);
-        
-            // TODO: notify the user more accurately where is the error
-            // if the message was sent and the storage in the sent folder failed, etc.
-        } catch (AddressException e) {
-            result.setError("Error while parsing recipient: " + e.getMessage());
-            logger.error("Error while parsing recipient", e);
-        } catch (AuthenticationFailedException e) {
-            result.setError("Error while sending message: SMTP Authentication error.");
-            logger.error("SMTP Authentication error", e);
-        } catch (MessagingException e) {
-            result.setError("Error while sending message: " + e.getMessage());
-            logger.error("Error while sending message", e);
-        } catch (Exception e) {
-            result.setError("Unexpected exception while sendig message: " + e.getMessage());
-            logger.error("Unexpected exception while sendig message: ", e);
-        }
-        return result;
-    }
-    
     /**
-     * Get a Address array for a set of address passed as arguments 
+     * Fill the body of a message already created.
+     * The result message depends on the information given. 
      * 
-     * @param addresses
-     * @return Address array
-     * @throws AddressException
-     */
-    static protected Address[] getRecipients(String... addresses) throws AddressException {
-        return getRecipients(Arrays.asList(addresses));
-    }
-
-    /**
-     * Get a Address array for the given ArrayList 
-     * 
-     * @param recipients
-     * @return addressArray
-     * @throws AddressException
-     */
-    static protected Address[] getRecipients(List&lt;String&gt; recipients) throws AddressException {
-        if (recipients == null) {
-            return new InternetAddress[]{};
-        }
-        Address[] array = new Address[recipients.size()];
-        for (int i = 0; i &lt; recipients.size(); i++) {
-            array[i] = new InternetAddress(recipients.get(i));
-        }
-        return array;
-
-    }
-    
-    /**
-     * Generate a mime-message 
-     * 
-     * 
-     * @param session
+     * @param message
      * @param text
      * @param html
      * @param items
@@ -392,13 +303,16 @@
      * @throws MessagingException
      * @throws IOException
      */
-    public static Message composeMessage (Session session, String text, String html, List&lt;FileItem&gt; items) throws MessagingException, IOException {
-        Message message = new MimeMessage(session);
+    @SuppressWarnings("unchecked")
+    public static Message composeMessage (Message message, String text, String html, List parts) throws MessagingException, IOException {
 
         MimeBodyPart txtPart = null;
         MimeBodyPart htmlPart = null;
         MimeMultipart mimeMultipart = null;
 
+        if (text == null &amp;&amp; html == null) {
+           text = ""; 
+        }
         if (text != null) {
             txtPart = new MimeBodyPart();
             txtPart.setContent(text, "text/plain");
@@ -414,7 +328,7 @@
             mimeMultipart.addBodyPart(htmlPart);
         }
 
-        if (items == null || items.size() == 0) {
+        if (parts == null || parts.isEmpty()) {
             if (mimeMultipart != null) {
                 message.setContent(mimeMultipart);
             } else if (html != null) {
@@ -424,7 +338,6 @@
                 message.setText(text);
             }
         } else {
-            Multipart multipart = new MimeMultipart();
             MimeBodyPart bodyPart = new MimeBodyPart();
             if (mimeMultipart != null) {
                 bodyPart.setContent(mimeMultipart);
@@ -434,13 +347,14 @@
             } else if (text != null) {
                 bodyPart.setText(text);
             }
+            Multipart multipart = new MimeMultipart();
             multipart.addBodyPart(bodyPart);
-            for (FileItem fileItem: items) {
-                MimeBodyPart messageBodyPart = new MimeBodyPart();
-                DataSource source = new AbstractSendMessageHandler.FileItemDataStore(fileItem);
-                messageBodyPart.setDataHandler(new DataHandler(source));
-                messageBodyPart.setFileName(source.getName());
-                multipart.addBodyPart(messageBodyPart);
+            for (Object attachment: parts) {
+                if (attachment instanceof FileItem) {
+                    multipart.addBodyPart(fileitemToBodypart((FileItem)attachment));
+                } else {
+                    multipart.addBodyPart((BodyPart)attachment);
+                }
             }
             message.setContent(multipart);
         }
@@ -449,5 +363,68 @@
         return message;
 
     }
+    
+    private static BodyPart fileitemToBodypart(FileItem item) throws MessagingException {
+        MimeBodyPart messageBodyPart = new MimeBodyPart();
+        DataSource source = new AbstractSendMessageHandler.FileItemDataStore(item);
+        messageBodyPart.setDataHandler(new DataHandler(source));
+        messageBodyPart.setFileName(source.getName());
+        return messageBodyPart;
+    }
+    
+
+    /**
+     * DataStore which wrap a FileItem
+     * 
+     */
+    protected static class FileItemDataStore implements DataSource {
+
+        private FileItem item;
+
+        public FileItemDataStore(FileItem item) {
+            this.item = item;
+        }
+
+        /*
+         * (non-Javadoc)
+         * @see javax.activation.DataSource#getContentType()
+         */
+        public String getContentType() {
+            return item.getContentType();
+        }
+
+        /*
+         * (non-Javadoc)
+         * @see javax.activation.DataSource#getInputStream()
+         */
+        public InputStream getInputStream() throws IOException {
+            return item.getInputStream();
+        }
+
+        /*
+         * (non-Javadoc)
+         * @see javax.activation.DataSource#getName()
+         */
+        public String getName() {
+            String fullName = item.getName();
+            
+            // Strip path from file
+            int index = fullName.lastIndexOf(File.separator);
+            if (index == -1) {
+                return fullName;
+            } else {
+                return fullName.substring(index +1 ,fullName.length());
+            }
+        }
+
+        /*
+         * (non-Javadoc)
+         * @see javax.activation.DataSource#getOutputStream()
+         */
+        public OutputStream getOutputStream() throws IOException {
+            return null;
+        }
+
+    }
 
 }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ForwardMessageHandler.java Tue Dec  1 15:05:00 2009
@@ -19,26 +19,31 @@
 
 package org.apache.hupa.server.handler;
 
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
 import java.util.List;
 
+import javax.activation.DataSource;
+import javax.mail.BodyPart;
 import javax.mail.Folder;
 import javax.mail.Message;
 import javax.mail.MessagingException;
-import javax.mail.Multipart;
 import javax.mail.Session;
 import javax.mail.internet.AddressException;
 import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeBodyPart;
 import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
 import javax.mail.internet.MimeMessage.RecipientType;
 import javax.servlet.http.HttpSession;
 
 import net.customware.gwt.dispatch.shared.ActionException;
 
+import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.logging.Log;
-import org.apache.hupa.server.FileItemRegistry;
 import org.apache.hupa.server.IMAPStoreCache;
+import org.apache.hupa.server.utils.MessageUtils;
 import org.apache.hupa.shared.data.SMTPMessage;
 import org.apache.hupa.shared.rpc.ForwardMessage;
 
@@ -50,82 +55,124 @@
 
 /**
  * Handler which handles the forwarding of a message
- * @author norman
- *
+ * 
  */
-public class ForwardMessageHandler extends AbstractSendMessageHandler&lt;ForwardMessage&gt;{
+public class ForwardMessageHandler extends AbstractSendMessageHandler&lt;ForwardMessage&gt; {
 
     @Inject
-    public ForwardMessageHandler(Log logger, FileItemRegistry registry,
-            IMAPStoreCache store, Provider&lt;HttpSession&gt; provider,
-            @Named("SMTPServerAddress") String address, @Named("SMTPServerPort") int port, @Named("SMTPAuth") boolean auth, @Named("SMTPS") boolean useSSL) {
-        super(logger, registry, store, provider, address, port, auth, useSSL);
+    public ForwardMessageHandler(Log logger, IMAPStoreCache store, Provider&lt;HttpSession&gt; provider, @Named("SMTPServerAddress") String address, @Named("SMTPServerPort") int port,
+            @Named("SMTPAuth") boolean auth, @Named("SMTPS") boolean useSSL) {
+        super(logger, store, provider, address, port, auth, useSSL);
     }
 
     @Override
-    protected Message createMessage(Session session, ForwardMessage action)
-            throws AddressException, MessagingException, ActionException {
-            MimeMessage message = new MimeMessage(session);
-            SMTPMessage m = action.getMessage();
-            message.setFrom(new InternetAddress(m.getFrom()));
-            List&lt;String&gt; to = m.getTo();
-            for (int i = 0; i &lt; to.size(); i++) {
-                message.addRecipient(RecipientType.TO, new InternetAddress(to
-                        .get(i)));
-            }
-
-            List&lt;String&gt; cc = m.getCc();
-            for (int i = 0; cc != null &amp;&amp; i &lt; cc.size(); i++) {
-                message.addRecipient(RecipientType.CC, new InternetAddress(cc
-                        .get(i)));
-            }
-            message.setSubject(m.getSubject());
-            message.saveChanges();
-            return message;
-    }
-
-    @Override
-    protected Message fillBody(Message message,
-            ForwardMessage action) throws MessagingException, ActionException {
+    protected Message createMessage(Session session, ForwardMessage action) throws AddressException, MessagingException, ActionException {
+        MimeMessage message = new MimeMessage(session);
         SMTPMessage m = action.getMessage();
+        message.setFrom(new InternetAddress(m.getFrom()));
+        List&lt;String&gt; to = m.getTo();
+        for (int i = 0; i &lt; to.size(); i++) {
+            message.addRecipient(RecipientType.TO, new InternetAddress(to.get(i)));
+        }
 
-        // create the message part
-        MimeBodyPart messageBodyPart = new MimeBodyPart();
+        List&lt;String&gt; cc = m.getCc();
+        for (int i = 0; cc != null &amp;&amp; i &lt; cc.size(); i++) {
+            message.addRecipient(RecipientType.CC, new InternetAddress(cc.get(i)));
+        }
+        message.setSubject(m.getSubject());
+        message.saveChanges();
+        return message;
+    }
 
-        // fill message
-        messageBodyPart.setText(m.getText());
 
-        Multipart multipart = new MimeMultipart();
-        multipart.addBodyPart(messageBodyPart);
-        
+    @Override
+    @SuppressWarnings("unchecked")
+    protected List getAttachments(ForwardMessage action) throws MessagingException, ActionException {
+        List&lt;BodyPart&gt; items = new ArrayList&lt;BodyPart&gt;();
         IMAPStore store = cache.get(getUser());
-        
+
         IMAPFolder folder = (IMAPFolder) store.getFolder(action.getFolder().getFullName());
         if (folder.isOpen() == false) {
             folder.open(Folder.READ_ONLY);
         }
-        Message fMessage = folder.getMessageByUID(action.getReplyMessageUid());
-        
-        // Create and fill part for the forwarded content
-        messageBodyPart = new MimeBodyPart();
-        messageBodyPart.setDataHandler(fMessage.getDataHandler());
-        multipart.addBodyPart(messageBodyPart);
-
-        multipart = handleAttachments(multipart, m.getMessageAttachments());
-        
-        
-        // Put parts in message
-        message.setContent(multipart);
-        message.saveChanges();
-        return message;
+        // Put the original attachments in the list 
+        Message msg = folder.getMessageByUID(action.getReplyMessageUid());
+        try {
+            items = MessageUtils.extractMessageAttachments(logger, msg.getContent());
+            logger.debug("Forwarding a message, extracted: " + items.size() + " from original.");
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        // Put in the list the attachments uploaded by the user
+        items.addAll(super.getAttachments(action));
+        return items;
     }
 
     /*
      * (non-Javadoc)
+     * 
      * @see net.customware.gwt.dispatch.server.ActionHandler#getActionType()
      */
     public Class&lt;ForwardMessage&gt; getActionType() {
         return ForwardMessage.class;
     }
 
+    /**
+     * DataStore which wrap a FileItem
+     * 
+     */
+    protected static class PartDataStore implements DataSource {
+
+        private FileItem item;
+
+        public PartDataStore(FileItem item) {
+            this.item = item;
+        }
+
+        /*
+         * (non-Javadoc)
+         * 
+         * @see javax.activation.DataSource#getContentType()
+         */
+        public String getContentType() {
+            return item.getContentType();
+        }
+
+        /*
+         * (non-Javadoc)
+         * 
+         * @see javax.activation.DataSource#getInputStream()
+         */
+        public InputStream getInputStream() throws IOException {
+            return item.getInputStream();
+        }
+
+        /*
+         * (non-Javadoc)
+         * 
+         * @see javax.activation.DataSource#getName()
+         */
+        public String getName() {
+            String fullName = item.getName();
+
+            // Strip path from file
+            int index = fullName.lastIndexOf(File.separator);
+            if (index == -1) {
+                return fullName;
+            } else {
+                return fullName.substring(index + 1, fullName.length());
+            }
+        }
+
+        /*
+         * (non-Javadoc)
+         * 
+         * @see javax.activation.DataSource#getOutputStream()
+         */
+        public OutputStream getOutputStream() throws IOException {
+            return null;
+        }
+
+    }
+
 }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java Tue Dec  1 15:05:00 2009
@@ -22,7 +22,6 @@
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
-import java.util.regex.Pattern;
 
 import javax.mail.Flags;
 import javax.mail.Message;
@@ -39,7 +38,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.hupa.server.IMAPStoreCache;
-import org.apache.hupa.shared.SConsts;
+import static org.apache.hupa.server.utils.RegexPatterns.*;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.MessageAttachment;
 import org.apache.hupa.shared.data.MessageDetails;
@@ -199,13 +198,15 @@
                         isHTML =  handleParts(msg, msg.getContent(), sbPlain, attachmentList);
                     } else {
                         if (part.getFileName() != null) {
-                            MessageAttachment attachment = new MessageAttachment();
-                            attachment.setName(MimeUtility.decodeText(part
-                                    .getFileName()));
-                            attachment.setContentType(part.getContentType());
-                            attachment.setSize(part.getSize());
-
-                            attachmentList.add(attachment);
+                            // Inline images are not added to the attachment list
+                            // TODO: improve the in-line images detection 
+                            if (part.getHeader("Content-ID") == null) {
+                                MessageAttachment attachment = new MessageAttachment();
+                                attachment.setName(MimeUtility.decodeText(part.getFileName()));
+                                attachment.setContentType(part.getContentType());
+                                attachment.setSize(part.getSize());
+                                attachmentList.add(attachment);
+                            }
                         } else {
                             isHTML = handleParts(message, part.getContent(), sbPlain, attachmentList);
                         }
@@ -241,69 +242,21 @@
         return isHTML;
     }
     
-    
-    static String HTML_LINK_REGEXP =  "\\b?(https?://[\\w\\d:#@%/;$\\(\\)~_\\?\\+\\-=\\\\.&amp;]*)\\b?";
-    static Pattern regex_http = Pattern.compile(HTML_LINK_REGEXP);
-    static String repl_http = "&lt;a href=\"$1\"&gt;$1&lt;/a&gt;";
-
-    static String EMAIL_REGEXP =  "\\b(?&lt;![A-z0-9._%\\+\\-=])([A-z][A-z0-9._%\\+\\-]+@[A-z0-9\\.\\-]+\\.[A-z]{2,4})";
-    static Pattern regex_email = Pattern.compile("\\b"+ EMAIL_REGEXP);
-    static String repl_email = "&lt;a href=\"mailto:$1\"&gt;$1&lt;/a&gt;";
-    
-    static Pattern regex_inlineImg = Pattern.compile("(?si)(&lt;\\s*img\\s+.*?src=[\"'])cid:([^\"']+[\"'])");
-    static String repl_inlineImg = "$1" + SConsts.HUPA + SConsts.SERVLET_DOWNLOAD 
-                            + "?" + SConsts.PARAM_FOLDER + "=%%FOLDER%%" 
-                            + "&amp;" + SConsts.PARAM_UID + "=%%UID%%" 
-                            + "&amp;" + SConsts.PARAM_NAME + "=$2";
-
-    static Pattern regex_badTags = Pattern.compile("(?si)&lt;(script|style|head).*?&lt;/\\1\\s*&gt;");
-    static String repl_badTags = "";
-
-    static Pattern regex_unneededTags = Pattern.compile("(?si)(&lt;/?(html|body)[^&gt;]*?&gt;)");
-    static String repl_unneededTags = "";
-
-    static String EVENT_ATTR_REGEX = "(?:on[dbl]*click)|(?:onmouse[a-z]+)|(?:onkey[a-z]+)";
-    static Pattern regex_badAttrs = Pattern.compile("(?si)(&lt;\\w+[^&lt;&gt;]*)\\s+("+ EVENT_ATTR_REGEX + ")=[\"']?([^\\s&lt;&gt;]+?)[\"']?([\\s&gt;])");
-    static String repl_badAttrs = "$1$4";
-    
-    static Pattern regex_orphandHttpLinks = Pattern.compile("(?si)(?!.*&lt;a\\s?[^&gt;]*?&gt;.+&lt;/a\\s*&gt;.*)(&lt;[^&lt;]*?&gt;[^&lt;&gt;]*)" + HTML_LINK_REGEXP + "([^&lt;&gt;]*&lt;[^&gt;]*?&gt;)");
-    static String repl_orphandHttpLinks = "$1&lt;a href=\"$2\"&gt;$2&lt;/a&gt;$3";
-    
-    static Pattern regex_existingHttpLinks = Pattern.compile("(?si)&lt;a\\s[^&gt;]*?href=[\"']?" + HTML_LINK_REGEXP + "[\"']?");
-    static String repl_existingHttpLinks = "&lt;a onClick=\"openLink('$1');return false;\" href=\"$1\"";
-
-    static Pattern regex_orphandEmailLinks = Pattern.compile("(?si)(?!.*&lt;a\\s?[^&gt;]*?&gt;.+&lt;/a\\s*&gt;.*)(&lt;[^&lt;]*?&gt;[^&lt;&gt;]*)" + EMAIL_REGEXP + "([^&lt;&gt;]*&lt;[^&gt;]*?&gt;)");
-    static String repl_orphandEmailLinks = "$1&lt;a href=\"mailto:$2\"&gt;$2&lt;/a&gt;$3";
-
-    static Pattern regex_existingEmailLinks = Pattern.compile("(?si)&lt;a\\s[^&gt;]*?href=[\"']*mailto:[\"']?([^\"]+)[\"']?");
-    static String repl_existngEmailLinks = "&lt;a onClick=\"mailTo('$1');return false;\" href=\"mailto:$1\"";
-    
-    
-    protected String replaceAll(String txt, Pattern pattern, String replacement) {
-        return pattern.matcher(txt).replaceAll(replacement);
-    }
-    
-    protected String replaceAllRecursive(String txt, Pattern pattern, String replacement) {
-        while (pattern.matcher(txt).find())
-            txt = pattern.matcher(txt).replaceAll(replacement);
-        return txt;
-    }
-
     protected String txtDocumentToHtml(String txt, String folderName, long uuid) {
         
         if (txt == null || txt.length()==0)
             return txt;
 
         // escape html tags symbols 
-        txt = txt.replaceAll("&lt;", "&amp;lt;");
-        txt = txt.replaceAll("&gt;", "&amp;gt;");
+        txt = replaceAll(txt, regex_lt, repl_lt);
+        txt = replaceAll(txt, regex_gt, repl_gt);
         
         // enclose between &lt;a&gt; http links and emails
-        txt = replaceAll(txt, regex_http, repl_http);
+        txt = replaceAll(txt, regex_htmllink, repl_htmllink);
         txt = replaceAll(txt, regex_email, repl_email);
         
         // put break lines
-        txt = txt.replaceAll("\r", "").replaceAll("\n", "&lt;br/&gt;\n");
+        txt = replaceAll(txt, regex_nl, repl_nl);
         
         txt = filterHtmlDocument(txt, folderName, uuid);
 

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/ReplyMessageHandler.java Tue Dec  1 15:05:00 2009
@@ -31,8 +31,8 @@
 import net.customware.gwt.dispatch.shared.ActionException;
 
 import org.apache.commons.logging.Log;
-import org.apache.hupa.server.FileItemRegistry;
 import org.apache.hupa.server.IMAPStoreCache;
+import org.apache.hupa.server.utils.MessageUtils;
 import org.apache.hupa.shared.data.SMTPMessage;
 import org.apache.hupa.shared.rpc.ReplyMessage;
 
@@ -50,10 +50,9 @@
 public class ReplyMessageHandler extends AbstractSendMessageHandler&lt;ReplyMessage&gt;{
 
     @Inject
-    public ReplyMessageHandler(Log logger, FileItemRegistry registry,
-            IMAPStoreCache store, Provider&lt;HttpSession&gt; provider,
+    public ReplyMessageHandler(Log logger, IMAPStoreCache store, Provider&lt;HttpSession&gt; provider,
             @Named("SMTPServerAddress") String address, @Named("SMTPServerPort") int port, @Named("SMTPAuth") boolean auth, @Named("SMTPS") boolean useSSL) {
-        super(logger, registry, store, provider, address, port, auth, useSSL);
+        super(logger, store, provider, address, port, auth, useSSL);
     }
 
     /*
@@ -70,9 +69,9 @@
         Message rMessage =  folder.getMessageByUID(action.getReplyMessageUid()).reply(action.getReplyAll());
         SMTPMessage m = action.getMessage();
         // Use the new recipient list, maybe it has changed
-        rMessage.setRecipients(RecipientType.TO, getRecipients(m.getTo()));
-        rMessage.setRecipients(RecipientType.CC, getRecipients(m.getCc()));
-        rMessage.setRecipients(RecipientType.BCC, getRecipients(m.getBcc()));
+        rMessage.setRecipients(RecipientType.TO, MessageUtils.getRecipients(m.getTo()));
+        rMessage.setRecipients(RecipientType.CC, MessageUtils.getRecipients(m.getCc()));
+        rMessage.setRecipients(RecipientType.BCC, MessageUtils.getRecipients(m.getBcc()));
         rMessage.setFrom(new InternetAddress(m.getFrom()));
         // replace subject
         rMessage.setSubject(m.getSubject());

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SendMessageHandler.java Tue Dec  1 15:05:00 2009
@@ -29,8 +29,8 @@
 import javax.servlet.http.HttpSession;
 
 import org.apache.commons.logging.Log;
-import org.apache.hupa.server.FileItemRegistry;
 import org.apache.hupa.server.IMAPStoreCache;
+import org.apache.hupa.server.utils.MessageUtils;
 import org.apache.hupa.shared.data.SMTPMessage;
 import org.apache.hupa.shared.rpc.SendMessage;
 
@@ -46,9 +46,9 @@
 public class SendMessageHandler extends AbstractSendMessageHandler&lt;SendMessage&gt; {
 
     @Inject
-    public SendMessageHandler(Log logger, FileItemRegistry registry,
-            IMAPStoreCache store, Provider&lt;HttpSession&gt; provider,@Named("SMTPServerAddress") String address, @Named("SMTPServerPort") int port, @Named("SMTPAuth") boolean auth, @Named("SMTPS") boolean useSSL) {
-        super(logger, registry, store, provider, address, port, auth,useSSL);
+    public SendMessageHandler(Log logger, IMAPStoreCache store, Provider&lt;HttpSession&gt; provider,
+            @Named("SMTPServerAddress") String address, @Named("SMTPServerPort") int port, @Named("SMTPAuth") boolean auth, @Named("SMTPS") boolean useSSL) {
+        super(logger, store, provider, address, port, auth,useSSL);
     }
 
     /*
@@ -60,9 +60,9 @@
         MimeMessage message = new MimeMessage(session);
         SMTPMessage m = action.getMessage();
         message.setFrom(new InternetAddress(m.getFrom()));
-        message.setRecipients(RecipientType.TO, getRecipients(m.getTo()));
-        message.setRecipients(RecipientType.CC, getRecipients(m.getCc()));
-        message.setRecipients(RecipientType.BCC, getRecipients(m.getBcc()));
+        message.setRecipients(RecipientType.TO, MessageUtils.getRecipients(m.getTo()));
+        message.setRecipients(RecipientType.CC, MessageUtils.getRecipients(m.getCc()));
+        message.setRecipients(RecipientType.BCC, MessageUtils.getRecipients(m.getBcc()));
         message.setSubject(m.getSubject());
         return message;
     }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/mock/MockSMTPTransport.java Tue Dec  1 15:05:00 2009
@@ -19,6 +19,9 @@
 
 package org.apache.hupa.server.mock;
 
+import java.io.IOException;
+import java.io.OutputStream;
+
 import javax.mail.Address;
 import javax.mail.Message;
 import javax.mail.MessagingException;
@@ -28,21 +31,25 @@
 
 import org.apache.hupa.server.guice.DemoModeConstants;
 
-
 public class MockSMTPTransport extends Transport {
 
     static final URLName demoUrl = new URLName(null, DemoModeConstants.DEMO_MODE, 143, null, null, null);
-    
+
     public MockSMTPTransport(Session session) {
         super(session, demoUrl);
     }
 
     @Override
     public void sendMessage(Message msg, Address[] addresses) throws MessagingException {
+        try {
+            msg.writeTo(new OutputStream() {
+                public void write(int b) throws IOException {}
+            });
+        } catch (IOException e) {}
     }
-    
+
     @Override
     public void connect(String host, int port, String user, String password) throws MessagingException {
     }
-    
+
 }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/DownloadAttachmentServlet.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/DownloadAttachmentServlet.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/DownloadAttachmentServlet.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/DownloadAttachmentServlet.java Tue Dec  1 15:05:00 2009
@@ -26,10 +26,8 @@
 import javax.mail.Folder;
 import javax.mail.Message;
 import javax.mail.MessagingException;
-import javax.mail.Multipart;
 import javax.mail.Part;
 import javax.mail.Store;
-import javax.mail.internet.MimeUtility;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
@@ -38,6 +36,7 @@
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.logging.Log;
 import org.apache.hupa.server.InMemoryIMAPStoreCache;
+import org.apache.hupa.server.utils.MessageUtils;
 import org.apache.hupa.shared.SConsts;
 import org.apache.hupa.shared.data.User;
 
@@ -99,7 +98,7 @@
             Message m = folder.getMessageByUID(Long.parseLong(message_uuid));
 
             Object content = m.getContent();
-            Part part  = handleMultiPart(logger, content, attachmentName);
+            Part part  = MessageUtils.handleMultiPart(logger, content, attachmentName);
             if (part.getContentType()!=null)
                 response.setContentType(part.getContentType());
             else
@@ -139,49 +138,4 @@
         }
     }
 
-    /**
-     * Loop over MuliPart and write the content to the Outputstream if a
-     * attachment with the given name was found.
-     *
-     * @param out
-     *            Outputstream to write the content to
-     * @param content
-     *            Content which should checked for attachments
-     * @param attachmentName
-     *            The attachmentname or the unique id for the searched attachment
-     * @throws MessagingException
-     * @throws IOException
-     */
-    static protected Part handleMultiPart(Log logger, Object content, String attachmentName)
-            throws MessagingException, IOException {
-        if (content instanceof Multipart) {
-            Multipart part = (Multipart) content;
-            for (int i = 0; i &lt; part.getCount(); i++) {
-                Part bodyPart = part.getBodyPart(i);
-                String fileName = bodyPart.getFileName();
-                String[] contentId = bodyPart.getHeader("Content-ID");
-                if (bodyPart.isMimeType("multipart/*")) {
-                    Part p = handleMultiPart(logger, bodyPart.getContent(), attachmentName);
-                    if (p != null)
-                        return p;
-                } else {
-                    if (contentId != null) {
-                        for (String id: contentId) {
-                            id = id.replaceAll("^.*&lt;(.+)&gt;.*$", "$1");
-                            if (attachmentName.equals(id))
-                                return bodyPart;
-                        }
-                    }
-                    if (fileName != null){
-                        if (attachmentName.equalsIgnoreCase(MimeUtility.decodeText(fileName)))
-                            return bodyPart;
-                    }
-                }
-            }
-        } else {
-            logger.error("Unknown content: " + content.getClass().getName());
-        }
-        return null;
-    }
-
 }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/UploadAttachmentServlet.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/UploadAttachmentServlet.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/UploadAttachmentServlet.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/servlet/UploadAttachmentServlet.java Tue Dec  1 15:05:00 2009
@@ -27,6 +27,7 @@
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.logging.Log;
 import org.apache.hupa.server.FileItemRegistry;
 
 import com.google.inject.Inject;
@@ -40,19 +41,33 @@
 public class UploadAttachmentServlet extends UploadAction{
 
     private static final long serialVersionUID = 4936687307133529124L;
-    private FileItemRegistry registry;
+    
+    
+
+    private Log logger;
     
     @Inject
-    public UploadAttachmentServlet(FileItemRegistry registry) {
-        this.registry = registry;
+    public UploadAttachmentServlet(Log logger) {
+        this.logger = logger;
+    }
+    
+    private FileItemRegistry getSessionRegistry(HttpServletRequest request) {
+        FileItemRegistry registry = (FileItemRegistry)request.getSession().getAttribute("registry");
+        if (registry == null) {
+            registry = new FileItemRegistry(logger);
+            request.getSession().setAttribute("registry", registry);
+        }
+        return registry;
     }
     
     @Override
     public String executeAction(HttpServletRequest request, List&lt;FileItem&gt; sessionFiles) throws UploadActionException {
-        logger.info("Executing Action, files in session: " + sessionFiles.size() + " files in registry: " + registry.size());
-        // save file items in the registry
+
+        logger.info("Executing Action, files in session: " + sessionFiles.size() + " previous files in registry: " + getSessionRegistry(request).size());
+        // save file items in the user session's registry
         for(FileItem item: sessionFiles) 
-            registry.add(item);
+            getSessionRegistry(request).add(item);
+
         
         // remove items from session but not remove the data from disk or memory
         removeSessionFileItems(request, false);
@@ -61,6 +76,6 @@
     
     @Override
     public void removeItem(HttpServletRequest request, FileItem item)  throws UploadActionException {
-       registry.remove(item);
+       getSessionRegistry(request).remove(item);
     }
 }

Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java?rev=885783&amp;view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java Tue Dec  1 15:05:00 2009
@@ -0,0 +1,161 @@
+/****************************************************************
+ * 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.utils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.mail.Address;
+import javax.mail.BodyPart;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.Part;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeUtility;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.logging.Log;
+import org.apache.hupa.server.FileItemRegistry;
+
+
+
+/**
+ * Utility methods in server side
+ */
+public class MessageUtils {
+
+    /**
+     * Get a Address array for a set of address passed as arguments 
+     * 
+     * @param addresses
+     * @return Address array
+     * @throws AddressException
+     */
+    public static Address[] getRecipients(String... addresses) throws AddressException {
+        return getRecipients(Arrays.asList(addresses));
+    }
+
+    /**
+     * Get a Address array for the given ArrayList 
+     * 
+     * @param recipients
+     * @return addressArray
+     * @throws AddressException
+     */
+    public static Address[] getRecipients(List&lt;String&gt; recipients) throws AddressException {
+        if (recipients == null) {
+            return new InternetAddress[]{};
+        }
+        Address[] array = new Address[recipients.size()];
+        for (int i = 0; i &lt; recipients.size(); i++) {
+            array[i] = new InternetAddress(recipients.get(i));
+        }
+        return array;
+    }
+
+    /**
+     * Extract the attachments present in a mime message
+     * 
+     * @param logger
+     * @param content
+     * @return
+     * @throws MessagingException
+     * @throws IOException
+     */
+    static public List&lt;BodyPart&gt; extractMessageAttachments(Log logger, Object content) throws MessagingException, IOException {
+        ArrayList&lt;BodyPart&gt; ret = new ArrayList&lt;BodyPart&gt;();
+        if (content instanceof Multipart) {
+            Multipart part = (Multipart) content;
+            for (int i = 0; i &lt; part.getCount(); i++) {
+                BodyPart bodyPart = part.getBodyPart(i);
+                String fileName = bodyPart.getFileName();
+                String[] contentId = bodyPart.getHeader("Content-ID");
+                if (bodyPart.isMimeType("multipart/*")) {
+                    ret.addAll(extractMessageAttachments(logger, bodyPart.getContent()));
+                } else {
+                    if (contentId != null || fileName != null) {
+                        ret.add(bodyPart);
+                    }
+                }
+            }
+        } else {
+            logger.error("Unknown content: " + content.getClass().getName());
+        }
+        return ret;
+    }
+
+    public static FileItemRegistry getSessionRegistry(HttpSession session, Log logger) {
+        FileItemRegistry registry = (FileItemRegistry)session.getAttribute("registry");
+        if (registry == null) {
+            registry = new FileItemRegistry(logger);
+            session.setAttribute("registry", registry);
+        }
+        return registry;
+    }
+
+    /**
+     * Loop over MuliPart and write the content to the Outputstream if a
+     * attachment with the given name was found.
+     *
+     * @param out
+     *            Outputstream to write the content to
+     * @param content
+     *            Content which should checked for attachments
+     * @param attachmentName
+     *            The attachmentname or the unique id for the searched attachment
+     * @throws MessagingException
+     * @throws IOException
+     */
+    public static Part handleMultiPart(Log logger, Object content, String attachmentName)
+            throws MessagingException, IOException {
+        if (content instanceof Multipart) {
+            Multipart part = (Multipart) content;
+            for (int i = 0; i &lt; part.getCount(); i++) {
+                Part bodyPart = part.getBodyPart(i);
+                String fileName = bodyPart.getFileName();
+                String[] contentId = bodyPart.getHeader("Content-ID");
+                if (bodyPart.isMimeType("multipart/*")) {
+                    Part p = handleMultiPart(logger, bodyPart.getContent(), attachmentName);
+                    if (p != null)
+                        return p;
+                } else {
+                    if (contentId != null) {
+                        for (String id: contentId) {
+                            id = id.replaceAll("^.*&lt;(.+)&gt;.*$", "$1");
+                            if (attachmentName.equals(id))
+                                return bodyPart;
+                        }
+                    }
+                    if (fileName != null){
+                        if (attachmentName.equalsIgnoreCase(MimeUtility.decodeText(fileName)))
+                            return bodyPart;
+                    }
+                }
+            }
+        } else {
+            logger.error("Unknown content: " + content.getClass().getName());
+        }
+        return null;
+    }
+    
+}
\ No newline at end of file

Added: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/RegexPatterns.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/RegexPatterns.java?rev=885783&amp;view=auto
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/RegexPatterns.java (added)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/RegexPatterns.java Tue Dec  1 15:05:00 2009
@@ -0,0 +1,102 @@
+/****************************************************************
+ * 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.utils;
+
+import java.util.regex.Pattern;
+
+import org.apache.hupa.shared.SConsts;
+
+/**
+ * A place where we centralize all compiled regular expressions which will be used in 
+ * server side for html and text transformations.
+ */
+public class RegexPatterns {
+    
+    public static final Pattern regex_lt = Pattern.compile("&lt;");
+    public static final String repl_lt = "&amp;lt;";
+    
+    public static final Pattern regex_gt = Pattern.compile("&gt;");
+    public static final String repl_gt = "&amp;lt;";
+
+    public static final Pattern regex_nl = Pattern.compile("\n");
+    public static final String repl_nl = "&lt;br/&gt;";
+
+    public static final String HTML_LINK_REGEXP =  "\\b?(https?://[\\w\\d:#@%/;$\\(\\)~_\\?\\+\\-=\\\\.&amp;]*)\\b?";
+    public static final Pattern regex_htmllink = Pattern.compile(HTML_LINK_REGEXP);
+    public static final String repl_htmllink = "&lt;a href=\"$1\"&gt;$1&lt;/a&gt;";
+    
+    public static final String EMAIL_REGEXP =  "\\b(?&lt;![A-z0-9._%\\+\\-=])([A-z][A-z0-9._%\\+\\-]+@[A-z0-9\\.\\-]+\\.[A-z]{2,4})";
+    public static final Pattern regex_email = Pattern.compile("\\b"+ EMAIL_REGEXP);
+    public static final String repl_email = "&lt;a href=\"mailto:$1\"&gt;$1&lt;/a&gt;";
+    
+    public static final Pattern regex_inlineImg = Pattern.compile("(?si)(&lt;\\s*img\\s+.*?src=)[\"']?cid:([^\"']+)[\"']?");
+    public static final String repl_inlineImg = "$1'" + SConsts.HUPA + SConsts.SERVLET_DOWNLOAD 
+                                        + "?" + SConsts.PARAM_FOLDER + "=%%FOLDER%%" 
+                                        + "&amp;" + SConsts.PARAM_UID + "=%%UID%%" 
+                                        + "&amp;" + SConsts.PARAM_NAME + "=$2' name='cid:$2'";
+    
+    public static final Pattern regex_revertInlineImg = Pattern.compile("(?si)(&lt;img\\s[^&gt;]*src=)[^&gt;]+name=([\"']cid:[^\"']+[\"'])");
+    public static final String repl_revertInlineImg = "$1$2";
+    
+    public static final Pattern regex_badTags = Pattern.compile("(?si)&lt;(script|style|head).*?&lt;/\\1\\s*&gt;");
+    public static final String repl_badTags = "";
+    
+    public static final Pattern regex_unneededTags = Pattern.compile("(?si)(&lt;/?(html|body)[^&gt;]*?&gt;)");
+    public static final String repl_unneededTags = "";
+    
+    public static final String EVENT_ATTR_REGEX = "(?:on[dbl]*click)|(?:onmouse[a-z]+)|(?:onkey[a-z]+)";
+    public static final Pattern regex_badAttrs = Pattern.compile("(?si)(&lt;\\w+[^&lt;&gt;]*)\\s+("+ EVENT_ATTR_REGEX + ")=[\"']?([^\\s&lt;&gt;]+?)[\"']?([\\s&gt;])");
+    public static final String repl_badAttrs = "$1$4";
+    
+    public static final Pattern regex_orphandHttpLinks = Pattern.compile("(?si)(?!.*&lt;a\\s?[^&gt;]*?&gt;.+&lt;/a\\s*&gt;.*)(&lt;[^&lt;]*?&gt;[^&lt;&gt;]*)" + HTML_LINK_REGEXP + "([^&lt;&gt;]*&lt;[^&gt;]*?&gt;)");
+    public static final String repl_orphandHttpLinks = "$1&lt;a href=\"$2\"&gt;$2&lt;/a&gt;$3";
+    
+    public static final Pattern regex_existingHttpLinks = Pattern.compile("(?si)&lt;a\\s[^&gt;]*?href=[\"']?" + HTML_LINK_REGEXP + "[\"']?");
+    public static final String repl_existingHttpLinks = "&lt;a onClick=\"openLink('$1');return false;\" href=\"$1\"";
+    
+    public static final Pattern regex_orphandEmailLinks = Pattern.compile("(?si)(?!.*&lt;a\\s?[^&gt;]*?&gt;.+&lt;/a\\s*&gt;.*)(&lt;[^&lt;]*?&gt;[^&lt;&gt;]*)" + EMAIL_REGEXP + "([^&lt;&gt;]*&lt;[^&gt;]*?&gt;)");
+    public static final String repl_orphandEmailLinks = "$1&lt;a href=\"mailto:$2\"&gt;$2&lt;/a&gt;$3";
+    
+    public static final Pattern regex_existingEmailLinks = Pattern.compile("(?si)&lt;a\\s[^&gt;]*?href=[\"']*mailto:[\"']?([^\"]+)[\"']?");
+    public static final String repl_existngEmailLinks = "&lt;a onClick=\"mailTo('$1');return false;\" href=\"mailto:$1\"";
+    
+    public static String replaceAll(String txt, Pattern pattern, String replacement) {
+        return pattern.matcher(txt).replaceAll(replacement);
+    }
+    
+    public static String replaceAllRecursive(String txt, Pattern pattern, String replacement) {
+        while (pattern.matcher(txt).find())
+            txt = pattern.matcher(txt).replaceAll(replacement);
+        return txt;
+    }
+    
+    public static final Pattern regex_nl_tags = Pattern.compile("(?si)(&lt;br\\s*?/?&gt;)|(&lt;/div\\s*?&gt;)");
+    public static final Pattern regex_any_tag = Pattern.compile("(\\w)&lt;.*?&gt;(\\w)");
+    public static final String repl_any_tag = "$1 $2";
+    
+//    s=s.replaceAll("\n", " ");
+//    s=s.replaceAll("(?si)&lt;br\\s*?/?&gt;", "\n");
+//    s=s.replaceAll("(?si)&lt;/div\\s*?&gt;", "\n");
+//    s=s.replaceAll("(\\w)&lt;.*?&gt;(\\w)", "$1 $2");
+//    s=s.replaceAll("&lt;.*?&gt;", "");
+//    s=s.replaceAll("[ \t]+", " ");
+
+    
+}
\ No newline at end of file

Added: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/HupaTestCase.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/HupaTestCase.java?rev=885783&amp;view=auto
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/HupaTestCase.java (added)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/HupaTestCase.java Tue Dec  1 15:05:00 2009
@@ -0,0 +1,52 @@
+/****************************************************************
+ * 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 javax.mail.Session;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.logging.Log;
+import org.apache.hupa.server.guice.GuiceTestModule;
+import org.apache.hupa.server.handler.AbstractSendMessageHandler;
+import org.apache.hupa.server.handler.ForwardMessageHandler;
+import org.apache.hupa.server.handler.GetMessageDetailsHandler;
+import org.apache.hupa.shared.rpc.SendMessage;
+
+import com.google.inject.Injector;
+
+public abstract class HupaTestCase extends TestCase{
+
+    protected GuiceTestModule module = new GuiceTestModule();
+    protected Injector injector = module.getInjector();
+    
+    protected Session session = injector.getInstance(Session.class);
+    protected Log logger = injector.getInstance(Log.class);
+    protected IMAPStoreCache storeCache = injector.getInstance(IMAPStoreCache.class);
+    
+    @SuppressWarnings("unchecked")
+    protected AbstractSendMessageHandler&lt;SendMessage&gt; abstSendMsgHndl = injector.getInstance(AbstractSendMessageHandler.class);
+    
+    protected ForwardMessageHandler fwdMsgHndl = injector.getInstance(ForwardMessageHandler.class);
+    
+    protected GetMessageDetailsHandler getDetailsMsgHndl = injector.getInstance(GetMessageDetailsHandler.class);
+    
+}

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceTestModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceTestModule.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceTestModule.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/guice/GuiceTestModule.java Tue Dec  1 15:05:00 2009
@@ -23,7 +23,6 @@
 import javax.servlet.http.HttpSession;
 
 import org.apache.commons.logging.Log;
-import org.apache.hupa.server.FileItemRegistry;
 import org.apache.hupa.server.IMAPStoreCache;
 import org.apache.hupa.server.handler.AbstractSendMessageHandler;
 import org.apache.hupa.server.handler.ForwardMessageHandler;
@@ -50,7 +49,6 @@
         Names.bindProperties(binder(), DemoModeConstants.demoProperties);
 
         bind(Log.class).toProvider(MockLogProvider.class).in(Singleton.class);
-        bind(FileItemRegistry.class).in(Singleton.class);
         bind(Session.class).toProvider(SessionProvider.class);
         bind(HttpSession.class).to(MockHttpSession.class).in(Singleton.class);
 

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbstractHandlerTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbstractHandlerTest.java?rev=885783&amp;r1=885782&amp;r2=885783&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbstractHandlerTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbstractHandlerTest.java Tue Dec  1 15:05:00 2009
@@ -20,12 +20,9 @@
 
 package org.apache.hupa.server.handler;
 
-import java.io.FileInputStream;
-import java.net.URL;
 import java.util.Properties;
 
 import javax.mail.Session;
-import javax.mail.internet.MimeMessage;
 import javax.servlet.http.HttpSession;
 
 import junit.framework.TestCase;
@@ -93,15 +90,6 @@
         user.setSettings(new Settings());
         return user;
     }
-    
-    protected MimeMessage loadMessage(String msgFile) throws Exception {
-        msgFile = DemoModeConstants.DEMO_MODE_MESSAGES_LOCATION + msgFile;
-        URL url = Thread.currentThread().getContextClassLoader().getResource(msgFile);
-        assertNotNull("Check that the file " + msgFile + " is in the classpath", url);
-    
-        FileInputStream is = new FileInputStream(url.getFile());
-        return new MimeMessage(session, is);
-    }
 
 
 }



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



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (IMAP-100) Exception while call IMAPFolder.isOpen in javamail</title>
<author><name>&quot;Norman Maurer (JIRA)&quot; &lt;server-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c504957799.1259678000667.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c504957799-1259678000667-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T14:33:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/IMAP-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784242#action_12784242
] 

Norman Maurer commented on IMAP-100:
------------------------------------

Maybe helpfull:


http://forums.sun.com/thread.jspa?threadID=5396428

&gt; Exception while call IMAPFolder.isOpen in javamail
&gt; --------------------------------------------------
&gt;
&gt;                 Key: IMAP-100
&gt;                 URL: https://issues.apache.org/jira/browse/IMAP-100
&gt;             Project: JAMES Imap
&gt;          Issue Type: Bug
&gt;            Reporter: Norman Maurer
&gt;
&gt; When trying to use HUPA to access JAMES IMAP I see this exception:
&gt;  408 FETCH (FLAGS (\Recent) INTERNALDATE "30-Nov-2009 19:16:48 +0000" RFC822.SIZE 4934
ENVELOPE ("Mon, 30 Nov 2009 19:16:21 +0000 (UTC)" "[jira] Created: (HUPA-56) Hupa throws Exception
when get used with
&gt;  an IMAP Server which not support the IDLE command" (("Norman Maurer (JIRA)" NIL "jira"
"apache.org")) (("Norman Maurer (JIRA)" NIL "jira" "apache.org")) (("James Developers List"
NIL "server-dev" "james.apache.org")) ((NIL NIL "server-dev" "james.apache.org")) NIL NIL
NIL "&lt;1223603979.1259608581218.JavaMail.jira@brutus&gt;") BODYSTRUCTURE ("TEXT" "PLAIN"
("charset" "utf-8") NIL NIL "7BIT" 2525 51 NIL NIL NIL NIL))
&gt; java.lang.ArrayIndexOutOfBoundsException: 256
&gt; 	at com.sun.mail.iap.Response.parseString(Response.java:396)
&gt; 	at com.sun.mail.iap.Response.readString(Response.java:325)
&gt; 	at com.sun.mail.imap.protocol.ENVELOPE.&lt;init&gt;(ENVELOPE.java:100)
&gt; 	at com.sun.mail.imap.protocol.FetchResponse.parse(FetchResponse.java:132)
&gt; 	at com.sun.mail.imap.protocol.FetchResponse.&lt;init&gt;(FetchResponse.java:68)
&gt; 	at com.sun.mail.imap.protocol.IMAPResponse.readResponse(IMAPResponse.java:137)
&gt; 	at com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:261)
&gt; 	at com.sun.mail.iap.Protocol.command(Protocol.java:310)
&gt; 	at com.sun.mail.iap.Protocol.simpleCommand(Protocol.java:357)
&gt; 	at com.sun.mail.imap.protocol.IMAPProtocol.noop(IMAPProtocol.java:301)
&gt; 	at com.sun.mail.imap.IMAPFolder.keepConnectionAlive(IMAPFolder.java:2685)
&gt; 	at com.sun.mail.imap.IMAPFolder.isOpen(IMAPFolder.java:1162)
&gt; 	at org.apache.hupa.server.handler.AbstractFetchMessagesHandler.executeInternal(AbstractFetchMessagesHandler.java:97)
&gt; 	at org.apache.hupa.server.handler.AbstractFetchMessagesHandler.executeInternal(AbstractFetchMessagesHandler.java:51)
&gt; 	at org.apache.hupa.server.handler.AbstractSessionHandler.execute(AbstractSessionHandler.java:60)
&gt; 	at net.customware.gwt.dispatch.server.DefaultDispatch.doExecute(DefaultDispatch.java:78)
&gt; 	at net.customware.gwt.dispatch.server.DefaultDispatch.execute(DefaultDispatch.java:68)
&gt; 	at net.customware.gwt.dispatch.server.service.DispatchServiceServlet.execute(DispatchServiceServlet.java:24)
&gt; 	at org.apache.hupa.server.servlet.HupaDispatchServlet.execute(HupaDispatchServlet.java:53)
&gt; 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&gt; 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
&gt; 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
&gt; 	at java.lang.reflect.Method.invoke(Method.java:585)
&gt; 	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
&gt; 	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
&gt; 	at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
&gt; 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
&gt; 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
&gt; 	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:231)
&gt; 	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:142)
&gt; 	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:93)
&gt; 	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:63)
&gt; 	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:122)
&gt; 	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:110)
&gt; 	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
&gt; 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
&gt; 	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
&gt; 	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
&gt; 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
&gt; 	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
&gt; 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
&gt; 	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
&gt; 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
&gt; 	at org.mortbay.jetty.Server.handle(Server.java:324)
&gt; 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
&gt; 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
&gt; 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
&gt; 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
&gt; 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
&gt; 	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
&gt; 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>JAMES Server Nightly Build Report</title>
<author><name>JAMES Nightly Build System &lt;noel@devtech.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c7512647.1236601259656489184.JavaMail.root@devtech.com%3e"/>
<id>urn:uuid:%3c7512647-1236601259656489184-JavaMail-root@devtech-com%3e</id>
<updated>2009-12-01T08:34:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
An automated nightly build of JAMES has been posted to http://people.apache.org/builds/james/nightly/
--------------------------------------------------------------------
Any unit test errors from the build should be reported below:
--------------------------------------------------------------------
BUILD SUCCESSFUL
Total time: 4 minutes 37 seconds
--------------------------------------------------------------------
Done. Packages Will Be Uploaded To The Nightly Repository.
--------------------------------------------------------------------
Please review http://people.apache.org/builds/james/nightly/BUILD.log.


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



</pre>
</div>
</content>
</entry>
<entry>
<title>[GUMP@vmgump]: Project james-server (in module james-server) failed</title>
<author><name>Gump &lt;server-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c20091201150357.29296AB4016@vmgump.apache.org%3e"/>
<id>urn:uuid:%3c20091201150357-29296AB4016@vmgump-apache-org%3e</id>
<updated>2009-12-01T07:03:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
To whom it may engage...
        
This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at general@gump.apache.org.

Project james-server has an issue affecting its community integration.
This issue affects 1 projects,
 and has been outstanding for 10 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
    - james-server :  James Server


Full details are available at:
    http://vmgump.apache.org/gump/public/james-server/james-server/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were provided:
 -DEBUG- Sole output [james-server-core-library-01122009.jar] identifier set to project name
 -DEBUG- Dependency on javamail exists, no need to add for property gump.resource.javamail.
 -DEBUG- Dependency on magic exists, no need to add for property magic.home.
 -INFO- Failed with reason build failed
 -INFO- Failed to extract fallback artifacts from Gump Repository



The following work was performed:
http://vmgump.apache.org/gump/public/james-server/james-server/gump_work/build_james-server_james-server.html
Work Name: build_james-server_james-server (Type: Build)
Work ended in a state of : Failed
Elapsed: 7 mins 43 secs
Command Line: /usr/lib/jvm/java-6-sun/bin/java -Djava.awt.headless=true org.apache.tools.ant.Main
-Dgump.merge=/srv/gump/public/gump/work/merge.xml -Dgump.resource.dnsjava=/srv/gump/public/workspace/james-server/stage/dnsjava/jars/dnsjava-2.0.6.jar
-Dgump.resource.javamail=/srv/gump/packages/javamail-1.4/mail.jar -Dgump.resource.jce=/srv/gump/packages/jce/jce-jdk13-116.jar
-Dmagic.home=/srv/gump/public/workspace/avalon-tools/tools/magic/target/01122009 -Dgump.resource.geronimo-spec-jms=/srv/gump/packages/jms1.1/lib/jms.jar
-Dgump.resource.cornerstone-scheduler-api=/srv/gump/public/workspace/excalibur/cornerstone/scheduler/api/target/cornerstone-scheduler-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.commons-logging=/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-01122009.jar
-Dgump.resource.excalibur-pool-impl=/srv/gump/public/workspace/excalibur/components/pool/impl/target/excalibur-pool-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.cornerstone-threads-api=/s
 rv/gump/public/workspace/excalibur/cornerstone/threads/api/target/cornerstone-threads-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.avalon-framework-api=/srv/gump/public/workspace/excalibur/framework/api/target/avalon-framework-api-4.3.2-SNAPSHOT.jar
-Dgump.resource.avalon-logkit=/srv/gump/packages/avalon/avalon-logkit-2.1.jar -Dgump.resource.cornerstone-connection-impl=/srv/gump/public/workspace/excalibur/cornerstone/connection/impl/target/cornerstone-connection-impl-2.2.3-SNAPSHOT.jar
-Dversion=01122009 -Dgump.resource.cornerstone-datasources-api=/srv/gump/public/workspace/excalibur/cornerstone/datasources/api/target/cornerstone-datasources-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.cornerstone-store-api=/srv/gump/public/workspace/excalibur/cornerstone/store/api/target/cornerstone-store-api-2.2.3-SNAPSHOT.jar
-Dbuild.sysclasspath=last -Dgump.resource.log4j=/srv/gump/public/workspace/logging-log4j-12/dist/lib/log4j-01122009.jar
-Dgump.resource.cornerstone-connection-api=/srv/gump/publ
 ic/workspace/excalibur/cornerstone/connection/api/target/cornerstone-connection-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.commons-net=/srv/gump/public/workspace/apache-commons/net/dist/commons-net-01122009.jar
-Dgump.resource.commons-pool=/srv/gump/public/workspace/apache-commons/pool/dist/commons-pool.jar
-Dgump.resource.bcmail=/srv/gump/packages/bouncycastle-jdk14/bcmail-130.jar -Dgump.signature=01122009
-Dgump.resource.commons-dbcp=/srv/gump/public/workspace/apache-commons/dbcp/dist/commons-dbcp.jar
-Dgump.resource.mailapi=/srv/gump/packages/javamail-1.4/mail.jar -Dgump.resource.excalibur-pool-api=/srv/gump/public/workspace/excalibur/components/pool/api/target/excalibur-pool-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.excalibur-thread-api=/srv/gump/public/workspace/excalibur/components/thread/api/target/excalibur-thread-api-2.2.3-SNAPSHOT.jar
-Dgump.resource.bcprov=/srv/gump/packages/bouncycastle-jdk14/bcprov-130.jar -Dgump.resource.cornerstone-sockets-api=/srv/gump/public/worksp
 ace/excalibur/cornerstone/sockets/api/target/cornerstone-sockets-api-2.2.3-SNAPSHOT.jar -Dgump.resource.cornerstone-threads-impl=/srv/gump/public/workspace/excalibur/cornerstone/threads/impl/target/cornerstone-threads-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.servletapi=/srv/gump/public/workspace/jakarta-servletapi-4/lib/servlet.jar
-Dgump.resource.avalon-meta-tools=/srv/gump/packages/avalon/avalon-meta-tools-1.4.0.jar -Dgump.resource.oro=/srv/gump/public/workspace/jakarta-oro/jakarta-oro-01122009.jar
-Dgump.resource.excalibur-thread-impl=/srv/gump/public/workspace/excalibur/components/thread/impl/target/excalibur-thread-impl-2.2.3-SNAPSHOT.jar
-Dgump.resource.avalon-framework-impl=/srv/gump/public/workspace/excalibur/framework/impl/target/avalon-framework-impl-4.3.2-SNAPSHOT.jar
-Dgump.resource.excalibur-datasource=/srv/gump/public/workspace/excalibur/components/datasource/target/excalibur-datasource-2.2.3-SNAPSHOT.jar
-Dgump.resource.activation=/srv/gump/packages/jaf-1.1ea/a
 ctivation.jar -Dgump.resource.concurrent=/srv/gump/packages/dougLea/concurrent.jar -Dgump.resource.commons-collections=/srv/gump/public/workspace/commons-collections-3.x/target/commons-collections-3.3-SNAPSHOT.jar

[Working Directory: /srv/gump/public/workspace/james-server]
CLASSPATH: /usr/lib/jvm/java-6-sun/lib/tools.jar:/srv/gump/public/workspace/james-mailet/target/apache-mailet-2.5-SNAPSHOT.jar:/srv/gump/public/workspace/avalon-tools/tools/magic/target/deliverables/jars/avalon-tools-magic-01122009.jar:/srv/gump/public/workspace/junit/dist/junit-01122009.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/ant/dist/lib/ant-trax.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/packages/junit3.8.1/junit.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/excalibur/framework/api/target/avalon-framework-api-4.3.2-SNAPSHOT.j
 ar:/srv/gump/packages/avalon/avalon-logkit-2.1.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/public/workspace/logging-log4j-12/dist/lib/log4j-01122009.jar:/srv/gump/public/workspace/jakarta-servletapi-4/lib/servlet.jar:/srv/gump/packages/jms1.1/lib/jms.jar:/srv/gump/public/workspace/excalibur/framework/impl/target/avalon-framework-impl-4.3.2-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/datasource/target/excalibur-datasource-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/pool/impl/target/excalibur-pool-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/pool/api/target/excalibur-pool-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/commons-collections-3.x/target/commons-collections-3.3-SNAPSHOT.jar:/srv/gump/packages/dougLea/concurrent.jar:/srv/gump/public/workspace/excalibur/cornerstone/threads/api/target/cornerstone-threads-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/thread/api/targ
 et/excalibur-thread-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/connection/api/target/cornerstone-connection-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/sockets/api/target/cornerstone-sockets-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/connection/impl/target/cornerstone-connection-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/threads/impl/target/cornerstone-threads-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/components/thread/impl/target/excalibur-thread-impl-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-01122009.jar:/srv/gump/public/workspace/excalibur/cornerstone/datasources/api/target/cornerstone-datasources-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/scheduler/api/target/cornerstone-scheduler-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/excalibur/cornerstone/store
 /api/target/cornerstone-store-api-2.2.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/net/dist/commons-net-01122009.jar:/srv/gump/public/workspace/apache-commons/dbcp/dist/commons-dbcp.jar:/srv/gump/public/workspace/apache-commons/pool/dist/commons-pool.jar:/srv/gump/public/workspace/jakarta-oro/jakarta-oro-01122009.jar:/srv/gump/public/workspace/james-server/stage/dnsjava/jars/dnsjava-2.0.6.jar:/srv/gump/packages/jaf-1.1ea/activation.jar:/srv/gump/packages/bouncycastle-jdk14/bcmail-130.jar:/srv/gump/packages/bouncycastle-jdk14/bcprov-130.jar:/srv/gump/packages/jce/jce-jdk13-116.jar:/srv/gump/packages/avalon/avalon-meta-tools-1.4.0.jar
---------------------------------------------
prepare-phoenix:
     [echo] Phoenix distribution present - adjusting linefeeds and permissions, copying files
     [copy] Copying 71 files to /srv/gump/public/workspace/james-server/phoenix-deployment/dist/james-server-01122009
     [copy] Copying 6 files to /srv/gump/public/workspace/james-server/phoenix-deployment/dist/james-server-01122009/lib
     [copy] Copying 1 file to /srv/gump/public/workspace/james-server/phoenix-deployment/dist/james-server-01122009/bin

prepare-mxinfo:
    [mkdir] Created dir: /srv/gump/public/workspace/james-server/phoenix-deployment/target/classes
[generatemeta] Writing Info descriptors as legacy xml.

prepare-metainf:
     [copy] Copying 1 file to /srv/gump/public/workspace/james-server/phoenix-deployment/target/meta-inf

prepare:

compile-main:
     [echo] Compiling James Java sources
    [javac] Compiling 7 source files to /srv/gump/public/workspace/james-server/phoenix-deployment/target/classes
     [copy] Copying 2 files to /srv/gump/public/workspace/james-server/phoenix-deployment/target/classes

compile-proposal:

compile:

unit-tests-classpath:

compile-unit-tests:
     [echo] Compiling James Unit Test Java sources
    [mkdir] Created dir: /srv/gump/public/workspace/james-server/phoenix-deployment/target/test
    [mkdir] Created dir: /srv/gump/public/workspace/james-server/phoenix-deployment/target/test/classes
    [javac] Compiling 5 source files to /srv/gump/public/workspace/james-server/phoenix-deployment/target/test/classes
    [javac] /srv/gump/public/workspace/james-server/phoenix-deployment/src/test/org/apache/james/JamesTest.java:161:
warning: [deprecation] isLocalUser(java.lang.String) in org.apache.mailet.MailetContext has
been deprecated
    [javac]         return ((MailetContext)mailServerImpl).isLocalUser(username);
    [javac]                                               ^
    [javac] 1 warning
     [copy] Copying 17 files to /srv/gump/public/workspace/james-server/phoenix-deployment/target/test/classes

run-unit-tests:
     [echo] Running James Unit Tests in directory /srv/gump/public/workspace/james-server/phoenix-deployment
    [mkdir] Created dir: /srv/gump/public/workspace/james-server/phoenix-deployment/target/test/reports
    [junit] Running org.apache.james.AvalonJamesTest
    [junit] Tests run: 5, Failures: 0, Errors: 5, Time elapsed: 0.483 sec

BUILD FAILED
/srv/gump/public/workspace/james-server/build.xml:164: The following error occurred while
executing this line:
/srv/gump/public/workspace/james-server/build.xml:84: The following error occurred while executing
this line:
/srv/gump/public/workspace/james-server/build.xml:40: The following error occurred while executing
this line:
/srv/gump/public/workspace/james-server/phoenix-deployment/build.xml:896: Test org.apache.james.AvalonJamesTest
failed

Total time: 7 minutes 42 seconds
---------------------------------------------

To subscribe to this information via syndicated feeds:
- RSS: http://vmgump.apache.org/gump/public/james-server/james-server/rss.xml
- Atom: http://vmgump.apache.org/gump/public/james-server/james-server/atom.xml

============================== Gump Tracking Only ===
Produced by Gump version 2.3.
Gump Run 09000001122009, vmgump:vmgump-public:09000001122009
Gump E-mail Identifier (unique within run) #41.

--
Apache Gump
http://gump.apache.org/ [Instance: vmgump]

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



</pre>
</div>
</content>
</entry>
<entry>
<title>[HUPA] Re: running Hupa</title>
<author><name>Norman Maurer &lt;norman.maurer@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200912.mbox/%3c75bda7a00911302246m7504921dp8b2e151326de7909@mail.gmail.com%3e"/>
<id>urn:uuid:%3c75bda7a00911302246m7504921dp8b2e151326de7909@mail-gmail-com%3e</id>
<updated>2009-12-01T06:46:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Alex,

did you read this too (about setting up maven plugin):

http://james.apache.org/hupa/dev/environment.html

HUPA is workin here on my MAC without a problem after a fresh checkout.

BTW, Feedback welcome ;)


Thx,
Norman

Ps: I cc server-dev at apache dot org because this is the ml used for
HUPA. So please include the list in your response ;)

2009/11/30 Alex Harvey &lt;alexanderharvey@gmail.com&gt;:
&gt; Hi Norman,
&gt;
&gt; I've been trying to run Hupa myself to study how you have incorporated the
&gt; recent gwt-presenter refactorings. On OS X I have closely followed the
&gt; directions from the hupa site and the README.TXT file.
&gt;
&gt; I'm having two problems. In Eclipse I cannot seem to be able to specify a
&gt; module in the Run Configuration:
&gt;
&gt; Missing required argument 'module[s]'
&gt;
&gt; When I try and add a module in the GWT tab none show up for some reason even
&gt; when clicking the add button.
&gt;
&gt; I've also tried to run from the command line using gwt:run but the hosted
&gt; mode browser doesn't seem to locate the module either even if I browse to
&gt; the hup.html file.
&gt;
&gt; Any advice on how I might get going?
&gt;
&gt; Thanks,
&gt;
&gt; Alex
&gt;

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



</pre>
</div>
</content>
</entry>
<entry>
<title>=?UTF-8?Q?Hudson_build_is_back_to_stable?= =?UTF-8?Q?:_hupa-trunk_=C2=BB_hupa-server_#37?=</title>
<author><name>Apache Hudson Server &lt;hudson@hudson.zones.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200911.mbox/%3c4326582.3731259613183011.JavaMail.hudson@hudson.zones.apache.org%3e"/>
<id>urn:uuid:%3c4326582-3731259613183011-JavaMail-hudson@hudson-zones-apache-org%3e</id>
<updated>2009-11-30T20:33:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
See &lt;http://hudson.zones.apache.org/hudson/job/hupa-trunk/org.apache.hupa$hupa-server/37/changes&gt;



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



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r885575 - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/mvp/ server/src/main/java/org/apache/hupa/server/guice/ server/src/main/java/org/apache/hupa/server/handler/ server/src/main/java/org/apache/hupa/server/mock/ serve...</title>
<author><name>norman@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-server-dev/200911.mbox/%3c20091130202514.C1D3623889BF@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091130202514-C1D3623889BF@eris-apache-org%3e</id>
<updated>2009-11-30T20:25:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: norman
Date: Mon Nov 30 20:25:13 2009
New Revision: 885575

URL: http://svn.apache.org/viewvc?rev=885575&amp;view=rev
Log:
Only send idle command if the store supports it.Rename Noop* to Idle* which better reflect
the real purpose (HUPA-56)

Added:
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/IdleHandler.java
      - copied, changed from r885569, james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/NoopHandler.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/IdleHandlerTest.java
      - copied, changed from r885528, james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/NoopHandlerTest.java
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/Idle.java
      - copied, changed from r885528, james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/Noop.java
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/IdleResult.java
      - copied, changed from r885528, james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/NoopResult.java
Removed:
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/NoopHandler.java
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/NoopHandlerTest.java
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/Noop.java
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/NoopResult.java
Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServerModule.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/PrepareNewMessageHandler.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java?rev=885575&amp;r1=885574&amp;r2=885575&amp;view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java Mon
Nov 30 20:25:13 2009
@@ -40,8 +40,8 @@
 import org.apache.hupa.shared.rpc.CheckSessionResult;
 import org.apache.hupa.shared.rpc.LogoutUser;
 import org.apache.hupa.shared.rpc.LogoutUserResult;
-import org.apache.hupa.shared.rpc.Noop;
-import org.apache.hupa.shared.rpc.NoopResult;
+import org.apache.hupa.shared.rpc.Idle;
+import org.apache.hupa.shared.rpc.IdleResult;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.ClickEvent;
@@ -71,7 +71,7 @@
         public void setServerStatus(ServerStatus status);
     }
 
-    private Timer noopTimer = new NoopTimer();
+    private Timer noopTimer = new IdleTimer();
 
     private DispatchAsync dispatcher;
     private User user;
@@ -195,14 +195,19 @@
         });
     }
     
-    private class NoopTimer extends Timer {
+    private class IdleTimer extends Timer {
         boolean running = false;
         public void run() {
             if (!running) {
                 running = true;
-                dispatcher.execute(new Noop(), new HupaCallback&lt;NoopResult&gt;(dispatcher,
eventBus) {
-                    public void callback(NoopResult result) {
+                dispatcher.execute(new Idle(), new HupaCallback&lt;IdleResult&gt;(dispatcher,
eventBus) {
+                    public void callback(IdleResult result) {
                         running = false;
+                        // check if the server is not supporting the Idle command.
+                        // if so cancel this Timer
+                        if (result.isSupported() == false) {
+                            IdleTimer.this.cancel();
+                        }
                         // Noop
                         // TODO: put code here to read new events from server (new messages
...)
                     }

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=885575&amp;r1=885574&amp;r2=885575&amp;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
Mon Nov 30 20:25:13 2009
@@ -44,7 +44,7 @@
 import org.apache.hupa.server.handler.LoginUserHandler;
 import org.apache.hupa.server.handler.LogoutUserHandler;
 import org.apache.hupa.server.handler.MoveMessageHandler;
-import org.apache.hupa.server.handler.NoopHandler;
+import org.apache.hupa.server.handler.IdleHandler;
 import org.apache.hupa.server.handler.RenameFolderHandler;
 import org.apache.hupa.server.handler.ReplyMessageHandler;
 import org.apache.hupa.server.handler.SendMessageHandler;
@@ -94,7 +94,7 @@
         bindHandler(SendMessageHandler.class);
         bindHandler(ReplyMessageHandler.class);
         bindHandler(ForwardMessageHandler.class);
-        bindHandler(NoopHandler.class);
+        bindHandler(IdleHandler.class);
         bindHandler(MoveMessageHandler.class);
         bindHandler(RenameFolderHandler.class);
         bindHandler(DeleteFolderHandler.class);

Copied: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/IdleHandler.java
(from r885569, james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/NoopHandler.java)
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/IdleHandler.java?p2=james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/IdleHandler.java&amp;p1=james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/NoopHandler.java&amp;r1=885569&amp;r2=885575&amp;rev=885575&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/NoopHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/IdleHandler.java
Mon Nov 30 20:25:13 2009
@@ -19,7 +19,6 @@
 
 package org.apache.hupa.server.handler;
 
-import javax.mail.MessagingException;
 import javax.servlet.http.HttpSession;
 
 import net.customware.gwt.dispatch.server.ExecutionContext;
@@ -28,8 +27,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.hupa.server.IMAPStoreCache;
 import org.apache.hupa.server.guice.DemoModeConstants;
-import org.apache.hupa.shared.rpc.Noop;
-import org.apache.hupa.shared.rpc.NoopResult;
+import org.apache.hupa.shared.rpc.Idle;
+import org.apache.hupa.shared.rpc.IdleResult;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -40,11 +39,11 @@
  * 
  *
  */
-public class NoopHandler extends AbstractSessionHandler&lt;Noop, NoopResult&gt;{
+public class IdleHandler extends AbstractSessionHandler&lt;Idle, IdleResult&gt;{
 
 
     @Inject
-    public NoopHandler(IMAPStoreCache cache, Log logger, Provider&lt;HttpSession&gt; provider)
{
+    public IdleHandler(IMAPStoreCache cache, Log logger, Provider&lt;HttpSession&gt; provider)
{
         super(cache,logger,provider);
     }
     
@@ -52,7 +51,7 @@
      * (non-Javadoc)
      * @see org.apache.hupa.server.handler.AbstractSessionHandler#executeInternal(org.apache.hupa.shared.rpc.Session,
net.customware.gwt.dispatch.server.ExecutionContext)
      */
-    public NoopResult executeInternal(Noop action, ExecutionContext context)
+    public IdleResult executeInternal(Idle action, ExecutionContext context)
             throws ActionException {
         try {
             IMAPStore store = cache.get(getUser());
@@ -64,10 +63,12 @@
                 if (store.hasCapability("IDLE")) {
                     // just send a noop to keep the connection alive
                     store.idle();
+                } else {
+                    return new IdleResult(false);
                 }
                
             }
-            return new NoopResult();
+            return new IdleResult(true);
         } catch (Exception e) {
             throw new ActionException("Unable to send NOOP " + e.getMessage());
         }
@@ -77,8 +78,8 @@
      * (non-Javadoc)
      * @see net.customware.gwt.dispatch.server.ActionHandler#getActionType()
      */
-    public Class&lt;Noop&gt; getActionType() {
-        return Noop.class;
+    public Class&lt;Idle&gt; getActionType() {
+        return Idle.class;
     }
 
 }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/PrepareNewMessageHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/PrepareNewMessageHandler.java?rev=885575&amp;r1=885574&amp;r2=885575&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/PrepareNewMessageHandler.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/PrepareNewMessageHandler.java
Mon Nov 30 20:25:13 2009
@@ -27,8 +27,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.hupa.server.IMAPStoreCache;
 import org.apache.hupa.server.guice.DemoModeConstants;
-import org.apache.hupa.shared.rpc.Noop;
-import org.apache.hupa.shared.rpc.NoopResult;
+import org.apache.hupa.shared.rpc.Idle;
+import org.apache.hupa.shared.rpc.IdleResult;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -39,7 +39,7 @@
  * 
  *
  */
-public class PrepareNewMessageHandler extends AbstractSessionHandler&lt;Noop, NoopResult&gt;{
+public class PrepareNewMessageHandler extends AbstractSessionHandler&lt;Idle, IdleResult&gt;{
 
 
     @Inject
@@ -51,7 +51,7 @@
      * (non-Javadoc)
      * @see org.apache.hupa.server.handler.AbstractSessionHandler#executeInternal(org.apache.hupa.shared.rpc.Session,
net.customware.gwt.dispatch.server.ExecutionContext)
      */
-    public NoopResult executeInternal(Noop action, ExecutionContext context)
+    public IdleResult executeInternal(Idle action, ExecutionContext context)
             throws ActionException {
         try {
             IMAPStore store = cache.get(getUser());
@@ -60,7 +60,7 @@
                 // just send a noop to keep the connection alive
                 store.idle();
             }
-            return new NoopResult();
+            return new IdleResult(false);
         } catch (Exception e) {
             throw new ActionException("Unable to send NOOP " + e.getMessage());
         }
@@ -70,8 +70,8 @@
      * (non-Javadoc)
      * @see net.customware.gwt.dispatch.server.ActionHandler#getActionType()
      */
-    public Class&lt;Noop&gt; getActionType() {
-        return Noop.class;
+    public Class&lt;Idle&gt; getActionType() {
+        return Idle.class;
     }
 
 }

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java?rev=885575&amp;r1=885574&amp;r2=885575&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/mock/MockIMAPStore.java Mon
Nov 30 20:25:13 2009
@@ -41,6 +41,7 @@
     private Map&lt;String, Integer&gt; validServers = new HashMap&lt;String, Integer&gt;();
     private boolean connected = false;
     private List&lt;MockIMAPFolder&gt; folders = new ArrayList&lt;MockIMAPFolder&gt;();
+    private List&lt;String&gt; capList;
     static final URLName demoUrl = new URLName(null, DemoModeConstants.DEMO_MODE, 143, null,
null, null);
     
     /**
@@ -213,4 +214,14 @@
         throw new AuthenticationFailedException("Invalid login");
     }
 
+    @Override
+    public synchronized boolean hasCapability(String capability) throws MessagingException
{
+        if (capList == null) return false;
+        return capList.contains(capability);
+    }
+    
+    public void setCapabilities(List&lt;String&gt; capList) {
+        this.capList = capList;
+    }
+
 }

Copied: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/IdleHandlerTest.java
(from r885528, james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/NoopHandlerTest.java)
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/IdleHandlerTest.java?p2=james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/IdleHandlerTest.java&amp;p1=james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/NoopHandlerTest.java&amp;r1=885528&amp;r2=885575&amp;rev=885575&amp;view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/NoopHandlerTest.java
(original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/IdleHandlerTest.java
Mon Nov 30 20:25:13 2009
@@ -22,19 +22,19 @@
 import net.customware.gwt.dispatch.shared.ActionException;
 
 import org.apache.hupa.shared.data.User;
-import org.apache.hupa.shared.rpc.Noop;
-import org.apache.hupa.shared.rpc.NoopResult;
+import org.apache.hupa.shared.rpc.Idle;
+import org.apache.hupa.shared.rpc.IdleResult;
 
-public class NoopHandlerTest extends AbstractHandlerTest{
+public class IdleHandlerTest extends AbstractHandlerTest{
 
     public void testNoop() {
-        NoopHandler handler = new NoopHandler(storeCache, logger, httpSessionProvider);
+        IdleHandler handler = new IdleHandler(storeCache, logger, httpSessionProvider);
         User user = createUser();
-        Noop action = new Noop();
+        Idle action = new Idle();
         storeCache.addValidUser(user.getName(), user.getPassword());
         httpSession.setAttribute("user", user);
         try {
-            NoopResult result = handler.execute(action, null);
+            IdleResult result = handler.execute(action, null);
             assertNotNull(result);
         } catch (ActionException e) {
             e.printStackTrace();

Copied: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/Idle.java (from r885528,
james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/Noop.java)
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/Idle.java?p2=james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/Idle.java&amp;p1=james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/Noop.java&amp;r1=885528&amp;r2=885575&amp;rev=885575&amp;view=diff
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/Noop.java (original)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/Idle.java Mon Nov 30
20:25:13 2009
@@ -22,7 +22,7 @@
 import net.customware.gwt.dispatch.shared.Action;
 
 
-public class Noop implements Action&lt;NoopResult&gt;{
+public class Idle implements Action&lt;IdleResult&gt;{
 
     private static final long serialVersionUID = 4076791577558340559L;
 

Copied: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/IdleResult.java (from
r885528, james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/NoopResult.java)
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/IdleResult.java?p2=james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/IdleResult.java&amp;p1=james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/NoopResult.java&amp;r1=885528&amp;r2=885575&amp;rev=885575&amp;view=diff
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/NoopResult.java (original)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/IdleResult.java Mon Nov
30 20:25:13 2009
@@ -21,8 +21,26 @@
 
 import net.customware.gwt.dispatch.shared.Result;
 
-public class NoopResult implements Result {
+public class IdleResult implements Result {
 
     private static final long serialVersionUID = 5530385273335407315L;
+    private boolean supported;
+    
+    protected IdleResult() {
+        
+    }
+    
+    public IdleResult(boolean supported) {
+        this.supported = supported;
+    }
+    
+    /**
+     * Return if the IDLE command is supported by the server
+     * 
+     * @return supported
+     */
+    public boolean isSupported() {
+        return supported;
+    }
 
 }



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



</pre>
</div>
</content>
</entry>
</feed>
