cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashayk <asha...@YAHOO.COM>
Subject generating static HTML with CocoonBean?
Date Sun, 11 Nov 2007 14:41:21 GMT

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


Mime
View raw message