You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2005/04/25 09:30:38 UTC

cvs commit: jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/roles role-details.vm

taylor      2005/04/25 00:30:38

  Modified:    applications/security/src/webapp/WEB-INF/security/sso
                        sites-details.vm
               applications/security/src/webapp/WEB-INF/security/users
                        user-details.jsp
               applications/security/src/webapp/WEB-INF/security/groups
                        group-details.vm
               applications/security/src/webapp/WEB-INF/security/roles
                        role-details.vm
  Added:       applications/security/src/webapp/WEB-INF/security/users
                        user-multi-chooser.vm
  Log:
  http://issues.apache.org/jira/browse/JS2-237
  - roles maintainance, add users to roles
  - groups maintainance, add users to groups
  
  Revision  Changes    Path
  1.12      +2 -2      jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/sso/sites-details.vm
  
  Index: sites-details.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/sso/sites-details.vm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- sites-details.vm	23 Apr 2005 20:13:48 -0000	1.11
  +++ sites-details.vm	25 Apr 2005 07:30:38 -0000	1.12
  @@ -27,7 +27,7 @@
   <script>
   function openWindow(pipeline)
   {	
  -    var vWinUsers = window.open(pipeline, 'UserPicker', 'status=no,resizable=yes,top=100,left=200,width=100,height=250,scrollbars=yes');
  +    var vWinUsers = window.open(pipeline, 'UserPicker', 'status=no,resizable=yes,width=200,height=250,scrollbars=yes');
       vWinUsers.opener = self;
   	vWinUsers.focus();
   }
  
  
  
  1.11      +2 -1      jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/users/user-details.jsp
  
  Index: user-details.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/users/user-details.jsp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- user-details.jsp	22 Apr 2005 20:42:09 -0000	1.10
  +++ user-details.jsp	25 Apr 2005 07:30:38 -0000	1.11
  @@ -15,6 +15,7 @@
   <%@ page import="java.util.*" %>
   <%@ page import="org.apache.portals.bridges.beans.TabBean" %>
   <%@ page import="org.apache.jetspeed.portlets.security.users.UserDetailsPortlet" %>
  +<%@ page import="org.apache.jetspeed.portlets.security.SecurityResources" %>
   <%@ page import="org.apache.jetspeed.portlets.security.users.JetspeedUserBean" %>
   <%@ page import="org.apache.jetspeed.om.common.preference.*" %>
   <%@ page import="org.apache.jetspeed.om.common.*" %>
  @@ -25,7 +26,7 @@
   
   <fmt:setBundle basename="org.apache.jetspeed.portlets.security.resources.SecurityResources" />
   
  -<c:set var="errorMessagesKey"><%=UserDetailsPortlet.ERROR_MESSAGES%></c:set>
  +<c:set var="errorMessagesKey"><%=SecurityResources.ERROR_MESSAGES%></c:set>
   <c:set var="errorMessages" value="${requestScope[errorMessagesKey]}"/>
   
   <portlet:defineObjects/>
  
  
  
  1.1                  jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/users/user-multi-chooser.vm
  
  Index: user-multi-chooser.vm
  ===================================================================
  #*
  Copyright 2004 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.
  *#
  
  #**
  
  @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  @version $Id: user-multi-chooser.vm,v 1.1 2005/04/25 07:30:38 taylor Exp $
  
  *#
  
  <script language="JavaScript" type="text/javascript">
      <!--
      function select(value)
      {
          var openerForm = opener.document.forms['securityform'];
          var openerEl = openerForm.elements['users'];
          window.close();
      }
  	function rowHover(row)
  	{
  	    row.oldClassName = row.className;
  	    row.className = 'jetdbLight';
  	    row.onmouseout = function()
  	    {
  	        this.className = this.oldClassName;
  	    }
  	}    
  	function sendChecks(form)
  	{
  		var result = "";
  		for(var i = 0; i < form.length; i++)
  		{
  		   var e = form.elements[i];
  		   if (e.type == "checkbox")
  		   {
  		       if (e.checked == true)
  		       {
  		       	   result = result + "," + e.name;
  		       }
  		   }
  		}
          var openerForm = opener.document.forms['securityform'];
          var openerEl = openerForm.elements['users'];
          openerEl.value = result;
          window.close();
          openerForm.submit();		
  	}
      //-->
  </script>
  
  
  #set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
  <form name='userform' onSubmit='sendChecks(this)'/>
  <table cellpadding=0 cellspacing=1 border=0 width='100%' >
    <tr>
      #foreach ($column in $title)    
        <td align='center' class="jetdbHeadNoLink" width="90%" nowrap>
          $column
        </td>
        <th class="jetdbHeadNoLink" width="10"></th>     
      #end
    </tr>
    #foreach ( $user in $table )
    <tr>
      #if ($velocityCount % 2 == 0)
         #set($rowstyle = "jetdbEven")
      #else
         #set($rowstyle = "jetdbOdd")
      #end   
        <td class="$rowstyle" nowrap width="90%" onmouseover="rowHover(this)">
          <div align="center">$user</div>
        </td>
  	  <td class="$rowstyle" width="10">
    	    <input type="checkbox" name="box_$user"/>
  	  </td>      
     </tr>
    #end
  </table>
   <input type="submit" name="add.users" value="Add Users" class="jetdbButton"  />
  </form>
  
  
  1.2       +71 -10    jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/groups/group-details.vm
  
  Index: group-details.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/groups/group-details.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- group-details.vm	23 Apr 2005 19:08:13 -0000	1.1
  +++ group-details.vm	25 Apr 2005 07:30:38 -0000	1.2
  @@ -21,13 +21,10 @@
   
   *#
   
  -## set ($pipeline = $renderResponse.createRenderURL())
  -## set ($pipeline = "$pipeline?pipeline=portlet-pipeline&entity=$chooser.Id")
  -
   <script>
   function openWindow(pipeline)
   {	
  -    var vWinUsers = window.open(pipeline, 'UserPicker', 'status=no,resizable=yes,top=100,left=200,width=100,height=250,scrollbars=yes');
  +    var vWinUsers = window.open(pipeline, 'UserPicker', 'status=no,resizable=yes,width=200,height=300,scrollbars=yes');
       vWinUsers.opener = self;
   	vWinUsers.focus();
   }
  @@ -38,21 +35,85 @@
   #if ($statusMsg)
   #parse ('/WEB-INF/view/status-include.vm')
   #end
  +#if ($group)
  +#set ($newGroup = "false")
  +#else
  +#set ($newGroup = "true")
  +#end
   
   <form name='groupForm' action="$renderResponse.createActionURL()" method="post">
   <table>
     <tr colspan="2" align="right">
       <td nowrap class="portlet-section-alternate" align="right">Group Name:&nbsp;</td>
       <td class="portlet-section-body" align="left">
  -      <input type="text" name="group.name" size="40" value="$!currentGroup" class="portlet-form-field-label">
  +      <input type="text" name='group' size="40" value="$!group" 
  +       class="portlet-form-field-label"
  +      #if ($newGroup == "false") readonly #end
  +      >
       </td>
     </tr>
   </table>
  -<input name='groupDelete' type='hidden' value=''/>
  -<input name='group.save' type="submit" value="$MESSAGES.getString('security.save')" class="portlet-form-button"/>
  -<input name='group.refresh' class="portlet-form-button" type="submit" value="$MESSAGES.getString('security.refresh')" />
  -<input name='group.new' class="portlet-form-button" type="submit" value="$MESSAGES.getString('security.new')" />
   
  +#if ($newGroup == "true")
  +<input type="submit" name="group.action" value="Save" class="portlet-form-button"/>
  +#end
   </form>	      
   
  +#if ($newGroup == "false")
  +<form name='securityform' action="$renderResponse.createActionURL()" method="post">
  +<table cellpadding=0 cellspacing=1 border=0 width='100%' >
  +#if ($tableSize > 0)
  +  <tr>
  +    #foreach ($column in $title)      
  +      <th align='center' class="portlet-section-header" nowrap width="260">
  +        $column
  +      </th>
  +     <th class="portlet-section-header" width="10"></th>
  +     <th width="100%"/>
  +    #end
  +  </tr>
  +#end  
  +  #foreach ( $user in $table )
  +  <tr>
  +    #if ($velocityCount % 2 == 0)
  +       #set($rowstyle = "portlet-section-body")
  +    #else
  +       #set($rowstyle = "portlet-section-alternate")
  +    #end  
  +	  <td class="$rowstyle" nowrap width="260">
  +	    <div align="center">$user</div>
  +	  </td>
  +	  <td class="$rowstyle" width="10">
  +  	    <input type="checkbox" name="box_$user"/>
  +	  </td>
  +     <td width="100%"/>	  
  +   </tr>
  +  #end
  +</table>
  +
  +<table>
  +<tr>
  +  <td>
  +   <input type="submit" name="group.action" value="Add New Group" class="portlet-form-button"  />
  +  </td>
  +  <td>
  +   <input onclick="javascript:openWindow('$userChooser')" type="submit" name="group.action" value="Add Users to Group..." class="portlet-form-button"  />
  +  </td>  
  +#if ($tableSize > 0)  
  +  <td>
  +   <input type="submit" name="group.action" value="Remove Checked Users" class="portlet-form-button" />
  +  </td>    
  +#end
  +  <td>
  +   <input type="submit" name="group.action" value="Remove Group" class="portlet-form-button" />
  +  </td>  
  +</tr>
  +</table>
  +<input type='hidden' name='users'/>
  +<input type='hidden' name='group' value='$group'/>
  +
  +</form>
  +
  +
  +#end
   
  
  
  
  1.2       +73 -12    jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/roles/role-details.vm
  
  Index: role-details.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/roles/role-details.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- role-details.vm	23 Apr 2005 19:08:13 -0000	1.1
  +++ role-details.vm	25 Apr 2005 07:30:38 -0000	1.2
  @@ -21,13 +21,10 @@
   
   *#
   
  -## set ($pipeline = $renderResponse.createRenderURL())
  -## set ($pipeline = "$pipeline?pipeline=portlet-pipeline&entity=$chooser.Id")
  -
   <script>
   function openWindow(pipeline)
   {	
  -    var vWinUsers = window.open(pipeline, 'UserPicker', 'status=no,resizable=yes,top=100,left=200,width=100,height=250,scrollbars=yes');
  +    var vWinUsers = window.open(pipeline, 'UserPicker', 'status=no,resizable=yes,width=200,height=300,scrollbars=yes');
       vWinUsers.opener = self;
   	vWinUsers.focus();
   }
  @@ -38,21 +35,85 @@
   #if ($statusMsg)
   #parse ('/WEB-INF/view/status-include.vm')
   #end
  +#if ($role)
  +#set ($newRole = "false")
  +#else
  +#set ($newRole = "true")
  +#end
   
  -<form name='groupForm' action="$renderResponse.createActionURL()" method="post">
  +<form name='roleForm' action="$renderResponse.createActionURL()" method="post">
   <table>
     <tr colspan="2" align="right">
  -    <td nowrap class="portlet-section-alternate" align="right">Group Name:&nbsp;</td>
  +    <td nowrap class="portlet-section-alternate" align="right">Role Name:&nbsp;</td>
       <td class="portlet-section-body" align="left">
  -      <input type="text" name="group.name" size="40" value="$!selected" class="portlet-form-field-label">
  +      <input type="text" name='role' size="40" value="$!role" 
  +       class="portlet-form-field-label"
  +      #if ($newRole == "false") readonly #end
  +      >
       </td>
     </tr>
   </table>
  -<input name='groupDelete' type='hidden' value=''/>
  -<input name='group.save' type="submit" value="$MESSAGES.getString('security.save')" class="portlet-form-button"/>
  -<input name='group.refresh' class="portlet-form-button" type="submit" value="$MESSAGES.getString('security.refresh')" />
  -<input name='group.new' class="portlet-form-button" type="submit" value="$MESSAGES.getString('security.new')" />
   
  +#if ($newRole == "true")
  +<input type="submit" name="role.action" value="Save" class="portlet-form-button"/>
  +#end
   </form>	      
   
  +#if ($newRole == "false")
  +<form name='securityform' action="$renderResponse.createActionURL()" method="post">
  +<table cellpadding=0 cellspacing=1 border=0 width='100%' >
  +#if ($tableSize > 0)
  +  <tr>
  +    #foreach ($column in $title)      
  +      <th align='center' class="portlet-section-header" nowrap width="260">
  +        $column
  +      </th>
  +     <th class="portlet-section-header" width="10"></th>
  +     <th width="100%"/>
  +    #end
  +  </tr>
  +#end  
  +  #foreach ( $user in $table )
  +  <tr>
  +    #if ($velocityCount % 2 == 0)
  +       #set($rowstyle = "portlet-section-body")
  +    #else
  +       #set($rowstyle = "portlet-section-alternate")
  +    #end  
  +	  <td class="$rowstyle" nowrap width="260">
  +	    <div align="center">$user</div>
  +	  </td>
  +	  <td class="$rowstyle" width="10">
  +  	    <input type="checkbox" name="box_$user"/>
  +	  </td>
  +     <td width="100%"/>	  
  +   </tr>
  +  #end
  +</table>
  +
  +<table>
  +<tr>
  +  <td>
  +   <input type="submit" name="role.action" value="Add New Role" class="portlet-form-button"  />
  +  </td>
  +  <td>
  +   <input onclick="javascript:openWindow('$userChooser')" type="submit" name="role.action" value="Add Users to Role..." class="portlet-form-button"  />
  +  </td>  
  +#if ($tableSize > 0)  
  +  <td>
  +   <input type="submit" name="role.action" value="Remove Checked Users" class="portlet-form-button" />
  +  </td>    
  +#end
  +  <td>
  +   <input type="submit" name="role.action" value="Remove Role" class="portlet-form-button" />
  +  </td>  
  +</tr>
  +</table>
  +<input type='hidden' name='users'/>
  +<input type='hidden' name='role' value='$role'/>
  +
  +</form>
  +
  +
  +#end
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org