unico       2003/12/14 07:29:16

  Modified:    src/blocks/slide/samples/screens login.xml
               src/blocks/slide/samples/styles description2html4locks.xsl
                        description2html4content.xsl
                        description2html4properties.xsl
               src/blocks/slide/samples sitemap.xmap
  Added:       src/blocks/slide/samples/screens users.jx roles.jx
                        permissions.jx groups.jx actions.jx
               src/blocks/slide/samples/styles description2html4users.xsl
                        permissions2html.xsl
  Removed:     src/blocks/slide/samples/styles
                        description2html4permissions.xsl
                        principal2html4users.xsl
  Log:
  major refactoring admin samples continued (hopefully not introducing new 
dos2unix problems)
  
  Revision  Changes    Path
  1.2       +1 -1      cocoon-2.1/src/blocks/slide/samples/screens/login.xml
  
  Index: login.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/screens/login.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- login.xml 10 Dec 2003 17:20:26 -0000      1.1
  +++ login.xml 14 Dec 2003 15:29:15 -0000      1.2
  @@ -11,7 +11,7 @@
         <column title="Login">
           <p class="samplesNote">These Slide examples require Java Transaction
           API library to be present. Get jta.jar and place it to the lib folder
  -        before trying these examples.
  +        before trying these examples. You will also need enabled uploads in 
web.xml .
           </p>
           <table border="0" cellspacing="0" cellpadding="2">
             <form action="login" method="post">
  
  
  
  1.1                  cocoon-2.1/src/blocks/slide/samples/screens/users.jx
  
  Index: users.jx
  ===================================================================
  <?xml version="1.0"?>
  <users xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";>
    <jx:forEach var="user" items="${users}">
      <user>
        <name>${user}</name>
      </user>
    </jx:forEach>
  </users>
  
  
  
  1.1                  cocoon-2.1/src/blocks/slide/samples/screens/roles.jx
  
  Index: roles.jx
  ===================================================================
  <?xml version="1.0"?>
  <roles xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";>
    <jx:forEach var="role" items="${roles}">
      <role>
        <name>${role}</name>
      </role>
    </jx:forEach>
  </roles>
  
  
  
  1.1                  
cocoon-2.1/src/blocks/slide/samples/screens/permissions.jx
  
  Index: permissions.jx
  ===================================================================
  <?xml version="1.0"?>
  <permissions xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";>
    <jx:forEach var="permission" items="${permissions}">
      <permission>
        <action>${permission.actionUri}</action>
        <object>${permission.objectUri}</object>
        <subject>${permission.subjectUri}</subject>
        <inheritable>${permission.inheritable}</inheritable>
        <negative>${permission.negative}</negative>
      </permission>
    </jx:forEach>
  </permissions>
  
  
  
  1.1                  cocoon-2.1/src/blocks/slide/samples/screens/groups.jx
  
  Index: groups.jx
  ===================================================================
  <?xml version="1.0"?>
  <groups xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";>
    <jx:forEach var="group" items="${groups}">
      <group>
        <name>${group}</name>
      </group>
    </jx:forEach>
  </groups>
  
  
  
  1.1                  cocoon-2.1/src/blocks/slide/samples/screens/actions.jx
  
  Index: actions.jx
  ===================================================================
  <?xml version="1.0"?>
  <actions xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";>
    <jx:forEach var="action" items="${actions}">
      <action>
        <name>${action}</name>
      </action>
    </jx:forEach>
  </actions>
  
  
  
  1.2       +17 -16    
cocoon-2.1/src/blocks/slide/samples/styles/description2html4locks.xsl
  
  Index: description2html4locks.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/slide/samples/styles/description2html4locks.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- description2html4locks.xsl        10 Dec 2003 17:20:25 -0000      1.1
  +++ description2html4locks.xsl        14 Dec 2003 15:29:16 -0000      1.2
  @@ -1,33 +1,34 @@
   <?xml version="1.0"?>
   <xsl:stylesheet 
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
  -  xmlns:collection="http://apache.org/cocoon/collection/1.0"; 
  +  xmlns:col="http://apache.org/cocoon/collection/1.0"; 
     xmlns:dav="DAV:" 
     version="1.0">
   
     <xsl:output indent="yes"/>
  +  <xsl:param name="base">/samples/slide</xsl:param>
     <xsl:param name="path" />
     
     <xsl:template match="/">
       <document>
         <header>
           <title>Jakarta Slide example</title>
  -        <tab title="users" href="../users/"/>
  -        <tab title="content" href="../content/{$path}"/>
  -        <tab title="properties" href="../properties/{$path}"/>
  -        <tab title="permissions" href="../permissions/{$path}"/>
  -        <tab title="locks" href="../locks/{$path}"/>
  -        <tab title="logout" href="../logout.html"/>
  +        <tab title="users" href="{$base}/users/"/>
  +        <tab title="content" href="{$base}/content/{$path}"/>
  +        <tab title="properties" href="{$base}/properties/{$path}"/>
  +        <tab title="permissions" href="{$base}/permissions/{$path}"/>
  +        <tab title="locks" href="{$base}/locks/{$path}"/>
  +        <tab title="logout" href="{$base}/logout.html"/>
         </header>
         <body>
           <row>
  -          <xsl:apply-templates 
select="collection:resource|collection:collection"/>
  +          <xsl:apply-templates select="col:resource|col:collection"/>
           </row>
         </body>
       </document>
     </xsl:template>
   
  -  <xsl:template match="collection:resource|collection:collection">
  +  <xsl:template match="col:resource|col:collection">
       <column title="Navigation">
         <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" 
width="100%" align="center">
           <tr>
  @@ -35,11 +36,11 @@
               <br/>
             </td>
           </tr>
  -        <xsl:for-each select="collection:resource|collection:collection">
  +        <xsl:for-each select="col:resource|col:collection">
             <tr>
               <td width="100%" bgcolor="#ffffff" align="left">
                 <font size="+0" face="arial,helvetica,sanserif" 
color="#000000">
  -                <a href="../locks/{$path}/[EMAIL PROTECTED]">
  +                <a href="{$base}/locks/{$path}/[EMAIL PROTECTED]">
                     <xsl:value-of select="@name"/>
                   </a>
                 </font>
  @@ -70,7 +71,7 @@
               </td>
               <td align="right"/>
             </tr>
  -          <xsl:for-each select="collection:locks/collection:lock">
  +          <xsl:for-each select="col:locks/col:lock">
               <tr bgcolor="#eeeeee">
                 <td align="left">
                   <xsl:value-of select="@subject"/>
  @@ -88,8 +89,8 @@
                   <xsl:value-of select="@exclusive"/>
                 </td>
                 <td align="right">
  -                <form action="../removelock.do" method="post">
  -                  <input type="hidden" name="resourcePath" value="/{$path}"/>
  +                <form action="{$base}/removelock.do" method="post">
  +                  <input type="hidden" name="resourcePath" value="{$path}"/>
                     <input type="hidden" name="subject" value="[EMAIL 
PROTECTED]"/>
                     <input type="submit" name="doRemoveLock" value="Delete"/>
                   </form>
  @@ -97,8 +98,8 @@
               </tr>
             </xsl:for-each>
             <tr>
  -            <form action="../addlock.do" method="post">
  -              <input type="hidden" name="resourcePath" value="/{$path}"/>
  +            <form action="{$base}/addlock.do" method="post">
  +              <input type="hidden" name="resourcePath" value="{$path}"/>
                 <td align="left">
                   <input name="subject" type="text" size="20" maxlength="40"/>
                 </td>
  
  
  
  1.2       +19 -18    
cocoon-2.1/src/blocks/slide/samples/styles/description2html4content.xsl
  
  Index: description2html4content.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/slide/samples/styles/description2html4content.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- description2html4content.xsl      10 Dec 2003 17:20:25 -0000      1.1
  +++ description2html4content.xsl      14 Dec 2003 15:29:16 -0000      1.2
  @@ -1,36 +1,37 @@
   <?xml version="1.0"?>
   <xsl:stylesheet 
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
  -  xmlns:collection="http://apache.org/cocoon/collection/1.0"; 
  +  xmlns:col="http://apache.org/cocoon/collection/1.0"; 
     xmlns:dav="DAV:" 
     xmlns:xi="http://www.w3.org/2001/XInclude"; 
     version="1.0">
   
     <xsl:output indent="yes"/>
  +  <xsl:param name="base">/samples/slide</xsl:param>
     <xsl:param name="path" />
     <xsl:param name="namespace">cocoon</xsl:param>
  -  <xsl:param name="principal">guest</xsl:param>
  +  <xsl:param name="principal">unauthenticated</xsl:param>
   
     <xsl:template match="/">
       <document>
         <header>
           <title>Jakarta Slide example</title>
  -        <tab title="users" href="../users/"/>
  -        <tab title="content" href="../content/{$path}"/>
  -        <tab title="properties" href="../properties/{$path}"/>
  -        <tab title="permissions" href="../permissions/{$path}"/>
  -        <tab title="locks" href="../locks/{$path}"/>
  -        <tab title="logout" href="../logout.html"/>
  +        <tab title="users" href="{$base}/users/"/>
  +        <tab title="content" href="{$base}/content/{$path}"/>
  +        <tab title="properties" href="{$base}/properties/{$path}"/>
  +        <tab title="permissions" href="{$base}/permissions/{$path}"/>
  +        <tab title="locks" href="{$base}/locks/{$path}"/>
  +        <tab title="logout" href="{$base}/logout.html"/>
         </header>
         <body>
           <row>
  -          <xsl:apply-templates 
select="collection:collection|collection:resource"/>
  +          <xsl:apply-templates select="col:collection|col:resource"/>
           </row>
         </body>
       </document>
     </xsl:template>
   
  -  <xsl:template match="collection:collection|collection:resource">
  +  <xsl:template match="col:collection|col:resource">
       <column title="Navigation">
         <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" 
width="100%" align="center">
           <tr>
  @@ -38,7 +39,7 @@
               <br/>
             </td>
           </tr>
  -        <xsl:for-each select="collection:collection|collection:resource">
  +        <xsl:for-each select="col:collection|col:resource">
             <tr>
               <td width="100%" bgcolor="#ffffff" align="left">
                 <font size="+0" face="arial,helvetica,sanserif" 
color="#000000">
  @@ -71,7 +72,7 @@
                   </td>
                   <td align="right"/>
                 </tr>
  -              <xsl:for-each 
select="collection:collection|collection:resource">
  +              <xsl:for-each select="col:collection|col:resource">
                   <tr>
                     <td align="left">&#xA0;&#xA0;
                      <a href="[EMAIL PROTECTED]"><xsl:value-of 
select="@name"/></a>
  @@ -86,8 +87,8 @@
                       <xsl:value-of select="@date"/>
                     </td>
                     <td align="right">
  -                    <form action="../delete.do" method="post">
  -                      <input type="hidden" name="parentPath" 
value="/{$path}" />
  +                    <form action="{$base}/delete.do" method="post">
  +                      <input type="hidden" name="parentPath" value="{$path}" 
/>
                         <input type="hidden" name="resourceName" value="[EMAIL 
PROTECTED]"/>
                         <input type="submit" name="doDeleteSource" 
value="Delete"/>
                       </form>
  @@ -95,8 +96,8 @@
                   </tr>
                 </xsl:for-each>
                 <tr>
  -                <form action="../upload.do" method="post" 
enctype="multipart/form-data">
  -                  <input type="hidden" name="parentPath" value="/{$path}"/>
  +                <form action="{$base}/upload.do" method="post" 
enctype="multipart/form-data">
  +                  <input type="hidden" name="parentPath" value="{$path}"/>
                     <td align="left"><input type="text" name="resourceName" 
size="15" maxlength="40"/></td>
                     <td align="left" colspan="3">
                      File:
  @@ -108,8 +109,8 @@
                   </form>
                 </tr>
                 <tr>
  -                <form action="../mkcol.do" method="post">
  -                  <input type="hidden" name="parentPath" value="/{$path}"/>
  +                <form action="{$base}/mkcol.do" method="post">
  +                  <input type="hidden" name="parentPath" value="{$path}"/>
                     <td align="left" colspan="4">
                       <input type="text" name="collectionName" size="15" 
maxlength="40"/>
                     </td>
  
  
  
  1.2       +17 -16    
cocoon-2.1/src/blocks/slide/samples/styles/description2html4properties.xsl
  
  Index: description2html4properties.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/slide/samples/styles/description2html4properties.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- description2html4properties.xsl   10 Dec 2003 17:20:25 -0000      1.1
  +++ description2html4properties.xsl   14 Dec 2003 15:29:16 -0000      1.2
  @@ -1,11 +1,12 @@
   <?xml version="1.0"?>
   <xsl:stylesheet 
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
  -  xmlns:collection="http://apache.org/cocoon/collection/1.0"; 
  +  xmlns:col="http://apache.org/cocoon/collection/1.0"; 
     xmlns:dav="DAV:" 
     version="1.0">
   
     <xsl:output indent="yes"/>
  +  <xsl:param name="base">/samples/slide</xsl:param>
     <xsl:param name="path" />
     <xsl:param name="namespace">cocoon</xsl:param>
     <xsl:param name="principal">guest</xsl:param>
  @@ -14,22 +15,22 @@
       <document>
         <header>
           <title>Jakarta Slide example</title>
  -        <tab title="users" href="../users/"/>
  -        <tab title="content" href="../content/{$path}"/>
  -        <tab title="properties" href="../properties/{$path}"/>
  -        <tab title="permissions" href="../permissions/{$path}"/>
  -        <tab title="locks" href="../locks/{$path}"/>
  -        <tab title="logout" href="../logout.html"/>
  +        <tab title="users" href="{$base}/users/"/>
  +        <tab title="content" href="{$base}/content/{$path}"/>
  +        <tab title="properties" href="{$base}/properties/{$path}"/>
  +        <tab title="permissions" href="{$base}/permissions/{$path}"/>
  +        <tab title="locks" href="{$base}/locks/{$path}"/>
  +        <tab title="logout" href="{$base}/logout.html"/>
         </header>
         <body>
           <row>
  -          <xsl:apply-templates 
select="collection:collection|collection:resource"/>
  +          <xsl:apply-templates select="col:collection|col:resource"/>
           </row>
         </body>
       </document>
     </xsl:template>
   
  -  <xsl:template match="collection:collection|collection:resource">
  +  <xsl:template match="col:collection|col:resource">
       <column title="Navigation">
         <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" 
width="100%" align="center">
           <tr>
  @@ -37,11 +38,11 @@
               <br/>
             </td>
           </tr>
  -        <xsl:for-each select="collection:collection|collection:resource">
  +        <xsl:for-each select="col:collection|col:resource">
             <tr>
               <td width="100%" bgcolor="#ffffff" align="left">
                 <font size="+0" face="arial,helvetica,sanserif" 
color="#000000">
  -                <a href="../properties/{$path}/[EMAIL PROTECTED]">
  +                <a href="{$base}/properties/{$path}/[EMAIL PROTECTED]">
                     <xsl:value-of select="@name"/>
                   </a>
                 </font>
  @@ -66,7 +67,7 @@
               </td>
               <td align="right"/>
             </tr>
  -          <xsl:for-each select="collection:properties/child::node()">
  +          <xsl:for-each select="col:properties/child::node()">
               <tr>
                 <td align="left">
                   <xsl:value-of select="namespace-uri(.)"/>
  @@ -79,8 +80,8 @@
                 </td>
                 <td align="right">
                   <xsl:if test="namespace-uri()!='DAV:'">
  -                  <form action="../removeproperty.do" method="post">
  -                    <input type="hidden" name="resourcePath" 
value="/{$path}"/>
  +                  <form action="{$base}/removeproperty.do" method="post">
  +                    <input type="hidden" name="resourcePath" 
value="{$path}"/>
                       <input type="hidden" name="namespace" 
value="{namespace-uri()}"/>
                       <input type="hidden" name="name" value="{local-name()}"/>
                       <input type="submit" name="doDeleteProperty" 
value="Delete"/>
  @@ -90,8 +91,8 @@
               </tr>
             </xsl:for-each>
             <tr>
  -            <form action="../addproperty.do" method="post">
  -              <input type="hidden" name="resourcePath" value="/{$path}"/>
  +            <form action="{$base}/addproperty.do" method="post">
  +              <input type="hidden" name="resourcePath" value="{$path}"/>
                 <td align="left">
                   <input name="namespace" type="text" size="15" 
maxlength="40"/>
                 </td>
  
  
  
  1.1                  
cocoon-2.1/src/blocks/slide/samples/styles/description2html4users.xsl
  
  Index: description2html4users.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
    xmlns:col="http://apache.org/cocoon/collection/1.0"; 
    xmlns:dav="DAV:" 
    version="1.0">
  
    <xsl:output indent="yes"/>
    <xsl:param name="base">/samples/slide</xsl:param>
  
    <xsl:template match="/">
      <document>
        <header>
          <title>Jakarta Slide example</title>
          <tab title="users" href="{$base}/users/"/>
          <tab title="content" href="{$base}/content/"/>
          <tab title="properties" href="{$base}/properties/"/>
          <tab title="permissions" href="{$base}/permissions/"/>
          <tab title="locks" href="{$base}/locks/"/>
          <tab title="logout" href="{$base}/logout.html"/>
        </header>
        <body>
          <row>
            <xsl:apply-templates select="/users/users/*|/users/groups/*"/>
          </row>
        </body>
      </document>
    </xsl:template>
  
    <xsl:template match="/users/users/col:[EMAIL PROTECTED]'users']">
      <column title="Users">
        <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" 
width="100%" align="center">
          <font size="+0" face="arial,helvetica,sanserif" color="#000000">
            <tr>
              <td align="left">
                <b>User</b>
              </td>
              <td align="left"/>
              <td align="left">
                <b>Role</b>
              </td>
              <td align="left">
                <b>Groups</b>
              </td>
              <td align="left"/>
              <td align="right"/>
            </tr>
            <xsl:for-each select="col:collection|col:resource">
              <xsl:variable name="name"><xsl:value-of 
select="@name"/></xsl:variable>
              <xsl:variable name="uri">/users/<xsl:value-of 
select="@name"/></xsl:variable>
              <tr>
                <form action="{$base}/removeuser.do" method="post">
                  <input type="hidden" name="username" value="[EMAIL 
PROTECTED]"/>
                  <td align="left">
                    <xsl:value-of select="@name"/>
                  </td>
                  <td align="left">
                    <input type="submit" name="doRemoveUser" value="Delete 
user"/>
                  </td>
                </form>
                <td align="left">
                  <xsl:value-of 
select="/users/roles/*/*[col:properties/dav:group-member-set/dav:href=$uri]/@name"/>
                </td>
                <form action="{$base}/removemember.do" method="post">
                  <input type="hidden" name="username" value="[EMAIL 
PROTECTED]"/>
                  <td align="left">
                    <xsl:variable name="name" select="@name"/>
                    <select name="groupname" 
size="{count(/users/groups/*/*[col:properties/dav:group-member-set/dav:href=$uri])}">
                      <xsl:for-each 
select="/users/groups/*/*[col:properties/dav:group-member-set/dav:href=$uri]">
                        <option>
                          <xsl:value-of select="@name"/>
                        </option>
                      </xsl:for-each>
                    </select>
                  </td>
                  <td align="left">
                    <input type="submit" name="doRemoveGroupMember" 
value="Remove group"/>
                  </td>
                </form>
              </tr>
              <tr>
                <td align="left"/>
                <td align="left"/>
                <td align="left"/>
                <form action="{$base}/addmember.do" method="post">
                  <input type="hidden" name="username" value="[EMAIL 
PROTECTED]"/>
                  <td align="left">
                    <xsl:variable name="name" select="@name"/>
                    <select name="groupname" size="1">
                      <xsl:for-each select="/users/groups/*/*">
                        <option>
                          <xsl:value-of select="@name"/>
                        </option>
                      </xsl:for-each>
                    </select>
                  </td>
                  <td align="left">
                    <input type="submit" name="doAddPrincipalGroupMember" 
value="Add group"/>
                  </td>
                </form>
              </tr>
            </xsl:for-each>
            <tr>
              <form action="{$base}/adduser.do" method="post">
                <td align="left">
                  <input name="username" type="text" size="10" maxlength="40"/>
                </td>
                <td align="left"/>
                <td align="left">
                  <input name="role" type="text" size="10" maxlength="40"/>
                </td>
                <td align="left">Password:</td>
                <td align="left">
                  <input name="password" type="text" size="10" maxlength="40"/>
                </td>
                <td align="right">
                  <input type="submit" name="doAddUser" value="Add user"/>
                </td>
              </form>
            </tr>
          </font>
        </table>
      </column>
    </xsl:template>
    
    <xsl:template match="/users/groups/col:[EMAIL PROTECTED]'groups']">
      <column title="Groups">
        <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" 
width="100%" align="center">
          <font size="+0" face="arial,helvetica,sanserif" color="#000000">
            <tr>
              <td align="left">
                <b>Group</b>
              </td>
              <td align="right"/>
            </tr>
            <xsl:for-each select="col:collection|col:resource">
              <tr>
                <form action="{$base}/removegroup.do" method="post">
                  <input type="hidden" name="groupname" value="[EMAIL 
PROTECTED]"/>
                  <td align="left">
                    <xsl:value-of select="@name"/>
                  </td>
                  <td align="right">
                    <input type="submit" name="doRemovePrincipalGroup" 
value="Delete group"/>
                  </td>
                </form>
              </tr>
            </xsl:for-each>
            <tr>
              <form action="{$base}/addgroup.do" method="post">
                <td align="left">
                  <input name="groupname" type="text" size="15" maxlength="40"/>
                </td>
                <td align="right">
                  <input type="submit" name="doAddPrincipalGroup" value="Add 
group"/>
                </td>
              </form>
            </tr>
          </font>
        </table>
      </column>
    </xsl:template>
  </xsl:stylesheet>
  
  
  
  1.1                  
cocoon-2.1/src/blocks/slide/samples/styles/permissions2html.xsl
  
  Index: permissions2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
    xmlns:col="http://apache.org/cocoon/collection/1.0"; 
    xmlns:dav="DAV:" 
    version="1.0">
  
    <xsl:output indent="yes"/>
    <xsl:param name="base">/samples/slide</xsl:param>
    <xsl:param name="path" />
    
    <xsl:template match="/">
      <document>
        <header>
          <title>Jakarta Slide example</title>
          <tab title="users" href="{$base}/users/"/>
          <tab title="content" href="{$base}/content/{$path}"/>
          <tab title="properties" href="{$base}/properties/{$path}"/>
          <tab title="permissions" href="{$base}/permissions/{$path}"/>
          <tab title="locks" href="{$base}/locks/{$path}"/>
          <tab title="logout" href="{$base}/logout.html"/>
        </header>
        <body>
          <row>
            <xsl:apply-templates 
select="/document/col:collection|/document/col:resource"/>
          </row>
        </body>
      </document>
    </xsl:template>
  
    <xsl:template match="col:collection|col:resource">
      <column title="Navigation">
        <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" 
width="100%" align="center">
          <tr>
            <td width="100%" bgcolor="#ffffff" align="left">
              <br/>
            </td>
          </tr>
          <xsl:for-each select="col:collection|col:resource">
            <tr>
              <td width="100%" bgcolor="#ffffff" align="left">
                <font size="+0" face="arial,helvetica,sanserif" color="#000000">
                  <xsl:choose>
                    <xsl:when test="$path = ''">
                        <a href="{$base}/permissions/[EMAIL PROTECTED]">
                          <xsl:value-of select="@name"/>
                        </a>
                    </xsl:when>
                    <xsl:otherwise>
                        <a href="{$base}/permissions/{$path}/[EMAIL PROTECTED]">
                          <xsl:value-of select="@name"/>
                        </a>
                    </xsl:otherwise>
                  </xsl:choose>
                </font>
              </td>
            </tr>
          </xsl:for-each>
        </table>
      </column>
  
      <column title="Permissions">
        <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" 
width="100%" align="center">
          <font size="+0" face="arial,helvetica,sanserif" color="#000000">
            <tr>
              <td align="left">
                <b>Principal</b>
              </td>
              <td align="left">
                <b>Privilege</b>
              </td>
              <td align="left">
                <b>Inheritable</b>
              </td>
              <td align="left">
                <b>Deny</b>
              </td>
              <td align="right"/>
            </tr>
            <xsl:for-each select="/document/permissions/permission">
              <tr>
                <td align="left">
                  <xsl:value-of select="subject"/>
                </td>
                <td align="left">
                  <xsl:value-of select="action"/>
                </td>
                <td align="left">
                  <xsl:value-of select="inheritable"/>
                </td>
                <td align="left">
                  <xsl:value-of select="negative"/>
                </td>
                <td align="right">
                  <form action="{$base}/removePermission.do" method="post">
                    <input type="hidden" name="resourcePath" value="{$path}"/>
                    <input type="hidden" name="subject" value="{subject}"/>
                    <input type="hidden" name="action" value="{action}"/>
                    <input type="hidden" name="inheritable" 
value="{inheritable}"/>
                    <input type="hidden" name="negative" value="{negative}"/>
                    <input type="submit" name="doRemovePermission" 
value="Delete"/>
                  </form>
                </td>
              </tr>
            </xsl:for-each>
            <tr>
              <form action="{$base}/addPermission.do" method="post">
                <input type="hidden" name="resourcePath" value="{$path}"/>
                <td align="left">
                  <select name="subject">
                    <option>self</option>
                    <option>owner</option>
                    <option>authenticated</option>
                    <option>unauthenticated</option>
                    <option>all</option>
                    <xsl:for-each select="/document/roles/role">
                      <option>
                        <xsl:value-of select="name"/>
                      </option>
                    </xsl:for-each>
                    <xsl:for-each select="/document/users/user">
                      <option>
                        <xsl:value-of select="name"/>
                      </option>
                    </xsl:for-each>
                    <xsl:for-each select="/document/groups/group">
                      <option>
                        <xsl:value-of select="name"/>
                      </option>
                    </xsl:for-each>
                  </select>
                </td>
                <td align="left">
                  <select name="action">
                    <option>all</option>
                    <option>default</option>
                    <xsl:for-each select="/document/actions/action">
                      <option>
                        <xsl:value-of select="name"/>
                      </option>
                    </xsl:for-each>
                  </select>
                </td>
                <td align="left">
                  <select name="inheritable">
                    <option>false</option>
                    <option>true</option>
                  </select>
                </td>
                <td align="left">
                  <select name="negative">
                    <option>false</option>
                    <option>true</option>
                  </select>
                </td>
                <td align="right">
                  <input type="submit" name="doAddPermission" 
value="Add/Modify"/>
                </td>
              </form>
            </tr>
          </font>
        </table>
      </column>
    </xsl:template>
  </xsl:stylesheet>
  
  
  
  1.13      +127 -121  cocoon-2.1/src/blocks/slide/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/sitemap.xmap,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- sitemap.xmap      10 Dec 2003 17:20:25 -0000      1.12
  +++ sitemap.xmap      14 Dec 2003 15:29:16 -0000      1.13
  @@ -10,10 +10,6 @@
                     
src="org.apache.cocoon.generation.TraversableSourceDescriptionGenerator" 
                     logger="sitemap.generator.traverse"
                     label="content"/>
  -   <map:generator name="principallist"
  -                  src="org.apache.cocoon.generation.PrincipalListGenerator"
  -                  logger="sitemap.generator.principallist"
  -                  label="content"/>
     </map:generators>
   
     <map:transformers default="xslt"/>
  @@ -56,126 +52,129 @@
   <!-- =========================== Pipelines ================================= 
-->
   
    <map:pipelines>
  -  <map:component-configurations>
  -   <authentication-manager>
  -    <handlers>
  -     <handler name="slidehandler" 
xmlns:map="http://apache.org/cocoon/sitemap/1.0";>
  -      <redirect-to    uri="cocoon://slide-samples/login.html"/>
  -      <authentication uri="cocoon:/authenticate"/>
  -     </handler>
  -    </handlers>
  -   </authentication-manager>
  -   <global-variables>
  -     <namespace>cocoon</namespace>
  -   </global-variables>
  +   
  +   <map:component-configurations>
  +     <authentication-manager>
  +       <handlers>
  +         <handler name="slidehandler" 
xmlns:map="http://apache.org/cocoon/sitemap/1.0";>
  +           <redirect-to    uri="cocoon://slide-samples/login.html"/>
  +           <authentication uri="cocoon:/screens/authenticate/none/"/>
  +         </handler>
  +       </handlers>
  +     </authentication-manager>
  +     <global-variables>
  +       <namespace>cocoon</namespace>
  +       <base>/slide-samples</base>
  +     </global-variables>
     </map:component-configurations>
   
   
     <map:pipeline internal-only="false" type="noncaching">
  -   <map:match pattern="principallist">
  -    <map:generate type="principallist">
  -     <map:parameter name="principalprovider" value="slide"/>
  -     <map:parameter name="principalcaller" value="root"/>
  -    </map:generate>
  -    <map:serialize type="xml"/>
  -   </map:match>
  -
  -   <map:match pattern="authenticate">
  -     <map:call function="authenticate" />
  -   </map:match>
  -
  -   <map:match pattern="authentication">
  -    <map:generate type="jx" src="screens/authentication.jx" />
  -    <map:serialize type="xml"/>
  -   </map:match>
      
  -   <!-- =============  Source description ============= -->
  -   <map:match pattern="description/*/**">
  -    <map:generate type="traverse" src="slide://[EMAIL 
PROTECTED]:namespace}/{2}">
  -     <map:parameter name="properties" value="true"/>
  -     <map:parameter name="permissions" value="false"/>
  -     <map:parameter name="locks" value="true"/>
  -     <map:parameter name="version" value="false"/>
  -     <map:parameter name="depth" value="1"/>
  -    </map:generate>
  -    <map:serialize type="xml"/>
  +   <map:match pattern="screens/*/*/**">
  +     <map:call function="screen_{1}">
  +       <map:parameter name="caller" value="{2}" />
  +       <map:parameter name="path" value="{3}" />
  +     </map:call>
      </map:match>
  +   
  +   <map:match pattern="screens/*.jx">
  +     <map:generate type="jx" src="screens/{1}.jx" />
  +     <map:serialize type="xml" />
  +   </map:match>
  +    
  +   <map:match pattern="users/*/*">
  +     <map:generate type="traverse" src="slide://[EMAIL 
PROTECTED]:namespace}/{1}?scope=/">
  +       <map:parameter name="properties" value="true"/>
  +       <map:parameter name="permissions" value="false"/>
  +       <map:parameter name="locks" value="false"/>
  +       <map:parameter name="version" value="false"/>
  +       <map:parameter name="depth" value="1"/>
  +     </map:generate>
  +     <map:serialize type="xml"/>
  +    </map:match>
  +    
     </map:pipeline>
   
   
  -  <map:pipeline>
  -   <map:match pattern="">
  -    <map:redirect-to uri="content/"/>
  -   </map:match>
  +  <map:pipeline type="noncaching">
  +    <map:match pattern="">
  +      <map:redirect-to uri="content/"/>
  +    </map:match>
    
  -   <map:match pattern="login.html">
  -    <map:generate src="screens/login.xml"/>
  -    <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  -     <map:parameter name="contextPath" value="{request:contextPath}"/>
  -    </map:transform>
  -    <map:serialize/>
  -   </map:match>
  -
  -   <map:match pattern="login">
  -    <map:act type="auth-login">
  -     <map:parameter name="handler" value="slidehandler"/>
  -     <map:parameter name="parameter_name" value="{request-param:userid}"/>
  -     <map:parameter name="parameter_password" 
value="{request-param:password}"/>
  -     <map:redirect-to uri="{request-param:resource}"/>
  -    </map:act>
  -
  -    <map:generate src="login-failed.xml"/>
  -    <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  -     <map:parameter name="contextPath" value="{request:contextPath}"/>
  -    </map:transform>
  -    <map:serialize/>
  -   </map:match>
  -
  -   <map:match pattern="logout.html">
  -    <map:act type="auth-logout">
  -     <map:parameter name="handler" value="slidehandler"/>
  -
  -     <map:generate src="screens/logout.xml"/>
  +    <map:match pattern="login.html">
  +      <map:generate src="screens/login.xml"/>
         <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  -       <map:parameter name="contextPath" value="{request:contextPath}"/>
  +        <map:parameter name="contextPath" value="{request:contextPath}"/>
         </map:transform>
  -     <map:serialize/>
  -    </map:act>
  -
  -    <map:redirect-to uri="login.html"/>
  -   </map:match>
  +      <map:serialize/>
  +    </map:match>
   
  -   <map:match pattern="**">
  -    <map:act type="auth-protect">
  -     <map:parameter name="handler" value="slidehandler"/>
  -     
  -     <map:match pattern="*.do">
  -       <map:call function="public_{1}">
  -         <map:parameter name="caller"    value="{../ID}" />
  -         <map:parameter name="namespace" value="{global:namespace}" />
  -       </map:call>
  -     </map:match>
  +    <map:match pattern="login">
  +      <map:act type="auth-login">
  +        <map:parameter name="handler" value="slidehandler"/>
  +        <map:parameter name="parameter_name" value="{request-param:userid}"/>
  +        <map:parameter name="parameter_password" 
value="{request-param:password}"/>
  +        <map:redirect-to uri="{request-param:resource}"/>
  +      </map:act>
  +
  +      <map:generate src="screens/login-failed.xml"/>
  +      <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  +        <map:parameter name="contextPath" value="{request:contextPath}"/>
  +      </map:transform>
  +      <map:serialize/>
  +    </map:match>
  +
  +    <map:match pattern="logout.html">
  +      <map:act type="auth-logout">
  +        <map:parameter name="handler" value="slidehandler"/>
  +
  +        <map:generate src="screens/logout.xml"/>
  +        <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  +          <map:parameter name="contextPath" value="{request:contextPath}"/>
  +        </map:transform>
  +        <map:serialize/>
  +      </map:act>
  +
  +      <map:redirect-to uri="login.html"/>
  +    </map:match>
  +
  +    <map:match pattern="**">
  +      <map:act type="auth-protect">
  +        <map:parameter name="handler" value="slidehandler"/>
  +        
  +        <map:match pattern="*.do">
  +          <map:call function="public_{1}">
  +            <map:parameter name="caller"    value="{../ID}" />
  +            <map:parameter name="namespace" value="{global:namespace}" />
  +          </map:call>
  +        </map:match>
   
        <!-- ============= Source content ================== -->
   
        <map:match pattern="content/**">
  -      <map:generate src="cocoon:/description/{../ID}/{1}"/>
  -      <map:transform src="styles/description2html4content.xsl">
  -       <map:parameter name="path" value="{1}" />
  -       <map:parameter name="namespace" value="{global:namespace}" />
  -       <map:parameter name="principal" value="{../ID}"/>
  -      </map:transform>
  -      <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  -       <map:parameter name="contextPath" value="{request:contextPath}"/>
  -      </map:transform>
  -      <map:transform type="xinclude"/>
  -      <map:serialize type="html"/>
  +       <map:generate src="cocoon:/description/{../ID}/{1}"/>
  +       <map:transform src="styles/description2html4content.xsl">
  +         <map:parameter name="base" 
value="{request:contextPath}{global:base}"/>
  +         <map:parameter name="path" value="{1}" />
  +         <map:parameter name="namespace" value="{global:namespace}" />
  +         <map:parameter name="principal" value="{../ID}"/>
  +       </map:transform>
  +       <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  +         <map:parameter name="base" value="{global:base}"/>
  +         <map:parameter name="contextPath" value="{request:contextPath}"/>
  +       </map:transform>
  +       <map:transform type="xinclude"/>
  +       <map:serialize type="html"/>
        </map:match>
   
        <!-- ============= Source properties =============== -->
        <map:match pattern="properties/**">
         <map:generate src="cocoon:/description/{../ID}/{1}"/>
  -      <map:transform src="styles/description2html4properties.xsl"/>
  +      <map:transform src="styles/description2html4properties.xsl">
  +         <map:parameter name="base" 
value="{request:contextPath}{global:base}"/>
  +         <map:parameter name="path" value="{1}" />
  +      </map:transform>
         <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
          <map:parameter name="contextPath" value="{request:contextPath}"/>
         </map:transform>
  @@ -184,23 +183,29 @@
   
        <!-- ============= Source permissions ============== -->
        <map:match pattern="permissions/**">
  -     
  -      <map:aggregate element="document">
  -       <map:part src="cocoon:/description/{../ID}/{1}"/>
  -       <map:part src="cocoon:/principallist"/>
  -      </map:aggregate>
  -
  -      <map:transform src="styles/description2html4permissions.xsl"/>
  -      <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  -       <map:parameter name="contextPath" value="{request:contextPath}"/>
  -      </map:transform>
  -      <map:serialize type="html"/>
  +       <map:aggregate element="document" label="content">
  +         <map:part src="cocoon:/screens/permissions/{../ID}/{1}" />
  +         <map:part src="cocoon:/screens/actions/{../ID}/{1}" />
  +         <map:part src="cocoon:/screens/groups/{../ID}/{1}" />
  +         <map:part src="cocoon:/screens/users/{../ID}/{1}" />
  +         <map:part src="cocoon:/screens/roles/{../ID}/{1}" />
  +         <map:part src="cocoon:/description/{../ID}/{1}" />
  +       </map:aggregate>
  +       <map:transform src="styles/permissions2html.xsl">
  +         <map:parameter name="base" 
value="{request:contextPath}{global:base}"/>
  +         <map:parameter name="path" value="{1}" />
  +       </map:transform>
  +       <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  +         <map:parameter name="contextPath" value="{request:contextPath}"/>
  +       </map:transform>
  +       <map:serialize type="html"/>
        </map:match>
   
        <!-- ============= Source locks ==================== -->
        <map:match pattern="locks/**">
         <map:generate src="cocoon:/description/{../ID}/{1}"/>
         <map:transform src="styles/description2html4locks.xsl">
  +       <map:parameter name="base" 
value="{request:contextPath}{global:base}"/>
          <map:parameter name="path" value="{1}" />
         </map:transform>
         <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  @@ -210,20 +215,21 @@
        </map:match>
   
        <!-- ============= Repository users =============== -->
  -     <map:match pattern="users/**">
  -      <map:generate type="principallist">
  -       <map:parameter name="principalprovider" value="slide"/>
  -       <map:parameter name="principalcaller" value="{../ID}"/>
  -      </map:generate>
  -      <map:transform src="styles/principal2html4users.xsl">
  -       <map:parameter name="contextPath" value="{request:contextPath}"/>
  +     <map:match pattern="users/">
  +      <map:aggregate element="users" label="content">
  +        <map:part element="users" src="cocoon:/users/users/{../ID}"/>
  +        <map:part element="groups" src="cocoon:/users/groups/{../ID}" />
  +        <map:part element="roles" src="cocoon:/users/roles/{../ID}" />
  +      </map:aggregate>
  +      <map:transform src="styles/description2html4users.xsl">
  +       <map:parameter name="base" 
value="{request:contextPath}{global:base}"/>
         </map:transform>
         <map:transform 
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
          <map:parameter name="contextPath" value="{request:contextPath}"/>
         </map:transform>
         <map:serialize type="html"/>
        </map:match>
  -
  +     
       </map:act>
      </map:match>
                        
  
  
  

Reply via email to