cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Simon Mieth)
Subject Re: Cocoon CLI Command Line Interface - Basic Question
Date Fri, 14 May 2004 09:17:10 GMT
On Thu, 13 May 2004, David Swearingen wrote:

> I'm trying to get Cocoon CLI to work.  I've scoured all the documents on this, but can't
figure out how cli knows where to find my sitemap.  I have cocoon up and running just fine
under Tomcat as a web application.
> What I need is a very basic command line -- which commands are REQUIRED to simply process
a request through the sitemap and output to a file?  I'd rather just put all the required
parameters on the command line rather than have to build an xconf file.  It seems to me that
the minimum parameters needed if I DON'T reference an xconf file are:
> -c contextdir (unless I use default)
> -d destination
> Part of my confusion in part stems from the fact that I have my sitemap under my Tomcat
folder (c:\jakarta-tomcat-4.1.30) but the docs say to run cocoon.bat residing in my cocoon
install directory, c:\cocoon-2.1.4. So, should my 'contextdir' be under the jakarta path or
the cocoon path?  What is the purpose of the contextdir?  That's not explained in the docs.
> Finally, it's not clear to me what the difference is between -x and -C.
> The page that ostensibly explains all this is
> Thanks,
> David

Hi David,

the usage of "cocoon cli -c ... -d ... myuri.html" will only works inside 
the directory of cocoon source distribution. 
You dont need (it is not possible) point to your sitemap.xmap, the 
main-sitemap should be in the contextdir, so you have to point to the 
right contextdir. 
If you want to use your deployed webapp under tomcat, you have 3 options 
to do this.

1.) you have the same cocoon-version as source package somewhere on the 
filesystem (c:\cocoon-2.1.4?) and it is build. You can use the cocoon.bat 
script there. Go to 
this folder and try cocoon -c c:\jakarta-tomact-4.1.30\webapps\cocoon -d 
c:\myoutput mystarting-uri.html

2.) You can use "java org.apache.cocoon.Main -c ... -d .... my....html", 
but you have to put all libs from the webapp (WEB-INF\libs) to the classpath 
(by a script). 

3.) You can use the ant-task (see the user-doc), where ant will add all 
libs to the classpath/classloader.

The difference between -x and -C:

-C: point to the cocoon.xconf, where the cocoon-components are confiured

-x: point to a CLI-configuration-file, where you have setup all options 
and uris for the Cocoon-CLI, so you dont need any switches then.

If you run in a ClassNotFound exception you have to add the 
servlet_2_2.jar form c:\cocoon-2.1.4\lib\optional to the 
build\webapp\WEB-INF\lib if you use option 1)

Yes, the "-c" and the "-d" switch are only required. 

I hope it helps.

Best Regards,



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message