continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r447786 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ resources/ webapp/
Date Tue, 19 Sep 2006 08:55:20 GMT
Author: evenisse
Date: Tue Sep 19 01:55:19 2006
New Revision: 447786

URL: http://svn.apache.org/viewvc?view=rev&rev=447786
Log:
[CONTINUUM-893] Add a delete confirmation screen for user group
[CONTINUUM-895] Add a delete confirmation screen for user
Submitted by: Marvin King

Added:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumConfirmAction.java
  (with props)
    maven/continuum/trunk/continuum-webapp/src/main/webapp/confirmation.jsp   (with props)
Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserGroupManagementAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserManagementAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/schedules.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroups.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/users.jsp

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java?view=diff&rev=447786&r1=447785&r2=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
Tue Sep 19 01:55:19 2006
@@ -36,7 +36,7 @@
  * role-hint="buildDefinition"
  */
 public class BuildDefinitionAction
-    extends ContinuumActionSupport
+    extends ContinuumConfirmAction
 {
 
     private int buildDefinitionId;

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java?view=diff&rev=447786&r1=447785&r2=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
Tue Sep 19 01:55:19 2006
@@ -31,8 +31,6 @@
     extends PlexusActionSupport
     implements Preparable
 {
-    public static final String CONFIRM = "confirm";
-
     /**
      * @plexus.requirement
      */

Added: 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?view=auto&rev=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumConfirmAction.java
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumConfirmAction.java
Tue Sep 19 01:55:19 2006
@@ -0,0 +1,109 @@
+package org.apache.maven.continuum.web.action;
+
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+public class ContinuumConfirmAction 
+    extends ContinuumActionSupport
+{
+
+    public static final String CONFIRM = "confirm";
+
+    protected boolean confirmed = false;
+
+    protected String confirmedDisplay;
+
+    protected String confirmationTitle;
+
+    protected String confirmedName;
+
+    protected String confirmedValue;
+
+    protected String action;
+
+    protected void setConfirmationInfo( String title, String actionName, String displayString,

+                                        String propertyName, String propertyValue )
+    {
+        action = actionName;
+        confirmationTitle = title;
+        confirmedDisplay = displayString;
+        confirmedName = propertyName;
+        confirmedValue = "" + propertyValue;
+    }
+
+    // setters and getters
+
+    public void setConfirmedName( String name )
+    {
+        confirmedName = name;
+    }
+
+    public String getConfirmedName()
+    {
+        return confirmedName;
+    }
+
+    public void setConfirmedValue( String value )
+    {
+        confirmedValue = value;
+    }
+
+    public String getConfirmedValue()
+    {
+        return confirmedValue;
+    }
+
+    public void setConfirmationTitle( String title )
+    {
+        confirmationTitle = title;
+    }
+
+    public String getConfirmationTitle()
+    {
+        return confirmationTitle;
+    }
+
+    public void setConfirmedDisplay( String display )
+    {
+        confirmedDisplay = display;
+    }
+
+    public String getConfirmedDisplay()
+    {
+        return confirmedDisplay;
+    }
+
+    public void setConfirmed( boolean _confirmed )
+    {
+        confirmed = _confirmed;
+    }
+
+    public boolean getConfirmed()
+    {
+        return confirmed;
+    }
+
+    public void setAction( String _action )
+    {
+        action = _action;
+    }
+
+    public String getAction()
+    {
+        return action;
+    }
+
+}

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumConfirmAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumConfirmAction.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?view=diff&rev=447786&r1=447785&r2=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Tue Sep 19 01:55:19 2006
@@ -30,7 +30,7 @@
  *   role-hint="projectGroup"
  */
 public class ProjectGroupAction
-    extends ContinuumActionSupport
+    extends ContinuumConfirmAction
 {
     private int projectGroupId;
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?view=diff&rev=447786&r1=447785&r2=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
Tue Sep 19 01:55:19 2006
@@ -26,7 +26,7 @@
  * @plexus.component role="com.opensymphony.xwork.Action" role-hint="schedule"
  */
 public class ScheduleAction
-    extends ContinuumActionSupport
+    extends ContinuumConfirmAction
 {
     private int id;
 
@@ -159,8 +159,9 @@
             getContinuum().removeSchedule( id );
         }
         else
-        {
-            schedule = getContinuum().getSchedule( id );
+        {    
+            setConfirmationInfo( "Schedule Removal", "removeSchedule", name, "id", "" + id
);
+                        
             return CONFIRM;
         }
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserGroupManagementAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserGroupManagementAction.java?view=diff&rev=447786&r1=447785&r2=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserGroupManagementAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserGroupManagementAction.java
Tue Sep 19 01:55:19 2006
@@ -31,7 +31,7 @@
  *   role-hint="userGroupManagement"
  */
 public class UserGroupManagementAction
-    extends ContinuumActionSupport
+    extends ContinuumConfirmAction
 {
     private int userGroupId;
 
@@ -111,6 +111,14 @@
 
     public String remove()
     {
+        if ( !confirmed )
+        {
+            setConfirmationInfo( "User Group Removal", "removeUserGroup", name, 
+                                 "userGroupId", "" + userGroupId );
+           
+            return CONFIRM;
+        }
+                       
         try
         {
             getContinuum().removeUserGroup( userGroupId );

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserManagementAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserManagementAction.java?view=diff&rev=447786&r1=447785&r2=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserManagementAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserManagementAction.java
Tue Sep 19 01:55:19 2006
@@ -34,7 +34,7 @@
  *   role-hint="userManagement"
  */
 public class UserManagementAction
-    extends ContinuumActionSupport
+    extends ContinuumConfirmAction
 {
     private int userId;
 
@@ -164,6 +164,13 @@
 
     public String remove()
     {
+        if ( !confirmed )
+        {
+            setConfirmationInfo( "User Removal", "removeUser", username, "userId", "" + userId
);
+            
+            return CONFIRM;
+        }
+        
         try
         {
             getContinuum().removeUser( userId );

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?view=diff&rev=447786&r1=447785&r2=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Tue Sep 19 01:55:19
2006
@@ -130,6 +130,7 @@
 
     <action name="removeUser" class="userManagement" method="remove">
       <result name="success" type="chain">users</result>
+      <result name="confirm">confirmation.jsp</result>
     </action>
 
     <!--
@@ -149,6 +150,7 @@
 
     <action name="removeUserGroup" class="userGroupManagement" method="remove">
       <result name="success" type="chain">userGroups</result>
+      <result name="confirm">confirmation.jsp</result>
     </action>
 
     <!--
@@ -293,7 +295,7 @@
     </action>
 
     <action name="removeSchedule" class="schedule" method="remove">
-      <result name="confirm">confirmScheduleRemoval.jsp</result>
+      <result name="confirm">confirmation.jsp</result>
       <result name="success" type="chain">schedules</result>
     </action>
 

Added: maven/continuum/trunk/continuum-webapp/src/main/webapp/confirmation.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/confirmation.jsp?view=auto&rev=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/confirmation.jsp (added)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/confirmation.jsp Tue Sep 19 01:55:19
2006
@@ -0,0 +1,48 @@
+<%--
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title>${confirmationTitle}</title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3>${confirmationTitle}</h3>
+        <div class="axial">
+        <ww:form action="${action}" method="post">
+          <ww:hidden name="${confirmedName}" value="${confirmedValue}"/>
+          <ww:hidden name="confirmed" value="true"/>
+          <ww:actionerror/>
+
+          <p>
+            Are you sure you wish to remove <c:out value="${confirmedDisplay}"/>?
+          </p>
+
+          <div class="functnbar3">
+            <c1:submitcancel value="%{getText('delete')}" cancel="%{getText('cancel')}"/>
+          </div>
+        </ww:form>
+        </div>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

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

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

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/schedules.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/schedules.jsp?view=diff&rev=447786&r1=447785&r2=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/schedules.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/schedules.jsp Tue Sep 19 01:55:19
2006
@@ -28,6 +28,7 @@
                 </ww:url>
                 <ww:url id="removeScheduleUrl" action="removeSchedule">
                   <ww:param name="id" value="${pageScope.schedule.id}"/>
+                  <ww:param name="name" value="%{'${pageScope.schedule.name}'}"/> 
                
                 </ww:url>
                 <ww:a href="%{editScheduleUrl}">Edit</ww:a>
                 &nbsp;

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroups.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroups.jsp?view=diff&rev=447786&r1=447785&r2=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroups.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroups.jsp Tue Sep 19 01:55:19
2006
@@ -29,6 +29,7 @@
                 </ww:url>
                 <ww:url id="removeUrl" action="removeUserGroup">
                   <ww:param name="userGroupId" value="${pageScope.userGroup.id}"/>
+                  <ww:param name="name" value="%{'${pageScope.userGroup.name}'}"/>
                 
                 </ww:url>
                 <ww:a href="%{editUrl}">Edit</ww:a>
                 &nbsp;

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/users.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/users.jsp?view=diff&rev=447786&r1=447785&r2=447786
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/users.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/users.jsp Tue Sep 19 01:55:19 2006
@@ -31,6 +31,7 @@
                 </ww:url>
                 <ww:url id="removeUrl" action="removeUser">
                   <ww:param name="userId" value="${pageScope.user.accountId}"/>
+                  <ww:param name="username" value="%{'${pageScope.user.username}'}"/>
                 
                 </ww:url>
                 <ww:a href="%{editUrl}">Edit</ww:a>
                 &nbsp;



Mime
View raw message