Confluence 2.8 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
When writing a macro plugin, it's a common requirement to render a Velocity file included with your plugin. The Velocity file should be rendered with some data provided by your plugin.
The easiest way to render Velocity templates from within a macro is to use VelocityUtils.getRenderedTemplate and simply return the result as the macro output. You can use it like this:
public String execute(Map params, String body, RenderContext renderContext) throws MacroException {
// do something with params ...
Map context = MacroUtils.defaultVelocityContext();
context.put("page", page);
context.put("labels", labels);
return VelocityUtils.getRenderedTemplate("com/atlassian/confluence/example/sample-velocity.vm", context);
}
参考資料
概要
コンテンツ ツール
アプリ
