continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r240351 - 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-model/src/main/mdo...
Date Fri, 26 Aug 2005 21:46:29 GMT
Author: evenisse
Date: Fri Aug 26 14:46:12 2005
New Revision: 240351

URL: http://svn.apache.org/viewcvs?rev=240351&view=rev
Log:
[CONTINUUM-282] Add edit screen for build definitions

Added:
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildDefinition.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-model/src/main/mdo/continuum.mdo
    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/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=240351&r1=240350&r2=240351&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 14:46:12 2005
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
@@ -135,5 +136,15 @@
         throws ContinuumException;
 
     Project getProjectWithBuilds( int projectId )
+        throws ContinuumException;
+
+    // ----------------------------------------------------------------------
+    // Build Definition
+    // ----------------------------------------------------------------------
+
+    BuildDefinition getBuildDefinition( int projectId, int buildDefinitionId )
+        throws ContinuumException;
+
+    void updateBuildDefinition( int projectId, int buildDefinitionId, Map configuration )
         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=240351&r1=240350&r2=240351&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
Fri Aug 26 14:46:12 2005
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Profile;
 import org.apache.maven.continuum.model.project.Project;
@@ -50,6 +51,9 @@
         throws ContinuumStoreException;
 
     ProjectNotifier storeNotifier( ProjectNotifier notifier )
+        throws ContinuumStoreException;
+
+    BuildDefinition storeBuildDefinition( BuildDefinition buildDefinition )
         throws ContinuumStoreException;
 
     ProjectGroup addProjectGroup( ProjectGroup group );

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=240351&r1=240350&r2=240351&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 14:46:12 2005
@@ -28,6 +28,7 @@
 import org.apache.maven.continuum.core.action.StoreProjectAction;
 import org.apache.maven.continuum.initialization.ContinuumInitializationException;
 import org.apache.maven.continuum.initialization.ContinuumInitializer;
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -603,6 +604,59 @@
         if ( n != null )
         {
             removeNotifier( n );
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    // Build Definition
+    // ----------------------------------------------------------------------
+
+    public BuildDefinition getBuildDefinition( int projectId, int buildDefinitionId )
+        throws ContinuumException
+    {
+        Project project = getProjectWithAllDetails( projectId );
+
+        List buildDefinitions = project.getBuildDefinitions();
+
+        BuildDefinition buildDefinition = null;
+
+        for ( Iterator i = buildDefinitions.iterator(); i.hasNext(); )
+        {
+            buildDefinition = (BuildDefinition) i.next();
+
+            if ( buildDefinition.getId() == buildDefinitionId )
+            {
+                break;
+            }
+        }
+
+        return buildDefinition;
+    }
+
+    public void updateBuildDefinition( int projectId, int buildDefinitionId, Map configuration
)
+        throws ContinuumException
+    {
+        BuildDefinition buildDefinition = getBuildDefinition( projectId, buildDefinitionId
);
+
+        buildDefinition.setBuildFile( (String) configuration.get( "buildFile" ) );
+
+        buildDefinition.setGoals( (String) configuration.get( "goals" ) );
+
+        buildDefinition.setArguments( (String) configuration.get( "arguments" ) );
+
+        storeBuildDefinition( buildDefinition );
+    }
+
+    public BuildDefinition storeBuildDefinition( BuildDefinition buildDefinition )
+        throws ContinuumException
+    {
+        try
+        {
+            return store.storeBuildDefinition( buildDefinition );
+        }
+        catch ( ContinuumStoreException ex )
+        {
+            throw logAndCreateException( "Error while storing buildDefinition.", ex );
         }
     }
 

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=240351&r1=240350&r2=240351&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 14:46:12 2005
@@ -467,6 +467,13 @@
       <version>1.0.0+</version>
       <fields>
         <field>
+          <name>id</name>
+          <required>true</required>
+          <identifier>true</identifier>
+          <version>1.0.0+</version>
+          <type>int</type>
+        </field>
+        <field>
           <name>goals</name>
           <version>1.0.0+</version>
           <type>String</type>

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=240351&r1=240350&r2=240351&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
Fri Aug 26 14:46:12 2005
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Profile;
 import org.apache.maven.continuum.model.project.Project;
@@ -250,7 +251,16 @@
         throws ContinuumStoreException
     {
         updateObject( notifier );
+
         return notifier;
+    }
+
+    public BuildDefinition storeBuildDefinition( BuildDefinition buildDefinition )
+        throws ContinuumStoreException
+    {
+        updateObject( buildDefinition );
+
+        return buildDefinition;
     }
 
     private Object makePersistent( PersistenceManager pm, Object object, boolean detach )

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=240351&r1=240350&r2=240351&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 14:46:12 2005
@@ -208,6 +208,24 @@
           </view>
           <!--
            |
+           | Project Builds Definitions
+           |
+           -->
+          <view>
+            <id>BuildDefinition</id>
+            <scalars>
+              <scalar>
+                <id>project</id>
+                <expression>getProject(#id)</expression>
+              </scalar>
+              <scalar>
+                <id>buildDefinition</id>
+                <expression>getBuildDefinition(#id,#buildDefinitionId)</expression>
+              </scalar>
+            </scalars>
+          </view>
+          <!--
+           |
            | Notification
            |
            -->
@@ -393,6 +411,15 @@
           <call>
             <cid>updateNotifier</cid>
             <expression>updateNotifier(#id,#notifierId,#parameters)</expression>
+          </call>
+          <!--
+           |
+           | Build Definition
+           |
+           -->
+          <call>
+            <cid>updateBuildDefinition</cid>
+            <expression>updateBuildDefinition(#id,#buildDefinitionId,#parameters)</expression>
           </call>
         </calls>
       </configuration>

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=240351&r1=240350&r2=240351&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
Fri Aug 26 14:46:12 2005
@@ -143,6 +143,18 @@
 continuumError = Continuum Error
 
 // ----------------------------------------------------------------------
+// Build Definition
+// ----------------------------------------------------------------------
+
+project.title.buildDefinition = Add Build Definition
+buildDefinition.pomFilename.label = POM filename
+buildDefinition.pomFilename.message =  Relative path of the POM file
+buildDefinition.goals.label = Goals
+buildDefinition.goals.message =  Enter one or more goals - leave empty to use the default
+buildDefinition.arguments.label = Arguments
+buildDefinition.arguments.message =  Enter one or more command line arguments
+
+// ----------------------------------------------------------------------
 // Notification
 // ----------------------------------------------------------------------
 

Added: 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=240351&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildDefinition.vm
(added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildDefinition.vm
Fri Aug 26 14:46:12 2005
@@ -0,0 +1,47 @@
+$page.setTitle( $i18n.getString( "project.title.buildDefinition" ) )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( "project.title.buildDefinition" )</h3>
+    <form method="post" action="$link">
+      #hidden ( "action" "cam" )
+      #hidden ( "cid" "updateBuildDefinition" )
+      #hidden ( "view" "View.vm" )
+      #hidden ( "fid" "$!{project.executorId}Project" )
+      #hidden ( "id" $project.id )
+      #hidden ( "buildDefinitionId" $buildDefinition.id )
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          <tr>
+            <th>$i18n.getString( "buildDefinition.pomFilename.label" )</th>
+            <td>
+              <input type="text" name="buildFile" value="$buildDefinition.buildFile" size="40"/>
+                  <p>
+                    $i18n.getString( "buildDefinition.pomFilename.message" ) <font color="red"><b></b></font>
+                  </p>
+            </td>
+          </tr>
+          <tr>
+            <th>$i18n.getString( "buildDefinition.goals.label" )</th>
+            <td>
+              <input type="text" name="goals" value="$buildDefinition.goals" size="40"/>
+                  <p>
+                    $i18n.getString( "buildDefinition.goals.message" ) <font color="red"><b></b></font>
+                  </p>
+            </td>
+          </tr>
+          <tr>
+            <th>$i18n.getString( "buildDefinition.arguments.label" )</th>
+            <td>
+              <input type="text" name="arguments" value="$buildDefinition.arguments" size="40"/>
+                  <p>
+                    $i18n.getString( "buildDefinition.arguments.message" ) <font color="red"><b></b></font>
+                  </p>
+            </td>
+          </tr>
+        </table>
+        #submitBar( "Submit" )
+      </div>
+    </form>
+  </div>
+</div>

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

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

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=240351&r1=240350&r2=240351&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 14:46:12 2005
@@ -81,7 +81,8 @@
         </td>
         <td>Project</td>
         <td>
-          <!-- <a href="#">Edit</a> | <a href="#">Delete</a> -->
+          #set ( $buildDefinitionLink = $link.setPage('BuildDefinition.vm').addPathInfo('view','BuildDefinition').addPathInfo('buildDefinitionId',
$buildDefinition.id).addPathInfo('id', $item.id) )
+          <a href="$buildDefinitionLink">Edit</a><!--  | <a href="#">Delete</a>
-->
         </td>
       </tr>
       #end



Mime
View raw message