Re: SourceFactory considered harmful (Bug #15279)

2002-12-16 Thread Sylvain Wallez
Carsten Ziegeler wrote:


Sylvain Wallez wrote:


Hi team,

Bug #15279 (WriteableSource doesn't work with "context:" URLs) reveals 
what seems to me a design flaw in the SourceResolver.

The SourceResolver uses two kinds of classes can to do its job : 
SourceFactories and URLFactories. When an URL has to be resolved, it 
first checks if any SourceFactory handles the URL's protocol, and if 
there's none, it falls back to searching an URLFactory then creates an 
URLSource.
   


This is true for 2.0.x, but not for 2.1 where the new source resolver
package from excalibur is used.
URLFactories are deprecated (starting with 2.1)

With this source resolving, the same implementation, URLSource I think,
is used. I guess the problem is that the current implementation of
the context: protocol does not use the WriteableSource implementation.
 


I checked ContextSourceFactory, which calls resolver.resolveURI() with 
the translated URL. If that URL is a "file:", then we should get a 
(writeable) FileSource.

It's been a long time since I wanted to dig in the source resolution in 
2.1. Time to do it ;-)

Sylvain

--
Sylvain Wallez  Anyware Technologies
http://www.apache.org/~sylvain   http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



RE: SourceFactory considered harmful (Bug #15279)

2002-12-15 Thread Carsten Ziegeler
Sylvain Wallez wrote:

> Hi team,
> 
> Bug #15279 (WriteableSource doesn't work with "context:" URLs) reveals 
> what seems to me a design flaw in the SourceResolver.
> 
> The SourceResolver uses two kinds of classes can to do its job : 
> SourceFactories and URLFactories. When an URL has to be resolved, it 
> first checks if any SourceFactory handles the URL's protocol, and if 
> there's none, it falls back to searching an URLFactory then creates an 
> URLSource.

This is true for 2.0.x, but not for 2.1 where the new source resolver
package from excalibur is used.
URLFactories are deprecated (starting with 2.1)

With this source resolving, the same implementation, URLSource I think,
is used. I guess the problem is that the current implementation of
the context: protocol does not use the WriteableSource implementation.

Carsten 

Carsten Ziegeler 
Open Source Group, S&N AG


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: SourceFactory considered harmful (Bug #15279)

2002-12-15 Thread Sylvain Wallez
Jeremy Quinn wrote:



On Saturday, Dec 14, 2002, at 22:44 Europe/London, Sylvain Wallez wrote:


So I propose to strongly deprecate URLFactories (means @deprecate the 
source and issue a warning in the logs if some are declared), and 
rewrite existing implementations as SourceFactories.

Thoughts ?


You could well be right Sylvain  but please keep in mind, when I 
re-factored SourceWritingTransformer (in 2.1) after Carsten's 
additions, this particular aspect (resolving the different Sources) 
was the bit I really did not understand very well! Are we sure that is 
is implemented correctly in SWT in the first place? (!!)


Well, this is not SWT-specific, since SWT just uses the SourceResolver 
to get a Source. That's what happens inside the SourceResolver that 
causes problems !

Sylvain

--
Sylvain Wallez  Anyware Technologies
http://www.apache.org/~sylvain   http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Re: SourceFactory considered harmful (Bug #15279)

2002-12-15 Thread Jeremy Quinn

On Saturday, Dec 14, 2002, at 22:44 Europe/London, Sylvain Wallez wrote:


So I propose to strongly deprecate URLFactories (means @deprecate the 
source and issue a warning in the logs if some are declared), and 
rewrite existing implementations as SourceFactories.

Thoughts ?


You could well be right Sylvain  but please keep in mind, when I 
re-factored SourceWritingTransformer (in 2.1) after Carsten's 
additions, this particular aspect (resolving the different Sources) was 
the bit I really did not understand very well! Are we sure that is is 
implemented correctly in SWT in the first place? (!!)


regards Jeremy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]