Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 63425 invoked by uid 500); 1 Apr 2003 10:33:24 -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 63408 invoked from network); 1 Apr 2003 10:33:23 -0000 Received: from unknown (HELO trinity.anyware-tech.com) (217.112.237.100) by daedalus.apache.org with SMTP; 1 Apr 2003 10:33:23 -0000 Received: (qmail 15355 invoked from network); 1 Apr 2003 10:33:35 -0000 Received: from unknown (HELO anyware-tech.com) (10.1.0.254) by trinity.anyware-tech.com with SMTP; 1 Apr 2003 10:33:35 -0000 Message-ID: <3E896B00.3070206@anyware-tech.com> Date: Tue, 01 Apr 2003 12:33:36 +0200 From: Sylvain Wallez Organization: Anyware Technologies User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3b) Gecko/20030210 X-Accept-Language: fr, en-us, en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: Polishing the flow contracts References: <3E884921.8010405@apache.org> In-Reply-To: <3E884921.8010405@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Stefano Mazzocchi wrote: > Pier Fumagalli wrote: > >> "Upayavira" wrote: >> >> >>>> var source = cocoon.componentManager.get( >>>> Packages.org.apache.excalibur.source.WriteableSource.ROLE + >>>> "/file >>>> ); >>>> source.setDest("whatever"); >>>> cocoon.process("whatever",source); >>> >>> >>> FWIW, that fits nicely with what I'm thinking of doing on the CLI. I >>> plan to >>> make it write to sources rather than files, and a >>> cocoon.process("some-uri", source) >>> would work well. >>> >>> More on my ideas soon. >>> >>> On the subject of the flow, presumably you could expose the source >>> resolver, >>> so that you could write the above with something like: >>> >>> cocoon.process("whatever", resolver.getSource("file://blah")); >> >> >> >> It's quite odd to "write" to a "source", but well, better than using >> LiveConnect. >> >> Thinking out loud... Should the "resolver" then be another read-only >> attribute of the script (instead of passing through the component >> manager?) > > > I think it would make sense. > > anybody sees a reason not to do this? One of the big changes of Cocoon 2.1 compared to 2.0 is that SourceResolver is now available as a regular component, meaning you get it using "cocoon.manager.lookup(SourceResolver.ROLE)", so I don't see the need to expose it as a property. Moreover the process() function could simply take an URI string and let the underlying implementation use the SourceResolver to get the actual source and verify that it's writeable. You will then write : cocoon.process("whatever", "file://blah") but also cocoon.process("whatever", "context://xdocs/content/foo.xml") (for a deployed webapp) and even cocoon.process("whatever", "cvs://my-module/foo") How does it sound ? Sylvain -- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }