cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: [RT] reconsidering pipeline semantics
Date Wed, 03 Jul 2002 08:18:37 GMT
Amir Rosen wrote:
> 
> > -----Original Message-----
> > From: Stefano Mazzocchi [mailto:stefano@apache.org]
> 
> >  - deprecate 'internal-only' attribute of 'map:pipeline'
> >    [because named pipelines become implicitly internal-only]
> 
> How can i reproduce the functionality of the given example without the 'internal-only'
> declaration ?

Let's see.

> The first pipeline is a cacheable pipeline that generates an XSLT stylesheets, used
> internally by other pipelines.
> 
>         <pipeline internal-only="true">
>          <match "generatedXSL/*">
>           ...
>          </match>
>         </pipeline>
> 
>         <pipeline>
>          <match "*">
>           ...
>           <transform src="cocoon:/generatedXSL/{...}"/>
>           ...
>          </match>
>         </pipeline>

Hmmm, good point.

One possible way of achieving this would be like this:

 <pipeline name="generatedXSLT">
  <match pattern="**">
   <generate src="{src}"/>
   ...
   <serialize ../>
  </match>
 </pipeline>

 <pipeline>
  <match pattern="**">
   ...
   <transform src="pipeline://generatedXSLT/{1}"/>
   ...
  </match>
 </pipeline>

It requires a different protocol that is composed like this

 pipeline://[named pipeline]/[path]

and the named pipeline is called with the path stripped (so that further
matching/selection and so on can be performed transparently).

Named pipelines are implicitly internal because they aren't connected to
the outside world.

Unnamed pipelines, on the other hand, are connected directly to the
Cocoon URI space.

Note that cocoon blocks might have sitemaps with named pipelines only,
so they don't expose their own URI space to Cocoon, but only internally,
to the other Cocoon Blocks.

In that case, the syntax might become something like this

[xslt-generating block prefixed with 'generateXSLT']

 <pipeline name="main">
  <match pattern="**">
   <generate src="{src}"/>
   ...
   <serialize ../>
  </match>
 </pipeline>

[your pipeline that uses that service]

 <pipeline>
  <match pattern="**">
   ...
   <transform src="pipeline://generatedXSLT:main/{1}"/>
   ...
  </match>
 </pipeline>

where the protocol now becomes

  pipeline://[block prefix]:[named pipeline]/[path]

in case of a normal pipeline call that might become

 <match pattern="*">
  <call block="generatedXSLT" pipeline="main">
   <parameter name="src" value="{1}"/>
  </call>
 </match>

where, if no '@block' attribute is specified, it falls back to the same
block (thus the same sitemap and all the parents [named pipelines should
be inherited by subsitemaps])

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message