continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r581740 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ resources/ resources/localization/ webapp/WEB-INF/jsp/
Date Wed, 03 Oct 2007 22:38:37 GMT
Author: olamy
Date: Wed Oct  3 15:38:28 2007
New Revision: 581740

URL: http://svn.apache.org/viewvc?rev=581740&view=rev
Log:
[CONTINUUM-1487] add a confirmation page before delete buildResult(s)

Added:
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmBuildResultsRemoval.jsp
  (with props)
Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumConfirmAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java?rev=581740&r1=581739&r2=581740&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
Wed Oct  3 15:38:28 2007
@@ -43,7 +43,7 @@
  * @plexus.component role="com.opensymphony.xwork.Action" role-hint="buildResult"
  */
 public class BuildResultAction
-    extends ContinuumActionSupport
+    extends ContinuumConfirmAction
 {
     private Project project;
 
@@ -62,6 +62,7 @@
     private String state;
 
     private String projectGroupName = "";
+    
 
     public String execute()
         throws ContinuumException, ConfigurationException, IOException
@@ -111,10 +112,13 @@
         {
             return REQUIRES_AUTHORIZATION;
         }
-        
-        getContinuum().removeBuildResult( buildId );
-        
-        return SUCCESS;
+        if ( this.isConfirmed() )
+        {
+            getContinuum().removeBuildResult( buildId );
+            return SUCCESS;
+        }
+
+        return CONFIRM;
     }
 
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java?rev=581740&r1=581739&r2=581740&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
Wed Oct  3 15:38:28 2007
@@ -33,7 +33,7 @@
  * @plexus.component role="com.opensymphony.xwork.Action" role-hint="buildResults"
  */
 public class BuildResultsListAction
-    extends ContinuumActionSupport
+    extends ContinuumConfirmAction
 {
     private Project project;
 
@@ -42,11 +42,13 @@
     private Collection selectedBuildResults;
 
     private int projectId;
+    
+    private int projectGroupId;
 
     private String projectName;
 
     private String projectGroupName = "";
-
+    
     public String execute()
         throws ContinuumException
     {
@@ -77,28 +79,30 @@
         {
             return REQUIRES_AUTHORIZATION;
         }
-        
-        if ( selectedBuildResults != null && !selectedBuildResults.isEmpty() )
+        if ( this.isConfirmed() )
         {
-            for ( Iterator i = selectedBuildResults.iterator(); i.hasNext(); )
+            if ( selectedBuildResults != null && !selectedBuildResults.isEmpty()
)
             {
-                int buildId = Integer.parseInt( (String) i.next() );
-                
-                try
-                {
-                    getLogger().info( "Removing BuildResult with id=" + buildId );
-                    
-                    getContinuum().removeBuildResult( buildId );
-                }
-                catch ( ContinuumException e )
+                for ( Iterator i = selectedBuildResults.iterator(); i.hasNext(); )
                 {
-                    getLogger().error( "Error removing BuildResult with id=" + buildId );
-                    addActionError( "Unable to remove BuildResult with id=" + buildId );
+                    int buildId = Integer.parseInt( (String) i.next() );
+
+                    try
+                    {
+                        getLogger().info( "Removing BuildResult with id=" + buildId );
+
+                        getContinuum().removeBuildResult( buildId );
+                    }
+                    catch ( ContinuumException e )
+                    {
+                        getLogger().error( "Error removing BuildResult with id=" + buildId
);
+                        addActionError( "Unable to remove BuildResult with id=" + buildId
);
+                    }
                 }
             }
+            return SUCCESS;
         }
-        
-        return SUCCESS;
+        return CONFIRM;
     }
 
     public int getProjectId()
@@ -151,4 +155,16 @@
     {
         this.selectedBuildResults = selectedBuildResults;
     }
+
+    public int getProjectGroupId()
+    {
+        return projectGroupId;
+    }
+
+    public void setProjectGroupId( int projectGroupId )
+    {
+        this.projectGroupId = projectGroupId;
+    }
+
+    
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumConfirmAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumConfirmAction.java?rev=581740&r1=581739&r2=581740&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumConfirmAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumConfirmAction.java
Wed Oct  3 15:38:28 2007
@@ -89,19 +89,19 @@
         return confirmedDisplay;
     }
 
-    public void setConfirmed( boolean _confirmed )
+    public void setConfirmed( boolean confirmed )
     {
-        confirmed = _confirmed;
+        this.confirmed = confirmed;
     }
 
-    public boolean getConfirmed()
+    public boolean isConfirmed()
     {
         return confirmed;
     }
 
-    public void setAction( String _action )
+    public void setAction( String action )
     {
-        action = _action;
+        this.action = action;
     }
 
     public String getAction()

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=581740&r1=581739&r2=581740&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Wed Oct  3 15:38:28 2007
@@ -740,4 +740,12 @@
 checkoutQueue.no.currentTaks = No current checkout
 checkoutQueue.section.title = Checkout Queue
 checkoutQueue.empty = Checkout Queue is empty
-checkoutQueue.removeEntries = Cancel Entries
\ No newline at end of file
+checkoutQueue.removeEntries = Cancel Entries
+
+# ----------------------------------------------------------------------
+# Page: Confirm Delete BuildResult(s)
+# ----------------------------------------------------------------------
+buildResult.delete.confirmation.page.title = Continuum - Delete Build Results
+buildResult.delete.confirmation.section.title = Delete Build Results
+buildResult.delete.confirmation.message = Are you sure you want to delete {0} build results
? 
+

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=581740&r1=581739&r2=581740&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Wed Oct  3 15:38:28
2007
@@ -1,6 +1,6 @@
 <!--
   ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
+  ~ or more contributor license agreements.  See the NOTICE filebu
   ~ distributed with this work for additional information
   ~ regarding copyright ownership.  The ASF licenses this file
   ~ to you under the Apache License, Version 2.0 (the
@@ -336,6 +336,7 @@
         <param name="actionName">buildResults</param>
         <param name="projectId">${projectId}</param>
       </result>
+      <result name="confirm">/WEB-INF/jsp/confirmBuildResultsRemoval.jsp</result>
     </action>
 
     <action name="buildResult" class="buildResult">
@@ -353,6 +354,7 @@
         <param name="actionName">buildResults</param>
         <param name="projectId">${projectId}</param>
       </result>
+      <result name="confirm">/WEB-INF/jsp/confirmBuildResultsRemoval.jsp</result>
     </action>
 
     <action name="surefireReport" class="surefireReport">

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp?rev=581740&r1=581739&r2=581740&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResults.jsp Wed
Oct  3 15:38:28 2007
@@ -40,6 +40,8 @@
             </ww:text>
         </h3>
         <form id="buildResultsForm" action="removeBuildResults.action" method="post">
+          <ww:hidden name="projectGroupId"/>
+          <ww:hidden name="projectId"/> 
           <ww:set name="buildResults" value="buildResults" scope="request"/>
           <ec:table items="buildResults"
                     var="buildResult"

Added: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmBuildResultsRemoval.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmBuildResultsRemoval.jsp?rev=581740&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmBuildResultsRemoval.jsp
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmBuildResultsRemoval.jsp
Wed Oct  3 15:38:28 2007
@@ -0,0 +1,71 @@
+<%--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  --%>
+
+<%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="continuum" prefix="c1" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="buildResult.delete.confirmation.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><ww:text name="buildResult.delete.confirmation.section.title"/></h3>
+        <div class="axial">
+        <!-- in this case we come from the build result edit -->
+        <ww:if test="buildId">
+          <form action="removeBuildResult.action" method="post">
+        </ww:if>
+        <ww:else>
+          <form action="removeBuildResults.action" method="post">
+        </ww:else>
+          <ww:hidden name="projectGroupId"/>
+          <ww:hidden name="projectId"/>
+          <ww:hidden name="buildId"/>
+          <ww:hidden name="confirmed" value="true"/>
+          <ww:if test="selectedBuildResults">
+          <ww:iterator value="selectedBuildResults">
+            <input type="hidden" value="<ww:property/>" name="selectedBuildResults"
/>
+          </ww:iterator>
+          </ww:if>
+          <ww:else>
+            <input type="hidden" value="<ww:property value="buildId"/>" name="selectedBuildResults"
/>
+          </ww:else>
+          
+          <ww:actionerror/>
+
+          <div class="warningmessage">
+            <p>
+              <strong>
+                <ww:text name="buildResult.delete.confirmation.message">
+                  <ww:param><ww:property value="%{selectedBuildResults.size}"/></ww:param>
+                </ww:text>
+              </strong>
+            </p>
+          </div>
+
+          <div class="functnbar3">
+            <c1:submitcancel value="%{getText('delete')}" cancel="%{getText('cancel')}"/>
+          </div>
+        </form>
+        </div>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmBuildResultsRemoval.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmBuildResultsRemoval.jsp
------------------------------------------------------------------------------
    svn:executable = *

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmBuildResultsRemoval.jsp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message