continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r208961 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/ continuum-core/sr...
Date Sun, 03 Jul 2005 17:34:57 GMT
Author: trygvis
Date: Sun Jul  3 10:34:56 2005
New Revision: 208961

URL: http://svn.apache.org/viewcvs?rev=208961&view=rev
Log:
o Adding a 'checkout' button.

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
    maven/continuum/trunk/continuum-plexus-application/pom.xml
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/FormicaValve.java
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
    maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.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=208961&r1=208960&r2=208961&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
Sun Jul  3 10:34:56 2005
@@ -36,9 +36,19 @@
 {
     String ROLE = Continuum.class.getName();
 
+    // ----------------------------------------------------------------------
+    // Project
+    // ----------------------------------------------------------------------
+
     void removeProject( String projectId )
         throws ContinuumException;
 
+    boolean isBuilding( String id )
+        throws ContinuumException;
+
+    void checkoutProject( String id )
+        throws ContinuumException;
+
     ContinuumProject getProject( String projectId )
         throws ContinuumException;
 
@@ -48,10 +58,6 @@
     CheckOutScmResult getCheckOutScmResultForProject( String projectId )
         throws ContinuumException;
 
-    // ----------------------------------------------------------------------
-    // Projects
-    // ----------------------------------------------------------------------
-
     Collection getProjects()
         throws ContinuumException;
 
@@ -62,9 +68,6 @@
         throws ContinuumException;
 
     ContinuumBuild getLatestBuildForProject( String id )
-        throws ContinuumException;
-
-    boolean isBuilding( String id )
         throws ContinuumException;
 
     // ----------------------------------------------------------------------

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=208961&r1=208960&r2=208961&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
Sun Jul  3 10:34:56 2005
@@ -27,6 +27,7 @@
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
 import org.apache.maven.continuum.core.action.CreateProjectsFromMetadata;
 import org.apache.maven.continuum.core.action.StoreProjectAction;
+import org.apache.maven.continuum.core.action.AddProjectToCheckOutQueueAction;
 import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumProject;
@@ -120,12 +121,6 @@
         return core.getLatestBuildForProject( id );
     }
 
-    public boolean isBuilding( String id )
-        throws ContinuumException
-    {
-        return core.isBuilding( id );
-    }
-
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -134,6 +129,29 @@
         throws ContinuumException
     {
         core.removeProject( projectId );
+    }
+
+    public boolean isBuilding( String id )
+        throws ContinuumException
+    {
+        return core.isBuilding( id );
+    }
+
+    public void checkoutProject( String id )
+        throws ContinuumException
+    {
+        Map context = new HashMap();
+
+        context.put( AddProjectToCheckOutQueueAction.KEY_PROJECT_ID, id );
+
+        try
+        {
+            actionManager.lookup( "add-project-to-checkout-queue" ).execute( context );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "Error while adding the project to the check out
queue.", e );
+        }
     }
 
     public ContinuumProject getProject( String projectId )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=208961&r1=208960&r2=208961&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
Sun Jul  3 10:34:56 2005
@@ -22,14 +22,11 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
-import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.scm.ContinuumScm;
 import org.apache.maven.continuum.scm.UpdateScmResult;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=208961&r1=208960&r2=208961&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
Sun Jul  3 10:34:56 2005
@@ -30,6 +30,7 @@
 import org.codehaus.plexus.action.Action;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.taskqueue.TaskQueue;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
 import java.util.Map;
@@ -74,6 +75,19 @@
      */
     private ContinuumNotificationDispatcher notificationDispatcher;
 
+    // ----------------------------------------------------------------------
+    // Utils
+    // ----------------------------------------------------------------------
+
+    protected String nullIfEmpty( String string )
+    {
+        if ( StringUtils.isEmpty( string ) )
+        {
+            return null;
+        }
+
+        return string;
+    }
 
     // ----------------------------------------------------------------------
     //

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java?rev=208961&r1=208960&r2=208961&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
Sun Jul  3 10:34:56 2005
@@ -88,9 +88,9 @@
 
             project.setCheckOutScmResult( result );
 
-            project.setCheckOutErrorMessage( errorMessage );
+            project.setCheckOutErrorMessage( nullIfEmpty( errorMessage ) );
 
-            project.setCheckOutErrorException( AbstractContinuumStore.throwableToString(
exception ) );
+            project.setCheckOutErrorException( nullIfEmpty( AbstractContinuumStore.throwableToString(
exception ) ) );
 
             getStore().updateProject( project );
         }

Modified: maven/continuum/trunk/continuum-plexus-application/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/pom.xml?rev=208961&r1=208960&r2=208961&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/pom.xml (original)
+++ maven/continuum/trunk/continuum-plexus-application/pom.xml Sun Jul  3 10:34:56 2005
@@ -105,6 +105,12 @@
       <version>1.0-alpha-1</version>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-local</artifactId>
+      <version>1.0-alpha-1</version>
+      <scope>runtime</scope>
+    </dependency>
 
     <!-- Maven Wagons -->
     <dependency>

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/FormicaValve.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/FormicaValve.java?rev=208961&r1=208960&r2=208961&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/FormicaValve.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/FormicaValve.java
Sun Jul  3 10:34:56 2005
@@ -81,7 +81,7 @@
         }
         catch ( FormToolException e )
         {
-            throw new ValveInvocationException( "Error populating context: ", e );
+            throw new ValveInvocationException( "Error populating context.", e );
         }
     }
 }

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java?rev=208961&r1=208960&r2=208961&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
Sun Jul  3 10:34:56 2005
@@ -276,7 +276,7 @@
         }
         catch ( ComponentLookupException e )
         {
-            throw new FormToolException( "Cannot lookup source component: ", e );
+            throw new FormToolException( "Cannot lookup source component.", e );
         }
 
         Map map = new HashMap();

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=208961&r1=208960&r2=208961&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
Sun Jul  3 10:34:56 2005
@@ -270,6 +270,10 @@
             <cid>buildAllProjects</cid>
             <expression>buildProjects()</expression>
           </call>
+          <call>
+            <cid>checkoutProject</cid>
+            <expression>checkoutProject(#id)</expression>
+          </call>
         </calls>
       </configuration>
     </component>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm?rev=208961&r1=208960&r2=208961&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/CommonMacros.vm Sun Jul
 3 10:34:56 2005
@@ -32,7 +32,11 @@
 ## ----------------------------------------------------------------------------
 
 #macro ( text $element $elementData )
+#if ( $element && $element.attributes && $element.attributes.size > 0
)
 <input type="text" name="$element.id" value="$elementData" size="$element.attributes.size"/>
+#else
+<input type="text" name="$element.id" value="$elementData"/>
+#end
 #end
 
 #macro ( textarea $element $elementData )

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm?rev=208961&r1=208960&r2=208961&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ProjectBuilds.vm
Sun Jul  3 10:34:56 2005
@@ -1,10 +1,14 @@
 $page.setTitle( "Continuum - ${project.name} Builds" )
 
 <div class="app">
-  #if ( $project.checkOutErrorException )
+  #if ( !$project.checkOutScmResult.success )
   <h3>Checkout Exception</h3>
   <p>
+    There was a error while checking out the project: $project.checkOutErrorMessage
+
+    #if ( $project.checkOutErrorException && $project.checkOutErrorException != ""
)
     <div style="width:100%; height:500px; overflow:auto; border-style: solid; border-width:
1px"><code><pre>$project.checkOutErrorException</pre></code></div>
+    #end
   </p>
   #end
   <h3>Build results for $project.name</h3>

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=208961&r1=208960&r2=208961&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 Sun Jul
 3 10:34:56 2005
@@ -13,8 +13,20 @@
         </tr>
         #end
         #end
+    </table>
+    <div class="functnbar3">
+      <table>
+        <tr>
+          <td>
+            <form method="post" action="$link">
+            #hidden ( "action" "cam" )
+            #hidden ( "cid" "checkoutProject" )
+            #hidden ( "id" "$item.id" )
+            <input type="submit" name="checkout-project" value="Checkout"/>
+            </form>
+          </td>
+        </tr>
       </table>
-      #bar()
     </div>
   </div>
 



Mime
View raw message