continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r752008 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ java/org/apache/maven/continuum/web/action/admin/ resources/ resources/localization/ webapp/WEB-INF/jsp/admin/
Date Tue, 10 Mar 2009 07:28:34 GMT
Author: ctan
Date: Tue Mar 10 07:28:33 2009
New Revision: 752008

URL: http://svn.apache.org/viewvc?rev=752008&view=rev
Log:
[CONTINUUM-2052] added confirmation pages when deleting installations and build definition
templates

Submitted By: Jan Ancajas

Added:
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionAsTemplate.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionTemplate.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteInstallation.jsp
Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildDefinitionAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.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/buildDefinitionTemplateSummary.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/installationsList.jsp

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildDefinitionAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildDefinitionAction.java?rev=752008&r1=752007&r2=752008&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildDefinitionAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildDefinitionAction.java
Tue Mar 10 07:28:33 2009
@@ -31,7 +31,7 @@
  * @since 16 sept. 07
  */
 public abstract class AbstractBuildDefinitionAction
-    extends ContinuumActionSupport
+    extends ContinuumConfirmAction
 {
 
     protected BuildDefinitionSummary generateBuildDefinitionSummary( BuildDefinition buildDefinition
)

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java?rev=752008&r1=752007&r2=752008&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
Tue Mar 10 07:28:33 2009
@@ -153,9 +153,17 @@
     public String delete()
         throws BuildDefinitionServiceException
     {
-        buildDefinitionTemplate = getContinuum().getBuildDefinitionService()
-            .getBuildDefinitionTemplate( this.buildDefinitionTemplate.getId() );
-        this.getContinuum().getBuildDefinitionService().removeBuildDefinitionTemplate( buildDefinitionTemplate
);
+        if ( confirmed )
+        {
+            buildDefinitionTemplate =
+                getContinuum().getBuildDefinitionService().getBuildDefinitionTemplate(
+                                                                                       this.buildDefinitionTemplate.getId()
);
+            this.getContinuum().getBuildDefinitionService().removeBuildDefinitionTemplate(
buildDefinitionTemplate );
+        }
+        else
+        {
+            return CONFIRM;
+        }
         return SUCCESS;
     }
     
@@ -233,8 +241,16 @@
     public String deleteBuildDefinition()
         throws BuildDefinitionServiceException
     {
-        buildDefinition = getContinuum().getBuildDefinitionService().getBuildDefinition(
this.buildDefinition.getId() );
-        this.getContinuum().getBuildDefinitionService().removeBuildDefinition( buildDefinition
);
+        if ( confirmed )
+        {
+            buildDefinition = getContinuum().getBuildDefinitionService().getBuildDefinition(
this.buildDefinition.getId() );
+            this.getContinuum().getBuildDefinitionService().removeBuildDefinition( buildDefinition
);
+        }
+        else
+        {
+            return CONFIRM;
+        }
+        
         return SUCCESS;
     }
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java?rev=752008&r1=752007&r2=752008&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java
Tue Mar 10 07:28:33 2009
@@ -12,7 +12,7 @@
 import org.apache.maven.continuum.model.system.Installation;
 import org.apache.maven.continuum.profile.AlreadyExistsProfileException;
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
-import org.apache.maven.continuum.web.action.ContinuumActionSupport;
+import org.apache.maven.continuum.web.action.ContinuumConfirmAction;
 import org.codehaus.plexus.redback.rbac.Resource;
 import org.codehaus.redback.integration.interceptor.SecureAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
@@ -45,7 +45,7 @@
  * @since 14 juin 07
  */
 public class InstallationAction
-    extends ContinuumActionSupport
+    extends ContinuumConfirmAction
     implements Preparable, SecureAction
 {
 
@@ -78,6 +78,8 @@
 
     private boolean automaticProfileDisplayable = true;
 
+    private boolean confirmed;
+
     // -----------------------------------------------------
     // Webwork methods
     // -----------------------------------------------------
@@ -169,9 +171,16 @@
     public String delete()
         throws Exception
     {
-        Installation installationToDelete = installationService.getInstallation( installation.getInstallationId()
);
-        installationService.delete( installationToDelete );
-        this.installations = installationService.getAllInstallations();
+        if ( confirmed )
+        {
+            Installation installationToDelete = installationService.getInstallation( installation.getInstallationId()
);
+            installationService.delete( installationToDelete );
+            this.installations = installationService.getAllInstallations();
+        }
+        else
+        {
+            return CONFIRM;
+        }
         return SUCCESS;
     }
 
@@ -361,4 +370,13 @@
         this.automaticProfileDisplayable = automaticProfileDisplayable;
     }
 
+    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=752008&r1=752007&r2=752008&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Tue Mar 10 07:28:33 2009
@@ -777,7 +777,14 @@
 installationTypeChoice.section.title = Installation Type Choice
 installationTypeChoice.action.label = Installation Type
 installationTypeChoice.tool.label = Tool
-installationTypeChoice.envar.label = Environment Variable 
+installationTypeChoice.envar.label = Environment Variable
+
+# ----------------------------------------------------------------------
+# Page: Delete Installation
+# ----------------------------------------------------------------------
+deleteInstallation.page.title = Continuum - Delete Installation
+deleteInstallation.section.title = Delete Installation
+deleteInstallation.confirmation.message = Are you sure you want to delete "{0}" installation
?
 
 # ----------------------------------------------------------------------
 # Page: Build Definitions Templates Summary
@@ -817,6 +824,13 @@
 buildDefinitionTemplate.builddefinitions.define = Configure the used Build Definitions
 
 # ----------------------------------------------------------------------
+# Page: Delete Build Definition Template
+# ----------------------------------------------------------------------
+deletebuildDefinition.template.page.title = Continuum - Delete Build Definition Template
+deletebuildDefinition.template.section.title = Delete Build Definition Template
+deletebuildDefinition.template.confirmation.message = Are you sure you want to delete build
definition template "{0}"?
+
+# ----------------------------------------------------------------------
 # Page: Queues
 # ----------------------------------------------------------------------
 buildQueue.page.title = Continuum - Build Queue

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=752008&r1=752007&r2=752008&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/struts.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/struts.xml Tue Mar 10 07:28:33 2009
@@ -708,6 +708,7 @@
     <action name="deleteInstallation" class="installation" method="delete">
       <result name="input">/WEB-INF/jsp/admin/installationsList.jsp</result>
       <result name="success">/WEB-INF/jsp/admin/installationsList.jsp</result>
+      <result name="confirm">/WEB-INF/jsp/admin/confirmDeleteInstallation.jsp</result>
     </action>  
     
     <!--addBuildEnv
@@ -729,8 +730,9 @@
 
     <action name="deleteDefinitionTemplate" class="buildDefinitionTemplates" method="delete">
       <result name="success" type="redirect-action">
-        <param name="actionName">buildDefinitionTemplates.action</param>
+        <param name="actionName">buildDefinitionTemplates.action</param>    
   
       </result>
+      <result name="confirm">/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionTemplate.jsp</result>
     </action>
     
     <action name="saveBuildDefinitionTemplate" class="buildDefinitionTemplates" method="save">
@@ -763,6 +765,7 @@
       <result name="success" type="redirect-action">
         <param name="actionName">buildDefinitionTemplates.action</param>
       </result>
+      <result name="confirm">/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionAsTemplate.jsp</result>
     </action>
     
     <action name="displayQueues" class="queues" method="display">

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildDefinitionTemplateSummary.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildDefinitionTemplateSummary.jsp?rev=752008&r1=752007&r2=752008&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildDefinitionTemplateSummary.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildDefinitionTemplateSummary.jsp
Tue Mar 10 07:28:33 2009
@@ -58,6 +58,7 @@
             <c:otherwise>
               <s:url id="deleteUrl" action="deleteDefinitionTemplate" method="delete"
namespace="/">
                 <s:param name="buildDefinitionTemplate.id">${pageScope.template.id}</s:param>
+                <s:param name="buildDefinitionTemplate.name">${pageScope.template.name}</s:param>
               </s:url>
               <s:a href="%{deleteUrl}"><img src="<s:url value='/images/delete.gif'
includeParams="none"/>" alt="<s:text name='delete'/>" title="<s:text name='delete'/>"
border="0"></s:a>
             </c:otherwise>
@@ -105,6 +106,7 @@
             <c:otherwise>
               <s:url id="deleteUrl" action="deleteBuildDefinitionAsTemplate" method="deleteBuildDefinition"
namespace="/">
                 <s:param name="buildDefinition.id">${pageScope.buildDefinitionSummary.id}</s:param>
+                <s:param name="buildDefinition.description">${pageScope.buildDefinitionSummary.description}</s:param>
               </s:url>
               <s:a href="%{deleteUrl}"><img src="<s:url value='/images/delete.gif'
includeParams="none"/>" alt="<s:text name='delete'/>" title="<s:text name='delete'/>"
border="0"></s:a>
             </c:otherwise>

Added: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionAsTemplate.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionAsTemplate.jsp?rev=752008&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionAsTemplate.jsp
(added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionAsTemplate.jsp
Tue Mar 10 07:28:33 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="deletebuildDefinition.template.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><s:text name="deletebuildDefinition.template.section.title"/></h3>
+
+        <div class="warningmessage">
+          <p>
+            <strong>
+                <s:text name="deletebuildDefinition.template.confirmation.message">
+                    <s:param><s:property value="%{buildDefinition.description}"/></s:param>
+                </s:text>
+            </strong>
+          </p>
+        </div>
+        <div class="functnbar3">
+          <s:form action="deleteBuildDefinitionAsTemplate" method="post">
+            <s:hidden name="buildDefinition.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

Added: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionTemplate.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionTemplate.jsp?rev=752008&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionTemplate.jsp
(added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildDefinitionTemplate.jsp
Tue Mar 10 07:28:33 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="deletebuildDefinition.template.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><s:text name="deletebuildDefinition.template.section.title"/></h3>
+
+        <div class="warningmessage">
+          <p>
+            <strong>
+                <s:text name="deletebuildDefinition.template.confirmation.message">
+                    <s:param><s:property value="%{buildDefinitionTemplate.name}"/></s:param>
+                </s:text>
+            </strong>
+          </p>
+        </div>
+        <div class="functnbar3">
+          <s:form action="deleteDefinitionTemplate" method="post">
+            <s:hidden name="buildDefinitionTemplate.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

Added: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteInstallation.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteInstallation.jsp?rev=752008&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteInstallation.jsp
(added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteInstallation.jsp
Tue Mar 10 07:28:33 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="deleteInstallation.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><s:text name="deleteInstallation.section.title"/></h3>
+
+        <div class="warningmessage">
+          <p>
+            <strong>
+                <s:text name="deleteInstallation.confirmation.message">
+                    <s:param><s:property value="%{installation.name}"/></s:param>
+                </s:text>
+            </strong>
+          </p>
+        </div>
+        <div class="functnbar3">
+          <s:form action="deleteInstallation" method="post">            
+            <input type="hidden" name="installation.installationId" value="${installation.installationId}"
/>
+            <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/installationsList.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/installationsList.jsp?rev=752008&r1=752007&r2=752008&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/installationsList.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/installationsList.jsp
Tue Mar 10 07:28:33 2009
@@ -53,7 +53,7 @@
           </a>  
         </ec:column>   
         <ec:column property="id" title="&nbsp;" width="1%">
-          <a href="deleteInstallation!delete.action?installation.installationId=<c:out
value="${installation.installationId}"/>">
+          <a href="deleteInstallation!delete.action?installation.installationId=<c:out
value="${installation.installationId}"/>&installation.name=<c:out value="${installation.name}"/>">
             <img src="<s:url value='/images/delete.gif' includeParams="none"/>"
alt="<s:text name='delete'/>" title="<s:text name='delete'/>" border="0" />
           </a>  
         </ec:column>             



Mime
View raw message