cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: Cocoon Bean Design
Date Tue, 17 Dec 2002 16:10:34 GMT
Upayavira wrote:

>I have been given some time at work during which I would like to implement a 
>CocoonBean (name and much of the below suggested by Vadim). I should have time 
>over the Christmas holiday. I would therefore like to try to pin down a spec for it before

>then.
>
>I would propose the following, as a code sample:
>
>CocoonBean cocoon = new CocoonBean("c:/working", "c:/context");
>
>/*** Set up Cocoon instance (optional) ***/
>cocoon.setConfigFile("WEB-INF/cocoon.xconf");
>cocoon.setBrokenLinkFile("c:/brokenlinks.txt");
>cocoon.setAcceptOptions("acceptoptions");
>cocoon.setAgentOptions("agentoptions");
>
>cocoon.setPrecompileOnly(false);
>cocoon.setRecursionOn();
>  
>

Is it "follow-links"? Then it's better be

setFollowLinks(true);
setFollowLinks(false);


>/*** Set up logging (optional) ***/
>cocoon.setLogKit("logkitname");
>cocoon.setLogLevel("ERROR");
>cocoon.setLogger("loggername");
>
>/*** Process a single URI and pass results to an output stream ***/
>String URI = "cocoon:/blah/foobar.html?page=1";
>
>File f = new File("foobar.html");
>FileOutputStream fos = new FileOutputStream(f);
>
>cocoon.processURI(URI, fos);
>
>/*** Process a number of URIs, sending the results to a 'destination' ***/
>cocoon.addTarget("cocoon:/blah/foobar.html?page=2");
>cocoon.addTarget("cocoon:/blah/foobar.html?page=3");
>cocoon.setDestination(new FileDestination("c:/destination"));
>
>cocoon.process();
>
>cocoon.setDestination(new FTPDestination("c:/localfolder", "ftp.myhost.com", "bill", 
>"myPassword", "foo/bar/"));
>cocoon.process();
>  
>

There is another option - but I'm not sure that it is better. Just for 
you consideration:

cocoon.process(ArrayList targets, Destination destination);

This way cocoon bean could be made thread safe (if the rest of it is 
threadsafe).


>Unless I hear from anyone, I'll just get on and do it like this.
>  
>

Go ahead.


>Also, does anyone know of any decent java FTP client classes? 
>  
>

sun.net.ftp.FtpClient has couple of bugs and limited functionality, but 
it's Ok for many cases.

Vadim


>Regards, Upayavira
>




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


Mime
View raw message