svn commit: r1336521 - 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/utils/ se

2012-05-10 Thread manolo
Author: manolo
Date: Thu May 10 08:00:53 2012
New Revision: 1336521

URL: http://svn.apache.org/viewvc?rev=1336521view=rev
Log:
Encode unstructures RFC 822 ^Caders when sending emails

Modified:

james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.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/AbstractSendMessageHandler.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/handler/ContactsHandlerTest.java

james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java

james/hupa/trunk/server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java

Modified: 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java?rev=1336521r1=1336520r2=1336521view=diff
==
--- 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java 
(original)
+++ 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java 
Thu May 10 08:00:53 2012
@@ -133,7 +133,8 @@ public class LoginView extends Composite
 if (event.getSource().equals(usernameTextBox)) {
 passwordTextBox.setFocus(true);
 }  else if (event.getSource().equals(passwordTextBox)) {
-formPanel.submit();
+submitButton.click();
+//formPanel.submit();
 }
 }
 }

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=1336521r1=1336520r2=1336521view=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
 Thu May 10 08:00:53 2012
@@ -19,9 +19,18 @@
 
 package org.apache.hupa.server.handler;
 
-import com.google.inject.Provider;
+import java.io.IOException;
+import java.util.ArrayList;
 
-import com.sun.mail.imap.IMAPStore;
+import javax.mail.Address;
+import javax.mail.FetchProfile;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.Part;
+import javax.mail.UIDFolder;
+import javax.mail.internet.MimeMessage.RecipientType;
+import javax.servlet.http.HttpSession;
 
 import net.customware.gwt.dispatch.server.ExecutionContext;
 import net.customware.gwt.dispatch.shared.ActionException;
@@ -29,27 +38,16 @@ import net.customware.gwt.dispatch.share
 import org.apache.commons.logging.Log;
 import org.apache.hupa.server.IMAPStoreCache;
 import org.apache.hupa.server.preferences.UserPreferencesStorage;
+import org.apache.hupa.server.utils.MessageUtils;
 import org.apache.hupa.shared.data.IMAPFolder;
+import org.apache.hupa.shared.data.Message.IMAPFlag;
 import org.apache.hupa.shared.data.Tag;
 import org.apache.hupa.shared.data.User;
-import org.apache.hupa.shared.data.Message.IMAPFlag;
 import org.apache.hupa.shared.rpc.FetchMessages;
 import org.apache.hupa.shared.rpc.FetchMessagesResult;
 
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-
-import javax.mail.Address;
-import javax.mail.FetchProfile;
-import javax.mail.Message;
-import javax.mail.MessagingException;
-import javax.mail.Multipart;
-import javax.mail.Part;
-import javax.mail.UIDFolder;
-import javax.mail.internet.MimeUtility;
-import javax.mail.internet.MimeMessage.RecipientType;
-import javax.servlet.http.HttpSession;
+import com.google.inject.Provider;
+import com.sun.mail.imap.IMAPStore;
 
 public abstract class AbstractFetchMessagesHandler A extends FetchMessages 
extends AbstractSessionHandlerA, FetchMessagesResult{
 
@@ -128,13 +126,13 @@ public abstract class AbstractFetchMessa
 Message m = messages[i];
 String from = null;
 if (m.getFrom() != null  m.getFrom().length 0 ) {
-from = decodeText(m.getFrom()[0].toString());
+from = MessageUtils.decodeText(m.getFrom()[0].toString());
 }
 msg.setFrom(from);
 
 String replyto = null;
 if (m.getReplyTo() != null  m.getReplyTo().length 0 ) {
-replyto = decodeText(m.getReplyTo()[0].toString());
+replyto = 
MessageUtils.decodeText(m.getReplyTo()[0].toString());

svn commit: r1336525 - in /james/hupa/trunk: server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java server/src/test/java/org/apache/hupa/server/utils/MessageUtilsTest.java shared/src/main

2012-05-10 Thread manolo
Author: manolo
Date: Thu May 10 08:06:01 2012
New Revision: 1336525

URL: http://svn.apache.org/viewvc?rev=1336525view=rev
Log:
fix tests

Modified:

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/utils/MessageUtilsTest.java

james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/ContactsResult.java

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=1336525r1=1336524r2=1336525view=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
 Thu May 10 08:06:01 2012
@@ -191,7 +191,6 @@ public class MessageUtils {
 } catch (UnsupportedEncodingException e) {
 System.out.println(e.getMessage());
 }
-System.out.println(s +   + ret);
 ret =  ret
   // Remove quotes around names in email addresses
   .replaceFirst(^[\' ]+([^\]*)[\' ]+, $1 );

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=1336525r1=1336524r2=1336525view=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
 Thu May 10 08:06:01 2012
@@ -58,7 +58,7 @@ public class MessageUtilsTest extends Hu
 }
 
 public void testGetRecipients () throws Exception  {
-String encodedEmail = =?ISO-8859-1?Q?Manolo=20Pe=F1a?= 
he...@hupa.org;
+String encodedEmail = =?ISO-8859-1?Q?Manolo_Pe=F1a?= 
he...@hupa.org;
 String decodedEmail = MessageUtils.decodeText(encodedEmail);
 assertFalse(encodedEmail.equals(decodedEmail));
 

Modified: 
james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/ContactsResult.java
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/ContactsResult.java?rev=1336525r1=1336524r2=1336525view=diff
==
--- 
james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/ContactsResult.java
 (original)
+++ 
james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rpc/ContactsResult.java
 Thu May 10 08:06:01 2012
@@ -34,12 +34,16 @@ public class ContactsResult implements R
}
 
public Contact(String address) {
-   mail = address.replaceAll(^.*([^]+), $1);
+   mail = address.replaceAll(^.*([^]+)\\s*$, $1);
 
realname = mail.equals(address) ? mail : address
-   .replaceAll(.+$, )
-   .replaceAll(^[\\s\']+, )
-   .replaceAll([\\s\']+$, );
+   // remove the email part
+   .replaceAll([^]+\\s*$, )
+   // remove start symbols in the name
+   .replaceAll(^[\\s\']+, )
+   // remove end symbols in the name
+   .replaceAll([\\s\']+$, )
+   ;
 
if (realname.isEmpty())
realname = mail;



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



svn commit: r1336542 - /james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java

2012-05-10 Thread manolo
Author: manolo
Date: Thu May 10 08:56:18 2012
New Revision: 1336542

URL: http://svn.apache.org/viewvc?rev=1336542view=rev
Log:
Fix NPE

Modified:

james/hupa/trunk/server/src/main/java/org/apache/hupa/server/utils/MessageUtils.java

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=1336542r1=1336541r2=1336542view=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
 Thu May 10 08:56:18 2012
@@ -203,6 +203,9 @@ public class MessageUtils {
  * =?ISO-8859-1?Q?No=20hay=20ma=F1ana?= he...@hupa.org 
  */
 public static String encodeEmail(String s) {
+if (s == null) {
+return s;
+}
 Pattern p = Pattern.compile(^\\s*(.*?)\\s*([^]+)\\s*);
 Matcher m = p.matcher(s);
 return m.matches() ? encodeTexts(m.group(1)) +   + m.group(2) : s;
@@ -213,9 +216,11 @@ public class MessageUtils {
  */
 public static String encodeTexts(String s) {
 String ret = s;
-try {
-ret = MimeUtility.encodeText(s, ISO-8859-1, null);
-} catch (UnsupportedEncodingException e) {
+if (s != null) {
+try {
+ret = MimeUtility.encodeText(s, ISO-8859-1, null);
+} catch (UnsupportedEncodingException e) {
+}
 }
 return ret;
 }



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



Re: work on Apache CMS site migration

2012-05-10 Thread Stefano Bagnara
2012/5/8 Ioan Eugen Stan stan.ieu...@gmail.com:
 The design is not done and there is much to be done but I wanted to
 get some impressions before I continue. Some things that come to my
 mind:
 - integrate with Google search and analytics

Yes, this is important. Expecially the Analytics part, as we want to
be able to measure things to understand if what we do works or not.

 - finish integration with twitter
 - design some aggregation pages similar to [2], [3]

IMO it has a much higher priority to let the CMS skin  and the maven
skin to match their look. Once the pages can be mixed together we can
go live, and after this we can start adding new docs/aggregation
pages.
Remember we have maven-generated docs that will probably have to be
interlinked with CMS pages. This page, for example, is automatically
generated by Maven using javadocs and source code, so I don't expect
to be able to move that to CMS:
http://james.apache.org/mailet/standard/mailet-report.html

I prefer our current skin to the new one (as it is right now) because
it is much more readable:
http://james.apache.org/server/3/config-users.html
http://james.staging.apache.org/server/config-users.html
I don't see paragraph titles in the new pages.

I'm not against moving to a new skin/layout, but we should keep
consistency and readability.
Also, make sure urls do not change, so in this case it is missing a
/3/ in the path.

The idea is that you should just replace james.apache.org with
james.staging.apache.org to see any page that we're going to move
from maven to CMS.

Stefano

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



svn commit: r1336662 - in /james/app/trunk: pom.xml src/main/resources/META-INF/org/apache/james/spring-server.xml src/main/resources/log4j-template.properties src/main/resources/log4j.properties

2012-05-10 Thread ieugen
Author: ieugen
Date: Thu May 10 13:12:02 2012
New Revision: 1336662

URL: http://svn.apache.org/viewvc?rev=1336662view=rev
Log:
MAILBOX-152

- added jetm monitoring in app for most beans 
- monitoring can be enable/disabled by configuration alone

Modified:
james/app/trunk/pom.xml

james/app/trunk/src/main/resources/META-INF/org/apache/james/spring-server.xml
james/app/trunk/src/main/resources/log4j-template.properties
james/app/trunk/src/main/resources/log4j.properties

Modified: james/app/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/app/trunk/pom.xml?rev=1336662r1=1336661r2=1336662view=diff
==
--- james/app/trunk/pom.xml (original)
+++ james/app/trunk/pom.xml Thu May 10 13:12:02 2012
@@ -18,7 +18,7 @@
 under the License.
 --
 project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;
-
+
 modelVersion4.0.0/modelVersion
 
 parent
@@ -42,7 +42,7 @@
 /scm
 
 properties
-
+
 james.server.version3.0-beta5-SNAPSHOT/james.server.version
 
 !-- For more details see --
@@ -75,7 +75,7 @@
 
james.system-properties${james.system-property1}/james.system-properties
 !-- this name is used for James's folders on Debian systems and james 
user --
 james.debian.userjames/james.debian.user
-
+
 /properties
 
 dependencies
@@ -415,7 +415,7 @@
 version${james.server.version}/version
 /dependency
 
-!-- 
+!--
 dependency
 groupIdorg.apache.james/groupId
 artifactIdapache-james-imap-processor/artifactId
@@ -428,6 +428,16 @@
 scoperuntime/scope
 version${protocols.version}/version
 /dependency
+dependency
+groupIdfm.void.jetm/groupId
+artifactIdjetm/artifactId
+version1.2.3/version
+/dependency
+dependency
+groupIdfm.void.jetm/groupId
+artifactIdjetm-optional/artifactId
+version1.2.3/version
+/dependency
 /dependencies
 
 build
@@ -860,7 +870,7 @@
 /plugins
 
 /build
-
+
 profiles
 profile
 idmake-deb/id
@@ -1009,5 +1019,5 @@
 /build
 /profile
   /profiles
-
+
 /project

Modified: 
james/app/trunk/src/main/resources/META-INF/org/apache/james/spring-server.xml
URL: 
http://svn.apache.org/viewvc/james/app/trunk/src/main/resources/META-INF/org/apache/james/spring-server.xml?rev=1336662r1=1336661r2=1336662view=diff
==
--- 
james/app/trunk/src/main/resources/META-INF/org/apache/james/spring-server.xml 
(original)
+++ 
james/app/trunk/src/main/resources/META-INF/org/apache/james/spring-server.xml 
Thu May 10 13:12:02 2012
@@ -18,28 +18,30 @@
   under the License.
 --
 
-beans xmlns=http://www.springframework.org/schema/beans; 
+beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:camel=http://camel.apache.org/schema/spring;
-   xmlns:amq=http://activemq.apache.org/schema/core; 
+   xmlns:amq=http://activemq.apache.org/schema/core;
+   xmlns:jetm=http://jetm.void.fm/schema/jetm_spring_config_1_2;
xsi:schemaLocation=
   http://www.springframework.org/schema/beans 
classpath:org/springframework/beans/factory/xml/spring-beans-3.0.xsd
   http://camel.apache.org/schema/spring classpath:camel-spring.xsd
-  http://activemq.apache.org/schema/core classpath:activemq.xsd
+  http://activemq.apache.org/schema/core classpath:activemq.xsd
+  http://jetm.void.fm/schema/jetm_spring_config_1_2 
http://jetm.void.fm/schema/jetm_spring_config_1_2.xsd;
 
 !-- 
 ===
Spring Wiring for James Server: Annotation, Bean Post-Processors...
 ===
 --
-  
+
 !-- 
   Enable Java Annotations processing.
  --
 bean 
class=org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
 property name=order value=3 /
 /bean
-
+
 !-- 
   Enable support for Persistence Annotations processing.
  --
@@ -124,7 +126,7 @@
Queues
 ===
 --
-  
+
 !-- 
   Mail Queue Factory
  --
@@ -182,12 +184,12 @@
Mailet Container
 ===
 --
-  
+
 !-- 
   Mailet Container Beans.
  --
 bean id=mailprocessor name=processorRoute 
class=org.apache.james.mailetcontainer.impl.camel.CamelCompositeProcessor/
-  
+
 !-- 
   !!! mailetcontext bean must be 

[jira] [Created] (JAMESAPP-9) JETM performance monitoring

2012-05-10 Thread Ioan Eugen Stan (JIRA)
Ioan Eugen Stan created JAMESAPP-9:
--

 Summary: JETM performance monitoring
 Key: JAMESAPP-9
 URL: https://issues.apache.org/jira/browse/JAMESAPP-9
 Project: JAMES App
  Issue Type: New Feature
Affects Versions: 3.0-beta5
Reporter: Ioan Eugen Stan
Assignee: Ioan Eugen Stan
 Fix For: 3.0-beta5


Provide performance measuring with JETM so we can get insight into how mailbox 
implementations perform. Extend to other parts of James.

http://jetm.void.fm/


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



[jira] [Commented] (JAMESAPP-9) JETM performance monitoring

2012-05-10 Thread Ioan Eugen Stan (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMESAPP-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13272312#comment-13272312
 ] 

Ioan Eugen Stan commented on JAMESAPP-9:


You can view monitoring result on the machine that runs the server by going to: 
http://localhost:4



 JETM performance monitoring
 ---

 Key: JAMESAPP-9
 URL: https://issues.apache.org/jira/browse/JAMESAPP-9
 Project: JAMES App
  Issue Type: New Feature
Affects Versions: 3.0-beta5
Reporter: Ioan Eugen Stan
Assignee: Ioan Eugen Stan
 Fix For: 3.0-beta5


 Provide performance measuring with JETM so we can get insight into how 
 mailbox implementations perform. Extend to other parts of James.
 http://jetm.void.fm/

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



[jira] [Resolved] (MAILBOX-152) JETM performance monitoring

2012-05-10 Thread Ioan Eugen Stan (JIRA)

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

Ioan Eugen Stan resolved MAILBOX-152.
-

Resolution: Duplicate

 JETM performance monitoring
 ---

 Key: MAILBOX-152
 URL: https://issues.apache.org/jira/browse/MAILBOX-152
 Project: James Mailbox
  Issue Type: New Feature
  Components: hbase, jcr, jpa, maildir, spring
Affects Versions: 0.4
Reporter: Ioan Eugen Stan
Assignee: Ioan Eugen Stan

 Provide performance measuring with JETM so we can get insight into how 
 mailbox implementations perform. Extend to other parts of James. 
 http://jetm.void.fm/

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



[jira] [Resolved] (JAMESAPP-9) JETM performance monitoring

2012-05-10 Thread Ioan Eugen Stan (JIRA)

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

Ioan Eugen Stan resolved JAMESAPP-9.


Resolution: Fixed

 JETM performance monitoring
 ---

 Key: JAMESAPP-9
 URL: https://issues.apache.org/jira/browse/JAMESAPP-9
 Project: JAMES App
  Issue Type: New Feature
Affects Versions: 3.0-beta5
Reporter: Ioan Eugen Stan
Assignee: Ioan Eugen Stan
 Fix For: 3.0-beta5


 Provide performance measuring with JETM so we can get insight into how 
 mailbox implementations perform. Extend to other parts of James.
 http://jetm.void.fm/

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



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



new monitoring solution available

2012-05-10 Thread Ioan Eugen Stan
Hi,

I've committed the changes needed to add jetm performance monitoring.
It uses Spring AOP and can be enabled/ disa bled by configuration for
every bean that we create.

The project home-page shows some stuff that you can do with it:
http://jetm.void.fm/views/monitoring_examples.html

It's in the same bucket as JMX but it has the advantage of being very
easy to enable/disable without code.

Cheers,

-- 
Ioan Eugen Stan
http://ieugen.blogspot.com/  *** http://bucharest-jug.github.com/ ***

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



svn commit: r1336796 - /james/server/trunk/src/site/xdoc/dev-extend-mailet.xml

2012-05-10 Thread eric
Author: eric
Date: Thu May 10 17:02:27 2012
New Revision: 1336796

URL: http://svn.apache.org/viewvc?rev=1336796view=rev
Log:
More documentation regarding logging in mailets

Modified:
james/server/trunk/src/site/xdoc/dev-extend-mailet.xml

Modified: james/server/trunk/src/site/xdoc/dev-extend-mailet.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/src/site/xdoc/dev-extend-mailet.xml?rev=1336796r1=1336795r2=1336796view=diff
==
--- james/server/trunk/src/site/xdoc/dev-extend-mailet.xml (original)
+++ james/server/trunk/src/site/xdoc/dev-extend-mailet.xml Thu May 10 17:02:27 
2012
@@ -57,6 +57,28 @@ methods./p
 pThe value of getMailetInfo() for the Mailet is prepended to the log entries 
for that 
 Mailet.  So it may be desirable for you to override this method so you can 
distinguish mailet
 log entries by Mailet./p
+pAlternatively, you can instanciate your own logger and log with different 
level, as show in the
+following snippet (don't forget to update the log4j.properties so you log are 
taken into account)./p
+code
+package com.test;
+
+import javax.mail.MessagingException;
+
+import org.apache.mailet.Mail;
+import org.apache.mailet.base.GenericMailet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MyMailet extends GenericMailet{
+  private static final Logger logger = LoggerFactory.getLogger(MyMailet.class);
+  @Override
+  public void service(Mail mail) throws MessagingException {
+log(log via mailet logger with INFO level);
+logger.info(Log via slf4j with INFO level !!! Add 
log4j.logger.com.test=INFO, CONS, FILE in the log4j.properties);
+logger.debug(Log via slf4j with DEBUG level !!! Add 
log4j.logger.com.test=DEBUG, CONS, FILE in the log4j.properties);
+  }
+}
+/code
 /subsection
 
 subsection name=Initialization



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



Re: Custom Mailet Logfile

2012-05-10 Thread Eric Charles

Hi,

The following snippet should work, but you need to configure 
log4j.properties.


I've updated the doc accordingly.

Thx, Eric

package com.test;

import javax.mail.MessagingException;

import org.apache.mailet.Mail;
import org.apache.mailet.base.GenericMailet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyMailet extends GenericMailet{
  private static final Logger logger = 
LoggerFactory.getLogger(MyMailet.class);

  @Override
  public void service(Mail mail) throws MessagingException {
log(log via mailet logger with INFO level);
logger.info(Log via slf4j with INFO level !!! Add 
log4j.logger.com.test=INFO, CONS, FILE in the log4j.properties);
logger.debug(Log via slf4j with DEBUG level !!! Add 
log4j.logger.com.test=DEBUG, CONS, FILE in the log4j.properties);

  }
}

On 05/08/2012 09:18 PM, Pao, Vanessa wrote:

I see your message :)

Vanessa Pao
Software Engineer - Harris Healthcare Solutions
321.914.1344
v...@harris.com


-Original Message-
From: Kiytiro-Keane, A Massae [mailto:akiyt...@harris.com]
Sent: Tuesday, May 08, 2012 3:16 PM
To: server-dev@james.apache.org
Subject: Custom Mailet Logfile

Hello,

I'm using the LogFactory to log the info,error,trace types of information in my 
mailet. I cannot find where James output the mailet log. I checked the 
james-server.log and mailetcontainer.log. The mailetcontainer.log only shows 
information that the mailet has been instantiated.



Thank you.

Massae Kiytiro-Keane
FBC/332 Phone (321) 914-1452
A person who never made a mistake never tried anything new. (by Albert 
Einstein)

This information is only intended for the use of the individual or entity named 
in this email. If you are not the intended recipient, you are hereby notified 
that any disclosure, copying, distribution, or use of the contents of this 
information is strictly prohibited. If you have received this email in error, 
please notify me and delete it immediately.




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



--
eric | http://about.echarles.net | @echarles

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



Re: new monitoring solution available

2012-05-10 Thread Eric Charles

Hi Ioan,

Alternative solution could be servo [1].
I didn't look at jetm yet but there are probably others.

Although MAILBOX-152 is created since long, I think it's worth to talk 
and announce on mailing list when introducing such components. Everybody 
could then propose alternative/better solutions.


Thx,

Eric

[1] http://techblog.netflix.com/2012/02/announcing-servo.html


On 05/10/2012 03:22 PM, Ioan Eugen Stan wrote:

Hi,

I've committed the changes needed to add jetm performance monitoring.
It uses Spring AOP and can be enabled/ disa bled by configuration for
every bean that we create.

The project home-page shows some stuff that you can do with it:
http://jetm.void.fm/views/monitoring_examples.html

It's in the same bucket as JMX but it has the advantage of being very
easy to enable/disable without code.

Cheers,



--
eric | http://about.echarles.net | @echarles

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



Re: new monitoring solution available

2012-05-10 Thread Ioan Eugen Stan
Hello Eric,

2012/5/10 Eric Charles e...@apache.org:
 Hi Ioan,

 Alternative solution could be servo [1].
 I didn't look at jetm yet but there are probably others.

Took a quick look at servo, and has a lot of potential. It's very new
so a lot of people didn't hear about it. I'm going to get a look at
it, maybe I'll use it to re-factor some code for more clarity and add
other metrics.

 Although MAILBOX-152 is created since long, I think it's worth to talk and
 announce on mailing list when introducing such components. Everybody could
 then propose alternative/better solutions.

You are right, but since nobody was against it and it required minimal
intrusion I decided to go for it.
I will be more verbose in the future.

As a note, servo also requires to write some code while jetm doesn't
so it can be turned off pretty easily.

JMX monitoring is more powerful than what jetm offers. If needed we
can provide jetm as an optional package since we can externalize it
into a config file and provide a special build profile to include it
so no harm done.

Since this discussion is open, let's have a poll to see what other
monitoring solutions are there.
If you've  worked with something else please share your experience.

Thanks,

 Thx,

 Eric

 [1] http://techblog.netflix.com/2012/02/announcing-servo.html



 On 05/10/2012 03:22 PM, Ioan Eugen Stan wrote:

 Hi,

 I've committed the changes needed to add jetm performance monitoring.
 It uses Spring AOP and can be enabled/ disa bled by configuration for
 every bean that we create.

 The project home-page shows some stuff that you can do with it:
 http://jetm.void.fm/views/monitoring_examples.html

 It's in the same bucket as JMX but it has the advantage of being very
 easy to enable/disable without code.

 Cheers,


 --
 eric | http://about.echarles.net | @echarles

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




-- 
Ioan Eugen Stan
http://ieugen.blogspot.com/  *** http://bucharest-jug.github.com/ ***

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



Re: work on Apache CMS site migration

2012-05-10 Thread Ioan Eugen Stan
Hi Stefano,

First of all  thanks for the input. See my comments inside.

2012/5/10 Stefano Bagnara apa...@bago.org:
 2012/5/8 Ioan Eugen Stan stan.ieu...@gmail.com:
 The design is not done and there is much to be done but I wanted to
 get some impressions before I continue. Some things that come to my
 mind:
 - integrate with Google search and analytics

 Yes, this is important. Expecially the Analytics part, as we want to
 be able to measure things to understand if what we do works or not.

 - finish integration with twitter
 - design some aggregation pages similar to [2], [3]

 IMO it has a much higher priority to let the CMS skin  and the maven
 skin to match their look. Once the pages can be mixed together we can
 go live, and after this we can start adding new docs/aggregation
 pages.
 Remember we have maven-generated docs that will probably have to be
 interlinked with CMS pages. This page, for example, is automatically
 generated by Maven using javadocs and source code, so I don't expect
 to be able to move that to CMS:
 http://james.apache.org/mailet/standard/mailet-report.html

If one tool can do that, means another one will be able to do so, but
I'm looking for ways to avoid it. Thanks for mentioning the page is
generated.

 I prefer our current skin to the new one (as it is right now) because
 it is much more readable:
 http://james.apache.org/server/3/config-users.html
 http://james.staging.apache.org/server/config-users.html
 I don't see paragraph titles in the new pages.

You are right. Readability will be excellent, I probably should have
made it more clear that I concentrated on general shape / CSS and
not content looks. Most pages are auto-converted from xdoc to mdtext,
but not a very good conversion. Now I'm looking into xdoc - html
conversion directly. The idea is to keep our current pages in xdoc,
use svn:externals to bring them into site-cms/content space and apply
XSLT transformations (in the perl scripts) to build html out of them
on the CMS side.
This way we will have no conversion errors and keep the docs with the
code. Any help with this step is welcomed.

I've put some examples from openejb. Did you took a look at them? We
can make our pages look like that too, and it's not hard as you can
see from the mdtext sources. You can read them as text with ease.

Moving to Apache CMS means a consistent view across all components of
the project and across all website. It's very easy to do actually, but
requires some familiarity with the technology.

The steps are:
- build a template in templates/
- write a transformation in lib/view.pm that will transform a path
according to the template
- make a regexp in lib/path.pm that matches paths you wish to apply a
given template, and call the view function

The only downside is that all this is done in perl, which I have a
very hard time reading.

We should have a set of templates that we are going to use across all
project. I imagine we won't be needing more than 5-7. Templates can
use inheritance so it should be even more easy.


 I'm not against moving to a new skin/layout, but we should keep
 consistency and readability.
 Also, make sure urls do not change, so in this case it is missing a
 /3/ in the path.

I was (am) trying out some  radical new face-lift. Aside for the bad
formatting what do you think about the new look and feel?

We can bring the existing docs with svn:externals so the urls will
remain untouched. Old docs will still be available, but with the old
view. In time, we can move them to the new look or phase them out and
replace them with a link to the full archive.


Cheers,

 The idea is that you should just replace james.apache.org with
 james.staging.apache.org to see any page that we're going to move
 from maven to CMS.

 Stefano

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




-- 
Ioan Eugen Stan
http://ieugen.blogspot.com/  *** http://bucharest-jug.github.com/ ***

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



Re: work on Apache CMS site migration

2012-05-10 Thread Stefano Bagnara
2012/5/10 Ioan Eugen Stan stan.ieu...@gmail.com:
 2012/5/10 Stefano Bagnara apa...@bago.org:
 Remember we have maven-generated docs that will probably have to be
 interlinked with CMS pages. This page, for example, is automatically
 generated by Maven using javadocs and source code, so I don't expect
 to be able to move that to CMS:
 http://james.apache.org/mailet/standard/mailet-report.html

 If one tool can do that, means another one will be able to do so, but
 I'm looking for ways to avoid it. Thanks for mentioning the page is
 generated.

Sure, but it will take much more time to recreate this tool outside
maven (and expecially outside java) than to create 20 skins :-)
Please note that this tool have a lot of knowledge right now and uses
both the sources and javadocs and the compiled classes and also
instantiate mailets to ask their names: you don't want to do this in
perl, i'm sure.

 I prefer our current skin to the new one (as it is right now) because
 it is much more readable:
 http://james.apache.org/server/3/config-users.html
 http://james.staging.apache.org/server/config-users.html
 I don't see paragraph titles in the new pages.

 You are right. Readability will be excellent, I probably should have
 made it more clear that I concentrated on general shape / CSS and
 not content looks. Most pages are auto-converted from xdoc to mdtext,
 but not a very good conversion. Now I'm looking into xdoc - html
 conversion directly. The idea is to keep our current pages in xdoc,
 use svn:externals to bring them into site-cms/content space and apply
 XSLT transformations (in the perl scripts) to build html out of them
 on the CMS side.
 This way we will have no conversion errors and keep the docs with the
 code. Any help with this step is welcomed.

Don't we loose the CSM browser-based editing this way?

 I've put some examples from openejb. Did you took a look at them? We
 can make our pages look like that too, and it's not hard as you can
 see from the mdtext sources. You can read them as text with ease.

As I wrote, my main concern is that maven generated stuff will looks
like ASF generated stuff. I don't see major issues in the current
(old) look, but I'm happy to move to a more modern look. The opebejb
skin as is is not too good to accept our big main menu as it goes
multiline and very high when you have narrow screens (tablet/phones).

 Moving to Apache CMS means a consistent view across all components of
 the project and across all website. It's very easy to do actually, but
 requires some familiarity with the technology.

I don't understand this sentence: we already have a consistent view in
our website. My understanding is that we are evaluating CMS so to be
able to have some website/docs separated from the code and editable
without using svn.

 We can bring the existing docs with svn:externals so the urls will
 remain untouched. Old docs will still be available, but with the old
 view. In time, we can move them to the new look or phase them out and
 replace them with a link to the full archive.

I don't think this is a good plan.

We need a new maven skin that resemble the new look *before* we can
mix the environments. I don't like having some pages with a skin and
some other pages with another skin: we already have this difference
between website and wiki and we want to fix this, not to make the
issue bigger.

I explained this also in IRC, but I didn't understand the feeling of
the other people from that meeting, so I can't tell you if this will
be a blocker or not.

Stefano

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



Re: new monitoring solution available

2012-05-10 Thread Eric Charles

On 05/10/2012 09:18 PM, Ioan Eugen Stan wrote:

Hello Eric,

2012/5/10 Eric Charlese...@apache.org:

Hi Ioan,

Alternative solution could be servo [1].
I didn't look at jetm yet but there are probably others.


Took a quick look at servo, and has a lot of potential. It's very new
so a lot of people didn't hear about it. I'm going to get a look at
it, maybe I'll use it to re-factor some code for more clarity and add
other metrics.


Although MAILBOX-152 is created since long, I think it's worth to talk and
announce on mailing list when introducing such components. Everybody could
then propose alternative/better solutions.


You are right, but since nobody was against it and it required minimal
intrusion I decided to go for it.
I will be more verbose in the future.


Thx.



As a note, servo also requires to write some code while jetm doesn't
so it can be turned off pretty easily.



Servo needs annotations, which is not code, and the start of a server, 
which can be made optional by configuration.



JMX monitoring is more powerful than what jetm offers. If needed we
can provide jetm as an optional package since we can externalize it
into a config file and provide a special build profile to include it
so no harm done.



Whatever the solution, I favor JMX to gather the metrics.
Does Jetm support this?


Since this discussion is open, let's have a poll to see what other
monitoring solutions are there.
If you've  worked with something else please share yor experience.



Never used such framework on other projects.


Thanks,


Thx,

Eric

[1] http://techblog.netflix.com/2012/02/announcing-servo.html



On 05/10/2012 03:22 PM, Ioan Eugen Stan wrote:


Hi,

I've committed the changes needed to add jetm performance monitoring.
It uses Spring AOP and can be enabled/ disa bled by configuration for
every bean that we create.

The project home-page shows some stuff that you can do with it:
http://jetm.void.fm/views/monitoring_examples.html

It's in the same bucket as JMX but it has the advantage of being very
easy to enable/disable without code.

Cheers,



--
eric | http://about.echarles.net | @echarles

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







--
eric | http://about.echarles.net | @echarles

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



Re: work on Apache CMS site migration

2012-05-10 Thread Eric Charles

(snip)


We can bring the existing docs with svn:externals so the urls will
remain untouched. Old docs will still be available, but with the old
view. In time, we can move them to the new look or phase them out and
replace them with a link to the full archive.


I don't think this is a good plan.

We need a new maven skin that resemble the new look *before* we can
mix the environments. I don't like having some pages with a skin and
some other pages with another skin: we already have this difference
between website and wiki and we want to fix this, not to make the
issue bigger.

I explained this also in IRC, but I didn't understand the feeling of
the other people from that meeting, so I can't tell you if this will
be a blocker or not.



My concerns:
- Have uniform skin between cms and mvn generated pages.
- Have on all pages the left menu which has 3 parts: the suproject 
links, the reports links and the top james links (about, download, asf).

- Have on all pages the same top menu with the list of projects.

James projects and its subprojects are really difficult for a newbie (we 
ship end product, libraries,...), so we need to be as crystal-clear as 
we can with our publications.


Thx, Eric


Stefano

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



--
eric | http://about.echarles.net | @echarles

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



Re: new monitoring solution available

2012-05-10 Thread Eric Charles

Also, did you look at the existing metrics we already have?
http://james.apache.org/server/3/monitor-jmx.html
How do you see them integrated?
We'd better not stay with multiple monitoring systems.

We also need to document this new feature (optional or not, how to 
configure to enable, disable,...).


Thx,
Eric

On 05/11/2012 06:25 AM, Eric Charles wrote:

On 05/10/2012 09:18 PM, Ioan Eugen Stan wrote:

Hello Eric,

2012/5/10 Eric Charlese...@apache.org:

Hi Ioan,

Alternative solution could be servo [1].
I didn't look at jetm yet but there are probably others.


Took a quick look at servo, and has a lot of potential. It's very new
so a lot of people didn't hear about it. I'm going to get a look at
it, maybe I'll use it to re-factor some code for more clarity and add
other metrics.


Although MAILBOX-152 is created since long, I think it's worth to
talk and
announce on mailing list when introducing such components. Everybody
could
then propose alternative/better solutions.


You are right, but since nobody was against it and it required minimal
intrusion I decided to go for it.
I will be more verbose in the future.


Thx.



As a note, servo also requires to write some code while jetm doesn't
so it can be turned off pretty easily.



Servo needs annotations, which is not code, and the start of a server,
which can be made optional by configuration.


JMX monitoring is more powerful than what jetm offers. If needed we
can provide jetm as an optional package since we can externalize it
into a config file and provide a special build profile to include it
so no harm done.



Whatever the solution, I favor JMX to gather the metrics.
Does Jetm support this?


Since this discussion is open, let's have a poll to see what other
monitoring solutions are there.
If you've worked with something else please share yor experience.



Never used such framework on other projects.


Thanks,


Thx,

Eric

[1] http://techblog.netflix.com/2012/02/announcing-servo.html



On 05/10/2012 03:22 PM, Ioan Eugen Stan wrote:


Hi,

I've committed the changes needed to add jetm performance monitoring.
It uses Spring AOP and can be enabled/ disa bled by configuration for
every bean that we create.

The project home-page shows some stuff that you can do with it:
http://jetm.void.fm/views/monitoring_examples.html

It's in the same bucket as JMX but it has the advantage of being very
easy to enable/disable without code.

Cheers,



--
eric | http://about.echarles.net | @echarles

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









--
eric | http://about.echarles.net | @echarles

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



Re: new monitoring solution available

2012-05-10 Thread Norman Maurer
Metrics is also a nice one:

http://metrics.codahale.com/

Bye,
Norman


2012/5/11 Eric Charles e...@apache.org:
 Also, did you look at the existing metrics we already have?
 http://james.apache.org/server/3/monitor-jmx.html
 How do you see them integrated?
 We'd better not stay with multiple monitoring systems.

 We also need to document this new feature (optional or not, how to configure
 to enable, disable,...).

 Thx,
 Eric


 On 05/11/2012 06:25 AM, Eric Charles wrote:

 On 05/10/2012 09:18 PM, Ioan Eugen Stan wrote:

 Hello Eric,

 2012/5/10 Eric Charlese...@apache.org:

 Hi Ioan,

 Alternative solution could be servo [1].
 I didn't look at jetm yet but there are probably others.


 Took a quick look at servo, and has a lot of potential. It's very new
 so a lot of people didn't hear about it. I'm going to get a look at
 it, maybe I'll use it to re-factor some code for more clarity and add
 other metrics.

 Although MAILBOX-152 is created since long, I think it's worth to
 talk and
 announce on mailing list when introducing such components. Everybody
 could
 then propose alternative/better solutions.


 You are right, but since nobody was against it and it required minimal
 intrusion I decided to go for it.
 I will be more verbose in the future.


 Thx.


 As a note, servo also requires to write some code while jetm doesn't
 so it can be turned off pretty easily.


 Servo needs annotations, which is not code, and the start of a server,
 which can be made optional by configuration.

 JMX monitoring is more powerful than what jetm offers. If needed we
 can provide jetm as an optional package since we can externalize it
 into a config file and provide a special build profile to include it
 so no harm done.


 Whatever the solution, I favor JMX to gather the metrics.
 Does Jetm support this?

 Since this discussion is open, let's have a poll to see what other
 monitoring solutions are there.
 If you've worked with something else please share yor experience.


 Never used such framework on other projects.

 Thanks,

 Thx,

 Eric

 [1] http://techblog.netflix.com/2012/02/announcing-servo.html



 On 05/10/2012 03:22 PM, Ioan Eugen Stan wrote:


 Hi,

 I've committed the changes needed to add jetm performance monitoring.
 It uses Spring AOP and can be enabled/ disa bled by configuration for
 every bean that we create.

 The project home-page shows some stuff that you can do with it:
 http://jetm.void.fm/views/monitoring_examples.html

 It's in the same bucket as JMX but it has the advantage of being very
 easy to enable/disable without code.

 Cheers,


 --
 eric | http://about.echarles.net | @echarles

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






 --
 eric | http://about.echarles.net | @echarles

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


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