home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / asciiart-generator.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  5.9 KB  |  190 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">
  18.  
  19. <document>
  20.   <header>
  21.     <title>AsciiArtSVGGenerator in Cocoon</title>
  22.     <version>0.9</version>
  23.     <type>Technical document</type>
  24.     <authors>
  25.       <person name="Bernhard Huber" email="huber.at.apache.org"/>
  26.     </authors>
  27.     <abstract>This document describes the AsciiArtSVGGenerator of Cocoon.</abstract>
  28.   </header>
  29.   <body>
  30.     <s1 title="AsciiArtSVGGenerator">
  31.       <table>
  32.         <tr>
  33.           <td>NAME</td><td>asciiart-svg</td>
  34.         </tr>
  35.         <tr>
  36.           <td>WHAT</td><td>The <code>AsciiArtSVGGenerator</code> component is used 
  37.             to serve ascii art text as SVGserve data.
  38.           </td>
  39.         </tr>
  40.         <tr>
  41.           <td>TYPE</td><td>Generator, Sitemap Component</td>
  42.         </tr>
  43.         <tr>
  44.           <!-- choose Core, the block name, or Scratchpad 
  45.             depending on where AsciiArtSVGGenerator sources live
  46.           -->
  47.           <td>BLOCK</td><td>Block-Mail/Scratchpad</td>
  48.         </tr>
  49.         <tr>
  50.           <td>CLASS</td><td>org.apache.cocoon.generation.asciiart.AsciiArtSVGGenerator</td>
  51.         </tr>
  52.         <!-- uncomment folling tr iff AsciiArtSVGGenerator is deprecated -->
  53.         <!--tr>
  54.           <td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td>
  55.         </tr-->
  56.         <tr>
  57.           <td>SINCE</td><td>Cocoon 2.1</td>
  58.         </tr>
  59.         <tr>
  60.           <td>CACHEABLE</td><td>yes</td>
  61.         </tr>
  62.       </table>
  63.     </s1>
  64.     <s1 title="Description">
  65.       <p>
  66.         The <code>AsciiArtSVGGenerator</code> reads a plain ascii text document
  67.         and generates SVG/XML SAX events.
  68.       </p>
  69.     </s1>
  70.     <s1 title="Usage">
  71.       <p>
  72.         The <code>AsciiArtSVGGenerator</code> can be used to serve
  73.         figural information in a quick, and simple way. 
  74.       </p>
  75.       <p>
  76.         The following snippet represents an ascii art which can be served
  77.         by <code>AsciiArtSVGGenerator</code>
  78.       </p>
  79.       <source><![CDATA[
  80.  +==============+  
  81.  |  Mail_Header |  
  82.  |  +========+  |  
  83.  |  | Body   |  |  
  84.  |  +==+==+==+  |  
  85.  |  |a |a |a |  |  
  86.  |  |1 |2 |3 |  |  
  87.  |  +==+==+==+  |  
  88.  +==============+  
  89. ]]></source>
  90.       <p>
  91.         Storing this as <code>image/asciiart/mail.txt</code>, and using
  92.         the matching snippet below, the mail ascii art can get embedded
  93.         in your document as
  94.       </p>
  95.       <source><![CDATA[
  96. <p> Talking about mail ....</p>
  97. <figure alt="Mail Structure" src="image/asciiart/mail.png"/>
  98.       ]]></source>
  99.  
  100.       <s2 title="Sitemap pipeline examples">
  101.         <p>
  102.           The snippet below matches URI of the format
  103.           <code>image/asciiart/*.png</code>, and 
  104.           serves them from ascii art files from the directory
  105.           <code>resources/asciiart/*.txt</code>.
  106.         </p>
  107.         <source><![CDATA[
  108. <map:match pattern="image/asciiart/*.png">
  109.   <map:generate type="asciiart-svg" 
  110.     src="resources/asciiart/{1}.txt">
  111.     <!-- option sitemap parameters -->
  112.   </map:generate>
  113.   <map:serialize type="svg2png"/>
  114. </map:match>
  115.         ]]></source>
  116.       </s2>
  117.       
  118.       <s2 title="Sitemap component configuration example">
  119.         <p>
  120.           The snippet below declares the <code>AsciiArtGenerator</code>
  121.           in the sitmap components section.
  122.         </p>
  123.         <source><![CDATA[
  124. <map:generators...
  125.   <map:generator name="asciiart-svg" 
  126.     src="org.apache.cocoon.generation.AsciiArtSVGGenerator"
  127.     logger="sitemap.generator.asciiart-svg" 
  128.   />
  129.     <!-- optional generator configuration -->
  130.     ...
  131. </map:generators>
  132. ...
  133. ]]></source>
  134.       </s2>
  135.       <s2 title="Configuration">
  136.         <p>
  137.           The <code>AsciiArtGenerator</code> has no configurational options.
  138.         </p>
  139.       </s2>
  140.       <s2 title="Setup">
  141.         <p>
  142.           Setting up the <code>AsciiArtGenerator</code> is simply specifying
  143.           the plain ascii text source.
  144.         </p>
  145.         <p>
  146.           Moreover following sitemap parameters are accepted
  147.         </p>
  148.         <table>
  149.           <tr><th>Parametername</th><th>Default</th><th>Comment</th></tr>
  150.           <tr><td>line-attribute</td><td><![CDATA[stroke:black; stroke-width:1.5]]></td>
  151.             <td>Style of generated SVG lines</td></tr>
  152.           <tr><td>text-attribute</td><td><![CDATA[font-size: 12; font-family:Times Roman; fill:blue;]]></td>
  153.             <td>Style of generated SVG text</td></tr>
  154.           <tr><td>x-grid</td><td>10</td>
  155.             <td>X Grid size</td></tr>
  156.           <tr><td>y-grid</td><td>12</td>
  157.             <td>Y Grid size</td></tr>
  158.         </table>
  159.       </s2>
  160.       <s2 title="Effect on Object Model and Sitemap Parameters">
  161.         <p>
  162.           The <code>AsciiArtGenerator</code> has no side effects on the
  163.           objectModel, or other sitemap parameters.
  164.         </p>
  165.       </s2>
  166.     </s1>
  167.     <s1 title="Bugs/Caveats">
  168.       <p>
  169.         The <code>AsciiArtGenerator</code> is a quick shot, and 
  170.         does not handle all characters visually consistently.
  171.       </p>
  172.     </s1>
  173.     <s1 title="History">
  174.       <p>
  175.         01-05-02: initial creation
  176.       </p>
  177.     </s1>
  178.     <s1 title="See also">
  179.       <p>
  180.         Read more information about 
  181.         <link href="http://www.w3.org/TR/SVG/">SVG</link>,
  182.         and about 
  183.         <link href="http://cocoon.apache.org/userdocs/serializers/svg-serializer.html">SVG Serializer</link>
  184.         family.
  185.       </p>
  186.     </s1>
  187.   </body>
  188. </document>
  189.  
  190.