forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: [patch] introduce use of sourcetype action in sitemap
Date Thu, 28 Nov 2002 12:25:52 GMT
Since  I didn't get any feedback on this patch, I thought it might be
useful to clarify it a bit more.

The functionality that this patch adds is the ability to use multiple
types of XML files withouth the need to put them in seperate directories
or to follow special naming conventions.

This is achieved by using the SourceTypeAction, a component which I
wrote and has been commited to forrest earlier but has not yet been put
into action.

The SourceTypeAction reads some meta-information from the top of the XML
file (using pull-parsing for efficiency), and based on some configurable
rules it will assign a "sourcetype" to the file. This sourcetype is then
made available to the sitemap, which can then decide to apply certain
transformations on the content. The end-result of these transformations
should be a document conforming to the documentv11 DTD, so that the
normal skinning operations can be applied to it.

The current patch applies this technique for the howto-files. To add
support for other file types, you need to:
 - add some configuration rules in the map:action declaration of the
SourceTypeAction. This is further documented here:
http://xml.apache.org/forrest/cap.html
 - create an xsl which transforms the custom file type to the
documentv11 DTD
 - add a new map:when case in the selector in the transform-to-document
resource, which checks the value of the sourcetype, and where you can
add a transformer that uses the xsl.


Note that all this has previously also been referred to as "content
aware pipelines", though with the current solution that name doesn't
really apply anymore.

As far as I can see, this patch should not break backwards
compatibility.

Since I have two forrest commiters at my disposal here, applying the
patch is not much of a problem, but I wanted to make sure that everybody
was aware of (and agrees with) these changes.

Regards,

Bruno

On Wed, 2002-11-27 at 14:03, Bruno Dumon wrote:
> Hi,
> 
> attached you'll find a patch for the forrest sitemap which introduces
> the use of the sourcetype action (aka CAP). It merges the howto-specific
> pipelines into the general html and pdf pipelines.
> 
> More specifically, here's what I've done:
> 
> - removed these matchers:
>    - body-**howto/*.xml
>    - community/howto/**.pdf
> - added a resource called 'transform-to-document' which uses the
> sourcetype action to do a x2document transformation as necessary.
> - changed the body-**/*.xml, body-**.xml and **.pdf pipelines to call
> the transform-to-document resource
> - and added of course the declaration of the sourcetype action, and also
> of the parameter selector (a standard cocoon selector)
> 
> Due to some errors in the sitemap-v05.rng grammar, the attached sitemap
> will only validate if that grammar is also patched. I sent the patch for
> this to cocoon-dev.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org


Mime
View raw message