continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r751144 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/admin/ resources/ resources/localization/ webapp/WEB-INF/jsp/admin/
Date Sat, 07 Mar 2009 00:06:35 GMT
Author: wsmoak
Date: Sat Mar  7 00:06:35 2009
New Revision: 751144

URL: http://svn.apache.org/viewvc?rev=751144&view=rev
Log:
[CONTINUUM-2051] Add confirmation upon deletion of a parallel build queue
Submitted by: Jan Ancajas

Added:
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildQueue.jsp
Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/resources/struts.xml
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/parallelbuilds.jsp

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java?rev=751144&r1=751143&r2=751144&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
Sat Mar  7 00:06:35 2009
@@ -24,7 +24,7 @@
 import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildQueue;
-import org.apache.maven.continuum.web.action.ContinuumActionSupport;
+import org.apache.maven.continuum.web.action.ContinuumConfirmAction;
 
 import com.opensymphony.xwork2.Preparable;
 
@@ -32,7 +32,7 @@
  * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="buildQueueAction"
  */
 public class BuildQueueAction
-    extends ContinuumActionSupport
+    extends ContinuumConfirmAction
     implements Preparable
 {
     private String name;
@@ -44,6 +44,8 @@
     private BuildQueue buildQueue;
     
     private String message;
+    
+    private boolean confirmed;
 
     public void prepare()
         throws ContinuumException
@@ -131,11 +133,19 @@
     public String delete()
         throws Exception
     {        
-        BuildQueue buildQueueToBeDeleted = getContinuum().getBuildQueue( this.buildQueue.getId()
);
-        getContinuum().getBuildsManager().removeOverallBuildQueue( buildQueueToBeDeleted.getId()
);
-        getContinuum().removeBuildQueue( buildQueueToBeDeleted );
+        if ( confirmed )
+        {
+            BuildQueue buildQueueToBeDeleted = getContinuum().getBuildQueue( this.buildQueue.getId()
);
+            getContinuum().getBuildsManager().removeOverallBuildQueue( buildQueueToBeDeleted.getId()
);
+            getContinuum().removeBuildQueue( buildQueueToBeDeleted );
 
-        this.buildQueueList = getContinuum().getAllBuildQueues();
+            this.buildQueueList = getContinuum().getAllBuildQueues();
+        }
+        else
+        {
+            return CONFIRM;
+        }
+        
         return SUCCESS;
     }
 
@@ -207,4 +217,14 @@
         
         return isExisting;
     }
+
+    public boolean isConfirmed()
+    {
+        return confirmed;
+    }
+
+    public void setConfirmed( boolean confirmed )
+    {
+        this.confirmed = confirmed;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=751144&r1=751143&r2=751144&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Sat Mar  7 00:06:35 2009
@@ -1049,6 +1049,13 @@
 parallel.build.queue.name = Name
 
 # ----------------------------------------------------------------------
+# Page: Delete Parallel Build Queue 
+# ----------------------------------------------------------------------
+deleteBuildQueue.page.title = Continuum - Delete Parallel Build Queue 
+deleteBuildQueue.section.title = Delete Parallel Build Queue
+deleteBuildQueue.confirmation.message = Are you sure you want to delete the build queue "{0}"?
+
+# ----------------------------------------------------------------------
 # Page: BuildAgents
 # ----------------------------------------------------------------------
 buildAgents.page.title = Continuum - Build Agents

Modified: continuum/trunk/continuum-webapp/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/struts.xml?rev=751144&r1=751143&r2=751144&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/struts.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/struts.xml Sat Mar  7 00:06:35 2009
@@ -843,10 +843,12 @@
     </action> 
     
     <action name="deleteBuildQueue" class="org.apache.maven.continuum.web.action.admin.BuildQueueAction"
method="delete">
-      <result name="input">/WEB-INF/jsp/admin/parallelbuilds.jsp</result>
-      <result name="success">/WEB-INF/jsp/admin/parallelbuilds.jsp</result> 
  
+      <result name="confirm">/WEB-INF/jsp/admin/confirmDeleteBuildQueue.jsp</result>
+      <result name="success" type="redirect-action">
+        <param name="actionName">buildQueueList</param>
+      </result>    
     </action>  
-        
+            
     <!--
     * Local Repository actions
     -->

Added: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildQueue.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildQueue.jsp?rev=751144&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildQueue.jsp
(added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildQueue.jsp
Sat Mar  7 00:06:35 2009
@@ -0,0 +1,50 @@
+<%--
+  ~ 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="/struts-tags" prefix="s" %>
+<%@ taglib uri="continuum" prefix="c1" %>
+<html>
+  <s:i18n name="localization.Continuum">
+    <head>
+        <title><s:text name="deleteBuildQueue.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><s:text name="deleteBuildQueue.section.title"/></h3>
+
+        <div class="warningmessage">
+          <p>
+            <strong>
+                <s:text name="deleteBuildQueue.confirmation.message">
+                    <s:param><s:property value="%{buildQueue.name}"/></s:param>
+                </s:text>
+            </strong>
+          </p>
+        </div>
+        <div class="functnbar3">
+          <s:form action="deleteBuildQueue" method="post">
+            <s:hidden name="buildQueue.id"/>
+            <s:hidden name="confirmed" value="true"/>
+            <c1:submitcancel value="%{getText('delete')}" cancel="%{getText('cancel')}"/>
+          </s:form>
+        </div>
+      </div>
+    </body>
+  </s:i18n>
+</html>
\ No newline at end of file

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/parallelbuilds.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/parallelbuilds.jsp?rev=751144&r1=751143&r2=751144&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/parallelbuilds.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/parallelbuilds.jsp
Sat Mar  7 00:06:35 2009
@@ -47,9 +47,13 @@
            
         <ec:column property="id" title="&nbsp;" width="1%">
           <c:if test="${buildQueue.id != 1}"> 
-            <a href="deleteBuildQueue!delete.action?buildQueue.id=<c:out value="${buildQueue.id}"/>">
+            <s:url id="deleteBuildQueueUrl" action="deleteBuildQueue">
+              <s:param name="buildQueue.id">${pageScope.buildQueue.id}</s:param>
+              <s:param name="buildQueue.name">${pageScope.buildQueue.name}</s:param>
+            </s:url>          
+            <s:a href="%{deleteBuildQueueUrl}">
               <img src="<s:url value='/images/delete.gif' includeParams="none"/>"
alt="<s:text name='delete'/>" title="<s:text name='delete'/>" border="0" />
-            </a>
+            </s:a>
           </c:if>
           <c:if test="${buildQueue.id == 1}">
               <img src="<s:url value='/images/delete_disabled.gif' includeParams="none"/>"
alt="<s:text name='delete'/>" title="<s:text name='delete'/>" border="0" />



Mime
View raw message