home *** CD-ROM | disk | FTP | other *** search
- <?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.
- -->
- <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "document-v10.dtd">
-
- <document>
- <header>
- <title>Offline Page Generation with the Command Line Interface</title>
- <version>1.0</version>
- <type>Technical document</type>
- <authors><person name="Upayavira" email="upayavira@apache.org"/>
- </authors>
- <abstract>This document explains how to use the Cocoon Command Line Interface for offline page and site generation.</abstract>
- </header>
- <body>
- <s1 title="Overview">
- <p>The Command Line Interface provides access to Cocoon's offline generation capabilities.</p>
- <p>This page gives details of how configure and use the CLI. Details of the concepts behind
- offline page generation are given on the offline generation
- <link href="index.html">overview</link> page.</p>
- </s1>
- <s1 title="Invoking the CLI">
- <p>The CLI can be invoked from the command line. Change to the root directory of your
- Cocoon distribution, and then, on Unix use: <code>./cocoon.sh cli <parameters></code>
- and on Windows use <code>cocoon.bat cli <parameters></code></p>
- <p>The relevant parameters are detailed in the following sections.</p>
- </s1>
- <s1 title="Configuring the CLI">
- <p>The CLI has two methods of configuration, with an <code>xconf</code> file, and using
- command line parameters.</p>
- <p>The <code>xconf</code> method is the newer, and gives access to a wider range of
- features, and is thus explained first.</p>
- <note>Whilst the xconf method provides access to more features, the command line
- parameter method is more stable, as there are currently plans to improve
- the xconf format to allow greater flexibility. If you require a stable and
- consistent method for accessing the CLI, it is recommended that you use the
- command line parameter method.</note>
- <s2 title="Using an Xconf file">
- <p>To start the CLI using an xconf file, on Unix do <code>./cocoon.sh cli -x <xconf file></code>
- or on Windows: <code>cocoon cli -x <xconf file></code>.</p>
- <p>For a sample xconf file, with comments describing each option, see the
- <link href="configuration.html">configuration</link> page.</p>
- </s2>
- <s2 title="Command Line Parameters">
- <p>You can get a listing of the available parameters on unix with
- <code>./cocoon.sh cli -h</code> or on Windows with <code>cocoon cli -h</code>.
- This should give a listing something like:</p>
- <source>
- -------------------- Executing -----------------
- Main Class: org.apache.cocoon.Main
- usage: cocoon cli [options] [targets]
- ------------------------------------------------------------------------
- cocoon 2.1
- Copyright (c) 1999-2003 Apache Software Foundation. All rights reserved.
- ------------------------------------------------------------------------
- -a,--userAgent use given string for user-agent header
- -e,--confirmExtensions confirm that file extensions match mime-type of
- pages and amend filename accordingly (default is true)
- -C,--configFile specify alternate location of the configuration
- file (default is ${contextDir}/cocoon.xconf)
- -D,--defaultFilename specify a filename to be appended to a URI when
- the URI refers to a directory
- -L,--loadClass specify a class to be loaded at startup
- (specifically for use with JDBC). Can be used multiple times
- -P,--precompileOnly generate java code for xsp and xmap files
- -V,--verbose enable verbose messages to System.out
- -b,--brokenLinkFile send a list of broken links to a file (one URI
- per line)
- -c,--contextDir use given dir as context
- -d,--destDir use given dir as destination
- -f,--uriFile use a text file with uris to process (one URI
- per line)
- -h,--help print this message and exit
- -k,--logKitconfig use given file for LogKit Management
- configuration
- -l,--Logger use given logger category as default logger for
- the Cocoon engine
- -p,--accept use given string for accept header
- -r,--followLinks process pages linked from starting page or not
- (boolean argument is expected, default is true)
- -u,--logLevel choose the minimum log level for logging
- (DEBUG, INFO, WARN, ERROR, FATAL_ERROR) for startup logging
- -v,--version print the version information and exit
- -w,--workDir use given dir as working directory
- -x,--xconf specify a file containing XML configuration
- details for the command line interface
- Note: the context directory defaults to './webapp'
- </source>
- <p>For details of the meaning of each specific parameter, see the <link href="index.html">overview</link>
- page.</p>
- <s3 title="Specifying Targets">
- <p>The command line parameter method does not have access to all of Cocoon's URI handling features. However,
- it is possible to specify multiple URIs to be crawled, all of which will be written to the same destination,
- and that destination (specified by the <code>-d</code> or <code>--destDir</code> option, may be a file URI
- or any other protocol for which a ModifiableSource exists (e.g. FTP).</p>
- </s3>
- <s3 title="URI Files">
- <p>A URI file offers a simple way to specify multiple URIs. The file is treated as one URI per line.</p>
- </s3>
- <s3 title="Broken Link Handling">
- <p>If a broken link file is specified, all broken links will be written to this file, in text format,
- one URI per line.</p>
- </s3>
- </s2>
- </s1>
- </body>
- </document>
-
-