You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ashayk <as...@YAHOO.COM> on 2007/11/11 15:41:21 UTC

generating static HTML with CocoonBean?

Hello,

I'm trying to generate an offline snapshot of a Webstite using the
CocoonBean.  I have no interest in using wget or similar screen scraping to
accomplish this.  

I've researched the subject a bit, searched the forums, etc... but found
little useful information.  I've tried using the CLI, but since it uses
CocoonBean internally, I figure I'd like to make it work using CocoonBean
itself.  FYI, there is a bug in cocoon.bat when running with the "cli" flag. 
It attempts to load sevlet2.2.jar rather than servlet2.3.jar which Cocoon
requires.  I get a ClassNotFoundException.

I've added all the relevant libraries to CLASSPATH, and am attempting the
following code in order to generate the Web site.  The code runs fine, but
fails to generate any meaningful output.  I suspect I'm not adding the
target the right way.  I would greatly appreciate some help with this from
someone who's managed it.

Thanks in advance,

Alex
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
File context = new File("C:\\JavaProjects\\cocoon-2.1.10\\build\\webapp\\");
 File work = new
File("C:\\JavaProjects\\cocoon-2.1.10\\build\\webapp\\temp");

 File dest = new
File("C:\\JavaProjects\\cocoon-2.1.10\\build\\webapp\\offline");

CocoonBean cocoon = new CocoonBean();
cocoon.setFollowLinks(true);
cocoon.setContextDir(context.getPath());
cocoon.setWorkDir(work.getPath());
cocoon.setDefaultFilename("index.html");
            
ArrayList list = new ArrayList();
File index = 
                    new
File("C:\\JavaProjects\\cocoon-2.1.10\\build\\webapp\\simetry.com.au\\index.html");
list.add(index.getPath());
// guessing the problem is here
// HOW DO I POINT CocoonBean AT THE sitemap.xmap FILE IN simetry.com.au
??????????
cocoon.addTargets(list, dest.getPath());
                   
            
cocoon.setLogLevel("INFO");

cocoon.initialize();
cocoon.process();
cocoon.dispose();
-- 
View this message in context: http://www.nabble.com/generating-static-HTML-with-CocoonBean--tf4786044.html#a13691940
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: generating static HTML with CocoonBean?

Posted by ashayk <as...@YAHOO.COM>.
>Did you found
>http://cocoon.apache.org/2.1/userdocs/offline/index.html?

Yes, there is zero actual documentation there on using the CocoonBean.

>Why do you not use the CLI, which internally is using the CocoonBean?

I'd like to write my own code.  The CLI
a) has a bug in it when used with cocoon.bat (as per my post) and
b) is not suitable for my purposes

>We are using the cocoon cli in Apache Forrest. 

Yes, I've seen references to Forrest.  It looks quite interesting, but I'd
actually like to know how to interact with the CocoonBean myself, not learn
another framework.

Thanks for replying, though.  I'm still hoping someone will chime in who's
actually worked directly with the CocoonBean.

Cheers,

Alex


-- 
View this message in context: http://www.nabble.com/generating-static-HTML-with-CocoonBean--tf4786044.html#a13705752
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: generating static HTML with CocoonBean?

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Sun, 2007-11-11 at 06:41 -0800, ashayk wrote:
> Hello,
> 
> I'm trying to generate an offline snapshot of a Webstite using the
> CocoonBean.  I have no interest in using wget or similar screen scraping to
> accomplish this.  
> 
> I've researched the subject a bit, searched the forums, etc... but found
> little useful information.  I've tried using the CLI, but since it uses
> CocoonBean internally, I figure I'd like to make it work using CocoonBean
> itself.  FYI, there is a bug in cocoon.bat when running with the "cli" flag. 
> It attempts to load sevlet2.2.jar rather than servlet2.3.jar which Cocoon
> requires.  I get a ClassNotFoundException.

Did you found
http://cocoon.apache.org/2.1/userdocs/offline/index.html?

Why do you not use the CLI, which internally is using the CocoonBean?

We are using the cocoon cli in Apache Forrest. 

HTH

salu2

> 
> I've added all the relevant libraries to CLASSPATH, and am attempting the
> following code in order to generate the Web site.  The code runs fine, but
> fails to generate any meaningful output.  I suspect I'm not adding the
> target the right way.  I would greatly appreciate some help with this from
> someone who's managed it.
> 
> Thanks in advance,
> 
> Alex
> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> File context = new File("C:\\JavaProjects\\cocoon-2.1.10\\build\\webapp\\");
>  File work = new
> File("C:\\JavaProjects\\cocoon-2.1.10\\build\\webapp\\temp");
> 
>  File dest = new
> File("C:\\JavaProjects\\cocoon-2.1.10\\build\\webapp\\offline");
> 
> CocoonBean cocoon = new CocoonBean();
> cocoon.setFollowLinks(true);
> cocoon.setContextDir(context.getPath());
> cocoon.setWorkDir(work.getPath());
> cocoon.setDefaultFilename("index.html");
>             
> ArrayList list = new ArrayList();
> File index = 
>                     new
> File("C:\\JavaProjects\\cocoon-2.1.10\\build\\webapp\\simetry.com.au\\index.html");
> list.add(index.getPath());
> // guessing the problem is here
> // HOW DO I POINT CocoonBean AT THE sitemap.xmap FILE IN simetry.com.au
> ??????????
> cocoon.addTargets(list, dest.getPath());
>                    
>             
> cocoon.setLogLevel("INFO");
> 
> cocoon.initialize();
> cocoon.process();
> cocoon.dispose();
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org