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 / locks2html.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  5.5 KB  |  148 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.   <xsl:param name="path"/>
  27.   <xsl:param name="type">locks</xsl:param>
  28.   
  29.   <xsl:param name="userspath"/>
  30.   <xsl:param name="rolespath"/>
  31.   <xsl:param name="groupspath"/>
  32.   <xsl:param name="actionspath"/>  
  33.   
  34.   <xsl:template name="middle">
  35.     <column title="Locks">
  36.       <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
  37.         <font size="+0" face="arial,helvetica,sanserif" color="#000000">
  38.           <tr>
  39.             <td align="left">
  40.               <b>Subject</b>
  41.             </td>
  42.             <td align="left">
  43.               <b>Type</b>
  44.             </td>
  45.             <td align="left">
  46.               <b>Expiration (mins)</b>
  47.             </td>
  48.             <td align="left">
  49.               <b>Inheritable</b>
  50.             </td>
  51.             <td align="left">
  52.               <b>Exclusive</b>
  53.             </td>
  54.             <td align="right"/>
  55.           </tr>
  56.           <xsl:for-each select="/document/locks/lock">
  57.             <tr bgcolor="#eeeeee">
  58.               <td align="left">
  59.                 <xsl:value-of select="subject"/>
  60.               </td>
  61.               <td align="left">
  62.                 <xsl:value-of select="type"/>
  63.               </td>
  64.               <td align="left">
  65.                 <xsl:value-of select="expiration"/>
  66.               </td>
  67.               <td align="left">
  68.                 <xsl:value-of select="inheritable"/>
  69.               </td>
  70.               <td align="left">
  71.                 <xsl:value-of select="exclusive"/>
  72.               </td>
  73.               <td align="right">
  74.                 <form action="{$base}/removelock" method="post">
  75.                   <input type="hidden" name="resourcePath" value="{$path}"/>
  76.                   <input type="hidden" name="objectUri" value="{object}"/>
  77.                   <input type="hidden" name="lockId" value="{id}"/>
  78.                   <input type="submit" name="doRemoveLock" value="Delete"/>
  79.                 </form>
  80.               </td>
  81.             </tr>
  82.           </xsl:for-each>
  83.           <tr>
  84.             <form action="{$base}/addlock" method="post">
  85.               <input type="hidden" name="resourcePath" value="{$path}"/>
  86.               <td align="left">
  87.                 <select name="subject">
  88.                   <option>self</option>
  89.                   <option>owner</option>
  90.                   <option>authenticated</option>
  91.                   <option>unauthenticated</option>
  92.                   <option>all</option>
  93.                   <xsl:for-each select="/document/roles/role">
  94.                     <xsl:variable name="roleuri" select="uri/text()" />
  95.                     <xsl:variable name="rolename" select="substring-after($roleuri,concat($rolespath,'/'))"/>
  96.                     <option value="{$roleuri}">
  97.                       role: <xsl:value-of select="$rolename"/>
  98.                     </option>
  99.                   </xsl:for-each>
  100.                   <xsl:for-each select="/document/users/user">
  101.                     <xsl:variable name="useruri" select="uri/text()" />
  102.                     <xsl:variable name="username" select="substring-after($useruri,concat($userspath,'/'))"/>
  103.                     <option value="{$useruri}">
  104.                       user: <xsl:value-of select="$username"/>
  105.                     </option>
  106.                   </xsl:for-each>
  107.                 </select>
  108.               </td>
  109.               <td align="left">
  110.                 <select name="type">
  111.                   <option>all</option>
  112.                   <option>default</option>
  113.                   <xsl:for-each select="/document/privileges/privilege">
  114.                     <xsl:variable name="actionuri" select="uri/text()" />
  115.                     <xsl:variable name="actionname" select="substring-after($actionuri,concat($actionspath,'/'))"/>
  116.                     <option value="{$actionuri}">
  117.                       <xsl:value-of select="$actionname"/>
  118.                     </option>
  119.                   </xsl:for-each>
  120.                 </select>
  121.               </td>
  122.               <td align="left">
  123.                 <input name="expiration" type="text" size="15" maxlength="40" value="1"/>
  124.               </td>
  125.               <td align="left">
  126.                 <select name="inheritable">
  127.                   <option>false</option>
  128.                   <option>true</option>
  129.                 </select>
  130.               </td>
  131.               <td align="left">
  132.                 <select name="exclusive">
  133.                   <option>false</option>
  134.                   <option>true</option>
  135.                 </select>
  136.               </td>
  137.               <td align="right">
  138.                 <input type="submit" name="doAddLock" value="Add/Modify"/>
  139.               </td>
  140.             </form>
  141.           </tr>
  142.         </font>
  143.       </table>
  144.     </column>
  145.   </xsl:template>
  146.   
  147. </xsl:stylesheet>
  148.