continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r240262 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core-it/src/test/java/org/apache/maven/continuum/it/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-model/src/main/md...
Date Fri, 26 Aug 2005 15:20:55 GMT
Author: evenisse
Date: Fri Aug 26 08:20:41 2005
New Revision: 240262

URL: http://svn.apache.org/viewcvs?rev=240262&view=rev
Log:
o Add an id to ProjectNotifier because a project can have multiple provider with the same
type

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenTwoIntegrationTest.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo
    maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=240262&r1=240261&r2=240262&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Fri Aug 26 08:20:41 2005
@@ -116,16 +116,16 @@
     // Notification
     // ----------------------------------------------------------------------
 
-    ProjectNotifier getNotifier( int projectId, String notifierType )
+    ProjectNotifier getNotifier( int projectId, int notifierId )
         throws ContinuumException;
 
-    void updateNotifier( int projectId, String notifierType, Map configuration )
+    void updateNotifier( int projectId, int notifierId, Map configuration )
         throws ContinuumException;
 
     void addNotifier( int projectId, String notifierType, Map configuration )
         throws ContinuumException;
 
-    void removeNotifier( int projectId, String notifierType )
+    void removeNotifier( int projectId, int notifierId )
         throws ContinuumException;
 
     Project getProjectWithCheckoutResult( int projectId )

Modified: maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenTwoIntegrationTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenTwoIntegrationTest.java?rev=240262&r1=240261&r2=240262&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenTwoIntegrationTest.java
(original)
+++ maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenTwoIntegrationTest.java
Fri Aug 26 08:20:41 2005
@@ -62,7 +62,7 @@
         assertEquals( "project.notifiers.size", 2, project.getNotifiers().size() );
 
         //TODO: Activate this test when CONTINUUM-252 will be fixed
-        //removeNotifier( projectId, ( (ProjectNotifier) project.getNotifiers().get( 1 )
).getType() );
+        //removeNotifier( projectId, ( (ProjectNotifier) project.getNotifiers().get( 1 )
).getId() );
 
         //assertEquals( "project.notifiers.size", 1, project.getNotifiers().size() );
 
@@ -133,11 +133,11 @@
         cvsImport( basedir, artifactId, getCvsRoot() );
     }
 
-    private void removeNotifier( int projectId, String notifierType )
+    private void removeNotifier( int projectId, int notifierId )
     {
         try
         {
-            getContinuum().removeNotifier( projectId, notifierType );
+            getContinuum().removeNotifier( projectId, notifierId );
         }
         catch ( Exception e )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=240262&r1=240261&r2=240262&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Fri Aug 26 08:20:41 2005
@@ -520,10 +520,10 @@
     // This whole section needs a scrub but will need to be dealt with generally
     // when we add schedules and profiles to the mix.
 
-    public ProjectNotifier getNotifier( int projectId, String notifierType )
+    public ProjectNotifier getNotifier( int projectId, int notifierId )
         throws ContinuumException
     {
-        Project project = getProject( projectId );
+        Project project = getProjectWithAllDetails( projectId );
 
         List notifiers = project.getNotifiers();
 
@@ -533,7 +533,7 @@
         {
             notifier = (ProjectNotifier) i.next();
 
-            if ( notifier.getType().equals( notifierType ) )
+            if ( notifier.getId() == notifierId )
             {
                 break;
             }
@@ -542,10 +542,10 @@
         return notifier;
     }
 
-    public void updateNotifier( int projectId, String notifierType, Map configuration )
+    public void updateNotifier( int projectId, int notifierId, Map configuration )
         throws ContinuumException
     {
-        ProjectNotifier notifier = getNotifier( projectId, notifierType );
+        ProjectNotifier notifier = getNotifier( projectId, notifierId );
 
         Properties notifierProperties = createNotifierProperties( configuration );
 
@@ -595,10 +595,10 @@
         updateProject( project );
     }
 
-    public void removeNotifier( int projectId, String notifierType )
+    public void removeNotifier( int projectId, int notifierId )
         throws ContinuumException
     {
-        ProjectNotifier n = getNotifier( projectId, notifierType );
+        ProjectNotifier n = getNotifier( projectId, notifierId );
 
         if ( n != null )
         {

Modified: maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo?rev=240262&r1=240261&r2=240262&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo Fri Aug 26 08:20:41 2005
@@ -12,7 +12,6 @@
   <classes>
     <!--
      TODO: need another root element that encases all the independant trees here
-     TODO: add stash attributes and generate package.jdo later
     -->
 
     <class rootElement="true">
@@ -207,6 +206,13 @@
         Configures one method for notifying users/developers when a build breaks.
       </description>
       <fields>
+        <field>
+          <name>id</name>
+          <required>true</required>
+          <identifier>true</identifier>
+          <version>1.0.0+</version>
+          <type>int</type>
+        </field>
         <field>
           <name>type</name>
           <version>1.0.0+</version>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml?rev=240262&r1=240261&r2=240262&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
Fri Aug 26 08:20:41 2005
@@ -234,7 +234,7 @@
             <scalars>
               <scalar>
                 <id>notifier</id>
-                <expression>getNotifier(#id,#notifierType)</expression>
+                <expression>getNotifier(#id,#notifierId)</expression>
               </scalar>
             </scalars>
           </view>
@@ -243,7 +243,7 @@
             <scalars>
               <scalar>
                 <id>notifier</id>
-                <expression>getNotifier(#id,#notifierType)</expression>
+                <expression>getNotifier(#id,#notifierId)</expression>
               </scalar>
             </scalars>
           </view>
@@ -252,7 +252,7 @@
             <scalars>
               <scalar>
                 <id>notifier</id>
-                <expression>getNotifier(#id,#notifierType)</expression>
+                <expression>getNotifier(#id,#notifierId)</expression>
               </scalar>
               <scalar>
                 <id>project</id>
@@ -265,7 +265,7 @@
             <scalars>
               <scalar>
                 <id>notifier</id>
-                <expression>getNotifier(#id,#notifierType)</expression>
+                <expression>getNotifier(#id,#notifierId)</expression>
               </scalar>
               <scalar>
                 <id>project</id>
@@ -388,11 +388,11 @@
            -->
           <call>
             <cid>deleteNotifier</cid>
-            <expression>removeNotifier(#id,#notifierType)</expression>
+            <expression>removeNotifier(#id,#notifierId)</expression>
           </call>
           <call>
             <cid>updateNotifier</cid>
-            <expression>updateNotifier(#id,#notifierType,#parameters)</expression>
+            <expression>updateNotifier(#id,#notifierId,#parameters)</expression>
           </call>
         </calls>
       </configuration>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm?rev=240262&r1=240261&r2=240262&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm Fri Aug
26 08:20:41 2005
@@ -132,22 +132,22 @@
           <td>Project</td>
           #if ( $notifier.type == "irc" )
             <td>
-              #set ( $editNotifierLink = $link.setPage('EditIrcNotifier.vm').addPathInfo('view','EditIrcNotifier').addPathInfo('notifierType',
$notifier.type).addPathInfo('id', $item.id) )
+              #set ( $editNotifierLink = $link.setPage('EditIrcNotifier.vm').addPathInfo('view','EditIrcNotifier').addPathInfo('notifierId',
$notifier.id).addPathInfo('id', $item.id) )
               <a href="$editNotifierLink">Edit</a> <!-- | <a href="$deleteNotifierLink">Delete</a>
-->
             </td>
           #elseif ( $notifier.type == "mail" )
             <td>
-              #set ( $editNotifierLink = $link.setPage('EditMailNotifier.vm').addPathInfo('view','EditMailNotifier').addPathInfo('notifierType',
$notifier.type).addPathInfo('id', $item.id) )
+              #set ( $editNotifierLink = $link.setPage('EditMailNotifier.vm').addPathInfo('view','EditMailNotifier').addPathInfo('notifierId',
$notifier.id).addPathInfo('id', $item.id) )
               <a href="$editNotifierLink">Edit</a> <!-- | <a href="$deleteNotifierLink">Delete</a>
-->
             </td>
           #elseif ( $notifier.type == "msn" )
             <td>
-              #set ( $editNotifierLink = $link.setPage('EditMsnNotifier.vm').addPathInfo('view','EditMsnNotifier').addPathInfo('notifierType',
$notifier.type).addPathInfo('id', $item.id) )
+              #set ( $editNotifierLink = $link.setPage('EditMsnNotifier.vm').addPathInfo('view','EditMsnNotifier').addPathInfo('notifierId',
$notifier.id).addPathInfo('id', $item.id) )
               <a href="$editNotifierLink">Edit</a> <!-- | <a href="$deleteNotifierLink">Delete</a>
-->
             </td>
           #elseif ( $notifier.type == "jabber" )
             <td>
-              #set ( $editNotifierLink = $link.setPage('EditJabberNotifier.vm').addPathInfo('view','EditJabberNotifier').addPathInfo('notifierType',
$notifier.type).addPathInfo('id', $item.id) )
+              #set ( $editNotifierLink = $link.setPage('EditJabberNotifier.vm').addPathInfo('view','EditJabberNotifier').addPathInfo('notifierId',
$notifier.id).addPathInfo('id', $item.id) )
               <a href="$editNotifierLink">Edit</a> <!-- | <a href="$deleteNotifierLink">Delete</a>
-->
             </td>
           #end



Mime
View raw message