cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [Ann/RFC] Virtual Sitemap Components
Date Mon, 11 Apr 2005 12:41:29 GMT
Daniel Fagerstrom wrote:

> I have continued Vadim's and Sylvain's work and added a first, 
> hopefully working version of virtual sitemap components (VPCs) to the 
> trunk.

Good job!

> Use
> ===
> To use VPCs one define them in the components section in the sitemap, 
> e.g.:
>   <map:components>
>     <map:readers>
>       <map:reader name="virtual1" 
> src="org.apache.cocoon.reading.VirtualPipelineReader">
>         <map:generate type="file" src="vpc-test.xml"/>
>         <map:serialize type="xml"/>
>       </map:reader>
>     </map:readers>
>     <map:transformers default="xslt">
>       <map:transformer name="virtual2" 
> src="org.apache.cocoon.transformation.VirtualPipelineTransformer">
>         <map:source param="src2"/>
>         <map:transform src="vpc-include.xsl">
>            <map:parameter name="file" value="{src}"/>
>         </map:transform>
>         <map:transform src="vpc-include.xsl">
>            <map:parameter name="file" value="{src2}"/>
>         </map:transform>
>       </map:transformer>
>     </map:transformers>
>   </map:components>

It seems weird to me to see sitemap statements in the <map:components> 
section. But they're also used as any other component. Hmm...

What about either:
- leave them in <map:components> but with special element names, e.g. 
<map:virtual-generator> that maps to the VirtualPipelineGenerator class
- or separate them in a <map:virtual-components> section just as we have 
today <map:resources> and <map:views>?

I would favor the second solution, even if this doesn't seem to be 
absolutely necessary for the implementation.

> then they can be used as any component:
>   <map:read type="virtual1"/>
>   <map:transform type="virtual2" src="vpc-test.xml">
>     <map:parameter name="src2" value="vpc-test2.xml"/>
>   </map:transform>
> in the sitemap where they are defined and in all its subsitemaps.
> One of the complicated things with VPCs was how and where to resolve 
> sources that are given to VPCs. I followed Sylvain's aproach in 
> modified with my ideas 
> ( 
> about how to increase the level of isolation between the caller and 
> the callee. This will be needed when we use them from "real" blocks.
> To use a source as a parameter one have to declare it with
>   <map:source param="src2"/>
> in the definition. The "src" is always supposed to be a source. 
> Sources are alwas resolved in the calling sitemap.
>                 --- o0o ---
> More examples of use can be found in the sitemaps for the test cases 
> in 
> src/test/org/apache/cocoon/[generation|transformation|serialization|reading]. 
> I didn't research old mails about VPCs about what things are supposed 
> to be called. So suggestions about better names and syntax are welcome.

Looks good so far except the location of VPCs definition (see above).

> VPCs are not cacheable yet. Its probably not that hard to add caching, 
> but it requires that we extend the ProcessingPipeline interface with 
> some methods that are needed for VPCs. It also requires that we find 
> some syntax for declaring what pipeline type that should be used for a 
> specific VPC.

Why do we have to choose a particular pipeline type? Isn't this defined 
by the <map:pipeline type=""> surrounding the call to the VPC?

> Implementation


Sorry, not much time to dig into the implementation for now, but I will :-)


Sylvain Wallez                        Anyware Technologies  
Apache Software Foundation Member     Research & Technology Director

View raw message