continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcconn...@apache.org
Subject svn commit: r432746 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/core/action/ continuum-core/src/test/java/org/apache/maven/continuum/ continuum-webapp/src...
Date Fri, 18 Aug 2006 22:11:17 GMT
Author: jmcconnell
Date: Fri Aug 18 15:11:16 2006
New Revision: 432746

URL: http://svn.apache.org/viewvc?rev=432746&view=rev
Log:
fixed some build definition navigation issues coupled with a bug in group definition updates,
added a test case for it too

Modified:
    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/core/action/AbstractBuildDefinitionContinuumAction.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/components/buildDefinitionGroupSummaryComponent.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/components/buildDefinitionSummaryComponent.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/error.jsp

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=432746&r1=432745&r2=432746&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 18 15:11:16 2006
@@ -1395,7 +1395,7 @@
         context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
         context.put( AbstractContinuumAction.KEY_PROJECT_ID, new Integer( projectId ) );
 
-        executeAction( "update-build-definition-for-project", context );
+        executeAction( "update-build-definition-from-project", context );
     }
 
     public void addBuildDefinitionToProjectGroup( int projectGroupId, BuildDefinition buildDefinition
)
@@ -1428,7 +1428,7 @@
         context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
         context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, new Integer( projectGroupId
) );
 
-        executeAction( "update-build-definition-for-project-group", context );
+        executeAction( "update-build-definition-from-project-group", context );
     }
 
     public void removeBuildDefinition( int projectId, int buildDefinitionId )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java?rev=432746&r1=432745&r2=432746&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
Fri Aug 18 15:11:16 2006
@@ -95,7 +95,7 @@
             // if buildDefinition passed in is not default then we are done
             if ( buildDefinition.isDefaultForProject() )
             {
-                if ( storedDefinition != null )
+                if ( storedDefinition != null && storedDefinition.getId() != buildDefinition.getId()
)  
                 {
                     storedDefinition.setDefaultForProject( false );
 
@@ -107,12 +107,14 @@
                 //make sure we are not wacking out default build definition, that would be
bad
                 if ( buildDefinition.getId() == storedDefinition.getId() )
                 {
+                    getLogger().info( "processing this build definition would result in no
default build definition for project group" );
                     throw new ContinuumException( "processing this build definition would
result in no default build definition for project group" );
                 }
             }
         }
         catch ( ContinuumStoreException cse )
         {
+            getLogger().info( "error updating old default build definition", cse );
             throw new ContinuumException( "error updating old default build definition",
cse );
         }
     }
@@ -170,7 +172,7 @@
 
                 storedDefinition.setSchedule( schedule );
 
-                store.storeBuildDefinition( buildDefinition );
+                store.storeBuildDefinition( storedDefinition );
             }
             else
             {

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=432746&r1=432745&r2=432746&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Fri Aug 18 15:11:16 2006
@@ -173,6 +173,14 @@
 
         BuildDefinition pgbd = (BuildDefinition) buildDefs.get( 0 );
 
+        pgbd.setGoals( "foo" );
+
+        continuum.updateBuildDefinitionForProjectGroup( projectGroup.getId(), pgbd );
+
+        pgbd = continuum.getBuildDefinition(  pgbd.getId() );
+
+        assertTrue ( "update failed for project group build definition", "foo".equals( pgbd.getGoals()
) );
+
         assertTrue ( "project group build definition is not default", pgbd.isDefaultForProject()
);
 
         assertTrue ( "project group build definition not default for project", continuum.getDefaultBuildDefinition(
project.getId() ).getId() == pgbd.getId() );

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java?rev=432746&r1=432745&r2=432746&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
Fri Aug 18 15:11:16 2006
@@ -39,7 +39,7 @@
 {
     public static final String CONFIRM = "confirm";
 
-    private int buildDefinitionId = -1;
+    private int buildDefinitionId;
 
     private int projectId;
 
@@ -47,7 +47,7 @@
 
     private int scheduleId;
 
-    private boolean isDefault;
+    private boolean defaultBuildDefinition;
 
     private boolean confirmed = false;
 
@@ -121,14 +121,15 @@
             return ERROR;
         }
 
-        if ( buildDefinitionId != -1 )
+        if ( buildDefinitionId != 0 )
         {
             try
             {
                 BuildDefinition buildDefinition = continuum.getBuildDefinition( buildDefinitionId
);
                 goals = buildDefinition.getGoals();
                 arguments = buildDefinition.getArguments();
-                isDefault = buildDefinition.isDefaultForProject();
+                buildFile = buildDefinition.getBuildFile();
+                defaultBuildDefinition = buildDefinition.isDefaultForProject();
 
             }
             catch ( ContinuumException ce )
@@ -146,7 +147,7 @@
 
         try
         {
-            if ( buildDefinitionId == -1 )
+            if ( buildDefinitionId == 0 )
             {
                 continuum.addBuildDefinitionToProject( projectId, getBuildDefinitionFromInput()
);
             }
@@ -162,6 +163,7 @@
         }
         catch ( ContinuumException ce )
         {
+            getLogger().info("error saving project build definition", ce);
             addActionError( "error saving project build definition" );
             return ERROR;
         }
@@ -173,7 +175,7 @@
     {
         try
         {
-            if ( buildDefinitionId == -1 )
+            if ( buildDefinitionId == 0 )
             {
                 continuum.addBuildDefinitionToProjectGroup( projectGroupId, getBuildDefinitionFromInput()
);
             }
@@ -189,6 +191,7 @@
         }
         catch ( ContinuumException ce )
         {
+            getLogger().info("error saving group build definition", ce);
             addActionError( "error saving group build definition" );
             return ERROR;
         }
@@ -208,6 +211,7 @@
             }
             catch ( ContinuumException ce )
             {
+                getLogger().info("error removing build definition from project", ce);
                 addActionError( "error removing build definition from project" );
                 return ERROR;
             }
@@ -230,7 +234,8 @@
             }
             catch ( ContinuumException ce )
             {
-                addActionError( "error removing build definition from project" );
+                getLogger().info("error removing build definition from project group", ce);
+                addActionError( "error removing build definition from project group" );
                 return ERROR;
             }
         }
@@ -258,11 +263,14 @@
 
         BuildDefinition buildDefinition = new BuildDefinition();
 
-        buildDefinition.setId( buildDefinitionId );
+        if ( buildDefinitionId != 0 )
+        {
+            buildDefinition.setId( buildDefinitionId );
+        }
         buildDefinition.setGoals( goals );
         buildDefinition.setArguments( arguments );
         buildDefinition.setBuildFile( buildFile );
-        buildDefinition.setDefaultForProject( isDefault );
+        buildDefinition.setDefaultForProject( defaultBuildDefinition );
         buildDefinition.setSchedule( schedule );
 
         return buildDefinition;
@@ -308,14 +316,14 @@
         this.scheduleId = scheduleId;
     }
 
-    public boolean isDefault()
+    public boolean isDefaultBuildDefinition()
     {
-        return isDefault;
+        return defaultBuildDefinition;
     }
 
-    public void setDefault( boolean aDefault )
+    public void setDefaultBuildDefinition( boolean defaultBuildDefinition )
     {
-        isDefault = aDefault;
+        this.defaultBuildDefinition = defaultBuildDefinition;
     }
 
     public boolean isConfirmed()

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=432746&r1=432745&r2=432746&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Fri Aug 18 15:11:16
2006
@@ -116,12 +116,12 @@
     </action>
 
     <action name="saveGroupBuildDefinition" class="buildDefinition" method="saveToGroup">
-      <result name="success" type="chain">projectView</result>
+      <result name="success" type="chain">projectGroupView</result>
     </action>
 
     <action name="removeGroupBuildDefinition" class="buildDefinition" method="removeFromGroup">
       <result name="confirm">deleteBuildDefinition.jsp</result>
-      <result name="success" type="chain">projectView</result>
+      <result name="success" type="chain">projectGroupView</result>
     </action>
 
 
@@ -216,17 +216,22 @@
       <result name="success">workingCopy.jsp</result>
     </action>
 
-    <action name="schedules" class="schedules">
+    <!--
+    * schedule actions
+    -->
+    <action name="schedules" class="schedule" method="summary">
       <result name="success">schedules.jsp</result>
     </action>
 
-    <action name="addSchedule" class="addSchedule">
-      <result name="input">editSchedule.jsp</result>
+    <action name="schedule" class="schedule" method="input">
+      <result name="success">editSchedule.jsp</result>
+    </action>
+
+    <action name="addSchedule" class="schedule" method="add">
       <result name="success" type="chain">schedules</result>
     </action>
 
-    <action name="editSchedule" class="editSchedule">
-      <result name="input">editSchedule.jsp</result>
+    <action name="editSchedule" class="schedule" method="edit">
       <result name="success" type="chain">schedules</result>
     </action>
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp?rev=432746&r1=432745&r2=432746&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/buildDefinitionEdit.jsp Fri Aug
18 15:11:16 2006
@@ -1,4 +1,5 @@
 <%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
 <%@ taglib uri="continuum" prefix="c1" %>
 <html>
   <ww:i18n name="localization.Continuum">
@@ -10,10 +11,23 @@
         <h3><ww:text name="buildDefinition.section.title"/></h3>
 
         <div class="axial">
-          
-          <ww:form action="addProjectBuildDefinition" method="post">
+
+
+
+          <ww:if test="${projectId != 0}">
+            <ww:url id="actionUrl" action="saveProjectBuildDefinition"/>
+          </ww:if>
+          <ww:else>
+            <ww:url id="actionUrl" action="saveGroupBuildDefinition"/>
+          </ww:else>
+
+
+
+          <ww:form action="%{actionUrl}" method="post" >
+
             <ww:hidden name="buildDefinitionId"/>
             <ww:hidden name="projectId"/>
+            <ww:hidden name="projectGroupId"/>
 
             <table>
               <tbody>
@@ -37,7 +51,7 @@
                 </ww:else>
 
                 <ww:textfield label="%{getText('buildDefinition.arguments.label')}" name="arguments"/>
-                <ww:checkbox label="%{getText('buildDefinition.defaultForProject.label')}"
 name="defaultForProject" value="defaultForProject" fieldValue="true"/>
+                <ww:checkbox label="%{getText('buildDefinition.defaultForProject.label')}"
 name="defaultBuildDefinition" value="defaultBuildDefinition" fieldValue="true"/>
                 <ww:select label="%{getText('buildDefinition.schedule.label')}" name="scheduleId"
list="schedules"/>
               </tbody>
             </table>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/components/buildDefinitionGroupSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/components/buildDefinitionGroupSummaryComponent.jsp?rev=432746&r1=432745&r2=432746&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/components/buildDefinitionGroupSummaryComponent.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/components/buildDefinitionGroupSummaryComponent.jsp
Fri Aug 18 15:11:16 2006
@@ -21,11 +21,11 @@
       <ec:column property="from" title="projectView.buildDefinition.from"/>
       <ec:column property="isDefault" title="projectView.buildDefinition.default"/>
       <ec:column property="actions" title="&nbsp;">
-          <ww:url id="editUrl" action="buildDefinition" method="input">
+          <ww:url id="editUrl" action="buildDefinition" method="input" namespace="/">
             <ww:param name="projectGroupId">${pageScope.buildDefinitionSummary.projectGroupId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
           </ww:url>
-          <ww:url id="removeUrl" action="removeGroupBuildDefinition">
+          <ww:url id="removeUrl" action="removeGroupBuildDefinition" namespace="/">
             <ww:param name="projectGroupId">${pageScope.buildDefinitionSummary.projectGroupId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
             <ww:param name="confirmed" value="false"/>
@@ -62,11 +62,11 @@
       <ec:column property="from" title="projectView.buildDefinition.from"/>
       <ec:column property="isDefault" title="projectView.buildDefinition.default"/>
       <ec:column property="actions" title="&nbsp;">
-          <ww:url id="editUrl" action="buildDefinition" method="input">
+          <ww:url id="editUrl" action="buildDefinition" method="input" namespace="/">
             <ww:param name="projectId">${pageScope.buildDefinitionSummary.projectId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
           </ww:url>
-          <ww:url id="removeUrl" action="removeProjectBuildDefinition">
+          <ww:url id="removeUrl" action="removeProjectBuildDefinition" namespace="/">
             <ww:param name="projectId">${pageScope.buildDefinitionSummary.projectId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
             <ww:param name="confirmed" value="false"/>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/components/buildDefinitionSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/components/buildDefinitionSummaryComponent.jsp?rev=432746&r1=432745&r2=432746&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/components/buildDefinitionSummaryComponent.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/components/buildDefinitionSummaryComponent.jsp
Fri Aug 18 15:11:16 2006
@@ -2,7 +2,7 @@
 <%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
 <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
 <%@ taglib uri="continuum" prefix="c1" %>
-<ww:i18n name="localization.Continuum">  
+<ww:i18n name="localization.Continuum">
   <ec:table items="allBuildDefinitionSummaries"
             var="buildDefinitionSummary"
             showExports="false"
@@ -21,22 +21,22 @@
       <ec:column property="actions" title="&nbsp;">
         <!-- if the from is PROJECT then render the links differently -->
         <ww:if test="${pageScope.buildDefinitionSummary.from == 'PROJECT'}">
-          <ww:url id="editUrl" action="buildDefinition" method="input">
+          <ww:url id="editUrl" action="buildDefinition" method="input" namespace="/">
             <ww:param name="projectId">${pageScope.buildDefinitionSummary.projectId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
           </ww:url>
-          <ww:url id="removeUrl" action="removeProjectBuildDefinition">
+          <ww:url id="removeUrl" action="removeProjectBuildDefinition" namespace="/">
             <ww:param name="projectId">${pageScope.buildDefinitionSummary.projectId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
             <ww:param name="confirmed" value="false"/>
           </ww:url>
         </ww:if>
         <ww:else>
-          <ww:url id="editUrl" action="buildDefinition" method="input">
+          <ww:url id="editUrl" action="buildDefinition" method="input" namespace="/">
             <ww:param name="projectGroupId">${pageScope.buildDefinitionSummary.projectGroupId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
           </ww:url>
-          <ww:url id="removeUrl" action="removeGroupBuildDefinition">
+          <ww:url id="removeUrl" action="removeGroupBuildDefinition" namespace="/">
             <ww:param name="projectGroupId">${pageScope.buildDefinitionSummary.projectGroupId}</ww:param>
             <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
             <ww:param name="confirmed" value="false"/>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/error.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/error.jsp?rev=432746&r1=432745&r2=432746&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/error.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/error.jsp Fri Aug 18 15:11:16 2006
@@ -1,16 +1,27 @@
 <%@ taglib uri="/webwork" prefix="ww" %>
 <html>
-  <ww:i18n name="localization.Continuum">
-    <head>
-        <title><ww:text name="error.page.title"/></title>
-    </head>
-    <body>
-      <div id="axial" class="h3">
-        <h3><ww:text name="error.section.title"/></h3>
-        <p>
-          <ww:text name="error.message"/>
-        </p>
-      </div>
-    </body>
-  </ww:i18n>
+<ww:i18n name="localization.Continuum">
+  <head>
+    <title><ww:text name="error.page.title"/></title>
+  </head>
+
+  <body>
+  <div id="axial" class="h3">
+    <h3><ww:text name="error.section.title"/></h3>
+
+    <p>
+      <ww:text name="error.message"/>
+    </p>
+
+    <p>
+
+
+      <h3>Action Error</h3>
+      <p>
+        <ww:actionerror/>
+       </p>
+    </p>
+  </div>
+  </body>
+</ww:i18n>
 </html>



Mime
View raw message