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 Fri, 08 Aug 2003 10:52:03 GMT
On Thu, Aug 07, 2003 at 04:34:28PM +0200, Juan Jose Pablos wrote:
> Jeff,
> 
> I removed the componets that are not related to submaps. But I would 
> like to remove the ones that does not declaring anything, to give you an 
> example on status.xml, I would like to remove:
> 
> 19d18
> <     <map:generators default="file"/>
> 27,29d25
> <     <map:transformers default="xslt"/>
> <     <map:matchers default="wildcard"/>
> <     <map:selectors default="browser"/>
> 
> 
> You said that they there because  "They act as documentation, and make 
> the subsitemap's interface with the owner sitemap explicit."
> 
> 
> 1) If we want to have as documentation, then we can have them under <!-- 
> comments -->
>
> I removed and test it, and I can not see any change on the behaviour.
> 
> Could you elaborate a bit futher on "make an explicit interface?"?

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.


--Jeff


> Cheers,
> Cheche
> 
> 
> 

Mime
View raw message