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 @@ - /WEB-INF/jsp/admin/parallelbuilds.jsp - /WEB-INF/jsp/admin/parallelbuilds.jsp + /WEB-INF/jsp/admin/confirmDeleteBuildQueue.jsp + + buildQueueList + - + 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" %> + + + + <s:text name="deleteBuildQueue.page.title"/> + + +
+

+ +
+

+ + + + + +

+
+
+ + + + + +
+
+ +
+ \ 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 @@ - "> + + ${pageScope.buildQueue.id} + ${pageScope.buildQueue.name} + + " alt="" title="" border="0" /> - + " alt="" title="" border="0" />