continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcconn...@apache.org
Subject svn commit: r434540 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/UserGroupManagementAction.java resources/xwork.xml webapp/user.jsp webapp/userGroup.jsp webapp/userGroups.jsp webapp/users.jsp
Date Thu, 24 Aug 2006 22:07:18 GMT
Author: jmcconnell
Date: Thu Aug 24 15:07:18 2006
New Revision: 434540

URL: http://svn.apache.org/viewvc?rev=434540&view=rev
Log:
user and user group pages functional now

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserGroupManagementAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/user.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroup.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/UserGroupManagementAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/UserGroupManagementAction.java?rev=434540&r1=434539&r2=434540&view=diff
==============================================================================
--- 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
Thu Aug 24 15:07:18 2006
@@ -1,4 +1,9 @@
 package org.apache.maven.continuum.web.action;
+
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.system.UserGroup;
+
+import java.util.List;
 /*
  * Copyright 2005 The Apache Software Foundation.
  *
@@ -34,30 +39,88 @@
 
     private String description;
 
+    private List userGroups;
+
+    public String summary()
+    {
+        try
+        {
+            userGroups = continuum.getUserGroups();
+        }
+        catch ( ContinuumException e )
+        {
+            addActionError( e.getMessage() );
+            return ERROR;
+        }
 
+        return SUCCESS;
+    }
 
-    private String display()
+    public String input()
     {
+        if ( userGroupId != 0 )
+        {
+            try
+            {
+                UserGroup userGroup = continuum.getUserGroup( userGroupId );
+
+                name = userGroup.getName();
+                description = userGroup.getDescription();
+
+            }
+            catch ( ContinuumException e )
+            {
+                addActionError( e.getMessage() );
+                return ERROR;
+            }
+        }
        return SUCCESS;
     }
 
-    private String save()
+    public String save()
     {
         if ( userGroupId == 0 )
         {
-            // add user group
+            UserGroup userGroup = new UserGroup();
+
+            userGroup.setName( name );
+            userGroup.setDescription( description );
+
+            continuum.addUserGroup( userGroup );
         }
         else
         {
-            // edit user group
+            try
+            {
+                UserGroup userGroup = continuum.getUserGroup( userGroupId );
+
+                userGroup.setName( name );
+                userGroup.setDescription( description );
+
+                continuum.updateUserGroup( userGroup );
+            }
+            catch ( ContinuumException e )
+            {
+                addActionError( e.getMessage() );
+                return ERROR;
+            }
         }
 
         return SUCCESS;
     }
 
-    private String remove()
+    public String remove()
     {
-        // remove user
+        try
+        {
+            continuum.removeUserGroup( userGroupId );
+        }
+        catch ( ContinuumException e )
+        {
+            addActionError( e.getMessage() );
+            return ERROR;
+        }
+
         return SUCCESS;
     }
 
@@ -92,4 +155,13 @@
         this.name = name;
     }
 
+    public List getUserGroups()
+    {
+        return userGroups;
+    }
+
+    public void setUserGroups( List userGroups )
+    {
+        this.userGroups = userGroups;
+    }
 }

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?rev=434540&r1=434539&r2=434540&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Thu Aug 24 15:07:18
2006
@@ -108,11 +108,11 @@
     <action name="login" class="session" method="login">
       <result name="input">login.jsp</result>
       <result name="error">login.jsp</result>
-      <result name="success" type="redirect">groupSummary.action</result>
+      <result name="success" type="chain">groupSummary</result>
     </action>
 
     <action name="logout" class="session" method="logout">
-      <result name="success" type="redirect">groupSummary.action</result>
+      <result name="success" type="chain">groupSummary</result>
     </action>
 
 
@@ -128,9 +128,12 @@
     </action>
 
     <action name="saveUser" class="userManagement" method="save">
-      <result name="success" type="redirect">users</result>
+      <result name="success" type="chain">users</result>
     </action>
 
+    <action name="removeUser" class="userManagement" method="remove">
+      <result name="success" type="chain">users</result>
+    </action>
 
     <!--
     * user group management actions
@@ -144,7 +147,11 @@
     </action>
 
     <action name="saveUserGroup" class="userGroupManagement" method="save">
-      <result name="success" type="redirect">userGroups</result>
+      <result name="success" type="chain">userGroups</result>
+    </action>
+
+    <action name="removeUserGroup" class="userGroupManagement" method="remove">
+      <result name="success" type="chain">userGroups</result>
     </action>
 
     <!--

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/user.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/user.jsp?rev=434540&r1=434539&r2=434540&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/user.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/user.jsp Thu Aug 24 15:07:18 2006
@@ -1,6 +1,7 @@
 <%@ taglib uri="/webwork" prefix="ww" %>
 <%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
 <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
+<%@ taglib uri="continuum" prefix="c1" %>
 <html>
 <ww:i18n name="localization.Continuum">
   <head>
@@ -10,29 +11,29 @@
   <body>
   <div id="axial" class="h3">
 
-    <div id="h3">
-      <h3><ww:text name="Users"/></h3>
+    <h3><ww:text name="Users"/></h3>
 
-      <ww:form action="saveUser" method="post">
+    <ww:form action="saveUser" method="post">
+      <ww:hidden name="userId"/>
 
-        <div class="axial">
-          <table border="1" cellspacing="2" cellpadding="3" width="100%">
-            <ww:textfield label="Username" name="username"/>
-            <ww:textfield label="Full Name" name="fullName"/>
-            <ww:textfield label="Email" name="email"/>
-            <ww:textfield label="Password" name="password"/>
-            <ww:textfield label="Password(again)" name="passwordTwo"/>
-            <ww:select  list="userGroups" label="User Group" name="userGroupId"/>
-          </table>
-        </div>
-
-
-        <div class="functnbar3">
-          <c1:submitcancel value="%{getText('save')}" cancel="%{getText('cancel')}"/>
-        </div>
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          <ww:textfield label="Username" name="username"/>
+          <ww:textfield label="Full Name" name="fullName"/>
+          <ww:textfield label="Email" name="email"/>
+          <ww:textfield label="Password" name="password"/>
+          <ww:textfield label="Password(again)" name="passwordTwo"/>
+          <ww:select list="userGroups" label="User Group" name="userGroupId"/>
+        </table>
+      </div>
+
+      <div class="functnbar3">
+        <c1:submitcancel value="%{getText('save')}" cancel="%{getText('cancel')}"/>
+      </div>
 
-      </ww:form>
-    </div>
+    </ww:form>
+
+  </div>
   </body>
 </ww:i18n>
 </html>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroup.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroup.jsp?rev=434540&r1=434539&r2=434540&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroup.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroup.jsp Thu Aug 24 15:07:18
2006
@@ -1,4 +1,7 @@
 <%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
+<%@ taglib uri="continuum" prefix="c1" %>
 <html>
 <ww:i18n name="localization.Continuum">
   <head>
@@ -7,9 +10,25 @@
 
   <body>
   <div id="axial" class="h3">
-    <h3>User Group Management</h3>
 
-    
+    <h3><ww:text name="User Group"/></h3>
+
+    <ww:form action="saveUserGroup" method="post">
+      <ww:hidden name="userGroupId"/>
+
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          <ww:textfield label="Name" name="name"/>
+          <ww:textfield label="Description" name="description"/>
+        </table>
+      </div>
+
+      <div class="functnbar3">
+        <c1:submitcancel value="%{getText('save')}" cancel="%{getText('cancel')}"/>
+      </div>
+
+    </ww:form>
+
   </div>
   </body>
 </ww:i18n>

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?rev=434540&r1=434539&r2=434540&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroups.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/userGroups.jsp Thu Aug 24 15:07:18
2006
@@ -1,4 +1,7 @@
 <%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
+<%@ taglib uri="continuum" prefix="c1" %>
 <html>
 <ww:i18n name="localization.Continuum">
   <head>
@@ -7,9 +10,39 @@
 
   <body>
   <div id="axial" class="h3">
-    <h3>User Group Management</h3>
 
-    
+     <div id="h3">
+        <h3><ww:text name="User Groups"/></h3>
+
+        <ec:table items="userGroups"
+                  var="userGroup"
+                  showExports="false"
+                  showPagination="false"
+                  showStatusBar="false"
+                  filterable="false">
+         <ec:row>
+            <ec:column property="name" title="Name"/>
+            <ec:column property="description" title="Description"/>
+            <ec:column property="actions" title="&nbsp;">
+                <ww:url id="editUrl" action="userGroup">
+                  <ww:param name="userGroupId" value="${pageScope.userGroup.id}"/>
+                </ww:url>
+                <ww:url id="removeUrl" action="removeUserGroup">
+                  <ww:param name="userGroupId" value="${pageScope.userGroup.id}"/>
+                </ww:url>
+                <ww:a href="%{editUrl}">Edit</ww:a>
+                &nbsp;
+                <ww:a href="%{removeUrl}">Delete</ww:a>
+            </ec:column>
+          </ec:row>
+        </ec:table>
+      </div>
+      <div class="functnbar3">
+        <ww:form action="userGroup" method="post">
+          <ww:submit value="%{getText('add')}"/>
+        </ww:form>
+    </div>
+
   </div>
   </body>
 </ww:i18n>

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?rev=434540&r1=434539&r2=434540&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/users.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/users.jsp Thu Aug 24 15:07:18 2006
@@ -26,13 +26,15 @@
             <ec:column property="email" title="Email"/>
             <ec:column property="userGroupId" title="Group"/>
             <ec:column property="actions" title="&nbsp;">
-                <ww:url id="editUrl" action="user" method="input">
+                <ww:url id="editUrl" action="user">
+                  <ww:param name="userId" value="${pageScope.user.accountId}"/>
+                </ww:url>
+                <ww:url id="removeUrl" action="removeUser">
                   <ww:param name="userId" value="${pageScope.user.accountId}"/>
                 </ww:url>
                 <ww:a href="%{editUrl}">Edit</ww:a>
                 &nbsp;
-
-                <ww:text name="delete"/>
+                <ww:a href="%{removeUrl}">Delete</ww:a>
             </ec:column>
           </ec:row>
         </ec:table>



Mime
View raw message