cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gian...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/webdav/samples/step5/styles dir2html.xsl doc2write.xsl file2html.xsl new2html.xsl request2doc.xsl
Date Tue, 22 Jul 2003 12:17:21 GMT
gianugo     2003/07/22 05:17:21

  Added:       src/blocks/webdav/samples samples.xml sitemap.xmap
               src/blocks/webdav/samples/step1 sitemap.xmap
               src/blocks/webdav/samples/step1/repo contentA.xml
               src/blocks/webdav/samples/step1/repo/dir1 contentB.xml
                        contentC.xml
               src/blocks/webdav/samples/step1/repo/dir2 contentA.xml
                        contentB.xml contentC.xml
               src/blocks/webdav/samples/step1/repo/dir2/subdir1
                        contentA.xml
               src/blocks/webdav/samples/step2 sitemap.xmap
               src/blocks/webdav/samples/step2/repo contentA.xml
               src/blocks/webdav/samples/step2/repo/dir1 contentB.xml
                        contentC.xml
               src/blocks/webdav/samples/step2/repo/dir2 contentA.xml
                        contentB.xml contentC.xml
               src/blocks/webdav/samples/step2/repo/dir2/subdir1
                        contentA.xml
               src/blocks/webdav/samples/step2/styles dir2html.xsl
                        file2html.xsl
               src/blocks/webdav/samples/step3 sitemap.xmap
               src/blocks/webdav/samples/step3/repo contentA.xml
               src/blocks/webdav/samples/step3/repo/dir1 contentB.xml
                        contentC.xml
               src/blocks/webdav/samples/step3/repo/dir2 contentA.xml
                        contentB.xml contentC.xml
               src/blocks/webdav/samples/step3/repo/dir2/subdir1
                        contentA.xml
               src/blocks/webdav/samples/step3/styles dir2html.xsl
                        doc2write.xsl file2html.xsl request2doc.xsl
               src/blocks/webdav/samples/step4 sitemap.xmap
               src/blocks/webdav/samples/step4/repo contentA.xml
                        contentA.xml.meta
               src/blocks/webdav/samples/step4/repo/dir1 contentB.xml
                        contentB.xml.meta contentC.xml contentC.xml.meta
               src/blocks/webdav/samples/step4/repo/dir2 contentA.xml
                        contentA.xml.meta contentB.xml contentB.xml.meta
                        contentC.xml contentC.xml.meta
               src/blocks/webdav/samples/step4/repo/dir2/subdir1
                        contentA.xml contentA.xml.meta
               src/blocks/webdav/samples/step4/styles dir2html.xsl
                        doc2write.xsl file2html.xsl request2doc.xsl
               src/blocks/webdav/samples/step5 new.xml sitemap.xmap
               src/blocks/webdav/samples/step5/repo contentA.xml
                        contentA.xml.meta
               src/blocks/webdav/samples/step5/repo/dir1 contentB.xml
                        contentB.xml.meta contentC.xml contentC.xml.meta
               src/blocks/webdav/samples/step5/repo/dir2 contentA.xml
                        contentA.xml.meta contentB.xml contentB.xml.meta
                        contentC.xml contentC.xml.meta
               src/blocks/webdav/samples/step5/repo/dir2/subdir1
                        contentA.xml contentA.xml.meta
               src/blocks/webdav/samples/step5/styles dir2html.xsl
                        doc2write.xsl file2html.xsl new2html.xsl
                        request2doc.xsl
  Log:
  Probably will get filtered... anyway: this is the webdav sample
  made by Guido Casper. I excluded for now the step6, which involves
  using HTMLarea which, in turn, adds 700K to the repository: let's
  discuss whether adding it or not.
  
  Revision  Changes    Path
  1.1                  cocoon-2.1/src/blocks/webdav/samples/samples.xml
  
  Index: samples.xml
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1"?>
  <samples xmlns:xlink="http://www.w3.org/1999/xlink">
  
    <group name="Main examples page.">
      <sample name="Back" href="..">to Cocoon examples main page</sample>
    </group>
  
    <group name="Documentation">
      <sample name="WebDAV" href="./">
        Not yet available - How to How to build a poor men's CMS with Cocoon and WebDAV
      </sample>
      <sample name="Setting up mod_dav" href="http://httpd.apache.org/docs-2.0/mod/mod_dav.html">
        How to setup the Apache Web server as a WebDAV server
      </sample>
    </group>
  
    <group name="WebDAV protocol examples">
      <note>
        NOTE: All these samples operate on the filesystem by default. Each sitemap has a global
        variable {staging} that is empty. Just put your content on a WebDAV server (i.e. copy
        this folder to your WebDAV server) and point this variable to the corresponding
        path. The WebDAV protocol is then used transparently. Now you can connect one or several
        additional Cocoon instances to your WebDAV repository to serve as publishing engines.
      </note>
      <note>
        In fact you could use any of Cocoon's pseudo protocols that implements the TraversableSource and
        ModifiableSource interfaces.
      </note>
      <sample name="step1" href="step1/repo/">
        Using the TraversableGenerator
      </sample>
      <sample name="step2" href="step2/repo/">
        Browsing the folder hierarchy
      </sample>
      <sample name="step3" href="step3/repo/">
        Changing content
      </sample>
      <sample name="step4" href="step4/repo/">
        Putting meta data separate. This sample puts the meta data in a separate file with
        a .meta extension. You could equally well put your meta data in a relational database
        by putting the SQLTransformer in the write pipeline and modifying the doc2write.xsl
        stylesheet accordingly. That way you can query your meta data via SQL later on. In the
        future there will be the possibility to store your meta data together with your document
        as a WebDAV property and query it via DASL (given you have a DASL enabled WebDAV server
        such as Catacomb)
      </sample>
      <sample name="step5" href="step5/repo/">
        Creating new content
      </sample>
      <!--
      <sample name="step6" href="step6/repo/">
        Enabling WYSIWYG - This sample integrates htmlArea (see below for the link) as an example
        how to integrate other editors.
      </sample>
      -->
    </group>
  
    <group name="Serving WebDAV">
      <sample name="WebDAV sitemap" href="./">
        Not yet available - This sample will show how to serve WebDAV clients from Cocoon
        (i.e. using Cocoon as a WebDAV server)
      </sample>
    </group>
  
    <group name="Resources">
      <sample name="webdav.org" href="http://www.webdav.org/">
        The webdav.org website
      </sample>
      <sample name="htmlArea" href="http://sourceforge.net/projects/itools-htmlarea/">
        A textarea replacement for WYSIWYG editing
      </sample>
      <sample name="Catacomb" href="http://www.webdav.org/catacomb/">
        A DASL enabled WebDAV server
      </sample>
    </group>
  
  </samples>
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
    <map:components/>
  
    <map:views>
      <map:view from-label="content" name="content">
        <map:serialize type="xml"/>
      </map:view>
      <map:view from-position="last" name="links">
        <map:serialize type="links"/>
      </map:view>
    </map:views>
  
    <map:pipelines>
      <map:pipeline>
  
        <map:match pattern="">
          <map:redirect-to uri="welcome"/>
        </map:match>
     
        <map:match pattern="welcome">
          <map:generate src="samples.xml"/>
          <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
            <map:parameter name="contextPath" value="{request:contextPath}"/>
          </map:transform>
          <map:serialize/>
        </map:match>
  
  
        <map:match pattern="*/**">
          <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
        </map:match>
  
      </map:pipeline>
    </map:pipelines>
  
  </map:sitemap>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step1/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
  <map:components>
    <map:generators default="file">
      <map:generator name="traverse" src="org.apache.cocoon.generation.TraversableGenerator"/>
    </map:generators>
  </map:components>
  
  <map:pipelines>
  
    <map:component-configurations>
      <global-variables>
        <staging></staging>
        <!--staging>webdav://localhost/webdav/step1/</staging-->
      </global-variables>
    </map:component-configurations>
  
    <map:pipeline>
  
      <map:match pattern="repo/">
        <map:generate type="traverse" src="{global:staging}repo/">
          <map:parameter name="depth" value="1"/>
        </map:generate>
        <map:serialize type="xml"/>
      </map:match>
  
      <map:match pattern="repo/**/">
        <map:generate type="traverse" src="{global:staging}repo/{1}/">
          <map:parameter name="depth" value="1"/>
        </map:generate>
        <map:serialize type="xml"/>
      </map:match>
  
    </map:pipeline>
  </map:pipelines>
  
  </map:sitemap>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step1/repo/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <page>
   <title>Page 1</title>
   <content>
     <para>Paragraph 1</para>
     <para>Paragraph 2</para>
   </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step1/repo/dir1/contentB.xml
  
  Index: contentB.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentB</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step1/repo/dir1/contentC.xml
  
  Index: contentC.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentC</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step1/repo/dir2/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentA</title>
    <content>
      <para>Paragraph 1.1</para>
      <para>Paragraph 2.1</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step1/repo/dir2/contentB.xml
  
  Index: contentB.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>Content B</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step1/repo/dir2/contentC.xml
  
  Index: contentC.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>content</title>
    <content>
      <para>Paragraph 1</para>
      <para>Paragraph 2</para>
      <para>Paragraph 3</para>
      <para>Paragraph 4</para>
    </content>
  </page>
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step1/repo/dir2/subdir1/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
   <title>New Content</title>
   <content>
     <para>Paragraph 1</para>
     <para>Paragraph 2</para>
   </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step2/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
  <map:components>
    <map:generators default="file">
      <map:generator name="traverse" src="org.apache.cocoon.generation.TraversableGenerator"/>
    </map:generators>
  </map:components>
  
  <map:pipelines>
  
    <map:component-configurations>
      <global-variables>
        <staging></staging>
        <!--staging>webdav://localhost/webdav/step2/</staging-->
      </global-variables>
    </map:component-configurations>
  
    <map:pipeline>
  
      <map:match pattern="repo/">
        <map:generate type="traverse" src="{global:staging}repo/"/>
        <map:transform src="{global:staging}styles/dir2html.xsl"/>
        <map:serialize type="html"/>
      </map:match>
  
      <map:match pattern="repo/**/">
        <map:generate type="traverse" src="{global:staging}repo/{1}/"/>
        <map:transform src="{global:staging}styles/dir2html.xsl"/>
        <map:serialize type="html"/>
      </map:match>
  
      <map:match pattern="repo/**">
          <map:generate src="{global:staging}repo/{1}"/>
          <map:transform src="{global:staging}styles/file2html.xsl">
            <map:parameter name="file" value="repo/{1}"/>
          </map:transform>
          <map:serialize type="html"/>
      </map:match>
  
    </map:pipeline>
  </map:pipelines>
  
  </map:sitemap>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step2/repo/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <page>
   <title>Page 1</title>
   <content>
     <para>Paragraph 1</para>
     <para>Paragraph 2</para>
   </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step2/repo/dir1/contentB.xml
  
  Index: contentB.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentB</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step2/repo/dir1/contentC.xml
  
  Index: contentC.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentC</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step2/repo/dir2/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentA</title>
    <content>
      <para>Paragraph 1.1</para>
      <para>Paragraph 2.1</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step2/repo/dir2/contentB.xml
  
  Index: contentB.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>Content B</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step2/repo/dir2/contentC.xml
  
  Index: contentC.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>content</title>
    <content>
      <para>Paragraph 1</para>
      <para>Paragraph 2</para>
      <para>Paragraph 3</para>
      <para>Paragraph 4</para>
    </content>
  </page>
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step2/repo/dir2/subdir1/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
   <title>New Content</title>
   <content>
     <para>Paragraph 1</para>
     <para>Paragraph 2</para>
   </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step2/styles/dir2html.xsl
  
  Index: dir2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:collection="http://apache.org/cocoon/collection/1.0">
  
  <xsl:template match="/collection:collection">
    <html>
      <body>
      Files:
        <ul>
          <xsl:apply-templates select="collection:resource"/>
        </ul>
        <br />
      Folders:
        <ul>
          <xsl:apply-templates select="collection:collection"/>
        </ul>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="collection:resource">
    <li><a href="{@name}"><xsl:value-of select="@name"/></a></li>
  </xsl:template>
  
  <xsl:template match="collection:collection">
    <li><a href="{@name}/"><xsl:value-of select="@name"/></a></li>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step2/styles/file2html.xsl
  
  Index: file2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:param name="file"></xsl:param>
  
  <xsl:template match="/page">
    <html>
      <body>
        <p>Title:<br />
          <xsl:value-of select="title"/>
        </p>
        <xsl:apply-templates select="content/para"/>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="page/content/para">
    <p>para:<br />
      <xsl:value-of select="normalize-space(.)"/>
    </p>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
  <map:components>
    <map:generators default="file">
      <map:generator name="traverse" src="org.apache.cocoon.generation.TraversableGenerator"/>
    </map:generators>
  </map:components>
  
  <map:pipelines>
  
    <map:component-configurations>
      <global-variables>
        <staging></staging>
        <!--staging>webdav://localhost/webdav/step3/</staging-->
      </global-variables>
    </map:component-configurations>
  
    <map:pipeline>
  
      <map:match pattern="repo/">
        <map:generate type="traverse" src="{global:staging}repo/"/>
        <map:transform src="{global:staging}styles/dir2html.xsl"/>
        <map:serialize type="html"/>
      </map:match>
  
      <map:match pattern="repo/**/">
        <map:generate type="traverse" src="{global:staging}repo/{1}/"/>
        <map:transform src="{global:staging}styles/dir2html.xsl"/>
        <map:serialize type="html"/>
      </map:match>
  
      <map:match pattern="repo/**">
          <map:generate src="{global:staging}repo/{1}"/>
          <map:transform src="{global:staging}styles/file2html.xsl">
            <map:parameter name="file" value="repo/{1}"/>
            <map:parameter name="requestURI" value="{request:requestURI}"/>
            <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
          </map:transform>
          <map:serialize type="html"/>
      </map:match>
  
      <map:match pattern="write/**">
          <map:generate type="request" label="content"/>
          <map:transform src="{global:staging}styles/request2doc.xsl"/>
          <map:transform src="{global:staging}styles/doc2write.xsl">
            <map:parameter name="file" value="{global:staging}{1}"/>
          </map:transform>
          <map:transform type="write-source"/>
          <map:serialize type="xml"/>
      </map:match>
  
    </map:pipeline>
  </map:pipelines>
  
  </map:sitemap>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/repo/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <page>
   <title>Page 1</title>
   <content>
     <para>Paragraph 1</para>
     <para>Paragraph 2</para>
   </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/repo/dir1/contentB.xml
  
  Index: contentB.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentB</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/repo/dir1/contentC.xml
  
  Index: contentC.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentC</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/repo/dir2/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentA</title>
    <content>
      <para>Paragraph 1.1</para>
      <para>Paragraph 2.1</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/repo/dir2/contentB.xml
  
  Index: contentB.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>Content B</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/repo/dir2/contentC.xml
  
  Index: contentC.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>content</title>
    <content>
      <para>Paragraph 1</para>
      <para>Paragraph 2</para>
      <para>Paragraph 3</para>
      <para>Paragraph 4</para>
    </content>
  </page>
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/repo/dir2/subdir1/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page><title>New Content</title><content><para>Paragraph 1 of 2</para><para>Paragraph 2</para></content></page>
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/styles/dir2html.xsl
  
  Index: dir2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:collection="http://apache.org/cocoon/collection/1.0">
  
  <xsl:template match="/collection:collection">
    <html>
      <body>
      Files:
        <ul>
          <xsl:apply-templates select="collection:resource"/>
        </ul>
        <br />
      Folders:
        <ul>
          <xsl:apply-templates select="collection:collection"/>
        </ul>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="collection:resource">
    <li><a href="{@name}"><xsl:value-of select="@name"/></a></li>
  </xsl:template>
  
  <xsl:template match="collection:collection">
    <li><a href="{@name}/"><xsl:value-of select="@name"/></a></li>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/styles/doc2write.xsl
  
  Index: doc2write.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:req="http://apache.org/cocoon/request/2.0"
                  xmlns:source="http://apache.org/cocoon/source/1.0">
  
  <xsl:param name="file"></xsl:param>
  
  <xsl:template match="request/parameters">
  <page>
    <source:write create="true">
      <source:source><xsl:value-of select="$file"/></source:source>
      <source:path>page</source:path>
      <source:fragment>
        <title><xsl:value-of select="title"/></title>
        <content>
          <xsl:for-each select="content/para">
          <para>
          <xsl:value-of select="normalize-space(.)"/>
          </para>
          </xsl:for-each>
        </content>
      </source:fragment>
    </source:write>
  </page>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/styles/file2html.xsl
  
  Index: file2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:param name="file"></xsl:param>
  <xsl:param name="sitemapURI"></xsl:param>
  <xsl:param name="requestURI"></xsl:param>
  
  <xsl:template match="/page">
    <html>
      <body>
        <form method="get">
          <xsl:attribute name="action"><xsl:value-of select="substring-before($requestURI, $sitemapURI)"/>write/<xsl:value-of select="$file"/></xsl:attribute>
          <p>Title:<br />
          <input name="title" type="text" size="30" maxlength="30" value="{title}" />
          </p>
          <xsl:apply-templates select="content/para"/>
          <input type="submit" value="Submit" />
          <input type="reset" value="Reset" />
        </form>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="content/para">
          <p>para:<br />
          <textarea name="para" cols="50" rows="10">
          <!--xsl:value-of select="normalize-space(.)"/-->
          <xsl:copy-of select="node()"/>
          </textarea>
          </p>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step3/styles/request2doc.xsl
  
  Index: request2doc.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:req="http://apache.org/cocoon/request/2.0">
  <xsl:template match="/req:request">
    <request>
      <xsl:apply-templates select="req:requestParameters"/>
    </request>
  </xsl:template>
  
  <xsl:template match="req:requestParameters">
    <parameters>
      <xsl:apply-templates select="req:parameter[@name='title']"/>
      <xsl:apply-templates select="req:parameter[@name='para']"/>
    </parameters>
  </xsl:template>
  
  <xsl:template match="req:parameter[@name='title']">
    <title>
      <xsl:value-of select="req:value"/>
    </title>
  </xsl:template>
  
  <xsl:template match="req:parameter[@name='para']">
    <content>
      <xsl:for-each select="req:value">
        <para><xsl:value-of select="normalize-space(.)"/></para>
      </xsl:for-each>
    </content>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
  <map:components>
    <map:generators default="file">
      <map:generator name="traverse" src="org.apache.cocoon.generation.TraversableGenerator"/>
    </map:generators>
  </map:components>
  
  <map:pipelines>
  
    <map:component-configurations>
      <global-variables>
        <staging></staging>
        <!--staging>webdav://localhost/webdav/step4/</staging-->
      </global-variables>
    </map:component-configurations>
  
    <map:pipeline>
  
      <map:match pattern="repo/">
        <map:generate type="traverse" src="{global:staging}repo/">
          <map:parameter name="exclude" value="[\w]*.meta"/>
        </map:generate>
        <map:transform src="{global:staging}styles/dir2html.xsl"/>
        <map:serialize type="html"/>
      </map:match>
  
      <map:match pattern="repo/**/">
        <map:generate type="traverse" src="{global:staging}repo/{1}/">
          <map:parameter name="exclude" value="[\w]*.meta"/>
        </map:generate>
        <map:transform src="{global:staging}styles/dir2html.xsl"/>
        <map:serialize type="html"/>
      </map:match>
  
      <map:match pattern="repo/**">
          <map:aggregate element="page" label="content">
            <map:part src="cocoon:/page/{1}"/>
            <map:part src="cocoon:/metapage/{1}"/>
          </map:aggregate>
          <map:transform src="{global:staging}styles/file2html.xsl">
            <map:parameter name="file" value="repo/{1}"/>
            <map:parameter name="requestURI" value="{request:requestURI}"/>
            <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
          </map:transform>
          <map:serialize type="html"/>
      </map:match>
      <map:match pattern="page/**">
          <map:generate src="{global:staging}repo/{1}"/>
          <map:serialize type="xml"/>
      </map:match>
      <map:match pattern="metapage/**">
          <map:generate src="{global:staging}repo/{1}.meta"/>
          <map:serialize type="xml"/>
      </map:match>
  
      <map:match pattern="write/**">
          <map:generate type="request" label="content"/>
          <map:transform src="{global:staging}styles/request2doc.xsl"/>
          <map:transform src="{global:staging}styles/doc2write.xsl">
            <map:parameter name="file" value="{global:staging}{1}"/>
          </map:transform>
          <map:transform type="write-source"/>
          <map:serialize type="xml"/>
      </map:match>
  
    </map:pipeline>
  </map:pipelines>
  
  </map:sitemap>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>Page A</title>
    <content>
      <para>Paragraph 1</para>
      <para>Paragraph 2</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/contentA.xml.meta
  
  Index: contentA.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>me</author>
    <category>cat A</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir1/contentB.xml
  
  Index: contentB.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentB</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir1/contentB.xml.meta
  
  Index: contentB.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>me</author>
    <category>cat B</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir1/contentC.xml
  
  Index: contentC.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentC</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir1/contentC.xml.meta
  
  Index: contentC.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>me</author>
    <category>Other Category</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir2/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentA</title>
    <content>
      <para>Paragraph 1.1</para>
      <para>Paragraph 2.1</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir2/contentA.xml.meta
  
  Index: contentA.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>me</author>
    <category>cat A</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir2/contentB.xml
  
  Index: contentB.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>Content B</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir2/contentB.xml.meta
  
  Index: contentB.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>you</author>
    <category>cat B</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir2/contentC.xml
  
  Index: contentC.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>content</title>
    <content>
      <para>Paragraph 1</para>
      <para>Paragraph 2</para>
      <para>Paragraph 3</para>
      <para>Paragraph 4</para>
    </content>
  </page>
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir2/contentC.xml.meta
  
  Index: contentC.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>me</author>
    <category>other</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir2/subdir1/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page><title>New Content</title><content><para>Paragraph 1 of 2</para><para>Paragraph 2</para></content></page>
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/repo/dir2/subdir1/contentA.xml.meta
  
  Index: contentA.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage><author>you</author><category>docs</category><state>new</state></metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/styles/dir2html.xsl
  
  Index: dir2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:collection="http://apache.org/cocoon/collection/1.0">
  
  <xsl:template match="/collection:collection">
    <html>
      <body>
      Files:
        <ul>
          <xsl:apply-templates select="collection:resource"/>
        </ul>
        <br />
      Folders:
        <ul>
          <xsl:apply-templates select="collection:collection"/>
        </ul>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="collection:resource">
    <li><a href="{@name}"><xsl:value-of select="@name"/></a></li>
  </xsl:template>
  
  <xsl:template match="collection:collection">
    <li><a href="{@name}/"><xsl:value-of select="@name"/></a></li>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/styles/doc2write.xsl
  
  Index: doc2write.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:req="http://apache.org/cocoon/request/2.0"
                  xmlns:source="http://apache.org/cocoon/source/1.0">
  
  <xsl:param name="file"></xsl:param>
  
  <xsl:template match="request/parameters">
  <page>
    <source:write create="true">
      <source:source><xsl:value-of select="$file"/></source:source>
      <source:path>page</source:path>
      <source:fragment>
        <title><xsl:value-of select="title"/></title>
        <content>
          <xsl:for-each select="content/para">
          <para>
          <xsl:value-of select="normalize-space(.)"/>
          </para>
          </xsl:for-each>
        </content>
      </source:fragment>
    </source:write>
  
    <source:write create="true">
      <source:source><xsl:value-of select="$file"/>.meta</source:source>
      <source:path>metapage</source:path>
      <source:fragment>
        <author><xsl:value-of select="author"/></author>
        <category><xsl:value-of select="category"/></category>
        <state><xsl:value-of select="state"/></state>
      </source:fragment>
    </source:write>
  </page>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/styles/file2html.xsl
  
  Index: file2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:param name="file"></xsl:param>
  <xsl:param name="sitemapURI"></xsl:param>
  <xsl:param name="requestURI"></xsl:param>
  
  <xsl:template match="/page">
    <html>
      <body>
        <form method="get">
          <xsl:attribute name="action"><xsl:value-of select="substring-before($requestURI, $sitemapURI)"/>write/<xsl:value-of select="$file"/></xsl:attribute>
          <p>Title:<br />
          <input name="title" type="text" size="30" maxlength="30" value="{page/title}" />
          </p>
          <xsl:apply-templates select="metapage"/>
          <xsl:apply-templates select="page/content/para"/>
          <input type="submit" value="Submit" />
          <input type="reset" value="Reset" />
        </form>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="page/content/para">
          <p>para:<br />
          <textarea name="para" cols="50" rows="10">
          <!--xsl:value-of select="normalize-space(.)"/-->
          <xsl:copy-of select="node()"/>
          </textarea>
          </p>
  </xsl:template>
  
  <xsl:template match="metapage">
    <p>Author:<br />
      <input name="author" type="text" size="30" maxlength="30" value="{author}" />
    </p>
    <p>Category:<br />
      <input name="category" type="text" size="30" maxlength="30" value="{category}" />
    </p>
    <p>State:<br />
      <input name="state" type="text" size="30" maxlength="30" value="{state}" />
    </p>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step4/styles/request2doc.xsl
  
  Index: request2doc.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:req="http://apache.org/cocoon/request/2.0">
  <xsl:template match="/req:request">
    <request>
      <xsl:apply-templates select="req:requestParameters"/>
    </request>
  </xsl:template>
  
  <xsl:template match="req:requestParameters">
    <parameters>
      <xsl:apply-templates select="req:parameter[@name='title']"/>
      <xsl:apply-templates select="req:parameter[@name='author']"/>
      <xsl:apply-templates select="req:parameter[@name='state']"/>
      <xsl:apply-templates select="req:parameter[@name='category']"/>
      <xsl:apply-templates select="req:parameter[@name='filename']"/>
      <xsl:apply-templates select="req:parameter[@name='para']"/>
    </parameters>
  </xsl:template>
  
  <xsl:template match="req:parameter[@name='title']">
    <title>
      <xsl:value-of select="req:value"/>
    </title>
  </xsl:template>
  
  <xsl:template match="req:parameter[@name='author']">
    <author>
      <xsl:value-of select="req:value"/>
    </author>
  </xsl:template>
  <xsl:template match="req:parameter[@name='state']">
    <state>
      <xsl:value-of select="req:value"/>
    </state>
  </xsl:template>
  <xsl:template match="req:parameter[@name='category']">
    <category>
      <xsl:value-of select="req:value"/>
    </category>
  </xsl:template>
  <xsl:template match="req:parameter[@name='filename']">
    <filename>
      <xsl:value-of select="req:value"/>
    </filename>
  </xsl:template>
  
  <xsl:template match="req:parameter[@name='para']">
    <content>
      <xsl:for-each select="req:value">
        <para><xsl:value-of select="normalize-space(.)"/></para>
      </xsl:for-each>
    </content>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/new.xml
  
  Index: new.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <page>
    <page>
      <title>Title</title>
      <content>
        <para>Paragraph 1</para>
        <para>Paragraph 2</para>
      </content>
    </page>
    <metapage>
      <author>you</author>
      <category></category>
      <state>new</state>  
    </metapage>
  </page>
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
  <map:components>
    <map:generators default="file">
      <map:generator name="traverse" src="org.apache.cocoon.generation.TraversableGenerator"/>
    </map:generators>
  </map:components>
  
  <map:pipelines>
  
    <map:component-configurations>
      <global-variables>
        <staging></staging>
        <!--staging>webdav://localhost/webdav/step5/</staging-->
      </global-variables>
    </map:component-configurations>
  
    <map:pipeline>
  
      <map:match pattern="repo/">
        <map:generate type="traverse" src="{global:staging}repo/">
          <map:parameter name="exclude" value="[\w]*.meta"/>
        </map:generate>
        <map:transform src="{global:staging}styles/dir2html.xsl"/>
        <map:serialize type="html"/>
      </map:match>
  
      <map:match pattern="repo/**/">
        <map:generate type="traverse" src="{global:staging}repo/{1}/">
          <map:parameter name="exclude" value="[\w]*.meta"/>
        </map:generate>
        <map:transform src="{global:staging}styles/dir2html.xsl"/>
        <map:serialize type="html"/>
      </map:match>
  
      <map:match pattern="**/new">
          <map:generate src="{global:staging}new.xml"/>
          <map:transform src="{global:staging}styles/new2html.xsl">
            <map:parameter name="file" value="{1}/new"/>
            <map:parameter name="requestURI" value="{request:requestURI}"/>
            <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
          </map:transform>
          <map:serialize type="html"/>
      </map:match>
  
      <map:match pattern="repo/**">
          <map:aggregate element="page">
            <map:part src="cocoon:/page/{1}"/>
            <map:part src="cocoon:/metapage/{1}"/>
          </map:aggregate>
          <map:transform src="{global:staging}styles/file2html.xsl">
            <map:parameter name="file" value="repo/{1}"/>
            <map:parameter name="requestURI" value="{request:requestURI}"/>
            <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
          </map:transform>
          <map:serialize type="html"/>
      </map:match>
      <map:match pattern="page/**">
          <map:generate src="{global:staging}repo/{1}"/>
          <map:serialize type="xml"/>
      </map:match>
      <map:match pattern="metapage/**">
          <map:generate src="{global:staging}repo/{1}.meta"/>
          <map:serialize type="xml"/>
      </map:match>
  
      <map:match pattern="write/**">
          <map:generate type="request"/>
          <map:transform src="{global:staging}styles/request2doc.xsl"/>
          <map:transform src="{global:staging}styles/doc2write.xsl">
            <map:parameter name="file" value="{global:staging}{1}"/>
          </map:transform>
          <map:transform type="write-source"/>
          <map:serialize type="xml"/>
      </map:match>
  
    </map:pipeline>
  </map:pipelines>
  
  </map:sitemap>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>Page A</title>
    <content>
      <para>Paragraph 1</para>
      <para>Paragraph 2</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/contentA.xml.meta
  
  Index: contentA.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>me</author>
    <category>cat A</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir1/contentB.xml
  
  Index: contentB.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentB</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir1/contentB.xml.meta
  
  Index: contentB.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>me</author>
    <category>cat B</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir1/contentC.xml
  
  Index: contentC.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentC</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir1/contentC.xml.meta
  
  Index: contentC.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>me</author>
    <category>Other Category</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir2/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>contentA</title>
    <content>
      <para>Paragraph 1.1</para>
      <para>Paragraph 2.1</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir2/contentA.xml.meta
  
  Index: contentA.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>me</author>
    <category>cat A</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir2/contentB.xml
  
  Index: contentB.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>Content B</title>
    <content>
      <para>First Paragraph</para>
      <para>Second Paragraph</para>
    </content>
  </page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir2/contentB.xml.meta
  
  Index: contentB.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>me</author>
    <category>cat B</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir2/contentC.xml
  
  Index: contentC.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
    <title>content</title>
    <content>
      <para>Paragraph 1</para>
      <para>Paragraph 2</para>
      <para>Paragraph 3</para>
      <para>Paragraph 4</para>
    </content>
  </page>
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir2/contentC.xml.meta
  
  Index: contentC.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage>
    <author>you</author>
    <category>other</category>
    <state>edited</state>
  </metapage>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir2/subdir1/contentA.xml
  
  Index: contentA.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page><title>Content A</title><content><para>Paragraph 1</para><para>Paragraph 2</para></content></page>
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/repo/dir2/subdir1/contentA.xml.meta
  
  Index: contentA.xml.meta
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <metapage><author>you</author><category>docs</category><state>new</state></metapage>
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/styles/dir2html.xsl
  
  Index: dir2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:collection="http://apache.org/cocoon/collection/1.0">
  
  <xsl:template match="/collection:collection">
    <html>
      <body>
      Files:
        <ul>
          <xsl:apply-templates select="collection:resource"/>
        </ul>
        <a href="new">new file</a>
        <br /><br /><br /><br />
      Folders:
        <ul>
          <xsl:apply-templates select="collection:collection"/>
        </ul>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="collection:resource">
    <li><a href="{@name}"><xsl:value-of select="@name"/></a></li>
  </xsl:template>
  
  <xsl:template match="collection:collection">
    <li><a href="{@name}/"><xsl:value-of select="@name"/></a></li>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/styles/doc2write.xsl
  
  Index: doc2write.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:req="http://apache.org/cocoon/request/2.0"
                  xmlns:source="http://apache.org/cocoon/source/1.0">
  
  <xsl:param name="file"></xsl:param>
  
  <xsl:template match="request/parameters">
  <page>
    <source:write create="true">
      <xsl:if test="filename">
        <source:source><xsl:value-of select="$file"/><xsl:value-of select="filename"/></source:source>
      </xsl:if>
      <xsl:if test="not(filename)">
        <source:source><xsl:value-of select="$file"/></source:source>
      </xsl:if>
      <source:path>page</source:path>
      <source:fragment>
        <title><xsl:value-of select="title"/></title>
        <content>
          <xsl:for-each select="content/para">
          <para>
          <xsl:value-of select="normalize-space(.)"/>
          </para>
          </xsl:for-each>
        </content>
      </source:fragment>
    </source:write>
  
    <source:write create="true">
      <xsl:if test="filename">
        <source:source><xsl:value-of select="$file"/><xsl:value-of select="filename"/>.meta</source:source>
      </xsl:if>
      <xsl:if test="not(filename)">
        <source:source><xsl:value-of select="$file"/>.meta</source:source>
      </xsl:if>
      <source:source><xsl:value-of select="$file"/>.meta</source:source>
      <source:path>metapage</source:path>
      <source:fragment>
        <author><xsl:value-of select="author"/></author>
        <category><xsl:value-of select="category"/></category>
        <state><xsl:value-of select="state"/></state>
      </source:fragment>
    </source:write>
  </page>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/styles/file2html.xsl
  
  Index: file2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:param name="file"></xsl:param>
  <xsl:param name="sitemapURI"></xsl:param>
  <xsl:param name="requestURI"></xsl:param>
  
  <xsl:template match="/page">
    <html>
      <body>
        <form method="get">
          <xsl:attribute name="action"><xsl:value-of select="substring-before($requestURI, $sitemapURI)"/>write/<xsl:value-of select="$file"/></xsl:attribute>
          <p>Title:<br />
          <input name="title" type="text" size="30" maxlength="30" value="{page/title}" />
          </p>
          <xsl:apply-templates select="metapage"/>
          <xsl:apply-templates select="page/content/para"/>
          <input type="submit" value="Submit" />
          <input type="reset" value="Reset" />
        </form>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="page/content/para">
          <p>para:<br />
          <textarea name="para" cols="50" rows="10">
          <!--xsl:value-of select="normalize-space(.)"/-->
          <xsl:copy-of select="node()"/>
          </textarea>
          </p>
  </xsl:template>
  
  <xsl:template match="metapage">
    <p>Author:<br />
      <input name="author" type="text" size="30" maxlength="30" value="{author}" />
    </p>
    <p>Category:<br />
      <input name="category" type="text" size="30" maxlength="30" value="{category}" />
    </p>
    <p>State:<br />
      <input name="state" type="text" size="30" maxlength="30" value="{state}" />
    </p>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/styles/new2html.xsl
  
  Index: new2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:param name="file"></xsl:param>
  <xsl:param name="sitemapURI"></xsl:param>
  <xsl:param name="requestURI"></xsl:param>
  
  <xsl:template match="/page">
    <html>
      <body>
        <form method="get">
          <xsl:attribute name="action"><xsl:value-of select="substring-before($requestURI, $sitemapURI)"/>write/<xsl:value-of select="substring-before($file, 'new')"/></xsl:attribute>
          <p>Filename:<br />
          <input name="filename" type="text" size="30" maxlength="30" value="" />
          </p>
          <p>Title:<br />
          <input name="title" type="text" size="30" maxlength="30" value="{page/title}" />
          </p>
          <xsl:apply-templates select="metapage"/>
          <xsl:apply-templates select="page/content/para"/>
          <input type="submit" value="Submit" />
          <input type="reset" value="Reset" />
        </form>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="page/content/para">
          <p>para:<br />
          <textarea name="para" cols="50" rows="10">
          <!--xsl:value-of select="normalize-space(.)"/-->
          <xsl:copy-of select="node()"/>
          </textarea>
          </p>
  </xsl:template>
  
  <xsl:template match="metapage">
    <p>Author:<br />
      <input name="author" type="text" size="30" maxlength="30" value="{author}" />
    </p>
    <p>Category:<br />
      <input name="category" type="text" size="30" maxlength="30" value="{category}" />
    </p>
    <p>State:<br />
      <input name="state" type="text" size="30" maxlength="30" value="{state}" />
    </p>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/step5/styles/request2doc.xsl
  
  Index: request2doc.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:req="http://apache.org/cocoon/request/2.0">
  <xsl:template match="/req:request">
    <request>
      <xsl:apply-templates select="req:requestParameters"/>
    </request>
  </xsl:template>
  
  <xsl:template match="req:requestParameters">
    <parameters>
      <xsl:apply-templates select="req:parameter[@name='title']"/>
      <xsl:apply-templates select="req:parameter[@name='author']"/>
      <xsl:apply-templates select="req:parameter[@name='state']"/>
      <xsl:apply-templates select="req:parameter[@name='category']"/>
      <xsl:apply-templates select="req:parameter[@name='filename']"/>
      <xsl:apply-templates select="req:parameter[@name='para']"/>
    </parameters>
  </xsl:template>
  
  <xsl:template match="req:parameter[@name='title']">
    <title>
      <xsl:value-of select="req:value"/>
    </title>
  </xsl:template>
  
  <xsl:template match="req:parameter[@name='author']">
    <author>
      <xsl:value-of select="req:value"/>
    </author>
  </xsl:template>
  <xsl:template match="req:parameter[@name='state']">
    <state>
      <xsl:value-of select="req:value"/>
    </state>
  </xsl:template>
  <xsl:template match="req:parameter[@name='category']">
    <category>
      <xsl:value-of select="req:value"/>
    </category>
  </xsl:template>
  <xsl:template match="req:parameter[@name='filename']">
    <filename>
      <xsl:value-of select="req:value"/>
    </filename>
  </xsl:template>
  
  <xsl:template match="req:parameter[@name='para']">
    <content>
      <xsl:for-each select="req:value">
        <para><xsl:value-of select="normalize-space(.)"/></para>
      </xsl:for-each>
    </content>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  

Mime
View raw message