cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Implementing Virtual Pipeline Components
Date Tue, 16 Nov 2004 21:14:16 GMT
Hey guys,

Thanks to help of Sylvain :) I'd like to present this horrible hack which shows 
how VPC can be implemented, in particular example of Virtual Pipeline Generator. 
VPC generator is defined in the sitemap as:

   <!--
     - Virtual Pipeline Generator: Composed of other pipeline components.
     -->
   <map:generator name="virtual"
                  src="org.apache.cocoon.generation.VirtualPipelineGenerator">
     <map:generate src="welcome.xml"/>
     <map:transform src="welcome.xslt">
       <map:parameter name="contextPath" value="{request:contextPath}"/>
     </map:transform>
   </map:generator>

Later on, VPC generator can be used from any sub sitemap (as is the case with 
regular sitemap components) like this:

   <map:match pattern="x">
     <map:generate type="virtual"/>
     <map:serialize type="xhtml"/>
   </map:match>

All sources used in the definition of VPC generator will be resolved relative to 
the parent sitemap. All sources mentioned in the src attribute will be resolved 
relative to caller sitemap (example: <map:generate type="virtual" 
src="relative.xml"/>).

To see VPC generator in action, apply attached patch to the trunk and go to:
   http://localhost:8888/
   http://localhost:8888/samples/x


Now, there are several things which should be resolved to have proper implementaion:

   1. Figure out proper way of switching environment.
   2. Figure out how ComponentsNodeBuilder can access SitemapLanguage's
      manager's avalon sub-context.
   3. Implement caching
   4. Implement parameter passing & resolving
   5. Refactor classes implementing ProcessingPipeline


Help is welcome :)

Vadim

Mime
View raw message