continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r656451 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ resources/ resources/localization/ webapp/WEB-INF/jsp/ webapp/WEB-INF/jsp/components/
Date Wed, 14 May 2008 22:10:22 GMT
Author: olamy
Date: Wed May 14 15:10:21 2008
New Revision: 656451

URL: http://svn.apache.org/viewvc?rev=656451&view=rev
Log:
[CONTINUUM-1762] add confirmation page before deleting multiple projects at once


Added:
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmDeleteProjects.jsp
  (with props)
Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
    continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java?rev=656451&r1=656450&r2=656451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
Wed May 14 15:10:21 2008
@@ -19,6 +19,10 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
@@ -27,11 +31,6 @@
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -40,7 +39,9 @@
 public class ProjectsListAction
     extends ContinuumActionSupport
 {
-    private Collection selectedProjects;
+    private List<String> selectedProjects;
+    
+    private List<String> selectedProjectsNames;
 
     private String projectGroupName = "";
 
@@ -66,10 +67,14 @@
         {
             return remove();
         }
+        else if ("confirmRemove".equals( methodToCall ))
+        {
+            return confirmRemove();
+        }
 
         return SUCCESS;
     }
-
+   
     private String remove()
         throws ContinuumException
     {
@@ -84,9 +89,9 @@
 
         if ( selectedProjects != null && !selectedProjects.isEmpty() )
         {
-            for ( Iterator i = selectedProjects.iterator(); i.hasNext(); )
+            for ( String selectedProject : selectedProjects )
             {
-                int projectId = Integer.parseInt( (String) i.next() );
+                int projectId = Integer.parseInt( selectedProject );
 
                 try
                 {
@@ -105,6 +110,21 @@
         return SUCCESS;
     }
 
+    public String confirmRemove()
+        throws ContinuumException
+    {
+        if ( selectedProjects != null && !selectedProjects.isEmpty() )
+        {
+            this.selectedProjectsNames = new ArrayList<String>();
+            for ( String selectedProject : selectedProjects )
+            {
+                int projectId = Integer.parseInt( selectedProject );
+                selectedProjectsNames.add( getContinuum().getProject( projectId ).getName()
);
+            }
+        }
+        return "confirmRemove";
+    }
+    
     private String build()
         throws ContinuumException
     {
@@ -209,12 +229,12 @@
         return projectGroupName;
     }
 
-    public Collection getSelectedProjects()
+    public List<String> getSelectedProjects()
     {
         return selectedProjects;
     }
 
-    public void setSelectedProjects( Collection selectedProjects )
+    public void setSelectedProjects( List<String> selectedProjects )
     {
         this.selectedProjects = selectedProjects;
     }
@@ -243,4 +263,14 @@
     {
         this.buildDefinitionId = buildDefinitionId;
     }
+
+    public List<String> getSelectedProjectsNames()
+    {
+        return selectedProjectsNames;
+    }
+
+    public void setSelectedProjectsNames( List<String> selectedProjectsNames )
+    {
+        this.selectedProjectsNames = selectedProjectsNames;
+    }
 }

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=656451&r1=656450&r2=656451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Wed May 14 15:10:21 2008
@@ -802,4 +802,11 @@
 # ----------------------------------------------------------------------
 # Page: Wait
 # ----------------------------------------------------------------------
-wait.addprocessing.processing= Adding your project is under process. Please wait ..
+wait.addprocessing.processing = Adding your project is under process. Please wait ..
+
+# ----------------------------------------------------------------------
+# Page: DeleteProjects
+# ----------------------------------------------------------------------
+deleteProjects.page.title = Continuum - Delete Continuum Projects
+deleteProjects.section.title = Delete Continuum Projects
+deleteProjects.confirmation.message = Are you sure you want to delete the projects "{0}"?

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties?rev=656451&r1=656450&r2=656451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
Wed May 14 15:10:21 2008
@@ -798,3 +798,16 @@
 legend.buildInSuccess=Construction r\u00e9ussie
 legend.buildInFailure=Construction en \u00echec
 legend.buildInError=Construction en erreur
+
+
+# ----------------------------------------------------------------------
+# Page: Wait
+# ----------------------------------------------------------------------
+wait.addprocessing.processing = L'ajout du projet est en cours ...
+
+# ----------------------------------------------------------------------
+# Page: DeleteProjects
+# ----------------------------------------------------------------------
+deleteProjects.page.title = Continuum - Supprimer des projets Continuum
+deleteProjects.section.title = Supprimer des projets Continuum
+deleteProjects.confirmation.message = Etes vous s\u00fbr de vouloir supprimer les projets
"{0}" ?

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties?rev=656451&r1=656450&r2=656451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
Wed May 14 15:10:21 2008
@@ -644,3 +644,10 @@
 workingCopy.page.title    = Continuum - C\u00F3pia de Trabalho
 workingCopy.section.title = C\u00F3pia de Trabalho para {0}
 workingCopy.currentFile.text = Download como Texto
+
+# ----------------------------------------------------------------------
+# Page: DeleteProjects
+# ----------------------------------------------------------------------
+deleteProjects.page.title = Continuum - Delete Continuum Projects
+deleteProjects.section.title = Delete Continuum Projects
+deleteProjects.confirmation.message = Are you sure you want to delete the projects "{0}"?

Modified: continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=656451&r1=656450&r2=656451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Wed May 14 15:10:21 2008
@@ -229,6 +229,7 @@
     </action>
 
     <action name="ProjectsList" class="projects">
+      <result name="confirmRemove">/WEB-INF/jsp/confirmDeleteProjects.jsp</result>
       <result name="success" type="redirect-action">
         <param name="actionName">projectGroupSummary</param>
         <param name="projectGroupId">${projectGroupId}</param>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp?rev=656451&r1=656450&r2=656451&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
Wed May 14 15:10:21 2008
@@ -239,7 +239,7 @@
                            onchange="$('projectsForm').buildDefinitionId.value=$('buildDef').value"
/>
                 <input type="button" name="build-projects" value="<ww:text name="projectGroup.buildProjects"/>"
onclick="$('projectsForm').methodToCall.value='build';document.forms.projectsForm.submit();"
/>
                 <input type="button" name="cancel-builds" value="<ww:text name="projectGroup.cancelBuilds"/>"
onclick="document.forms.projectsForm.action='cancelBuilds.action';document.forms.projectsForm.submit();"
/>
-                <input type="button" name="delete-projects" value="<ww:text name="projectGroup.deleteProjects"/>"
onclick="document.forms.projectsForm.methodToCall.value='remove';document.forms.projectsForm.submit();"
/>
+                <input type="button" name="delete-projects" value="<ww:text name="projectGroup.deleteProjects"/>"
onclick="document.forms.projectsForm.methodToCall.value='confirmRemove';document.forms.projectsForm.submit();"
/>
               </redback:ifAuthorized>
             </td>
           </tr>

Added: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmDeleteProjects.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmDeleteProjects.jsp?rev=656451&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmDeleteProjects.jsp
(added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/confirmDeleteProjects.jsp
Wed May 14 15:10:21 2008
@@ -0,0 +1,53 @@
+<%--
+  ~ 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="deleteProjects.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><ww:text name="deleteProjects.section.title"/></h3>
+
+        <div class="warningmessage">
+          <p>
+            <strong>
+                <ww:text name="deleteProjects.confirmation.message">
+                    <ww:param><ww:property value="selectedProjectsNames"/></ww:param>
+                </ww:text>
+            </strong>
+          </p>
+        </div>
+        <div class="functnbar3">
+          <ww:form action="ProjectsList.action" method="post">
+            <ww:iterator value="selectedProjects">
+              <input type="hidden" value="<ww:property/>" name="selectedProjects"/>
+            </ww:iterator>
+            <input type="hidden" name="projectGroupId" value="${projectGroupId}" />
+            <input type="hidden" name="methodToCall" value="remove" />
+            <c1:submitcancel value="%{getText('delete')}" cancel="%{getText('cancel')}"/>
+          </ww:form>
+        </div>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

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

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

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



Mime
View raw message