cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: cocoon & resource interfaces
Date Wed, 03 May 2000 10:18:27 GMT
Paul Lamb wrote:
> I've been working thru changes for cocoon 1.7x that would enable resource
> access instead of the current file and url scheme in the XSP and XSLT
> processors--this allows much better integration with the current servlet
> containers. But this doesn't really come out very clean or pretty in the
> current 1.7x.
> So, I started looking at cocoon2 and noticed that it is better, but still
> doesn't have a Resource concept. What I'm thinking of is something like a
> Resouce base class with ResourceFromFile and ResourceFromURL. All file type
> access would only happen on Resources, and the only place a "new File()"
> would ever be allowed would be in the ResourceFromFile. If running inside a
> servlet container the only way to get a resource should be using
> context.getResource(res) and then doing a getStream() on it.

There is no difference between ResourceFromURL and ResourceFromFile, if
all you want to do is accessing the resource and read it.

I like the concept of "resource" very much (I was the one that proposed
the method getResource() for addiction to the Servlet API, anyway) and I
agree that Cocoon2 should be based on that.
> I'm looking for suggestions on the concept and the interfaces. I'd be happy
> to contribute the work. I also don't think it will take much to create
> something that can be used in both cocoon 1 and 2.

I like the concept, but don't mess around with Cocoon1: concentrate on
making Cocoon2 even better so that people will be repaid of the cost of

As far as the interface goes, a Resource interface should provide
methods for

 - reading the resource
 - writing the resource
 - knowing the time when the resource was changed
 - knowing the resource encoding
 - ??? (anything else?)

I know we could use and forget it, the problem with URL is
that you have to specify your URLHandlerFactory and we all know the
problems with that on the server side. So I'd prefer to clone the
functionality and _use_ URL inside Resource implementations.


Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------

View raw message