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 / configuration.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  10.8 KB  |  280 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" "document-v10.dtd">
  18.  
  19. <document>
  20.   <header>
  21.     <title>Configuration of Cocoon for Offline Use</title>
  22.     <version>1.0</version>
  23.     <type>Technical document</type>
  24.     <authors><person name="Upayavira" email="upayavira@apache.org"/>
  25.     </authors>
  26.     <abstract>This document explains how to configure Cocoon for offline page and site generation.</abstract>
  27.   </header>
  28.   <body>
  29.     <s1 title="Overview">
  30.       <p>This page details the {{xconf}} configuration format for configuring Cocoon's offline 
  31.          page and site generation capabilities.</p>
  32.       <p>This page gives details of how configure Cocoon. Details of the concepts behind
  33.          offline page generation are given on the offline generation 
  34.          <link href="index.html">overview</link> page.</p>
  35.     </s1>
  36.     <s1 title="The xconf Configuration Format">
  37.       <p>The {{xconf}} configuration format can be used both within the Cocoon 
  38.          <link href="cli.html">Command Line Interface</link> and within the 
  39.          <link href="ant.html">Cocoon Ant Task</link>.</p>
  40.     </s1>
  41.     <s1 title="Sample xconf File">
  42.       <p>Below is a sample XConf file. The details of the file are detailed as comments within
  43.          this sample itself.</p>
  44. <source>
  45. <![CDATA[
  46. <?xml version="1.0"?>
  47.  
  48. <!--+
  49.     |  This is an Apache Cocoon command line configuration file. 
  50.     |  Here you give the command line interface details of where
  51.     |  to find various aspects of your Cocoon installation.
  52.     |
  53.     |  If you wish, you can also use this file to specify the URIs
  54.     |  that you wish to generate.
  55.     |
  56.     |  The current configuration information in this file is for
  57.     |  building the Cocoon documentation. Therefore, all links here 
  58.     |  are relative to the build context dir, which, in the build.xml 
  59.     |  file, is set to ${build.context} 
  60.     |
  61.     |  Options:
  62.     |    verbose:            increase amount of information presented
  63.     |                        to standard output (default: false)
  64.     |    follow-links:       whether linked pages should also be 
  65.     |                        generated (default: true)
  66.     |    precompile-only:    precompile sitemaps and XSP pages, but 
  67.     |                        do not generate any pages (default: false)
  68.     |    confirm-extensions: check the mime type for the generated page
  69.     |                        and adjust filename and links extensions
  70.     |                        to match the mime type 
  71.     |                        (e.g. text/html->.html)
  72.     |    context-dir:        The context directory is usually the webapp 
  73.     |                        directory containing the sitemap.xmap file.
  74.     |    config-file:        The config file is the cocoon.xconf file, 
  75.     |                        usually found within the WEB-INF folder
  76.     |    work-dir:           The work directory is used by Cocoon to 
  77.     |                        store temporary files and cache files.
  78.     |    dest-dir:           The destination directory is where generated 
  79.     |                        pages will be written (assuming the 'simple' 
  80.     |                        mapper is used, see below)
  81.     |
  82.     +-->
  83.     
  84. <cocoon verbose="true"  
  85.         follow-links="true" 
  86.         precompile-only="false" 
  87.         confirm-extensions="true"
  88.         context-dir="build/webapp/xconf"
  89.         config-file="WEB-INF/cocoon.xconf"
  90.         work-dir="build/work"
  91.         dest-dir="build/dest">
  92.  
  93.    <!--+
  94.        | Broken link reporting options:
  95.        |   Report into a text file, one link per line:
  96.        |     <broken-links type="text" report="filename"/>
  97.        |   Report into an XML file:
  98.        |     <broken-links type="xml" report="filename"/>
  99.        |   Ignore broken links (default):
  100.        |     <broken-links type="none"/>
  101.        |     
  102.        |   Two attributes to this node specify whether a page should
  103.        |   be generated when an error has occured. 'generate' specifies 
  104.        |   whether a page should be generated (default: true) and
  105.        |   extension specifies an extension that should be appended
  106.        |   to the generated page's filename (default: none)
  107.        |   
  108.        |   Using this, a quick scan through the destination directory
  109.        |   will show broken links, by their filename extension.
  110.        +-->
  111.    <broken-links type="xml" 
  112.                  file="brokenlinks.xml"
  113.                  generate="false"
  114.                  extension=".error"/>
  115.    
  116.    <!--+
  117.        |  Load classes at startup. This is necessary for generating
  118.        |  from sites that use SQL databases and JDBC.
  119.        |  The <load-class> element can be repeated if multiple classes
  120.        |  are needed.
  121.        +-->
  122.    <!--
  123.    <load-class>org.firebirdsql.jdbc.Driver</load-class>
  124.    -->
  125.  
  126.    <!--+
  127.        |  Configures logging. 
  128.        |  The 'log-kit' parameter specifies the location of the log kit 
  129.        |  configuration file (usually called logkit.xconf. 
  130.        | 
  131.        |  Logger specifies the logging category (for all logging prior 
  132.        |  to other Cocoon logging categories taking over)
  133.        |
  134.        |  Available log levels are:
  135.        |    DEBUG:        prints all level of log messages.
  136.        |    INFO:         prints all level of log messages except DEBUG 
  137.        |                  ones.
  138.        |    WARN:         prints all level of log messages except DEBUG 
  139.        |                  and INFO ones.
  140.        |    ERROR:        prints all level of log messages except DEBUG, 
  141.        |                  INFO and WARN ones.
  142.        |    FATAL_ERROR:  prints only log messages of this level
  143.        +-->
  144.    <logging log-kit="build/webapp/WEB-INF/logkit.xconf" logger="cli" level="DEBUG" />
  145.  
  146.    <!--+
  147.        |  Specifies the filename to be appended to URIs that
  148.        |  refer to a directory (i.e. end with a forward slash).
  149.        +-->
  150.    <default-filename>index.html</default-filename>
  151.  
  152.    <!--+
  153.        |  Specifies a user agent string to the sitemap when
  154.        |  generating the site.
  155.        +-->
  156.    <!--
  157.    <user-agent>xxx</user-agent>
  158.    -->
  159.  
  160.    <!--+
  161.        |  Specifies an accept string to the sitemap when generating
  162.        |  the site.
  163.        +-->
  164.    <accept>*/*</accept>
  165.    
  166.    <!--+
  167.        | Specifies which URIs should be included or excluded, according
  168.        | to wildcard patterns. 
  169.        | 
  170.        | By default, all URIs are included. If both include and exclude
  171.        | patterns are specified, a URI is first checked against the 
  172.        | include patterns, and then against the exclude patterns.
  173.        | 
  174.        | Multiple patterns can be given, using muliple include or exclude
  175.        | nodes. 
  176.        | 
  177.        | The order of the elements is not significant, as only the first 
  178.        | successful match of each category is used.
  179.        | 
  180.        | Currently, only the complete source URI can be matched (including
  181.        | any URI prefix). Future plans include destination URI matching 
  182.        | and regexp matching. If you have requirements for these, contact
  183.        | dev@cocoon.apache.org.
  184.        +-->
  185.    <include pattern="**"/>
  186.    <exclude pattern="docs/apidocs/**"/>
  187.    
  188. <!--   <include-links extension=".html"/>-->
  189.    
  190.    <!--+
  191.        |  <uri> nodes specify the URIs that should be generated, and 
  192.        |  where required, what should be done with the generated pages.
  193.        |
  194.        |  Append: append the generated page's URI to the end of the 
  195.        |  source URI:
  196.        |
  197.        |   <uri type="append" src-prefix="documents/" src="index.html"
  198.        |   dest="build/dest/"/>
  199.        |
  200.        |  Replace: Completely ignore the generated page's URI - just 
  201.        |  use the destination URI:
  202.        |
  203.        |   <uri type="replace" src-prefix="documents/" src="index.html" 
  204.        |   dest="build/dest/docs.html"/>
  205.        |
  206.        |  Insert: Insert generated page's URI into the destination 
  207.        |  URI at the point marked with a * (example uses fictional 
  208.        |  zip protocol)
  209.        |
  210.        |   <uri type="insert" src-prefix="documents/" src="index.html" 
  211.        |   dest="zip://*.zip/page.html"/>
  212.        |
  213.        |  If in any of these scenarios, the dest attribute is omitted,
  214.        |  the value provided globally using the <dest-dir> node will 
  215.        |  be used.
  216.        +-->
  217.  
  218.    <uri type="replace" 
  219.         src-prefix="samples/" 
  220.         src="hello-world/hello.html"
  221.         dest="build/dest/hello-world.html"/>
  222.         
  223.    <!--+
  224.        | <uri> nodes can be grouped together in a <uris> node. This 
  225.        | enables a group of URIs to share properties. The following
  226.        | properties can be set for a group of URIs:
  227.        |   * follow-links:       should pages be crawled for links
  228.        |   * confirm-extensions: should file extensions be checked
  229.        |                         for the correct mime type
  230.        |   * src-prefix:         all source URIs should be 
  231.        |                         pre-pended with this prefix before
  232.        |                         generation. The prefix is not 
  233.        |                         included when calculating the 
  234.        |                         destination URI
  235.        |   * dest:               the base destination URI to be
  236.        |                         shared by all pages in this group
  237.        |   * type:               the method to be used to calculate
  238.        |                         the destination URI. See above 
  239.        |                         section on <uri> node for details.
  240.        | 
  241.        | Each <uris> node can have a name attribute. When a name
  242.        | attribute has been specified, the -n switch on the command
  243.        | line can be used to tell Cocoon to only process the URIs
  244.        | within this URI group. When no -n switch is given, all 
  245.        | <uris> nodes are processed. Thus, one xconf file can be 
  246.        | used to manage multiple sites.
  247.        +-->
  248.    <uris name="docs" follow-links="true">
  249.      <uri type="append" src-prefix="docs/" src="index.html"
  250.           dest="build/dest/" />
  251.    </uris>
  252.    
  253.    <uris name="samples" follow-links="false"
  254.          confirm-extensions="true"
  255.          src-prefix="samples/"
  256.          dest="build/dest/examples/"
  257.          type="append"
  258.          >
  259.       <uri src=""/>
  260.       <uri src="hello-world/"/>
  261.       <uri src="hello-world/hello.html"/>
  262.       <uri src="hello-world/hello.xml"/>
  263.    </uris>
  264.  
  265.    <!--+
  266.        |  File containing URIs (plain text, one per
  267.        |  line).
  268.        +-->
  269.    <!--
  270.    <uri-file></uri-file>
  271.    -->
  272.    
  273. </cocoon>
  274. ]]>
  275.         </source>
  276.     </s1>
  277.   </body>
  278. </document>
  279.  
  280.