forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: Where to put components (Re: cvs commit: ...)
Date Sat, 09 Aug 2003 06:15:33 GMT
On Fri, Aug 08, 2003 at 05:57:05PM +0200, cheche@che-che.com wrote:
> Jeff,
> 
> Thank you very much about this explanation, I found it very useful. I
> belive that this is a minor issue but it helps to define a pattern to
> write xmaps.
> 
> We are moving now to define the best pattern to use in the xmap so it is
>  easier to read and maintain.
> 
> 
> > 
> > What does the following subsitemap do?
> > 
> > <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> >   <map:pipelines>
> >     <map:pipeline>
> >       <map:match pattern="aaa"/>
> >       <map:generate src="bbb"/>
> >       <map:transform src="ccc"/>
> >       <map:serialize/>
> >     </map:pipeline>
> >   </map:pipelines>
> > </map:sitemap>
> > 
> > There is no way to tell, because it depends on what the parent sitemap
> > has declared as the defaults.
> > 
> > If you add:
> > 
> > <map:components>
> >   <map:generators default="serverpages"/>
> >   <map:transformers default="xslt"/>
> >   <map:serializers default="fo2pdf"/>
> > </map:components>
> > 
> > Then
> > 
> > - You immediately know that 'aaa' is a PDF, 'bbb' is an XSP, and 'ccc'
> >   is an XSLT stylesheet.  This is the documentation effect
> > 
> > - Say some day we decide to switch the default transformer from XSLT
> >   to STX.  If we handn't explicitly said "ccc is an XSLT" then this
> >   sitemap would quietly fail.  But as we've defined it, the sitemap
> >   will work fine if we keep the 'xslt' component, and fail in a
> >   sensible manner if we don't.
> >
> 
> To probe that your proposal it is less apropiate I will point a few  facts:
> 
> In our code there is 13 declarations that the default serializer is
> "html"(  grep "serializers default" *.xmap | wc -l) , It has been used
> only in one place that is raw.xmap (it was omited)

Then perhaps we should make the default 'xml'.  HTML is the Cocoon
default though.

> On the declarations there is no way to ensure that what you declare it
> is used or not on the submap.

Didn't follow that?

> Overwriting a default declaration is another way to duplicate, to  allow
>  explicit declaration use type="..."

Seems better to declare a default than to use type="..." on every
element.

> You even got confused in your own example!!. aaa is "wildcard"

http://localhost:8888/aaa is a PDF, although the matcher is a
WildcardMatcher.

--Jeff

> 
> Cheche
> 
> 
> 

Mime
View raw message