You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2004/04/01 21:05:42 UTC

cvs commit: cocoon-2.1/src/webapp/samples/hello-world samples.xml

vgritsenko    2004/04/01 11:05:42

  Modified:    tools/src blocks-build.xsl
               tools/targets samples-build.xml
               src/webapp/samples samples.xml sitemap.xmap
               src/webapp/samples/common/style/xsl/html
                        simple-samples2html.xsl
               src/webapp/samples/hello-world samples.xml
  Added:       src/webapp/samples/blocks gump2samples.xsl sitemap.xmap
  Removed:     src/webapp/samples block-samples.xml
  Log:
  Reworking block samples page
  
  Revision  Changes    Path
  1.62      +2 -4      cocoon-2.1/tools/src/blocks-build.xsl
  
  Index: blocks-build.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/tools/src/blocks-build.xsl,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- blocks-build.xsl	31 Mar 2004 20:56:41 -0000	1.61
  +++ blocks-build.xsl	1 Apr 2004 19:05:41 -0000	1.62
  @@ -422,9 +422,6 @@
       </target>
   
       <target name="{@name}-patch-samples" unless="unless.exclude.block.{$block-name}">
  -      <xpatch file="${{build.webapp}}/samples/block-samples.xml" srcdir="${{blocks}}">
  -        <include name="{$block-name}/conf/*.xsamples"/>
  -      </xpatch>
         <xpatch file="${{build.webapp}}/samples/sitemap.xmap" srcdir="${{blocks}}">
           <include name="{$block-name}/conf/*.samplesxpipe"/>
         </xpatch>
  @@ -448,8 +445,9 @@
         <if>
           <available file="${{blocks}}/{$block-name}/samples/sitemap.xmap"/>
           <then>
  -          <copy filtering="on" todir="${{build.webapp}}/samples/{$block-name}">
  +          <copy filtering="on" todir="${{build.webapp}}/samples/blocks/{$block-name}">
               <fileset dir="${{blocks}}/{$block-name}/samples"/>
  +            <fileset dir="${{blocks}}/{$block-name}/conf" includes="*.xsamples"/>
             </copy>
   
             <!-- copy sample classes -->
  
  
  
  1.4       +24 -19    cocoon-2.1/tools/targets/samples-build.xml
  
  Index: samples-build.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/tools/targets/samples-build.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- samples-build.xml	8 Mar 2004 06:07:15 -0000	1.3
  +++ samples-build.xml	1 Apr 2004 19:05:41 -0000	1.4
  @@ -14,6 +14,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
   -->
  +
   <project name="samples">
   
     <description>
  @@ -24,36 +25,40 @@
       <mkdir dir="${build.samples}"/>
   
       <javac srcdir="${samples}"
  -       destdir="${build.samples}"
  -       debug="${compiler.debug}"
  -       optimize="${compiler.optimize}"
  -       deprecation="${compiler.deprecation}"
  -       target="${target.vm}"
  -       compiler="${compiler}"
  -       classpathref="classpath"/>
  +           destdir="${build.samples}"
  +           debug="${compiler.debug}"
  +           optimize="${compiler.optimize}"
  +           deprecation="${compiler.deprecation}"
  +           target="${target.vm}"
  +           compiler="${compiler}"
  +           classpathref="classpath"/>
   
       <!-- copy sample files -->
       <copy todir="${build.webapp.samples}" filtering="on">
         <fileset dir="${webapp.samples}">
  -       <exclude name="samples.xwelcome"/>
  -       <exclude name="old_sitemap.xmap"/>
  -       <exclude name="**/*.jpg"/>
  -       <exclude name="**/*.gif"/>
  -       <exclude name="**/*.png"/>
  -       <exclude name="i18n/**"/> <!-- filtering breaks UTF-8 files -->
  -       <exclude name="hello-world/style/xsl/**"/> <!-- filtering breaks UTF-8 files -->
  +        <exclude name="samples.xwelcome"/>
  +        <exclude name="old_sitemap.xmap"/>
  +        <exclude name="**/*.jpg"/>
  +        <exclude name="**/*.gif"/>
  +        <exclude name="**/*.png"/>
  +        <!-- filtering breaks UTF-8 files -->
  +        <exclude name="i18n/**"/> 
  +        <exclude name="hello-world/style/xsl/**"/>
         </fileset>
       </copy>
   
       <copy todir="${build.webapp.samples}" filtering="off">
         <fileset dir="${webapp.samples}">
  -       <include name="**/*.jpg"/>
  -       <include name="**/*.gif"/>
  -       <include name="**/*.png"/>
  -       <include name="i18n/**"/>
  -       <include name="hello-world/style/xsl/**"/>
  +        <include name="**/*.jpg"/>
  +        <include name="**/*.gif"/>
  +        <include name="**/*.png"/>
  +        <include name="i18n/**"/>
  +        <include name="hello-world/style/xsl/**"/>
         </fileset>
       </copy>
  +
  +    <!-- copy gump.xml which is used to create block samples page -->
  +    <copy file="gump.xml" todir="${build.webapp.samples}/blocks"/>
   
       <!-- copy sample classes -->
       <copy todir="${build.webapp.classes}" filtering="off">
  
  
  
  1.37      +2 -2      cocoon-2.1/src/webapp/samples/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/samples.xml,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- samples.xml	21 Mar 2004 03:19:55 -0000	1.36
  +++ samples.xml	1 Apr 2004 19:05:42 -0000	1.37
  @@ -77,7 +77,7 @@
     </group>
   
     <group name="Block Samples">
  -    <sample name="Blocks with samples" href="blocks">
  +    <sample name="Blocks with samples" href="blocks/">
         Functionality outside the core has been moved to units called "blocks".
         This will lead to a more modular Cocoon. Here you find the many samples 
         provided by the currently installed blocks. 
  
  
  
  1.23      +1 -10     cocoon-2.1/src/webapp/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/sitemap.xmap,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- sitemap.xmap	20 Mar 2004 12:57:17 -0000	1.22
  +++ sitemap.xmap	1 Apr 2004 19:05:42 -0000	1.23
  @@ -93,15 +93,6 @@
       <map:serialize/>
      </map:match>
   
  -   <map:match pattern="blocks">
  -    <map:generate src="block-samples.xml"/>
  -    <map:transform src="stylesheets/sort-samples.xsl"/>
  -    <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="components">
       <map:generate src="components-samples.xml"/>
       <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
  
  
  
  1.1                  cocoon-2.1/src/webapp/samples/blocks/gump2samples.xsl
  
  Index: gump2samples.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  
  <!--+
      | Convert Gump descriptor with Cocoon blocks to the Blocks Samples page
      |
      | CVS $Id: gump2samples.xsl,v 1.1 2004/04/01 19:05:42 vgritsenko Exp $
      +-->
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template match="/">
      <samples name="Blocks Samples">
        <group name="Back">
          <sample href="./" name="Back">
            Back to the samples home page.
          </sample>
        </group>
  
        <group name="Stable Blocks">
          <xsl:apply-templates select="module/project[starts-with(@name, 'cocoon-block-')][@status = 'stable']">
            <xsl:sort select="@name"/>
          </xsl:apply-templates>
        </group>
  
        <xsl:variable name="unstable" select="module/project[starts-with(@name, 'cocoon-block-')][@status = 'unstable']"/>
        <xsl:if test="$unstable">
          <group name="Unstable Blocks">
            <note>
              Blocks below are subject to change without notice!
            </note>
            <xsl:apply-templates select="$unstable">
              <xsl:sort select="@name"/>
            </xsl:apply-templates>
          </group>
        </xsl:if>
  
        <xsl:variable name="deprecated" select="module/project[starts-with(@name, 'cocoon-block-')][@status = 'deprecated']"/>
        <xsl:if test="$deprecated">
          <group name="Deprecated Blocks">
            <note>
              Blocks below will be removed in the future!
            </note>
            <xsl:apply-templates select="$deprecated">
              <xsl:sort select="@name"/>
            </xsl:apply-templates>
          </group>
        </xsl:if>
  
        <xsl:variable name="excluded" select="module/project[starts-with(@name, 'cocoon-block-')][not(document(concat(substring-after(@name,'cocoon-block-'), '/', substring-after(@name,'cocoon-block-'),'.xsamples')))]"/>
        <xsl:if test="$excluded">
          <group name="Excluded Blocks">
            <note>
              Blocks below are either excluded from the build or has no samples.
            </note>
            <xsl:apply-templates select="$excluded" mode="excluded">
              <xsl:sort select="@name"/>
            </xsl:apply-templates>
          </group>
        </xsl:if>
      </samples>
    </xsl:template>
  
    <xsl:template match="project">
      <xsl:variable name="name" select="substring-after(@name,'cocoon-block-')"/>
      <xsl:variable name="sample" select="document(concat($name, '/', $name,'.xsamples'))/xsamples/group/sample"/>
      <xsl:choose>
        <xsl:when test="$sample">
          <xsl:apply-templates select="$sample"/>
        </xsl:when>
        <xsl:otherwise>
          <!-- Output nothing for excluded blocks -->
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
  
    <xsl:template match="project" mode="excluded">
      <xsl:variable name="name" select="substring-after(@name,'cocoon-block-')"/>
      <sample name="{$name}">
        <strong>Note:</strong> Block has no samples or was excluded from the build.
      </sample>
    </xsl:template>
  
    <xsl:template match="@*|node()">
      <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/webapp/samples/blocks/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  
  <!-- CVS $Id: sitemap.xmap,v 1.1 2004/04/01 19:05:42 vgritsenko Exp $ -->
  
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
    <!-- =========================== Views =================================== -->
  
    <map:views>
      <map:view from-label="content" name="content">
        <map:serialize type="xml"/>
      </map:view>
  
      <map:view from-label="content" name="pretty-content">
        <map:transform src="context://stylesheets/system/xml2html.xslt"/>
        <map:serialize type="html"/>
      </map:view>
  
      <map:view from-position="last" name="links">
        <map:serialize type="links"/>
      </map:view>
    </map:views>
  
    <!-- =========================== Pipelines ================================ -->
  
    <map:pipelines>
      <map:pipeline>
        <map:match pattern="">
          <map:generate src="gump.xml"/>
          <map:transform src="gump2samples.xsl"/>
          <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>
  
        <!-- ======================== Automount =============================== -->
        <map:match pattern="*/**">
          <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
        </map:match>
      </map:pipeline>
    </map:pipelines>
  </map:sitemap>
  
  
  
  1.11      +11 -3     cocoon-2.1/src/webapp/samples/common/style/xsl/html/simple-samples2html.xsl
  
  Index: simple-samples2html.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/common/style/xsl/html/simple-samples2html.xsl,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- simple-samples2html.xsl	6 Mar 2004 02:25:58 -0000	1.10
  +++ simple-samples2html.xsl	1 Apr 2004 19:05:42 -0000	1.11
  @@ -171,8 +171,16 @@
         </xsl:choose>
       </xsl:variable>
   
  -    <a href="{$link}"><xsl:value-of select="@name"/></a><xsl:text> - </xsl:text>
  -    <xsl:value-of select="."/>
  +    <xsl:choose>
  +      <xsl:when test="string-length($link) &gt; 0">
  +        <a href="{$link}"><xsl:value-of select="@name"/></a>
  +      </xsl:when>
  +      <xsl:otherwise>
  +        <xsl:value-of select="@name"/>
  +      </xsl:otherwise>
  +    </xsl:choose>
  +    <xsl:text> - </xsl:text>
  +    <xsl:copy-of select="*|text()"/>
       <br/>
     </xsl:template>
   
  
  
  
  1.14      +9 -9      cocoon-2.1/src/webapp/samples/hello-world/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/hello-world/samples.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- samples.xml	6 Mar 2004 02:26:07 -0000	1.13
  +++ samples.xml	1 Apr 2004 19:05:42 -0000	1.14
  @@ -110,28 +110,28 @@
       These samples only work if the corresponding blocks are activated
       at build time. 
      </note>
  -   <sample name="RTF" href="../jfor/hello.rtf">
  +   <sample name="RTF" href="../blocks/jfor/hello.rtf">
       Hello from the jfor block in Rich Text Format.
      </sample>
  -   <sample name="PDF" href="../fop/hello.pdf">
  +   <sample name="PDF" href="../blocks/fop/hello.pdf">
       Hello from the fop block in Portable Document Format.
      </sample>
  -   <sample name="PDF" href="../itext/hello.pdf">
  +   <sample name="PDF" href="../blocks/itext/hello.pdf">
       Another hello in Portable Document Format, from the itext block.
      </sample>
  -   <sample name="JPEG" href="../batik/hello.jpeg">
  +   <sample name="JPEG" href="../blocks/batik/hello.jpeg">
       Hello from the batik block in JPEG.
      </sample>
  -   <sample name="PNG" href="../batik/hello.png">
  +   <sample name="PNG" href="../blocks/batik/hello.png">
       Hello from the batik block in PNG.
      </sample>
  -   <sample name="SWF" href="../swf/hello.swf">
  +   <sample name="SWF" href="../blocks/swf/hello.swf">
       Flashy hello from swf block! You need the appropriate (flash) plugin for your browser.
      </sample>
  -   <sample name="XLS" href="../poi/hello.xls">
  +   <sample name="XLS" href="../blocks/poi/hello.xls">
       Hello in Excel spreadsheet format from the POI block.
      </sample>
  -   <sample name="HTML" href="../stx/hello.html">
  +   <sample name="HTML" href="../blocks/stx/hello.html">
       Hello in the HTML format, but now with help from stx block.
      </sample>
     </group>