This page (revision-12) was last changed on 01-May-2024 14:17 by Juan Pablo 

This page was created on 19-Jan-2014 07:46 by Ichiro Furusato

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Version Date Modified Size Author Changes ... Change note
12 01-May-2024 14:17 2 KB Juan Pablo to previous
11 29-Mar-2024 09:12 2 KB Juan Pablo to previous | to last JSPWikiPluginBcc195432.431-43331.431.4ec88.19809.2Bxss.meEsiInclude src=HttpBxss.meRpb.png ==> JSPWikiPlugin
10 29-Mar-2024 05:26 2 KB fHLvlxbf to previous | to last JSPWikiPluginBcc195432.431-43331.431.4ec88.19809.2Bxss.me ==> JSPWikiPluginBcc195432.431-43331.431.4ec88.19809.2Bxss.meEsiInclude src=HttpBxss.meRpb.png
9 27-Mar-2024 03:35 2 KB fHLvlxbf to previous | to last JSPWikiPlugin ==> JSPWikiPluginBcc195432.431-43331.431.4ec88.19809.2Bxss.me
8 02-Apr-2019 19:19 2 KB Juan Pablo to previous | to last StringBuffer -> StringBuilder
7 31-Mar-2016 22:30 2 KB Victor Fedorov to previous | to last The section Plugins is isolated in documentation.
6 19-Jan-2014 21:08 2 KB Ichiro Furusato to previous | to last added sample code
5 19-Jan-2014 09:51 1 KB Ichiro Furusato to previous | to last extracted from javadocs
4 19-Jan-2014 09:48 1 KB Ichiro Furusato to previous | to last extracted from javadocs
3 19-Jan-2014 09:44 1 KB Ichiro Furusato to previous | to last Org.apache.wiki.api.plugin.WikiPlugin ==> WikiPlugin
2 19-Jan-2014 09:44 1 KB Ichiro Furusato to previous | to last extracted from javadocs
1 19-Jan-2014 07:46 1 KB Ichiro Furusato to last initial content extracted from javadocs

Difference between version and

At line 31 added 41 lines
!! Example
Following is an example of a simple "Hello World" plugin. This returns an HTML {{<div>}} element
containing the content of the {{text}} parameter, or "Hello World!" if it is absent.
{{{
public class HelloWorld implements WikiPlugin
{
public String execute( WikiContext context, Map<String,String> params )
throws PluginException
{
StringBuffer out = new StringBuffer();
try {
out.append( "<div class=\"helloworld\">\n" );
String text = (String)params.get("text");
if ( text == null ) {
out.append("Hello, World!");
} else {
out.append( text );
}
out.append( "</div>" );
} catch ( Exception e ) {
out.append( "<div class=\"error\">\n" );
out.append( e.getClass().getName()
+ " thrown by HelloWorld plugin: " + e.getMessage() );
out.append( "</div>\n" );
}
return out.toString();
}
}
}}}
Once [installed|InstallingPlugins], this plugin would be invoked via the following [WikiMarkup]:
{{{
[{HelloWorld text='Good morning.'}]
}}}