You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by "Schenk, Andre" <An...@FIZ-Karlsruhe.DE> on 2010/02/22 16:01:32 UTC

Wiki plugin call from inside a Wiki link

Dear all,

I'd like to write a JSPWiki plugin that is able to resolve some kind of an identifier into a Wiki page:

[{eSciDocResourceIdResolver id='escidoc:7002'}]

which results in

[Startpage]

But unfortunately it isn't displayed as a Wiki link. I guess the Wiki markup is resolved before the plugin is called. Is there another way to do this? Probably a page filter could handle it, but then I had to parse every page for some special term.

Thank you for your help!

Best regards,

André





-------------------------------------------------------

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische Information mbH. 
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 101892. 
Geschäftsführerin: Sabine Brünger-Weilandt. 
Vorsitzender des Aufsichtsrats: MinR Hermann Riehl.


RE: Wiki plugin call from inside a Wiki link

Posted by "Schenk, Andre" <An...@FIZ-Karlsruhe.DE>.
Hi Janne,

> Plugins always return XHTML.  However, you can fairly easily turn
> WikiMarkup into XHTML by using RenderingManager yourself.

Works very well, thanks a lot!

Best regards,

André


-------------------------------------------------------

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische Information mbH. 
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 101892. 
Geschäftsführerin: Sabine Brünger-Weilandt. 
Vorsitzender des Aufsichtsrats: MinR Hermann Riehl.



Re: Wiki plugin call from inside a Wiki link

Posted by Janne Jalkanen <ja...@ecyrd.com>.
Plugins always return XHTML.  However, you can fairly easily turn WikiMarkup into XHTML by using RenderingManager yourself.

	RenderingManager mgr = engine.getRenderingManager();
        MarkupParser parser = mgr.getParser( context, pagedata );
        WikiDocument doc = parser.parse();

         String html = mgr.getRenderer(context,doc).getString();

This has certain performance implications, but you can e.g. cache the WikiDocument yourself (since parsing is slow; rendering is fast).

/Janne

On 22 Feb 2010, at 17:01, Schenk, Andre wrote:

> Dear all,
> 
> I'd like to write a JSPWiki plugin that is able to resolve some kind of an identifier into a Wiki page:
> 
> [{eSciDocResourceIdResolver id='escidoc:7002'}]
> 
> which results in
> 
> [Startpage]
> 
> But unfortunately it isn't displayed as a Wiki link. I guess the Wiki markup is resolved before the plugin is called. Is there another way to do this? Probably a page filter could handle it, but then I had to parse every page for some special term.
> 
> Thank you for your help!
> 
> Best regards,
> 
> André
> 
> 
> 
> 
> 
> -------------------------------------------------------
> 
> Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische Information mbH. 
> Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 101892. 
> Geschäftsführerin: Sabine Brünger-Weilandt. 
> Vorsitzender des Aufsichtsrats: MinR Hermann Riehl.
>