home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / users2html.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  6.6 KB  |  178 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17. <xsl:stylesheet 
  18.   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  19.   xmlns:col="http://apache.org/cocoon/collection/1.0" 
  20.   version="1.0">
  21.   
  22.   <xsl:import href="layout.xsl" />
  23.   <xsl:output indent="yes"/>
  24.   
  25.   <xsl:param name="base"/>
  26.   
  27.   <xsl:param name="userspath"/>
  28.   <xsl:param name="rolespath"/>
  29.    
  30.   <xsl:template name="left">
  31.     <xsl:apply-templates select="/document/users"/>
  32.   </xsl:template>
  33.   
  34.   <xsl:template name="middle">
  35.     <xsl:apply-templates select="/document/roles"/>
  36.   </xsl:template>
  37.  
  38.   <xsl:template match="/document/users">
  39.     <column title="Users">
  40.       <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
  41.         <font size="+0" face="arial,helvetica,sanserif" color="#000000">
  42.           <tr>
  43.             <td align="left">
  44.               <b>User</b>
  45.             </td>
  46.             <td/>
  47.             <td align="left">
  48.               <b>Password</b>
  49.             </td>
  50.             <td/>
  51.             <td align="left">
  52.               <b>Roles</b>
  53.             </td>
  54.             <td align="right"/>
  55.           </tr>
  56.           <xsl:for-each select="user">
  57.             <xsl:variable name="useruri"  select="uri/text()" />
  58.             <xsl:variable name="username" select="substring-after($useruri,concat($userspath,'/'))" />
  59.             <tr>
  60.               <td align="left">
  61.                 <xsl:value-of select="$username"/><br/>
  62.               </td>
  63.               <td align="left">
  64.                 <form action="{$base}/removeobject">
  65.                   <input type="hidden" name="objecturi" value="{$useruri}"/>
  66.                   <input type="submit" name="doRemoveUser" value="Delete"/>
  67.                 </form>
  68.               </td>
  69.               <form action="{$base}/changepwd" method="post">
  70.                 <input type="hidden" name="username" value="{$username}"/>
  71.                 <td align="left">
  72.                   <input type="password" name="password" size="10" maxlength="40"/>
  73.                 </td>
  74.                 <td>
  75.                   <input type="submit" name="doSetPassword" value="Change"/>
  76.                 </td>
  77.               </form>
  78.               <form action="{$base}/removemember" method="post">
  79.                 <input type="hidden" name="subjecturi" value="{$useruri}"/>
  80.                 <td align="left">
  81.                   <select name="objecturi">
  82.                     <xsl:for-each select="/document/roles/role[member=$useruri]">
  83.                       <xsl:variable name="roleuri" select="uri/text()" />
  84.                       <xsl:variable name="rolename" select="substring-after($roleuri,concat($rolespath,'/'))" />
  85.                       <option value="{$roleuri}">
  86.                         <xsl:value-of select="$rolename"/>
  87.                       </option>
  88.                     </xsl:for-each>
  89.                   </select>
  90.                 </td>
  91.                 <td align="left">
  92.                   <input type="submit" name="doRemoveRoleMember" value="Remove role"/>
  93.                 </td>
  94.               </form>
  95.             </tr>
  96.             <tr>
  97.               <td colspan="4"/>
  98.               <form action="{$base}/addmember" method="post">
  99.                 <input type="hidden" name="subjecturi" value="{$useruri}"/>
  100.                 <td align="left">
  101.                   <select name="objecturi" size="1">
  102.                     <xsl:for-each select="/document/roles/role">
  103.                       <xsl:variable name="roleuri" select="uri/text()"/>
  104.                       <xsl:variable name="rolename" select="substring-after($roleuri,concat($rolespath,'/'))"/>
  105.                       <option value="{$roleuri}">
  106.                         <xsl:value-of select="$rolename"/>
  107.                       </option>
  108.                     </xsl:for-each>
  109.                   </select>
  110.                 </td>
  111.                 <td align="left">
  112.                   <input type="submit" name="doAddRoleMember" value="Add role"/>
  113.                 </td>
  114.                 <td align="left"/>
  115.               </form>
  116.             </tr>
  117.           </xsl:for-each>
  118.           <tr>
  119.             <form action="{$base}/adduser" method="post">
  120.               <td align="left">
  121.                 <input name="username" type="text" size="10" maxlength="40"/>
  122.               </td>
  123.               <td align="left"/>
  124.               <td align="left">
  125.                 <input name="password" type="password" size="10" maxlength="40"/>
  126.               </td>
  127.               <td colspan="2"/>
  128.               <td align="right">
  129.                 <input type="submit" name="doAddUser" value="Add user"/>
  130.               </td>
  131.             </form>
  132.           </tr>
  133.         </font>
  134.       </table>
  135.     </column>
  136.   </xsl:template>
  137.     
  138.   <xsl:template match="/document/roles">
  139.     <column title="Roles">
  140.       <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
  141.         <font size="+0" face="arial,helvetica,sanserif" color="#000000">
  142.           <tr>
  143.             <td align="left">
  144.               <b>Role</b>
  145.             </td>
  146.             <td align="right"/>
  147.           </tr>
  148.           <xsl:for-each select="role">
  149.             <xsl:variable name="roleuri"  select="uri/text()" />
  150.             <xsl:variable name="rolename" select="substring-after($roleuri,concat($rolespath,'/'))" />
  151.             <tr>
  152.               <form action="{$base}/removeobject" method="post">
  153.                 <input type="hidden" name="objecturi" value="{$roleuri}"/>
  154.                 <td align="left">
  155.                   <xsl:value-of select="$rolename"/>
  156.                 </td>
  157.                 <td align="right">
  158.                   <input type="submit" name="doRemovePrincipalRole" value="Remove role"/>
  159.                 </td>
  160.               </form>
  161.             </tr>
  162.           </xsl:for-each>
  163.           <tr>
  164.             <form action="{$base}/addrole" method="post">
  165.               <td align="left">
  166.                 <input name="rolename" type="text" size="15" maxlength="40"/>
  167.               </td>
  168.               <td align="right">
  169.                 <input type="submit" name="doAddPrincipalRole" value="Add role"/>
  170.               </td>
  171.             </form>
  172.           </tr>
  173.         </font>
  174.       </table>
  175.     </column>
  176.   </xsl:template>
  177. </xsl:stylesheet>
  178.