Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 46393 invoked by uid 500); 17 Dec 2002 18:56:07 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 46358 invoked from network); 17 Dec 2002 18:56:05 -0000 Date: Tue, 17 Dec 2002 17:07:41 +0100 (CET) From: Giacomo Pati Sender: giacomo@lapgp To: cocoon-dev@xml.apache.org Subject: Re: Cocoon Bean Design In-Reply-To: <3DFF4264.11051.5D31E28@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Tue, 17 Dec 2002, 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(); > > /*** 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(); > > Unless I hear from anyone, I'll just get on and do it like this. > > Also, does anyone know of any decent java FTP client classes? Look into the jakarta-commons-sandbox/net repository for the FTPClient. Giacomo --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org