cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: Polishing the flow contracts
Date Tue, 01 Apr 2003 10:33:36 GMT
Stefano Mazzocchi wrote:

> Pier Fumagalli wrote:
>
>> "Upayavira" <uv@upaya.co.uk> 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 }



Mime
View raw message