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) |
|
| $param<name> |
Named 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 its htmlEncode() method |
VelocityWebWorkUtil |
| $req |
The current HttpServletRequest object (if the page is rendered as a result of an HTTP request) |
HttpServletRequest |
| $res |
The corresponding HttpServletResponse object (not recommended to be played with) |
HttpServletResponse |
| $userAccessor |
For retrieving users, groups and checking membership |
UserAccessor |
Comments (13)
Jan 16, 2007
Matt Ryall (Atlassian) says:
Actually, this totally depends on what Velocity file you're talking about. There...Actually, this totally depends on what Velocity file you're talking about. There are at least four different Velocity contexts that exist in Confluence:
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.
Jan 16, 2007
Matt Ryall (Atlassian) says:
Oops, it's actually VelocityRenderedQueueItem for the notification context. More...Oops, it's actually VelocityRenderedQueueItem for the notification context. More information available in the [Confluence rendering pipeline] document.
Oct 23, 2007
Giles Lewis says:
Is there any way to get a PageManager object from within a user macro?Is there any way to get a PageManager object from within a user macro?
Oct 29, 2007
Mei Yan Chan says:
Hi Giles, Unfortunately, I am not aware of the PageManager object available for...Hi Giles,
Unfortunately, I am not aware of the PageManager object available for use within user macro. Perhaps, you want to raise a feature request at the issue tracker at http://jira.atlassian.com.
Regards,
Mei
Nov 25, 2007
Anonymous says:
I'm trying to modify lastblogs.vm to add some conditional logic to control a Mor...I'm trying to modify lastblogs.vm to add some conditional logic to control a More... link. (There is already something in there for this feature, but it doesn't seem to be working).
I see the $req, $generalUtil and $action objects being used in the file. But I don't seem to have $content, which is the one I was hoping was going to let me figure out what page I was on.
If that object isn't available, how can I determine what other objects may be available to use?
Thanks!
M.
Nov 28, 2007
Ming Giet Chong says:
Hi, I would suggest you to post this question to the forum and mailing list as ...Hi,
I would suggest you to post this question to the forum and mailing list as there might be other user/developers who have already implemented it and should be able to share their ideas with you.
Regards,
MG
Mar 07, 2008
Jeff Schnitter says:
All of the links to the Doc reference are resulting in 404 errors. Will someone...All of the links to the Doc reference are resulting in 404 errors. Will someone from Atlassian please take a look? Thanks!
Mar 10, 2008
Choy Li Tham says:
Hi Jeff, Thanks for reporting this. The links to the API documentation in this ...Hi Jeff,
Thanks for reporting this. The links to the API documentation in this page has been changed. The API documentation are available at the following link now:
Sorry for the inconvenience.
Regards,
Choy Li
Apr 02, 2008
Anonymous says:
Yeah, and try clicking on some of the properties in UserAccessor, for instance. ...Yeah, and try clicking on some of the properties in UserAccessor, for instance. Click on "User". Page broken.
Apr 03, 2008
Tony Cheah Tong Nyee says:
Hi there, Thanks for reporting this. We are in the process of correcting the li...Hi there,
Thanks for reporting this. We are in the process of correcting the links in our Confluence's documentation due to the change of the new API URL. However, the direct link to the UserAccessor should be:
Apologies for the inconvenience caused.
Cheers,
Tony
Apr 30, 2008
Anonymous says:
how to pass argument to $helper.renderConfluenceMacro('Unknown macro: {useapi} '...how to pass argument to $helper.renderConfluenceMacro('
May 02, 2008
Mei Yan Chan says:
Hi, Would you be able to elaborate more on what you are achieving? For all quer...Hi,
Would you be able to elaborate more on what you are achieving? For all queries relating to development, please post them at:
Regards,
Mei
Jun 09
Chris Paquin says:
The current (working) links for the above API documents are: VTL Object URL...The current (working) links for the above API documents are:
HTH Chris
Add Comment