You could try Lars' mail, or you could take a completely different tack:
Use the SourceWritingTransformer in a secret pipeline that generates your data, and then writes it to a file using the SourceWritingTransformer.
Regards, Upayavira
Justin Makeig wrote:
Argh. After struggling with cocoon.sh and Upayavira's helpful email, I still can't get the CLI to work. I just need to push the result of http://localhost:8080/toc into the the file /usr/local/jakarta-tomcat-4.1.27/webapps/cocoon/cde/xml/toc.xml. I've attached the relevant configuration below. Any help would be much appreciated. Thanks.
- Justin
Tomcat ====== /usr/local/jakarta-tomcat-4.1.27/webapps/cocoon cde/ sitemap.xmap cli.xconf sitemap.xmap -> offloads logic to cde/sitemap.xmap WEB-INF/
CLI script ========== /usr/local/cocoon/cocoon-2.1.1 cocoon.sh
cli.xconf ========= <cocoon verbose="true" follow-links="false" precompile-only="false" confirm-extensions="false">
<context-dir>/usr/local/jakarta-tomcat-4.1.27/webapps/cocoon</context-dir>
<config-file>/usr/local/jakarta-tomcat-4.1.27/webapps/cocoon/WEB-INF/cocoon.
xconf</config-file>
<work-dir>build/work</work-dir>
<accept>*/*</accept>
<include pattern="**"/>
<exclude pattern="docs/apidocs/**"/>
<uri
type="replace"
src-prefix=""
src="toc"
dest="/usr/local/jakarta-tomcat-4.1.27/webapps/cocoon/cde/xml/toc.xml"/>
</cocoon>
command line ============ ./cocoon.sh cli -x /usr/local/jakarta-tomcat-4.1.27/webapps/cocoon/cli.xconf
Excpetions ========== Exception in thread "main" java.lang.reflect.InvocationTargetException ... Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
On 10/18/03 11:43 PM, "Upayavira" <[EMAIL PROTECTED]> wrote:
Justin,
Shouldn't be a problem.I've read the documentation and the Wiki as well the most recent CLI threads in July and earlier this month. However, I can't seem to figure out how to configure the cli.xconf for my webapp.
The site I'm building is dynamic, using Cocoon 2.1.1 to transform aggregated XML docs at run-time. Part of this aggregation is a static table of contents (TOC) document that is generated at design-time with a transform on Cocoon's directory generator output.
<map:match pattern="toc"> <map:generate src="xml/site" type="directory"> <map:parameter name="depth" value="10"/> </map:generate> <map:transform src="xsl/gentoc.xsl"/> <map:serialize type="xml"/> </map:match>
I request http://server:8080/toc to generate the XML in my browser. By hand, I paste the resulting XML into a file called toc.xml. This is a mind numbingly arduous process that I hoped to automate in the deployment process with Ant. However, the first step is generating toc.xml with Cocoon's command line interface. Because I need to use the directory generator, I don't see a way around this.
To install Cocoon 2.1.1, I built a minimalist WAR that I deployed in Tomcat. This, of course, doesn�t include all of the goodies in the build directory of the installation directory. Where do I put my custom cli.xconf file?
Anywhere. But it must be referred to via an absolute path, or relative to the cocoon.sh file.
In my cocoon-2.1.2/build directory or in my tomcat/webapps/cocoon directory? Also, given my path confusion, I'm not sure how to set the <context-dir>,
The root of your webapp - the folder containing your sitemap.xmap and your WEB-INF folder.
<config-file>,
Path, from your config directory (or absolute) to your cocoon.xconf (optional)
<work-dir>,A working directory, can be anywhere.
and <dest-dir> elements.
The folder where you want your files written (if not specified in a <uri> node @dest attribute. Therefore not relevent in your case.
Yup. That looks fine.Finally, is this the correct <uri> for generating the URL http://server:8080/toc into the file site/xml/toc.xml within tomcat/webapps/cocoon?
<uri type="replace" src-prefix="" src="toc" dest="site/xml/toc.xml"/>
Your config file path is missing 'cde' I think.Here are the interesting parts of my cli.xconf (currently located in tomcat/webapps/cocoon/):
<context-dir> /usr/local/jakarta-tomcat-4.1.27/webapps/cocoon/cde </context-dir> <config-file> /usr/local/jakarta-tomcat-4.1.27/webapps/cocoon/WEB-INF/cocoon.xconf </config-file> <work-dir>build/work</work-dir> <dest-dir> /usr/local/jakarta-tomcat-4.1.27/webapps/cocoon/cde/xml </dest-dir>
...
<uri type="replace" src-prefix="" src="toc" dest="site/xml/toc.xml"/>
Run from the commandline using
./cocoon.sh cli -x /usr/local/jakarta-tomcat-4.1.27/webapps/cocoon/cli.xconf
The cocoon.sh script is configured to work off a built Cocoon with the webapp in build/webapp. You can try setting COCOON_HOME environment variable to the path to your webapp (same as context-dir) before running it.
I'm getting the errorYou can ignore that one. Now fixed in latest Cocoon in CVS.
Cannot find CatalogManager.properties
Exception in thread "main" java.lang.reflect.InvocationTargetException ... Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
You need to have servlet2_X.jar in your classpath, which is defined in cocoon.sh.
I'm very confused. Any help would be much appreciated.Does that help?
Regards, Upayavira
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
