You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Danny Bols <db...@osirion.be> on 2003/11/19 08:12:47 UTC

LinkRewriter transformer

Hello,

I want to use a similar linkrewriting approach as in Forrest (but much
simlper) and I ran into 2 problems:

1. My documents are not in the default namespace and the LinkRewriter only
acts upon the default namespace. Is there any chance the namespace for the
LinkRewriter will be configurable?

2. In my case I only want to replace the pseudo protocol of a link by a
string based on the current context in the sitemap. The problem is that the
LinkRewriter expects an input module for the replacement. Looking in the
input modules I couldn't find such a simple module. Any suggestions or
ideas?

---

Danny

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


RE: LinkRewriter transformer

Posted by Danny Bols <db...@osirion.be>.
> -----Original Message-----
> From: Joerg Heinicke [mailto:jheinicke@virbus.de]
> Sent: donderdag 20 november 2003 9:25
> To: users@cocoon.apache.org
> Subject: Re: LinkRewriter transformer
>
>
> On 19.11.2003 08:12, Danny Bols wrote:
> > Hello,
> >
> > I want to use a similar linkrewriting approach as in Forrest (but much
> > simlper) and I ran into 2 problems:
> >
> > 1. My documents are not in the default namespace and the
> LinkRewriter only
> > acts upon the default namespace. Is there any chance the
> namespace for the
> > LinkRewriter will be configurable?
>
> No, not at the moment. But you can add an XSLT to the pipeline before
> doing the link rewriting.
>
> > 2. In my case I only want to replace the pseudo protocol of a link by a
> > string based on the current context in the sitemap. The problem
> is that the
> > LinkRewriter expects an input module for the replacement. Looking in the
> > input modules I couldn't find such a simple module. Any suggestions or
> > ideas?
>
> But if the link rewriter handles the complicate case, why it shouldn't
> handle the simple case? I guess it's a question of configuration.
>
> OTOH you can do this by doing it the same way as in the Cocoon samples:
>
> <map:transform src="simple-samples2html.xsl">
>    <map:parameter name="contextPath" value="{request:contextPath}"/>
> </map:transform>
>
> The stylesheet accepts this parameter and adds it to every link.

Thanks for the tip....a much easier solution which would also work in my
case.

--
Danny


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


Re: LinkRewriter transformer

Posted by Joerg Heinicke <jh...@virbus.de>.
On 19.11.2003 08:12, Danny Bols wrote:
> Hello,
> 
> I want to use a similar linkrewriting approach as in Forrest (but much
> simlper) and I ran into 2 problems:
> 
> 1. My documents are not in the default namespace and the LinkRewriter only
> acts upon the default namespace. Is there any chance the namespace for the
> LinkRewriter will be configurable?

No, not at the moment. But you can add an XSLT to the pipeline before 
doing the link rewriting.

> 2. In my case I only want to replace the pseudo protocol of a link by a
> string based on the current context in the sitemap. The problem is that the
> LinkRewriter expects an input module for the replacement. Looking in the
> input modules I couldn't find such a simple module. Any suggestions or
> ideas?

But if the link rewriter handles the complicate case, why it shouldn't 
handle the simple case? I guess it's a question of configuration.

OTOH you can do this by doing it the same way as in the Cocoon samples:

<map:transform src="simple-samples2html.xsl">
   <map:parameter name="contextPath" value="{request:contextPath}"/>
</map:transform>

The stylesheet accepts this parameter and adds it to every link.

Joerg


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