TitleCannot nest [{ }] references
Date24-Feb-2005 00:07:50 EET
Bug criticalityEnhancementRequest
Browser versionFirefox 1.0
Bug statusClosedBug
PageProvider usedDefault
Servlet ContainerTomcat 5.5.7
Operating SystemWindows 2000
Java version1.5.0_01


I'd like to nest [{ }] references so that I can have


more body
}] #end plugin

Motivation I want a form that can create new wiki pages, and I want those wiki pages to have a predefined left menu.

I am using the InsertLeftMenuTag and the NewPageHandler, but I can't accomplish this because the NewPageHandler takes the template as a Plugin Body, and the InsertLeftMenuTag requires a [{SET leftmenu='...'}] line. So what I'd like to be able to write is this:

[{FormOutput form='newProjectForm' handler='com.mckessonaps.jspwiki.handler.newpage.NewPageHandler' 

[{SET leftmenu='ProjectLeftMenu'}]
!!!Project Description


Back to [Project List]


But the FormOutput tag is ended by the }] of the SET, and not by the matching }] after the end of the template.


I cannot find a workaround to allow me to create the pages with the SET reference from a wiki form, so I'm assuming it's not possible without the ability to nest plugin markup.

This is not a bug, it's actually a feature. Nested plugins may happen at a later stage (I can imagine several complicated scenarios which make things very nasty, so I'm not willing to take them in yet.)

However, you can use FormSet to set any arbitrary variables to the handler.

-- JanneJalkanen

Janne is right, that technique shoudl work just fine. Specifically your example should be doable as follows... (I think the plugins allow nesting of the single quotes so this should work.)


[{FormSet form='newProjectForm' setLeftMenu='[{SET leftmenu='ProjectLeftMenu'}]'}]

[{FormOutput form='newProjectForm' handler='com.mckessonaps.jspwiki.handler.newpage.NewPageHandler' 

!!!Project Description


Back to [Project List]


I tried this, but it doesn't work. Specifically, the first }] causes the parser to drop out of parsing, so there's no way to pass a string that has those two characters in it to setLeftMenu. I'd say that's a bug, even if nested plugins aren't.
I hacked around this to allow one level deep plugin nesting in the NewPageHandler. I really need to take sometime and release the McKessonApsPlugins for the 2.3 branch as they have quite a few tweaks to let out. but releaseing means that all the docs/text needs fixed up. Stand by, I'll get to it soon --JohnV

This should be fixed in 2.3.50 alpha.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-8) was last changed on 11-Dec-2005 22:37 by Janne Jalkanen