You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by Harry Metske <ha...@gmail.com> on 2010/02/21 19:21:43 UTC

unit tests and pagenames (wikispace)

Hi,

I had a look at some failing unit tests for the Plugins.
A lot of tests fail because we now get pages with the wikispace prepended,
so instead of MyNicePage , we now get main:MyNicePage or Main:MyNicePage.
(These page names also show up when running JSPWiki.)

Maybe a stupid question, but is it intended to expose these pagenames to
humans in JSPWiki 3 ?
Or, should I fix the plugintest class or the plugin class itself ?

regards,
Harry

Re: unit tests and pagenames (wikispace)

Posted by Janne Jalkanen <ja...@ecyrd.com>.
Yup, PageNameTag and others should clean away the Wiki space name before outputting.  This may be gnarly if someone has been using ${page.name} in their templates... 

/Janne

On 21 Feb 2010, at 21:13, Andrew Jaquith wrote:

> Thanks for looking into the failing tests, Harry!
> 
> My $0.02:
> 
> The plugin tests should probably be fixed to test for the Main: space -- for internal data structure testing.
> 
> However, users should not see the Main: space in any output, for example in plugin output. That includes page name tags, etc too. We want the capability to be there under the covers but not exposed to end users until 3.1.
> 
> That's just a guess on how to handle it, though. Janne?
> 
> Andrew
> 
> 
> 
> On Feb 21, 2010, at 10:21, Harry Metske <ha...@gmail.com> wrote:
> 
>> Hi,
>> 
>> I had a look at some failing unit tests for the Plugins.
>> A lot of tests fail because we now get pages with the wikispace prepended,
>> so instead of MyNicePage , we now get main:MyNicePage or Main:MyNicePage.
>> (These page names also show up when running JSPWiki.)
>> 
>> Maybe a stupid question, but is it intended to expose these pagenames to
>> humans in JSPWiki 3 ?
>> Or, should I fix the plugintest class or the plugin class itself ?
>> 
>> regards,
>> Harry


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.
> 


Wiki plugin call from inside a Wiki link

Posted by "Schenk, Andre" <An...@FIZ-Karlsruhe.DE>.
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: unit tests and pagenames (wikispace)

Posted by Andrew Jaquith <an...@gmail.com>.
Thanks for looking into the failing tests, Harry!

My $0.02:

The plugin tests should probably be fixed to test for the Main: space  
-- for internal data structure testing.

However, users should not see the Main: space in any output, for  
example in plugin output. That includes page name tags, etc too. We  
want the capability to be there under the covers but not exposed to  
end users until 3.1.

That's just a guess on how to handle it, though. Janne?

Andrew



On Feb 21, 2010, at 10:21, Harry Metske <ha...@gmail.com> wrote:

> Hi,
>
> I had a look at some failing unit tests for the Plugins.
> A lot of tests fail because we now get pages with the wikispace  
> prepended,
> so instead of MyNicePage , we now get main:MyNicePage or  
> Main:MyNicePage.
> (These page names also show up when running JSPWiki.)
>
> Maybe a stupid question, but is it intended to expose these  
> pagenames to
> humans in JSPWiki 3 ?
> Or, should I fix the plugintest class or the plugin class itself ?
>
> regards,
> Harry