cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier Lange" <ola...@petit-atelier.ch>
Subject Linkrewriter dynamic configuration overloading syntax pitfall (Javadoc out of sync, Cocoon 2.1M1)
Date Sun, 11 May 2003 04:10:27 GMT
Dear all

I had a hard time figuring out how to dynamically overload the configuration
of the input modules used for the LinkRewriter configuration. I believe
there is a syntax pitfall in the Javadoc of Cocoon 2.1M1, the Javadoc being
out of sync on this topic.

I discovered the Linkrewriter in Forrest 0.4, studied its configuration,
then followed the Javadoc and overlooked the sitemap configuration of the
bookdemo and sitedemo samples of Cocoon 2.1M1. Here is a summary.

The Javadoc notes that the "dynamic config syntax [is] different to the
static config syntax (attributes used instead of elements)"
(LinkRewriterTransformer.java, lines 114-116). So one is suggested to write:

<map:sitemap>
  <map:components>
    <map:transformers>
      <map:transformer name="linkrewriter"
        src="org.apache.cocoon.transformation.LinkRewriterTransformer">
        ...
        <input-module name="linkmap" src="{src}" ... />
        ...                          ^^^ attribute: does not work
      </map:transformer>

I tried, but this didn't work. The linkwriter would not use the sitemap's
substitued value of the 'src' attribute to get the "Linkmap", it rather used
the value of the static configuration defined in the cocoon.xconf file:

  <component-instance name="linkmap" ...>
    ...
    <file src="cocoon://linkmap"/>
    ...
  </component-instance>

To dynamically overload the cocoon.xconf's static configuration, one has to
write:

  <map:transformer name="linkrewriter" src="..."
    ...
    <input-module name="linkmap" ... >
      <file src="{src}"/>
    </input-module>
    ...
  </map:transformer>

There is actually no difference to the static configuration syntax. The
samples use this later syntax and work fine.

Olivier





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


Mime
View raw message