upayavira 2003/09/01 07:07:33
Modified: . cli.xconf status.xml src/java/org/apache/cocoon/bean CocoonWrapper.java Log: Changing logkit path to be relative to the context dir, rather than relative to the invocation directory. All other paths in the CLI are relative to the context, so this is fixing an anomaly. Updating the cli.xconf in cocoon root to reference the docs in the build/webapp. Thus the CLI it is all set to work directly from the built webapp rather than from a no-longer used (?) docs target. Now cocoon cli -x cli.xconf will generate the docs to build/dest/ Revision Changes Path 1.5 +72 -34 cocoon-2.1/cli.xconf Index: cli.xconf =================================================================== RCS file: /home/cvs/cocoon-2.1/cli.xconf,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- cli.xconf 7 Aug 2003 12:56:39 -0000 1.4 +++ cli.xconf 1 Sep 2003 14:07:33 -0000 1.5 @@ -33,13 +33,32 @@ | consistent method for accessing the CLI, it is recommended | that you use the command line parameters to configure | the CLI.</note> + | | CVS: $Id$ +--> <cocoon verbose="true" follow-links="true" precompile-only="false" - confirm-extensions="false"> + confirm-extensions="true"> + + <!--+ + | The context directory is usually the webapp directory + | containing the sitemap.xmap file. + | + | The config file is the cocoon.xconf file. + | + | The work directory is used by Cocoon to store temporary + | files and cache files. + | + | The destination directory is where generated pages will + | be written (assuming the 'simple' mapper is used, see + | below) + +--> + <context-dir>build/webapp</context-dir> + <config-file>WEB-INF/cocoon.xconf</config-file> + <work-dir>build/work</work-dir> + <dest-dir>build/dest</dest-dir> <!--+ | Broken link reporting options: @@ -49,18 +68,18 @@ | <broken-links type="xml" report="filename"/> | Ignore broken links (default): | <broken-links type="none"/> - | When a page includes an error, should a page be generated? | | Two attributes to this node specify whether a page should - | be generated when an error occured. 'generate' specifies + | be generated when an error has occured. 'generate' specifies | whether a page should be generated (default: true) and | extension specifies an extension that should be appended | to the generated page's filename (default: none) - | <broken-links generate="true" extension=".error.txt"/> - | + | + | Using this, a quick scan through the destination directory + | will show broken links, by their filename extension. +--> <broken-links type="xml" - file="../brokenlinks.xml" + file="brokenlinks.xml" generate="false" extension=".error"/> @@ -75,30 +94,28 @@ --> <!--+ - | + | Configures logging. + | The 'log-kit' parameter specifies the location of the log kit + | configuration file (usually called logkit.xconf. + | + | Logger specifies the logging category (for all logging prior + | to other Cocoon logging categories taking over) + | + | Available log levels are: + | DEBUG: prints all level of log messages. + | INFO: prints all level of log messages except DEBUG + | ones. + | WARN: prints all level of log messages except DEBUG + | and INFO ones. + | ERROR: prints all level of log messages except DEBUG, + | INFO and WARN ones. + | FATAL_ERROR: prints only log messages of this level +--> - <logging log-kit="./logkit.xconf" logger="cli" level="ERROR" /> + <logging log-kit="WEB-INF/logkit.xconf" logger="cli" level="ERROR" /> <!--+ - | The context directory is usually the webapp directory - | containing the sitemap.xmap file. - | - | The config file is the cocoon.xconf file. - | - | The work directory is used by Cocoon to store temporary - | files and cache files. - | - | The destination directory is where generated pages will - | be written (assuming the 'simple' mapper is used) - +--> - <context-dir>.</context-dir> - <config-file>cocoon.xconf</config-file> - <work-dir>../temp/docs</work-dir> - <dest-dir>../docs</dest-dir> - - <!--+ - | Specifies the filename to be appended to URIs that - | refer to a directory (i.e. end with a forward slash). + | Specifies the filename to be appended to URIs that + | refer to a directory (i.e. end with a forward slash). +--> <default-filename>index.html</default-filename> @@ -117,15 +134,32 @@ <accept>*/*</accept> <!--+ + | Specifies which URIs should be included or excluded, according + | to wildcard patterns. + | + | By default, all URIs are included. If both include and exclude + | patterns are specified, a URI is first checked against the + | include patterns, and then against the exclude patterns. + | + | Multiple patterns can be given, using muliple include or exclude + | nodes. + | + | The order of the elements is not significant, as only the first + | successful match of each category is used. + | + | Currently, only the complete source URI can be matched (including + | any URI prefix). Future plans include destination URI matching + | and regexp matching. If you have requirements for these, contact + | [EMAIL PROTECTED] + +--> + <include pattern="**"/> + <exclude pattern="api/**"/> + + <!--+ | Specifies the URIs that should be generated (using <uri> | elements, and (if necessary) what should be done with the | generated pages. | - | The old behaviour - appends uri to the specified destination - | directory (as specified in <dest-dir>): - | - | <uri>documents/index.html</uri> - | | Append: append the generated page's URI to the end of the | source URI: | @@ -145,8 +179,12 @@ | <uri type="insert" src-prefix="documents/" src="index.html" | dest="zip://*.zip/page.html"/> | + | If in any of these scenarios, the dest attribute is omitted, + | the value provided globally using the <dest-dir> node will + | be used. +--> - <uri>favicon.ico</uri> + <uri type="append" src-prefix="docs/" src="index.html" + dest="build/dest/" /> <!--+ | File containing URIs (plain text, one per 1.132 +8 -1 cocoon-2.1/status.xml Index: status.xml =================================================================== RCS file: /home/cvs/cocoon-2.1/status.xml,v retrieving revision 1.131 retrieving revision 1.132 diff -u -r1.131 -r1.132 --- status.xml 31 Aug 2003 09:32:35 -0000 1.131 +++ status.xml 1 Sep 2003 14:07:33 -0000 1.132 @@ -189,6 +189,13 @@ <changes> <release version="@version@" date="@date@"> + <action dev="UV" type="fix"> + Changed logkit attribute of <logging in cli.xconf to be relative to context dir, + rather than CLI invocation dir. + </action> + <action dev="UV" type="add"> + Added include/exclude feature to CLI to allow fine-tuning of crawling of a site. + </action> <action dev="BRD" type="fix" fixes-bug="18131"> Patched util-concurrent.jar so that Tomcat shutdown and continuations cleanup now works properly. 1.4 +2 -2 cocoon-2.1/src/java/org/apache/cocoon/bean/CocoonWrapper.java Index: CocoonWrapper.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/bean/CocoonWrapper.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CocoonWrapper.java 28 Aug 2003 19:21:00 -0000 1.3 +++ CocoonWrapper.java 1 Sep 2003 14:07:33 -0000 1.4 @@ -149,7 +149,7 @@ appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, cliContext); DefaultLogKitManager logKitManager = null; if (logKit != null) { - final FileInputStream fis = new FileInputStream(logKit); + final FileInputStream fis = new FileInputStream(new File(this.context, logKit)); final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder(); final Configuration logKitConf = builder.build(fis);