vgritsenko 2003/09/06 23:12:58
Modified: src/blocks/asciiart/conf asciiart.xsamples
src/blocks/asciiart/samples dir2html.xsl sitemap.xmap
Log:
Apply corporate design to the samples page. Add views.
Revision Changes Path
1.3 +1 -1 cocoon-2.1/src/blocks/asciiart/conf/asciiart.xsamples
Index: asciiart.xsamples
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/asciiart/conf/asciiart.xsamples,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- asciiart.xsamples 16 Aug 2003 01:44:12 -0000 1.2
+++ asciiart.xsamples 7 Sep 2003 06:12:58 -0000 1.3
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<xsamples xpath="/samples" unless="[EMAIL PROTECTED]'asciiart']">
+<xsamples xpath="/samples" unless="[EMAIL PROTECTED]'ASCII Art']">
<group name="ASCII Art">
<sample name="ASCII Art" href="asciiart/">
1.3 +35 -59 cocoon-2.1/src/blocks/asciiart/samples/dir2html.xsl
Index: dir2html.xsl
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/asciiart/samples/dir2html.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dir2html.xsl 20 Jul 2003 05:23:08 -0000 1.2
+++ dir2html.xsl 7 Sep 2003 06:12:58 -0000 1.3
@@ -1,62 +1,38 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
+
<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:dir="http://apache.org/cocoon/directory/2.0"
->
-
-<xsl:template match="dir:directory">
- <html>
- <head>
- <title>AsciiArt Samples</title>
- </head>
- <body>
- <table width="90%">
- <tr>
- <td>Available ascii art as <em>TXT</em>
- <ul>
- <xsl:apply-templates select="dir:file" mode="txt"/>
- </ul>
- </td>
- <td>Available ascii art as <em>JPEG</em>
- <ul>
- <xsl:apply-templates select="dir:file" mode="jpg"/>
- </ul>
- </td>
- <td>Available ascii art as <em>PNG</em>
- <ul>
- <xsl:apply-templates select="dir:file" mode="png"/>
- </ul>
- </td>
- </tr>
- </table>
- </body>
- </html>
-</xsl:template>
-
-<xsl:template match="dir:file" mode="txt">
- <li>
- <a>
- <xsl:attribute name="href"><xsl:value-of
select="@name"/></xsl:attribute>
- <xsl:value-of select="@name"/>
- </a>
- </li>
-</xsl:template>
-
-<xsl:template match="dir:file" mode="jpg">
- <li>
- <a>
- <xsl:attribute name="href"><xsl:value-of
select="@name"/>.jpg</xsl:attribute>
- <xsl:value-of select="@name"/>
- </a>
- </li>
-</xsl:template>
-
-<xsl:template match="dir:file" mode="png">
- <li>
- <a>
- <xsl:attribute name="href"><xsl:value-of
select="@name"/>.png</xsl:attribute>
- <xsl:value-of select="@name"/>
- </a>
- </li>
-</xsl:template>
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:dir="http://apache.org/cocoon/directory/2.0">
+
+ <xsl:template match="dir:directory">
+ <samples name="ASCII Art 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="Available ascii art TXT files">
+ <xsl:apply-templates select="dir:file" mode="txt"/>
+ </group>
+
+ <group name="ascii art in JPEG">
+ <xsl:apply-templates select="dir:file" mode="jpg"/>
+ </group>
+
+ <group name="ascii art in PNG">
+ <xsl:apply-templates select="dir:file" mode="png"/>
+ </group>
+ </samples>
+ </xsl:template>
+
+ <xsl:template match="dir:file" mode="txt">
+ <sample name="[EMAIL PROTECTED]" href="[EMAIL PROTECTED]">as
text</sample>
+ </xsl:template>
+
+ <xsl:template match="dir:file" mode="jpg">
+ <sample name="[EMAIL PROTECTED]" href="[EMAIL PROTECTED]">as jpg</sample>
+ </xsl:template>
+
+ <xsl:template match="dir:file" mode="png">
+ <sample name="[EMAIL PROTECTED]" href="[EMAIL PROTECTED]">as png</sample>
+ </xsl:template>
</xsl:stylesheet>
1.3 +57 -45 cocoon-2.1/src/blocks/asciiart/samples/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/asciiart/samples/sitemap.xmap,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sitemap.xmap 20 Jul 2003 05:17:13 -0000 1.2
+++ sitemap.xmap 7 Sep 2003 06:12:58 -0000 1.3
@@ -2,54 +2,66 @@
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
- <map:components>
-
- <map:generators default="file">
- <map:generator name="asciiart-svg"
logger="sitemap.generator.asciiart-svg"
-
src="org.apache.cocoon.generation.asciiart.AsciiArtSVGGenerator"/>
- </map:generators>
-
- </map:components>
+ <map:components>
+ <map:generators default="file">
+ <map:generator name="asciiart-svg"
logger="sitemap.generator.asciiart-svg"
+
src="org.apache.cocoon.generation.asciiart.AsciiArtSVGGenerator"/>
+ </map:generators>
+ </map:components>
+
+<!-- =========================== 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:pipelines>
+ <map:pipeline>
- <map:match pattern="">
- <map:redirect-to uri="welcome"/>
- </map:match>
-
- <map:match pattern="welcome">
- <map:generate type="directory" src="data">
- <map:parameter name="include" value="\.txt$"/>
- </map:generate>
- <map:transform src="dir2html.xsl"/>
- <map:serialize/>
- </map:match>
-
- <!-- expects format xxxyyyzzt.txt.png -->
- <map:match pattern="*.jpg">
- <map:generate type="asciiart-svg" src="data/{1}">
- </map:generate>
- <map:serialize type="svg2jpeg"/>
- </map:match>
-
- <!-- expects format xxxyyyzzt.txt.png -->
- <map:match pattern="*.png">
- <map:generate type="asciiart-svg" src="data/{1}">
- </map:generate>
- <map:serialize type="svg2png"/>
- </map:match>
-
- <map:match pattern="*.txt">
- <map:read src="data/{1}.txt"
- mime-type="text/plain"/>
- </map:match>
-
- </map:pipeline>
- </map:pipelines>
+ <map:match pattern="">
+ <map:redirect-to uri="welcome"/>
+ </map:match>
+
+ <map:match pattern="welcome">
+ <map:generate type="directory" src="data">
+ <map:parameter name="include" value="\.txt$"/>
+ </map:generate>
+ <map:transform src="dir2html.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>
+
+ <!-- expects format xxxyyyzzt.txt.png -->
+ <map:match pattern="*.jpg">
+ <map:generate type="asciiart-svg" src="data/{1}"/>
+ <map:serialize type="svg2jpeg"/>
+ </map:match>
+
+ <!-- expects format xxxyyyzzt.txt.png -->
+ <map:match pattern="*.png">
+ <map:generate type="asciiart-svg" src="data/{1}"/>
+ <map:serialize type="svg2png"/>
+ </map:match>
+
+ <map:match pattern="*.txt">
+ <map:read src="data/{1}.txt" mime-type="text/plain"/>
+ </map:match>
+ </map:pipeline>
+ </map:pipelines>
</map:sitemap>
-