You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <va...@reverycodes.com> on 2004/11/16 22:14:16 UTC
Implementing Virtual Pipeline Components
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
Re: Implementing Virtual Pipeline Components
Posted by Sylvain Wallez <sy...@apache.org>.
Vadim Gritsenko wrote:
> 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.
<snip/>
> 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 :)
Hehe, I spent the evening writing a long RT that we now have to turn
into concrete code :-)
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }