You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jeremy Quinn <je...@media.demon.co.uk> on 2002/02/21 14:48:01 UTC
Aggregating
Hi All,
Can anyone give me an example of aggregating with the DirectoryGenerator?
I know how to do it for assets that come from the FileGenerator but not
anything else.
Thanks for any help.
regards Jeremy
--
___________________________________________________________________
Jeremy Quinn Karma Divers
webSpace Design
HyperMedia Research Centre
<ma...@mac.com> <http://www.media.demon.co.uk>
<phone:+44.[0].20.7737.6831> <pa...@vizzavi.net>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: Aggregating
Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 11:49 am -0500 21/2/02, Vadim Gritsenko wrote:
>> From: Jeremy Quinn [mailto:jermq@media.demon.co.uk]
>ing
>>
>> Hi All,
>>
>> Can anyone give me an example of aggregating with the
>DirectoryGenerator?
>>
>> I know how to do it for assets that come from the FileGenerator but
>not
>> anything else.
>
>What's the difference?
Thanks
this is what I ended up doing:
<map:pipeline internal-only="true">
<map:match pattern="dir/**">
<map:generate type="directory" src="docs/{1}"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
<map:pipeline>
<map:match pattern="dir/**/">
<map:aggregate element="root" label="content">
<map:part src="cocoon:/dir/{1}"/>
<map:part src="editor/docs/editor.xml"/>
</map:aggregate>
<map:transform src="editor/stylesheets/editor-page2html.xsl">
<map:parameter name="target-dir" value="{1}/"/>
<map:parameter name="behaviour" value="dir"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
</map:pipeline>
It works ....
Thanks
regards Jeremy
--
___________________________________________________________________
Jeremy Quinn Karma Divers
webSpace Design
HyperMedia Research Centre
<ma...@mac.com> <http://www.media.demon.co.uk>
<phone:+44.[0].20.7737.6831> <pa...@vizzavi.net>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: Aggregating
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Jeremy Quinn [mailto:jermq@media.demon.co.uk]
ing
>
> Hi All,
>
> Can anyone give me an example of aggregating with the
DirectoryGenerator?
>
> I know how to do it for assets that come from the FileGenerator but
not
> anything else.
What's the difference?
<map:aggregate element="page" ns="http://foo.bar.com/myspace">
<!--
Aggregation is a very powerful concept that allows a document
be generated from several other documents. Strictly speaking,
all parts are just concatenated in this order to a new
document.
Several things to note here:
"cocoon:" is a pseudo protocol and refers to another
pipeline. "cocoon:/" refers to a pipeline from the current
sitemap while "cocoon://" refers to a pipeline from the root
sitemap.
Other pseudo protocols exist:
"context:" is another pseudo protocol, "context://" is
refering to a resource using the servlet context.
"resource:" is yet another pseudo protocol, "resource://" is
refering to a resource from the context classloader.
These pseudo protocols are declared in cocoon.xconf
Thus the parts refer to the pipeline fragments above.
The element attribute places the content in a new root element
named as specified, using the namespace provided by the ns
attribute.
Please see docs for further explanations.
-->
<map:part src="cocoon:/path/to/my/directory/" element="dir"
ns="http://foo.bar.com/xmlhack"/>
</map:aggregate>
Provided that directory "path/to/my/directory/" is created under cocoon
webapp, it should work.
(map:part will be processed by pipeline
<map:match pattern="**/">
<map:generate type="directory" src="{1}"/>
<map:transform src="stylesheets/system/directory2html.xsl"/>
<map:serialize/>
</map:match>
)
Vadim
> Thanks for any help.
>
> regards Jeremy
> --
> ___________________________________________________________________
>
> Jeremy Quinn Karma Divers
> webSpace Design
> HyperMedia Research Centre
>
> <ma...@mac.com>
<http://www.media.demon.co.uk>
> <phone:+44.[0].20.7737.6831> <pa...@vizzavi.net>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>