You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Olivier Lange <ol...@petit-atelier.ch> on 2003/05/11 06:10:27 UTC
Linkrewriter dynamic configuration overloading syntax pitfall (Javadoc out of sync, Cocoon 2.1M1)
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
Re: Linkrewriter dynamic configuration overloading syntax pitfall (Javadoc out of sync, Cocoon 2.1M1)
Posted by Jeff Turner <je...@apache.org>.
On Sun, May 11, 2003 at 06:10:27AM +0200, Olivier Lange wrote:
> 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.
Thanks for the reminder, I've just fixed the javadocs. I'm now trying to
fix the swallow-all-errors behaviour that makes syntax errors like this
so hard to track down.
--Jeff
...
> 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
Re: dynamic xsp compiled only once
Posted by Alexandre Victoor <al...@fr.adp.com>.
>
>Minor correction: sample which should compile XSP just once is
>http://localhost:8888/samples/sources/xsp-cocoon. xsp-dynamic should get
>compiled on every request.
>
>Vadim
Thanks for your help
Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: dynamic xsp compiled only once
Posted by Vadim Gritsenko <va...@verizon.net>.
Alexandre Victoor wrote:
>
>>
>>
>> Minor correction: sample which should compile XSP just once is
>> http://localhost:8888/samples/sources/xsp-cocoon. xsp-dynamic should
>> get compiled on every request.
>>
>> Vadim
>>
>
> Hi again
> I have tried the example and it gets recompiled at each request :( I
> have tried with cocoon-2.0.4 and cocoon-latest.
> Is there an older version of cocoon working better ?
Works ok with 2.0.5-dev, I just verified it. Does not work with 2.1m1 -
as I said, there is some bug there. Don't know about 2.0.4, but it
supposed to be working there too.
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: dynamic xsp compiled only once
Posted by Alexandre Victoor <al...@fr.adp.com>.
>
>
>Minor correction: sample which should compile XSP just once is
>http://localhost:8888/samples/sources/xsp-cocoon. xsp-dynamic should get
>compiled on every request.
>
>Vadim
>
Hi again
I have tried the example and it gets recompiled at each request :( I have
tried with cocoon-2.0.4 and cocoon-latest.
Is there an older version of cocoon working better ?
Thanks
Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: dynamic xsp compiled only once
Posted by Vadim Gritsenko <va...@verizon.net>.
Vadim Gritsenko wrote:
> Alexandre Victoor wrote:
>
>> Hello,
>> I need to use XSPs resulting from an XSL transformation. In my
>> company, instead of using directly XSP, we use a proprietary language
>> that we call 'aml'.
>>
>> AML --> XSL --> XSP --> XSL --> HTML
>>
>> In the sitemap, I have something like that :
>>
>> <map:match pattern="*.xsp">
>> <map:generate src="{1}.aml"/>
>> <map:transform src="aml2xsp.xsl"/>
>> <map:serialize type="xml"/>
>> </map:match>
>> <map:match pattern="*.html">
>> <map:generate src="cocoon:/{1}.xsp" type="serverpages"/>
>> <map:transform src="xsp2html.xsl"/>
>> <map:serialize type="html"/>
>> </map:match>
>>
>> For performances issues, I would cocoon to compile once for all the
>> XSPs. Is it possible or do I need to write my own 'aml' generator ?
>
>
>
> Yes, it is (was) possible. Unfortunately, right now cocoon protocol
> suffers from some bug so it recompiles every time. See similar sample
> at: http://localhost:8888/samples/sources/xsp-dynamic
Minor correction: sample which should compile XSP just once is
http://localhost:8888/samples/sources/xsp-cocoon. xsp-dynamic should get
compiled on every request.
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: dynamic xsp compiled only once
Posted by Vadim Gritsenko <va...@verizon.net>.
Alexandre Victoor wrote:
> Hello,
> I need to use XSPs resulting from an XSL transformation. In my
> company, instead of using directly XSP, we use a proprietary language
> that we call 'aml'.
>
> AML --> XSL --> XSP --> XSL --> HTML
>
> In the sitemap, I have something like that :
>
> <map:match pattern="*.xsp">
> <map:generate src="{1}.aml"/>
> <map:transform src="aml2xsp.xsl"/>
> <map:serialize type="xml"/>
> </map:match>
> <map:match pattern="*.html">
> <map:generate src="cocoon:/{1}.xsp" type="serverpages"/>
> <map:transform src="xsp2html.xsl"/>
> <map:serialize type="html"/>
> </map:match>
>
> For performances issues, I would cocoon to compile once for all the
> XSPs. Is it possible or do I need to write my own 'aml' generator ?
Yes, it is (was) possible. Unfortunately, right now cocoon protocol
suffers from some bug so it recompiles every time. See similar sample
at: http://localhost:8888/samples/sources/xsp-dynamic
PS This was working ok in 2.0.4
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
dynamic xsp compiled only once
Posted by Alexandre Victoor <al...@fr.adp.com>.
Hello,
I need to use XSPs resulting from an XSL transformation. In my company,
instead of using directly XSP, we use a proprietary language that we call
'aml'.
AML --> XSL --> XSP --> XSL --> HTML
In the sitemap, I have something like that :
<map:match pattern="*.xsp">
<map:generate src="{1}.aml"/>
<map:transform src="aml2xsp.xsl"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="*.html">
<map:generate src="cocoon:/{1}.xsp" type="serverpages"/>
<map:transform src="xsp2html.xsl"/>
<map:serialize type="html"/>
</map:match>
For performances issues, I would cocoon to compile once for all the XSPs.
Is it possible or do I need to write my own 'aml' generator ?
Thanks in advance for your help.
Regards
Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: Linkrewriter dynamic configuration overloading syntax pitfall (Javadoc out of sync, Cocoon 2.1M1)
Posted by Jeff Turner <je...@apache.org>.
On Mon, May 12, 2003 at 04:49:07PM +0100, Simon Collins wrote:
> Hi Olivier,
>
> Is Cocoon 2.1M1 the version that comes with Forrest 0.4? I couldn't
> figure that out.
No, Forrest uses an earlier version (11 March). Problems with the new
command-line code in M1 are delaying an upgrade.
...
> Cheers,
> Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: Linkrewriter dynamic configuration overloading syntax pitfall (Javadoc out of sync, Cocoon 2.1M1)
Posted by Simon Collins <sc...@fastmail.fm>.
Oops, sorry the closed Cocoon bug I referred to is actually at:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16248
On Mon, 12 May 2003 16:49:07 +0100, "Simon Collins"
<sc...@fastmail.fm> said:
> Hi Olivier,
>
> Is Cocoon 2.1M1 the version that comes with Forrest 0.4? I couldn't
> figure that out. I'm using the binaries from 0.4 and had a similar
> problem. Any changes I make to the link map don't take affect until I
> reload the servlet context. I tried your suggested config changes but
> they didnt seem to fix it.
>
> I noticed that Forrest has an open bug logged to do with this caching
> issue:
> http://issues.cocoondev.org/jira//ViewIssue.jspa?key=FOR-27
>
> which refers to a caching bug in Cocoon that is now fixed:
> http://issues.cocoondev.org/jira//ViewIssue.jspa?key=FOR-27
>
> I thought that this was what was causing my problems, but if you dont
> have any problems after changing your config then maybe it's something
> else I'm doing wrong. Did you also get this working with Forrest 0.4
> binaries or just separately with Cocoon 2.1M1 ?
>
> Cheers,
> Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
RE: Linkrewriter dynamic configuration overloading syntax pitfall (Javadoc out of sync, Cocoon 2.1M1)
Posted by Olivier Lange <wi...@petit-atelier.ch>.
Simon,
I do apologize for not having answered earlier, I overlooked your e-mail.
> Is Cocoon 2.1M1 the version that comes with Forrest 0.4? I couldn't
> figure that out. [...]
It is not, as Jeff mentionned earlier
(http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=105282491203216&w=2).
But ...
> [...] I'm using the binaries from 0.4 and had a similar problem.
> Any changes I make to the link map don't take affect until I reload
> the servlet context. I tried your suggested config changes but
> they didnt seem to fix it.
... I also experienced the problem you describe with Cocoon 2.1M1: the
linkmap does not reload when you change it and when Cocoon is running.
Neverthless, I believe it has nothing to do with the configuration hint I
mentionned.
About this: I found that you can also clear the cache to force the reloading
of the linkmap, which achieves the same as and is somehow faster than
restarting the webapp context. You can do this with the following sitemap
entries (available in the defaut sitemap.xmap of Cocoon 2.1):
<map:components>
<map:actions>
<map:action name="clear-cache" logger="sitemap.action.clear-cache"
src="org.apache.cocoon.acting.ClearCacheAction"/>
</map:actions>
</map:components>
<map:pipeline>
...
<map:match pattern="clear-cache.html">
<map:act type="clear-cache">
<map:generate src="status" type="status"/>
<map:transform src="context://stylesheets/system/status2html.xslt">
<map:parameter name="contextPath" value="{request:contextPath}"/>
</map:transform>
<map:serialize/>
</map:act>
</map:match>
...
</map:pipeline>
(assuming you have kept the default Cocoon «system» stylesheets)
Olivier
-----Message d'origine-----
De : Simon Collins [mailto:scollins@fastmail.fm]
Envoyé : lundi, 12. mai 2003 17:49
À : cocoon-users@xml.apache.org
Objet : Re: Linkrewriter dynamic configuration overloading syntax
pitfall (Javadoc out of sync, Cocoon 2.1M1)
Hi Olivier,
Is Cocoon 2.1M1 the version that comes with Forrest 0.4? I couldn't
figure that out. I'm using the binaries from 0.4 and had a similar
problem. Any changes I make to the link map don't take affect until I
reload the servlet context. I tried your suggested config changes but
they didnt seem to fix it.
I noticed that Forrest has an open bug logged to do with this caching
issue:
http://issues.cocoondev.org/jira//ViewIssue.jspa?key=FOR-27
which refers to a caching bug in Cocoon that is now fixed:
http://issues.cocoondev.org/jira//ViewIssue.jspa?key=FOR-27
I thought that this was what was causing my problems, but if you dont
have any problems after changing your config then maybe it's something
else I'm doing wrong. Did you also get this working with Forrest 0.4
binaries or just separately with Cocoon 2.1M1 ?
Cheers,
Simon
On Sun, 11 May 2003 06:10:27 +0200, "Olivier Lange"
<ol...@petit-atelier.ch> said:
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: Linkrewriter dynamic configuration overloading syntax pitfall (Javadoc out of sync, Cocoon 2.1M1)
Posted by Simon Collins <sc...@fastmail.fm>.
Hi Olivier,
Is Cocoon 2.1M1 the version that comes with Forrest 0.4? I couldn't
figure that out. I'm using the binaries from 0.4 and had a similar
problem. Any changes I make to the link map don't take affect until I
reload the servlet context. I tried your suggested config changes but
they didnt seem to fix it.
I noticed that Forrest has an open bug logged to do with this caching
issue:
http://issues.cocoondev.org/jira//ViewIssue.jspa?key=FOR-27
which refers to a caching bug in Cocoon that is now fixed:
http://issues.cocoondev.org/jira//ViewIssue.jspa?key=FOR-27
I thought that this was what was causing my problems, but if you dont
have any problems after changing your config then maybe it's something
else I'm doing wrong. Did you also get this working with Forrest 0.4
binaries or just separately with Cocoon 2.1M1 ?
Cheers,
Simon
On Sun, 11 May 2003 06:10:27 +0200, "Olivier Lange"
<ol...@petit-atelier.ch> said:
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
LinkRewriter transformer namespace configuration (Cocoon 2.1M1)
Posted by Olivier Lange <wi...@petit-atelier.ch>.
Still about the LinkRewriter's configuration, as of Cocoon 2.1M1, there is
another hint perhaps worth mentionning here: it is possible to change the
namespace of the elements handled by the LinkRewriter transformer by
defining a "namespaceURI" parameter to the transformer in the sitemap.
This might seem obvious... indeed, this parameter is available to all
transformer, as it is defined in the AbstractSAXTransformer abstract class,
base of all transformers. But I didn't see it at first, until Jeff Turner
refered me to the AbstractSAXTransformer source code.
Thus, if one wants the LinkRewriter to handle elements from the XHTML
namespace, one would write:
<map:transform type="linkrewriter" src="cocoon:/{1}/linkmap.abs.xml">
<!-- Changing Linkrewriter's processed namespace -->
<map:parameter name="namespaceURI"
value="http://www.w3.org/1999/xhtml"/>
<!-- Other LinkRewriter parameters -->
<map:parameter name="link-attrs" value="href src onmouseover
onmouseout"/>
<map:parameter name="schemes" value="phga external"/>
<map:parameter name="exclude-schemes" value="http https ftp mailto
news"/>
<map:parameter name="bad-link-str" value="bad-link"/>
</map:transform>
If not already done, may I suggest adding a comment to the Javadoc for this
hint? Thanks!
Olivier
-----Message d'origine-----
De : Olivier Lange [mailto:olange@petit-atelier.ch]
Envoyé : dimanche, 11. mai 2003 06:10
À : cocoon-users@xml.apache.org; jefft@apache.org
Objet : Linkrewriter dynamic configuration overloading syntax pitfall
(Javadoc out of sync, Cocoon 2.1M1)
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