This page last changed on Dec 11, 2006 by david.soul@atlassian.com.
The complete list of objects available for use are:
Name |
Description |
Doc Reference |
$body |
The body of the macro (if the macro has a body) |
|
$param0-n |
The parameters passed to your macro (as available) |
|
$config |
The BootstrapManager object, useful for retrieving Confluence properties |
BootstrapManager |
$content |
The current ContentEntity object that this macro is a included in (if available) |
ContentEntityObject |
$space |
The Space object that this content object is located in (if relevant) |
Space |
$generalUtil |
A GeneralUtil object, with useful utility methods for URL encoding etc |
GeneralUtil |
$action |
A blank ConfluenceActionSupport object, useful for retrieving i18n text if needed |
ConfluenceActionSupport |
$webwork |
A VelocityWebWorkUtil object, for it's htmlEncode() method |
VelocityWebWorkUtil |
$req |
The current HttpServletRequest object (if the page is rendered as a result of an HTTP request) |
|
$res |
The corresponding HttpServletResponse object (not recommended to be played with) |
|
$userAccessor |
For retrieving users, groups and checking membership |
UserAccessor |
Actually, this totally depends on what Velocity file you're talking about. There are at least four different Velocity contexts that exist in Confluence:
- user macros (listed above)
- normal action results (*.vm)
- Sitemesh decorators in themes or custom layouts (*.vmd)
- notifications.
The best reference until someone has time to write about it is the code. Check out the ConfluenceVelocityContext class for the normal action context, and the ProfilingPageFilter for the decorator context, and PreRenderedMailNotificationQueueItem for the notification context.

Posted by mryall at Jan 16, 2007 21:01
|
Oops, it's actually VelocityRenderedQueueItem for the notification context. More information available in the Confluence rendering pipeline document.

Posted by mryall at Jan 16, 2007 22:45
|
|