continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r574675 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/notification/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/ continuum-webapp/src/main/java/org/apache/maven/contin...
Date Tue, 11 Sep 2007 19:36:06 GMT
Author: evenisse
Date: Tue Sep 11 12:36:05 2007
New Revision: 574675

URL: http://svn.apache.org/viewvc?rev=574675&view=rev
Log:
[CONTINUUM-605] Allow a mail notifier to send to latest committers

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/ContinuumRecipientSource.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/DeleteGroupNotifierAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/DeleteProjectNotifierAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction-mailProjectGroupNotifierSave-validation.xml
    maven/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction-mailProjectNotifierSave-validation.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierMail.jsp

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/ContinuumRecipientSource.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/ContinuumRecipientSource.java?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/ContinuumRecipientSource.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/ContinuumRecipientSource.java
Tue Sep 11 12:36:05 2007
@@ -20,15 +20,19 @@
  */
 
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectDeveloper;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.model.scm.ChangeSet;
+import org.apache.maven.continuum.model.scm.ScmResult;
 import org.codehaus.plexus.notification.AbstractRecipientSource;
 import org.codehaus.plexus.notification.NotificationException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -42,6 +46,8 @@
 {
     public static String ADDRESS_FIELD = "address";
 
+    public static String COMMITTER_FIELD = "committers";
+
     /**
      * @plexus.configuration
      */
@@ -85,7 +91,7 @@
             throw new NotificationException( "Missing project from the notification context."
);
         }
 
-        Set recipients = new HashSet();
+        Set<String> recipients = new HashSet<String>();
 
         if ( !StringUtils.isEmpty( toOverride ) )
         {
@@ -93,18 +99,16 @@
         }
         else if ( projectNotifier != null )
         {
-            addNotifierAdresses( projectNotifier, recipients );
+            addNotifierAdresses( projectNotifier, recipients, project, context );
         }
         else if ( project.getNotifiers() != null && !project.getNotifiers().isEmpty()
)
         {
-            for ( Iterator notifierIterator = project.getNotifiers().iterator(); notifierIterator.hasNext();
)
+            for ( ProjectNotifier notifier : (List<ProjectNotifier>) project.getNotifiers()
)
             {
-                ProjectNotifier notifier = (ProjectNotifier) notifierIterator.next();
-
-                if ( notifier.getId() == new Integer( notifierId ).intValue() &&
+                if ( notifier.getId() == Integer.parseInt( notifierId ) &&
                     notifier.getConfiguration().containsKey( ADDRESS_FIELD ) )
                 {
-                    addNotifierAdresses( notifier, recipients );
+                    addNotifierAdresses( notifier, recipients, project, context );
                 }
             }
         }
@@ -119,7 +123,8 @@
         }
     }
 
-    private void addNotifierAdresses( ProjectNotifier notifier, Set recipients )
+    private void addNotifierAdresses( ProjectNotifier notifier, Set<String> recipients,
Project project, Map context )
+        throws NotificationException
     {
         if ( notifier.getConfiguration() != null )
         {
@@ -129,11 +134,76 @@
             {
                 String[] addresses = StringUtils.split( addressField, "," );
 
-                for ( int i = 0; i < addresses.length; i++ )
+                for ( String address : addresses )
                 {
-                    recipients.add( addresses[i].trim() );
+                    recipients.add( address.trim() );
+                }
+            }
+
+            if ( "mail".equals( notifier.getType() ) )
+            {
+                String committerField = (String) notifier.getConfiguration().get( COMMITTER_FIELD
);
+                if ( StringUtils.isNotEmpty( committerField ) )
+                {
+                    if ( Boolean.parseBoolean( committerField ) )
+                    {
+                        ScmResult scmResult =
+                            (ScmResult) context.get( ContinuumNotificationDispatcher.CONTEXT_UPDATE_SCM_RESULT
);
+                        if ( scmResult != null && scmResult.getChanges() != null
&& !scmResult.getChanges().isEmpty() )
+                        {
+                            if ( project == null )
+                            {
+                                throw new NotificationException( "Missing project from the
notification context." );
+                            }
+
+                            List<ProjectDeveloper> developers = project.getDevelopers();
+                            if ( developers == null || developers.isEmpty() )
+                            {
+                                getLogger().warn(
+                                    "No developers have been configured...notifcation email
" + "will not be sent" );
+                                return;
+                            }
+
+                            Map<String, String> developerToEmailMap = mapDevelopersToRecipients(
developers );
+
+                            List<ChangeSet> changes = scmResult.getChanges();
+
+                            for ( ChangeSet changeSet : changes )
+                            {
+                                String scmId = changeSet.getAuthor();
+                                if ( StringUtils.isNotEmpty( scmId ) )
+                                {
+                                    String email = developerToEmailMap.get( scmId );
+                                    if ( StringUtils.isEmpty( email ) )
+                                    {
+                                        getLogger().warn( "no email address is defined in
developers list for '" +
+                                            scmId + "' scm id." );
+                                    }
+                                    else
+                                    {
+                                        recipients.add( email );
+                                    }
+                                }
+                            }
+                        }
+                    }
                 }
             }
         }
+    }
+
+    private Map<String, String> mapDevelopersToRecipients( List<ProjectDeveloper>
developers )
+    {
+        Map<String, String> developersMap = new HashMap<String, String>();
+
+        for ( ProjectDeveloper developer : developers )
+        {
+            if ( StringUtils.isNotEmpty( developer.getScmId() ) && StringUtils.isNotEmpty(
developer.getEmail() ) )
+            {
+                developersMap.put( developer.getScmId(), developer.getEmail() );
+            }
+        }
+
+        return developersMap;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/DeleteGroupNotifierAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/DeleteGroupNotifierAction.java?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/DeleteGroupNotifierAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/DeleteGroupNotifierAction.java
Tue Sep 11 12:36:05 2007
@@ -20,6 +20,7 @@
  */
 
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.web.action.ContinuumActionSupport;
@@ -90,7 +91,7 @@
         if ( ( "mail".equals( notifierType ) ) || ( "msn".equals( notifierType ) ) ||
             ( "jabber".equals( notifierType ) ) )
         {
-            recipient = (String) configuration.get( "address" );
+            recipient = (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD
);
         }
 
         if ( "irc".equals( notifierType ) )

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/DeleteProjectNotifierAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/DeleteProjectNotifierAction.java?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/DeleteProjectNotifierAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/DeleteProjectNotifierAction.java
Tue Sep 11 12:36:05 2007
@@ -23,6 +23,7 @@
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
 import org.apache.maven.continuum.web.action.ContinuumActionSupport;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.codehaus.plexus.util.StringUtils;
@@ -101,7 +102,7 @@
         if ( ( "mail".equals( notifierType ) ) || ( "msn".equals( notifierType ) ) ||
             ( "jabber".equals( notifierType ) ) )
         {
-            recipient = (String) configuration.get( "address" );
+            recipient = (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD
);
         }
 
         if ( "irc".equals( notifierType ) )

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction.java?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction.java
Tue Sep 11 12:36:05 2007
@@ -21,6 +21,7 @@
 
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -68,7 +69,7 @@
 
         domainName = (String) configuration.get( "domainName" );
 
-        address = (String) configuration.get( "address" );
+        address = (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD );
 
         sslConnection = Boolean.valueOf( (String) configuration.get( "sslConnection" ) ).booleanValue();
 
@@ -89,7 +90,7 @@
 
         configuration.put( "domainName", domainName );
 
-        configuration.put( "address", address );
+        configuration.put( ContinuumRecipientSource.ADDRESS_FIELD, address );
 
         configuration.put( "sslConnection", String.valueOf( sslConnection ) );
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction.java?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction.java
Tue Sep 11 12:36:05 2007
@@ -21,6 +21,7 @@
 
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -67,7 +68,7 @@
 
         domainName = (String) configuration.get( "domainName" );
 
-        address = (String) configuration.get( "address" );
+        address = (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD );
 
         sslConnection = Boolean.valueOf( (String) configuration.get( "sslConnection" ) ).booleanValue();
 
@@ -88,7 +89,7 @@
 
         configuration.put( "domainName", domainName );
 
-        configuration.put( "address", address );
+        configuration.put( ContinuumRecipientSource.ADDRESS_FIELD, address );
 
         configuration.put( "sslConnection", String.valueOf( sslConnection ) );
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.java?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.java
Tue Sep 11 12:36:05 2007
@@ -21,6 +21,8 @@
 
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -39,16 +41,31 @@
 {
     private String address;
 
+    private boolean committers;
+
     protected void initConfiguration( Map configuration )
     {
-        address = (String) configuration.get( "address" );
+        if ( StringUtils.isNotEmpty( (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD
) ) )
+        {
+            address = (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD
);
+        }
+
+        if ( StringUtils.isNotEmpty( (String) configuration.get( ContinuumRecipientSource.COMMITTER_FIELD
) ) )
+        {
+            committers = Boolean.parseBoolean( (String) configuration.get( ContinuumRecipientSource.COMMITTER_FIELD
) );
+        }
     }
 
     protected void setNotifierConfiguration( ProjectNotifier notifier )
     {
-        HashMap configuration = new HashMap();
+        HashMap<String, Object> configuration = new HashMap<String, Object>();
+
+        if ( StringUtils.isNotEmpty( address ) )
+        {
+            configuration.put( ContinuumRecipientSource.ADDRESS_FIELD, address );
+        }
 
-        configuration.put( "address", address );
+        configuration.put( ContinuumRecipientSource.COMMITTER_FIELD, String.valueOf( committers
) );
 
         notifier.setConfiguration( configuration );
     }
@@ -61,5 +78,15 @@
     public void setAddress( String address )
     {
         this.address = address;
+    }
+
+    public boolean isCommitters()
+    {
+        return committers;
+    }
+
+    public void setCommitters( boolean committers )
+    {
+        this.committers = committers;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.java?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.java
Tue Sep 11 12:36:05 2007
@@ -21,6 +21,8 @@
 
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -39,16 +41,31 @@
 {
     private String address;
 
+    private boolean committers;
+
     protected void initConfiguration( Map configuration )
     {
-        address = (String) configuration.get( "address" );
+        if ( StringUtils.isNotEmpty( (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD
) ) )
+        {
+            address = (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD
);
+        }
+
+        if ( StringUtils.isNotEmpty( (String) configuration.get( ContinuumRecipientSource.COMMITTER_FIELD
) ) )
+        {
+            committers = Boolean.parseBoolean( (String) configuration.get( ContinuumRecipientSource.COMMITTER_FIELD
) );
+        }
     }
 
     protected void setNotifierConfiguration( ProjectNotifier notifier )
     {
-        HashMap configuration = new HashMap();
+        HashMap<String, Object> configuration = new HashMap<String, Object>();
+
+        if ( StringUtils.isNotEmpty( address ) )
+        {
+            configuration.put( ContinuumRecipientSource.ADDRESS_FIELD, address );
+        }
 
-        configuration.put( "address", address );
+        configuration.put( ContinuumRecipientSource.COMMITTER_FIELD, String.valueOf( committers
) );
 
         notifier.setConfiguration( configuration );
     }
@@ -61,5 +78,15 @@
     public void setAddress( String address )
     {
         this.address = address;
+    }
+
+    public boolean isCommitters()
+    {
+        return committers;
+    }
+
+    public void setCommitters( boolean committers )
+    {
+        this.committers = committers;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction.java?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction.java
Tue Sep 11 12:36:05 2007
@@ -21,6 +21,7 @@
 
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -48,7 +49,7 @@
 
         password = (String) configuration.get( "password" );
 
-        address = (String) configuration.get( "address" );
+        address = (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD );
     }
 
     protected void setNotifierConfiguration( ProjectNotifier notifier )
@@ -59,7 +60,7 @@
 
         configuration.put( "password", password );
 
-        configuration.put( "address", address );
+        configuration.put( ContinuumRecipientSource.ADDRESS_FIELD, address );
 
         notifier.setConfiguration( configuration );
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction.java?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction.java
Tue Sep 11 12:36:05 2007
@@ -21,6 +21,7 @@
 
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -49,7 +50,7 @@
 
         password = (String) configuration.get( "password" );
 
-        address = (String) configuration.get( "address" );
+        address = (String) configuration.get( ContinuumRecipientSource.ADDRESS_FIELD );
     }
 
     protected void setNotifierConfiguration( ProjectNotifier notifier )
@@ -60,7 +61,7 @@
 
         configuration.put( "password", password );
 
-        configuration.put( "address", address );
+        configuration.put( ContinuumRecipientSource.ADDRESS_FIELD, address );
 
         notifier.setConfiguration( configuration );
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
Tue Sep 11 12:36:05 2007
@@ -20,6 +20,7 @@
  */
 
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.notification.ContinuumRecipientSource;
 import org.extremecomponents.table.bean.Column;
 import org.extremecomponents.table.cell.DisplayCell;
 import org.extremecomponents.table.core.TableModel;
@@ -67,13 +68,13 @@
                 return notifier.getConfiguration().get( "url" ).toString();
             }
 
-            if ( notifier.getConfiguration().get( "address" ) == null )
+            if ( notifier.getConfiguration().get( ContinuumRecipientSource.ADDRESS_FIELD
) == null )
             {
                 return "";
             }
             else
             {
-                return notifier.getConfiguration().get( "address" ).toString();
+                return notifier.getConfiguration().get( ContinuumRecipientSource.ADDRESS_FIELD
).toString();
             }
         }
     }

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Tue Sep 11 12:36:05 2007
@@ -404,7 +404,8 @@
 notifier.page.title = Continuum - Add/Edit {0} Notifier
 notifier.section.title = Add/Edit {0} Notifier
 notifier.type.label = Type
-notifier.mail.recipient.label = Mail Recipient Address
+notifier.mail.recipient.address.label = Mail Recipient Address
+notifier.mail.recipient.committers.label = Send a mail to latest committers
 notifier.irc.host.label = IRC Host
 notifier.irc.port.label = IRC port
 notifier.irc.channel.label = IRC channel

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction-mailProjectGroupNotifierSave-validation.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction-mailProjectGroupNotifierSave-validation.xml?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction-mailProjectGroupNotifierSave-validation.xml
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction-mailProjectGroupNotifierSave-validation.xml
Tue Sep 11 12:36:05 2007
@@ -23,9 +23,6 @@
 
 <validators>
   <field name="address">
-    <field-validator type="requiredstring">
-      <message key="mailNotifier.address.required"/>
-    </field-validator>
     <field-validator type="email">
       <message key="mailNotifier.address.invalid"/>
     </field-validator>

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction-mailProjectNotifierSave-validation.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction-mailProjectNotifierSave-validation.xml?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction-mailProjectNotifierSave-validation.xml
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction-mailProjectNotifierSave-validation.xml
Tue Sep 11 12:36:05 2007
@@ -23,9 +23,6 @@
 
 <validators>
   <field name="address">
-    <field-validator type="requiredstring">
-      <message key="mailNotifier.address.required"/>
-    </field-validator>
     <field-validator type="email">
       <message key="mailNotifier.address.invalid"/>
     </field-validator>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierMail.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierMail.jsp?rev=574675&r1=574674&r2=574675&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierMail.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierMail.jsp
Tue Sep 11 12:36:05 2007
@@ -52,7 +52,8 @@
             <ww:hidden name="fromGroupPage"/>
             <table>
               <tbody>
-                <ww:textfield label="%{getText('notifier.mail.recipient.label')}" name="address"
required="true" />
+                <ww:textfield label="%{getText('notifier.mail.recipient.address.label')}"
name="address" />
+                <ww:checkbox label="%{getText('notifier.mail.recipient.committers.label')}"
name="committers" value="committers" fieldValue="true"/>
                 <ww:checkbox label="%{getText('notifier.event.sendOnSuccess')}" name="sendOnSuccess"
value="sendOnSuccess" fieldValue="true"/>
                 <ww:checkbox label="%{getText('notifier.event.sendOnFailure')}" name="sendOnFailure"
value="sendOnFailure" fieldValue="true"/>
                 <ww:checkbox label="%{getText('notifier.event.sendOnError')}" name="sendOnError"
value="sendOnError" fieldValue="true"/>



Mime
View raw message