continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r264124 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-store/src/main/jav...
Date Mon, 29 Aug 2005 12:18:42 GMT
Author: evenisse
Date: Mon Aug 29 05:18:23 2005
New Revision: 264124

URL: http://svn.apache.org/viewcvs?rev=264124&view=rev
Log:
[CONTINUUM-299] use build definitions

Added:
    maven/continuum/trunk/continuum-web/src/main/resources/forms/buildDefinition.xml   (with
props)
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddBuildDefinition.vm
  (with props)
Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
    maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildDefinition.vm
    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=264124&r1=264123&r2=264124&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
Mon Aug 29 05:18:23 2005
@@ -147,4 +147,10 @@
 
     void updateBuildDefinition( int projectId, int buildDefinitionId, Map configuration )
         throws ContinuumException;
+
+    void addBuildDefinition( int projectId, Map configuration )
+        throws ContinuumException;
+
+    void removeBuildDefinition( int projectId, int buildDefinitionId )
+        throws ContinuumException;
 }

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?rev=264124&r1=264123&r2=264124&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
Mon Aug 29 05:18:23 2005
@@ -53,6 +53,9 @@
     ProjectNotifier storeNotifier( ProjectNotifier notifier )
         throws ContinuumStoreException;
 
+    void removeBuildDefinition( BuildDefinition buildDefinition )
+        throws ContinuumStoreException;
+
     BuildDefinition storeBuildDefinition( BuildDefinition buildDefinition )
         throws ContinuumStoreException;
 

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=264124&r1=264123&r2=264124&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
Mon Aug 29 05:18:23 2005
@@ -660,8 +660,50 @@
         }
     }
 
+    public void addBuildDefinition( int projectId, Map configuration )
+        throws ContinuumException
+    {
+        BuildDefinition buildDefinition = new BuildDefinition();
+
+        buildDefinition.setBuildFile( (String) configuration.get( "buildFile" ) );
+
+        buildDefinition.setGoals( (String) configuration.get( "goals" ) );
+
+        buildDefinition.setArguments( (String) configuration.get( "arguments" ) );
+
+        Project project = getProjectWithAllDetails( projectId );
+
+        project.addBuildDefinition( buildDefinition );
+
+        updateProject( project );
+    }
+
+    public void removeBuildDefinition( int projectId, int buildDefinitionId )
+        throws ContinuumException
+    {
+        BuildDefinition buildDefinition = getBuildDefinition( projectId, buildDefinitionId
);
+
+        if ( buildDefinition != null )
+        {
+            removeBuildDefinition( buildDefinition );
+        }
+    }
+
+    public void removeBuildDefinition( BuildDefinition buildDefinition )
+        throws ContinuumException
+    {
+        try
+        {
+            store.removeBuildDefinition( buildDefinition );
+        }
+        catch ( ContinuumStoreException ex )
+        {
+            throw logAndCreateException( "Error while removing build definition.", ex );
+        }
+    }
+
     // ----------------------------------------------------------------------
-    // Lifecylce Management
+    // Lifecycle Management
     // ----------------------------------------------------------------------
 
     public void initialize()

Modified: maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?rev=264124&r1=264123&r2=264124&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
Mon Aug 29 05:18:23 2005
@@ -255,6 +255,12 @@
         return notifier;
     }
 
+    public void removeBuildDefinition( BuildDefinition buildDefinition )
+        throws ContinuumStoreException
+    {
+        attachAndDelete( buildDefinition );
+    }
+
     public BuildDefinition storeBuildDefinition( BuildDefinition buildDefinition )
         throws ContinuumStoreException
     {

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=264124&r1=264123&r2=264124&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
Mon Aug 29 05:18:23 2005
@@ -418,6 +418,14 @@
            |
            -->
           <call>
+            <cid>addBuildDefinition</cid>
+            <expression>addBuildDefinition(#id,#parameters)</expression>
+          </call>
+          <call>
+            <cid>deleteBuildDefinition</cid>
+            <expression>removeBuildDefinition(#id,#buildDefinitionId)</expression>
+          </call>
+          <call>
             <cid>updateBuildDefinition</cid>
             <expression>updateBuildDefinition(#id,#buildDefinitionId,#parameters)</expression>
           </call>

Added: maven/continuum/trunk/continuum-web/src/main/resources/forms/buildDefinition.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/buildDefinition.xml?rev=264124&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/buildDefinition.xml (added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/buildDefinition.xml Mon Aug
29 05:18:23 2005
@@ -0,0 +1,59 @@
+<form>
+  <id>buildDefinition</id>
+  <source-role>org.apache.maven.continuum.Continuum</source-role>
+  <lookup-expression>getBuildDefinition(#id,#buildDefinitionId)</lookup-expression>
 
+  <elements>
+    <element>
+      <id>pomFilename</id>
+      <validators>
+        <validator>
+          <id>required</id>
+          <error-message-key>project.pomFilename.error</error-message-key>
+        </validator>
+      </validators>
+      <type>text</type>
+      <label-key>buildDefinition.pomFilename.label</label-key>
+      <message-key>buildDefinition.pomFilename.message</message-key>
+    </element>
+    <element>
+      <id>goals</id>
+      <validators>
+        <validator>
+          <id>required</id>
+          <error-message-key>project.goals.error</error-message-key>
+        </validator>
+      </validators>
+      <type>text</type>
+      <label-key>buildDefinition.goals.label</label-key>
+      <message-key>buildDefinition.goals.message</message-key>
+    </element>
+    <element>
+      <id>arguments</id>
+      <validators>
+      </validators>
+      <type>text</type>
+      <label-key>buildDefinition.arguments.label</label-key>
+      <message-key>buildDefinition.arguments.message</message-key>
+    </element>
+  </elements>
+
+  <!-- Add -->
+  <add>
+    <title-key>project.title.buildDefinition.add</title-key>
+    <action>cam</action>
+    <view>Summary.vm</view>
+    <view-on-failure>AddBuildDefinition.vm</view-on-failure>
+    <fid-on-failure>buildDefinition</fid-on-failure>    
+    <expression>addBuildDefinition(#id)</expression>
+  </add>
+
+  <!-- Update -->
+  <update>
+    <title-key>project.title.buildDefinition.update</title-key>
+    <action>updateEntity</action>
+    <view>View.vm</view>
+    <view-on-failure>Edit.vm</view-on-failure>
+    <expression>updateBuildDefinition(#entity)</expression>
+  </update>
+
+</form>

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/forms/buildDefinition.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/forms/buildDefinition.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties?rev=264124&r1=264123&r2=264124&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
Mon Aug 29 05:18:23 2005
@@ -146,7 +146,8 @@
 // Build Definition
 // ----------------------------------------------------------------------
 
-project.title.buildDefinition = Add Build Definition
+project.title.buildDefinition.add = Add Build Definition
+project.title.buildDefinition.update = Edit Build Definition
 buildDefinition.pomFilename.label = POM filename
 buildDefinition.pomFilename.message =  Relative path of the POM file
 buildDefinition.goals.label = Goals

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddBuildDefinition.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddBuildDefinition.vm?rev=264124&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddBuildDefinition.vm
(added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddBuildDefinition.vm
Mon Aug 29 05:18:23 2005
@@ -0,0 +1,29 @@
+$page.setTitle( $form.add.titleKey )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( $form.add.titleKey )</h3>
+    <form method="post" action="$link" #if( $form.attributes.multipart )enctype="multipart/form-data"#end>
+      #hidden ( "action" "cam" )
+      #hidden ( "cid" "addBuildDefinition" )
+      #hidden ( "view" "$form.add.view" )
+      #hidden ( "id" $id )
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          #foreach ( $element in $form.elements )
+          #if ( !$element.immutable )
+          <tr>
+            #field( $i18n $data $element $item $formtool )
+          </tr>
+          #else
+            #if ( $element.defaultValue )
+              #hidden ( $element.id $element.defaultValue )
+            #end
+          #end
+          #end
+        </table>
+        #submitBar( "Submit" )
+      </div>
+    </form>
+  </div>
+</div>

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddBuildDefinition.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/AddBuildDefinition.vm
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildDefinition.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildDefinition.vm?rev=264124&r1=264123&r2=264124&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildDefinition.vm
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildDefinition.vm
Mon Aug 29 05:18:23 2005
@@ -1,8 +1,8 @@
-$page.setTitle( $i18n.getString( "project.title.buildDefinition" ) )
+$page.setTitle( $i18n.getString( "project.title.buildDefinition.update" ) )
 
 <div class="app">
   <div id="axial" class="h3">
-    <h3>$i18n.getString( "project.title.buildDefinition" )</h3>
+    <h3>$i18n.getString( "project.title.buildDefinition.update" )</h3>
     <form method="post" action="$link">
       #hidden ( "action" "cam" )
       #hidden ( "cid" "updateBuildDefinition" )

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=264124&r1=264123&r2=264124&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 Mon Aug
29 05:18:23 2005
@@ -87,19 +87,17 @@
       </tr>
       #end
     </table>
-    <!--
     <div class="functnbar3">
       <table>
         <tr>
           <td>
-            <form method="post" action="$link">
+            <form method="post" action="$link.setPage('AddBuildDefinition.vm').addPathInfo('view','BuildDefinition').addPathInfo('fid',
'buildDefinition').addPathInfo('id', $item.id).addPathInfo('executorId', $item.executorId)">
               <input type="submit" name="add-build-def" value="Add"/>
             </form>
           </td>
         </tr>
       </table>
     </div>
-    -->
     
     #if ( $project.notifiers )
     <h3>$i18n.getString( "project.notifiers.label" )</h3>



Mime
View raw message