You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Bruno Dumon <br...@outerthought.org> on 2002/11/27 14:03:06 UTC

[patch] introduce use of sourcetype action in sitemap

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.

Regards,

Bruno

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

Re: [patch] introduce use of sourcetype action in sitemap

Posted by Jeff Turner <je...@apache.org>.
On Thu, Nov 28, 2002 at 01:25:52PM +0100, Bruno Dumon wrote:
> Since  I didn't get any feedback on this patch, I thought it might be
> useful to clarify it a bit more.

Sorry, I didn't have time to look so didn't comment, but +1000 on someone
committing this.  It sounds marvellous.

--Jeff

Re: [patch] introduce use of sourcetype action in sitemap

Posted by Steven Noels <st...@outerthought.org>.
Nicola Ken Barozzi wrote:

> It should not affects the discussion we've had about having a single dir 
> for content versus several ones, because all these files are xml anyway.

Yes, and even though they are all in the same directory (shudder ;-), we 
still can differentiate processing based on their individual grammars.

Oh BTW - thanks to Bruno for actually implementing this - it has been 
one of my pet peeves for a _long_ time (longer than Forrest exists).

> Please, "forrest commiters at his disposal here", apply that patch, +1 
> from me.

I'll be the humble servant, then. Let me see where my toothbrush is :-)

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at              http://radio.weblogs.com/0103539/
stevenn at outerthought.org                stevenn at apache.org


Re: [patch] introduce use of sourcetype action in sitemap

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Bruno Dumon wrote:
> Since  I didn't get any feedback on this patch, I thought it might be
> useful to clarify it a bit more.

Usually no news is good news, but I appreciate you ask for opinions.

[...]

> 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.

I'm aware, and it's something I really like.

It should not affects the discussion we've had about having a single dir 
for content versus several ones, because all these files are xml anyway.

Please, "forrest commiters at his disposal here", apply that patch, +1 
from me.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: [patch] introduce use of sourcetype action in sitemap

Posted by Bruno Dumon <br...@outerthought.org>.
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