[2008-11-05 update:] updated the commentplugin, it works now with JSPWiki-2.8.0 and has a slightly different rendering of the comments. The comments are now displayed inline in the wikipage with yellow background and a red font.
new jar:
sources:
comment 1.1
-----------
There is a CommentPlugin on the JSPWiki page, however this is really functional (cant handle more than one word). So I quickly build my own version of a commentplugin.
Installation:
- put comment.jar in WEB-INF/lib in your JSPWiki root directory
- put comment.gif in images/ in your JSPWiki root directory (or any other picture you would like to use, just name it comment.gif)
- add de.d3web.we.jspwiki.comment to your jspwiki.plugin.searchPath variable in jspwiki.properties
- restart your container
usage:
[{Comment this is a comment}]
source:
package de.d3web.we.jspwiki.comment;
import java.util.Map;
import com.ecyrd.jspwiki.WikiContext;
import com.ecyrd.jspwiki.plugin.PluginException;
import com.ecyrd.jspwiki.plugin.WikiPlugin;
/**
* @author kazamatzuri
* Simple plugin for JSPWiki to allow comments in Pages
*
*/
public class Comment implements WikiPlugin{
/* (non-Javadoc)
* @see com.ecyrd.jspwiki.plugin.WikiPlugin#execute(com.ecyrd.jspwiki.WikiContext, java.util.Map)
*/
public String execute(WikiContext context, Map params)
throws PluginException {
final String COMMENT_ICON
= "<img src=\"images/comment.gif\" alt=\"COMMENT\" title=\"COMMENT\"/>";
if( !params.isEmpty()
&& params.values().iterator().next() != null )
{
return COMMENT_ICON.replaceAll("COMMENT",
(String)params.get("_cmdline") );
}
return "";
}
}