The CLI generates three times: once for link gathering, once to get the mime-type and once to generate the actual content.
If you don't need to follow links, or don't want Cocoon to confirm your extensions for you, this can be unnecessary work.
The CLI in 2.1 has changed significantly since 2.0.4, including functionality that allows you to reduce the number of times a page is generated, and also includes a programmatic interface to Cocoon (the CocoonBean).
There are a lot more enhancements in 2.1 too, and more are planned, so I would recommend upgrading. If you are not able to upgrade, you may well be able to lift some of the code from 2.1 and back-port it to 2.0.4 for your own use.
Regards, Upayavira
Verwer, Nico wrote:
I am using Cocoon 2.0.4 from the command-line to generate single documents (no links are followed):
java -Xmx256m -Xss2048k \ -cp $CLASSPATH \ org.apache.cocoon.Main \ -c $HOME/cocoon.war \ -C $HOME/cocoon.war/WEB-INF/cocoon.xconf \ -k $HOME/cocoon.war/WEB-INF/logkit.xconf \ -u INFO \ -r no \ $URL
This works fine, but when I request one URL, the pipeline for this URL is executed three times! I can see this by including an action component which writes to a log file. When I request a profile as well, in the profiling output there are two <pipeline> elements for the original URL, one with count="2" and one with count="1" (which again suggests that the pipeline is executed three times). The pipeline with count="1" has an extra <element> with role="<translator>" added right before the serializer.From the discussions on various mailing lists, I have concluded that the <translator> is a link-translator component, which is automatically inserted to enable Cocoon to find and generate linked pages. But since I have not asked for this (-r no), I wonder why the pipeline is executed *three* times? When I request the URL through the servlet, the pipeline is executed once, as expected.
My question is: Why is the pipeline executed three times (and not twice or just once)? Is it possible to bypass this behaviour and execute it only once, from the command-line? We are using cocoon for some CPU-heavy offline transformations, and executing the pipeline once or three times makes a lot of difference.
Thanks for considering this question, and for any answers!
Regards, Nico Verwer Kluwer, the Netherlands.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
